procmail
[Top] [All Lists]

Re: Extracting envelope to

1997-10-01 15:54:42
Excerpts from mail: (01-Oct-97) Re: Extracting envelope to  by Geoff Mulligan
What procmail would then do is lookup where the mail is actually supposed
to go and forward it as appropriate.

I can't just use the virtualuser facility in sendmail 8 because the true 
destination mailbox is stored separately.

I can run procmail as the local delivery agent if necessary, but I'd like
to figure out how to add a rule to my sendmail.cf such that all mail sent
to anyuser(_at_)anyhost(_dot_)foo(_dot_)com would be passed on to procmail 
with the actual
user as a parameter to procmail.

Well, Phillip has already explained how to find out the envelope recipient
when procmail is the LDA. As for changing your sendmail.cf, it's easiest to
just use the sendmail V8 m4 macro to enable the procmail feature and
install the resulting sendmail.cf file. If you aren't using the latest
version of sendmail (8.8.7), then this is may be a convenient time to
upgrade.

If making procmail your LDA is too much of a hassle, I think you can just add
a sendmail alias to /etc/aliases like so:

someuser: "|/usr/local/bin/procmail -m /etc/procmailrcs/forward.rc someuser"

Then in /etc/procmailrcs/forward.rc:

# Assign procmail arguments to variables...
RECIPT = $1

# Forward the e-mail
:0
* RECIPT ?? ^^someuser^^
{ ... whatever you want to do to handle forwarding the e-mail ... }

:0
* RECIPT ?? ^^someotheruser^^
{ ...etc... }

Later,
Ed

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