Con Nikolozakis <con(_at_)securecommerce(_dot_)com(_dot_)au> writes:
Im having the following problem with my
linux(2.2.16)/sendmail(8.10.2)/procmail(3.13.1) system. I am accepting mail
for multiple domains on a single email server. Basically mail is not being
delivered correctly within each domain.
My 'sendmail.cw' file contains
a.com
b.com
My 'virtusertable' file contains
@a.com user_a
@b.com user_b
The .procmail recipe for user_a contains
:0:
* ^TO_info(_at_)a(_dot_)com
{
:0c
info_user
}
When receiving email via a mailing list (of which info(_at_)a(_dot_)com is a
member)
the mail is incorrectly dropped into /var/spool/mail/user_a instead of
/var/spool/mail/info_user
I think this is because the procmail ^To_ function cant see the address
info(_at_)a(_dot_)com in any of the TO/CC/BCC etc fields. Typical message
header -
(info(_at_)a(_dot_)com is a member of list1(_at_)list1(_dot_)com)
You're right, because IT ISN'T THERE. This is what happens when you
try to route email based on the header instead of the envelope: it
doesn't work.
The solution is to pass the envelope recipient address through to
procmail.
Step 1: change your virtusertable to read:
@a.com user_a+%1
@b.com user_b+%1
Step 2: change the .procmailrc recipe for user_a to read:
USER = $1
:0
* USER ?? ^^info^^
info_user
...other virtual user recipes here following the above pattern
Ditto for user_b
^TO_ and ^TO are for determining whether something was _addressed_
to a given address, not whether it was _delivered_ to a given address.
That difference is the heart of most virtual domain problems.
Philip Guenther
_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail