[Exim] Re: Getting multidrop to work with Exim

Kezdőlap
Üzenet törlése
Válasz az üzenetre
Szerző: Sandip Bhattacharya
Dátum:  
Címzett: exim-users
Tárgy: [Exim] Re: Getting multidrop to work with Exim
Suresh Ramasubramanian wrote:
> Sandip Bhattacharya wrote:
>
>> I am using exim w/ spamassassin running on a typical cpanel redhat
>> server. I have been trying like hell to get multidrop working on exim.
>> So far my major problem had been to somehow retain the original envelope
>> recipient which gets munged when the message passes though spamassasin.
>> However, playing around with some esoteric router configuration solved
>> that problem.
>
>
> Like, how about showing us some snippets from your config (exim - and
> maybe whatever procmail you have in there) to tell us just what you are
> doing?
>


Ok. Using spamassassin breaks up the mail delivery process into two
different steps - the first step resolves the original user to a local
user and then pipes the message to another exim process using bsmtp with
the envelope recipient right now pointing to the local user. In the
second step, the other exim process actually delivers the final message.

To preserve the envelope recipient of the original mail, I have added
this router before any of the routers which resolve the recipients.

===========
recipient_hdr:
driver = redirect
headers_add=X-Original-Recipient:original_local_part@$original_domain
condition = ${if !match{$received_protocol}{local-bsmtp}{yes}fail}
self = pass
data = $local_part@$domain
repeat_use = false
===========

This adds the X-Original-Recipient header to the mail, and takes care
that it is added only once in each delivery regardless of the number of
child addresses which are generated in each delivery. It also works only
when the message is received using esmtp/asmtp.

This code seems to work perfectly in doing what I need. However the
problem I am facing is during the address resolving code, like in the
two routers below which generate new child addresses based on either the
/etc/aliases file or /etc/valiases/$domain file.


=====================
virtual_aliases:
driver = redirect
allow_defer
allow_fail
data = ${if
exists{/etc/valiases/$domain}{${lookup{*}lsearch{/etc/valiases/$domain}}}}
file_transport = address_file
group = mail
pipe_transport = virtual_address_pipe
domains = lsearch;/etc/localdomains
retry_use_local_part

system_aliases:
driver = redirect
allow_defer
allow_fail
data = ${lookup{$local_part}lsearch{/etc/aliases}}
file_transport = address_file
pipe_transport = address_pipe
retry_use_local_part
======================

Say the same mail was sent to both a1@??? and a2@???, by
listing them in the To: field. I want both of them to delivered
separately to the catchall account (using the entry "*:
catch-all-account@???").

But since the result of this resolution in both the recipients of the
same message delivery is the same, exim is removing duplicates and
delivering only to the first email address. This is causing messages to
be "lost" while delivery to the catchall account.

I figured the two possible ways out are to either disable the duplicate
handling code of exim for these two routers or to ensure that each of
the envelope recipients are handled in distinct delivery processes.

- Sandip



--
Sandip Bhattacharya                        http://www.sandipb.net
sandip at puroga.com
Puroga Technologies Pvt. Ltd.
http://www.puroga.com