Qmail
[Top] [All Lists]

Re: Limit number of "to:"

To: qmail@list.cr.yp.to
Subject: Re: Limit number of "to:"
From: Kyle Wheeler <kyle-qmail@memoryhole.net>
Date: Wed, 23 May 2007 12:51:31 -0600
Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys
Delivered-to: sp-com-lists@consult.net
Delivered-to: gmail-qmail@securepoint.com
Delivered-to: sp.com.list@gmail.com
Delivered-to: mailing list qmail@list.cr.yp.to
Dkim-signature: v=0.5; a=rsa-sha1; c=relaxed; d=memoryhole.net; h=received:comment:domainkey-signature:received:received:date:from:to:subject:message-id:mail-followup-to:references:mime-version:content-type:content-disposition:in-reply-to:user-agent; q=dns/txt; s=default; bh=w3nWUgU4Noexh27b2tMF0L1tdxc=; b=jaI9+0IDuGPhMhTmgEz4ZG+fbT/dGPcj06+/LWiMoBF45z7TkzrSI10cvxVKecmfA13bQfPw5agEw0dVmP1G4J3ziXMoxAYOSkMYgwsqWqL9fS7gnpxen1dNgMW9EiDipeSm8zJzEucyTO/Dn8AwgPXyHWkCXG8Oi6DL/S2AjO0=
Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=memoryhole.net; b=Ocy+6/OvYiAxWrUFjPqXWdskzM//hGj7DbYrPcR03eJYlxvHQvTE+KfzsqnvsEmFdylbChyGrojUDvxEt5WXZmEcMUZk9YbaKWBBw/LAxbNiUvpFX2vX5fHSsiwDpI0Je/t/onq6efDQYj7uuZumsN2nXjT9/Vy6lmdKtzHpamM= ;
Domainkey-status: good
In-reply-to: <46548081.103@phibee.net>
Mail-followup-to: qmail@list.cr.yp.to
Mailing-list: contact qmail-help@list.cr.yp.to; run by ezmlm
References: <46548081.103@phibee.net>
User-agent: Mutt/1.5.15cvs (2007-05-20)
On Wednesday, May 23 at 07:57 PM, quoth Noc Phibee:
can i limit into qmail the number of "to:" ...

Yes.

As with most things qmail, there are two ways of doing it: patching qmail, or using a wrapper. (You may also be able to get mailfront or magic-smtpd to do the same thing).

On the patching front, there's the chkuser patch that allows you to specify a maximum number of recipients.

You can also use a wrapper around qmail-queue to count the recipients and fail if there are too many. For example:

    #!/bin/sh
    read -u 1 -d $'\0' sender
    # count recipients
    i=0
    while read -u 1 -d $'\0' recipient ; do
        [ -z "$recipient" ] && break
        recipients[$i]="$recipient"
        i=$(($i+1))
    done
    [ $i -gt $MAXRECIPIENTS ] && exit 11
    # restore the envelope data
    seek0 1
    # call the real qmail-queue
    exec /var/qmail/bin/qmail-queue.orig

~Kyle
--
If you're flammable and have legs, you are never blocking a fire exit. Unless you're a table.
                                                      -- Mitch Hedberg

Attachment: pgpmUdjojtsTv.pgp
Description: PGP signature

<Prev in Thread] Current Thread [Next in Thread>