mailscanner only sees the envelope TO

Ken Anderson ka at PACIFIC.NET
Wed Jul 16 22:50:51 IST 2003

Stephen Swaney wrote:

> On Wed, 2003-07-16 at 13:48, Matt Kettler wrote:
>>At 12:09 PM 7/16/2003 -0400, Stephen Swaney wrote:
>>>What about a MailScanner option that passes delivery of messages to
>>>multiple to a recipients to another program, i.e. procmail?
>>At that point, why use spam-scanning via MailScanner at all? Why not just
>>use procmail to call SA for everything?.
> Absolutely right and silly of me not to think of it.
>>By passing a subset of the messages to procmail, you've lost any benefits
>>of using MS to call SA.
> Right again and that is the way I used to use SpamAssassin. Don't want
> to go there again!
> Am I right in thinking that a message to multiple recipients is not
> "split into separate messages" until until the local delivery agent is
> called? If so, might it be possible to write another delivery agent that
> is only called if the message has multiple recipients. This new delivery
> agent would simply deliver the individual (split) messages to the
> incoming MailScanner directory.

This seems ideal. If sendmail could be made to put all messages in the
incoming MS queue if they have 1 recipient, and all messages with > 1
recipient in another queue. Then you could use perl/other mail tools to
split/clone the messages with >1 recip and then move them back to the MS
incoming queue.

Another option:

Looking at sendmail/TUNING:
------ snip ---------

Before 8.12 sendmail delivers an e-mail sequentially to all its
recipients. For mailing lists or large aliases the overall delivery
time can be substantial... Some mailing list software therefore "split"
up e-mails into smaller pieces with fewer recipients. Sendmail 8.12 can
do this itself, either across queue groups or within a queue
directory... The latter is controlled by the 'r=' field of a queue group
... So for this queue each envelope will have at most 5 recipients.
You can apply this to the main queue:
QUEUE_GROUP(`mqueue', `P=/var/spool/mqueue, F=f, r=5, R=8, I=2m')dnl

-------- snip ---------

Or QUEUE_GROUP(`mqueue', `P=/var/spool/mqueue, F=f, r=5, R=8, I=2m')dnl
for 1 recip per message.

This could be used to split all messages with multiple recipients into
messages with 1 recipient, right? Mail could then be queued up properly
for MS with 1 recip per message max, so all per-user rules never
affected other users. Anyone tried this?


Ken A.

> Steve
> Steve at

More information about the MailScanner mailing list