Brian Rankin <brankin(_at_)taurus(_dot_)fwl(_dot_)org> writes:
I'm capturing all email for a domain into one mailbox, using procmail.
Works fine. I'm doing this so I can read each "To:" header field and
send the body of the email to a fax machine (The "To:" field contains
phone number & related information).
This works great _except_ on email originating from mailing lists.
Mailing list mail has the list name (i.e. sample-list(_at_)foobar(_dot_)com)
in the
"To:" field, effectively obliterating the "real" address (which is
strange as the email arrives at the machine just fine).
My question: How can I capture the "real" To: address of email arriving
from mailing lists? Any info greatly appreciated - I'm to the point of
desperation as I cannot implement my fax server without solving this!
The only place that the envelope recipient addresses (which are what
you are looking for) can be 'captured' is from sendmail, or whatever
your MTA is. With virtual domains, by the time procmail is started up,
you have *LOST* the envelope recipients, and _cannot_get_them_back_.
You'll have to tweak you sendmail.cf, perferably to make it save the
original destination address in a '+' local part which will then get
passed into procmail via the '-a' flag, where it can be accessed as
$1. I.e., "foo(_at_)virtual(_dot_)domain" => "virt+foo(_at_)real", where
"virt(_at_)real"
is the "one mailbox" for the domain "virtual.domain"
I would suggest you take this up in comp.mail.sendmail as, simply put,
procmail can't do the impossible here without help.
Philip Guenther