procmail
[Top] [All Lists]

Re: Forward to a pager. or any outside mail account.

1997-08-28 18:06:10
John Kelley <plasma(_at_)erinet(_dot_)com> writes:
Most of you are going to say that this is cake, well check out my situation.

Our company has a registered domain name company.com.  We have asked the
administrators at our ISP to forward all mail to company.com to our isp
account.  Basically *(_at_)company(_dot_)com ! user(_at_)isp, I think...
We then us a linux box to go and fetch the mail down and use procmail to
distribute the mail to all the users on the Linux system.

so if mail is to  bubb(_at_)company(_dot_)com it goes into user(_at_)isp 
mailbox, then we
fetch and procmail sends it to bubba(_at_)local(_dot_)net(_dot_)  The internal 
Domain name
(local.net) used is not the same as the registered one.  so i run into
problems if I just say 

*^TO user(_at_)local(_dot_)net
! email(_at_)elsewhere

Because it is using the root account (Don't yell I know) to send the mail
out.  So its return address is root(_at_)local(_dot_)net which doesn't resolve 
so
doesn't get sent by my ISP's mail server.

Problem 1: you're using the header of the message to do mail routing.
This is the Wrong Thing, and will bite you in the future, if it hasn't
already (for instance, "user(_at_)local(_dot_)net" can't subscribe to mailing
lists).  You'll need to find out from your ISP how it's mail server is
routing mail from *(_at_)company(_dot_)com to user(_at_)isp(_dot_)  In 
particular, you need
to find out how it's preserving the _envelope_recipient_address(es)_.
If it isn't, you must convince your ISP to change things so that it
does so.  Then, in the procmailrc on your Linux box, instead of
deciding where to send mail using "^TO", you'll use whatever marks your
ISP's mail system puts in to preserve the envelope recipient
address(es).  If you ISP won't change this, consider changing ISPs to
one which has a clue about hosting virtual domains.


Problem 2: Sendmail on your Linux box should be rewriting "local.net"
to "company.com" all address in messages that are being sent to your
ISP's mailserver.  Actually, it would probably be easiest to just
always rewrite "local.net" to "company.com", and then add "company.com"
to class 'w'.  Anyway, this problem is related to procmail.  Try
comp.mail.sendmail, or that mail guru at your ISP that you bugged about
problem #1.


Philip Guenther

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