procmail
[Top] [All Lists]

setting "mail from;"

2002-05-21 20:34:28
I'm not sure I'm doing this the right way...

I have sendmail and procmail is my MDA on one of my machines.  I'm hosting
a few domains.  For a given domain, for example, "foo.com" I have sendmail
deliver to all messages to local user "foo".

Now, I want to forward on message sent to admin(_at_)foo(_dot_)com to one 
person (on
another domain),  webmaster(_at_)foo(_dot_)com to someone else, and so on.  
Basically,
create mail aliases.[1]

I set and X-Envelope-To:, and then I use that to match the domain's valid
address and forward onto the right person.  For example:

    # -- (Webmaster: Bill Moseley )
    : 0
    * ^X-Envelope-To:.*webmaster
    ! moseley(_at_)hank(_dot_)org

Simple enough.

The problem is bounces.  If moseley(_at_)hank(_dot_)org is a bad address the 
bounce
comes back to "foo" on this machine, not back to the *original* sender. 

So what I need to do is reliably extract the address from the Return-Path:
when the message first comes in, and then set SENDMAIL-FLAGS -oi -f
$RETURN_PATH.  I can set Sender: and Errors-To: also, if needed, to make
sure that bounces go back to the original sender.

Yes, I have this user's ("foo") account set as a trusted user so I can use -f.

How would I accomplish this?


All this seems rather hackish.  Is there a better way to do this mail
forwarding with procmail?

Thanks,

[1] Boring details:

The reason I'm using procmail for this is the web site for this domain is
hosted at he.net, but he.net's mail setup is a bit hosed.  They use
procmail as the MDA, but they do not set the X-Envelope-To:, so it's
impossible to know who the mail was addressed to and multi-drop to the same
domain causes all messages to be delivered as a single message.

The email alias mapping is maintained in a database on the web site.  When
that changes on the web site a message is sent to my machine, and the my
machine fetches the mappings and writes the .procmailrc file.  

-- 
Bill Moseley
mailto:moseley(_at_)hank(_dot_)org
_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

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