[sendmail] mailertable vs procmail vs aliases

[sendmail] mailertable vs procmail vs aliases

am 05.07.2005 14:59:03 von Troy Piggins

I have a home LAN with a sendmail server on a RH9 linux box. My family
has the domain piggo.com, but not all of the family is on my LAN and I
don't use the LAN as piggo.com because my external IP is dynamically
assigned by my ISP. I use a free domain name parking service to forward
mail etc.

I set up once before sendmail with the following in my
/etc/mail/mailertable

piggo.com local:

which worked a treat for any mail sent internally. But for some email
sent to xyz@piggo.com it needs to go externally to the free forwarding
server, and get forwarded to their actual (ISP provided) email address.

So I have a couple of thoughts, but am not sure of the best way to
continue and would appreciate expert opinions on the "best" way for me
to set it up.

First idea was to change /etc/mail/mailertable to

piggo.com procmail:/etc/procmailrc

then have recipes in /etc/procmailrc like

:0 # this user is external
* ^TO_.*xyz@piggo.com
! -oi -f $1 xyz@realdomain.com

:0 # this user is internal
* ^TO_.*abc@piggo.com
! abc

or something along those lines.

Second idea was to leave my origin mailertable entry with "local:", and
for each user have an /etc/aliases entry like

xyz: xyz@realdomain.com

I /think/ both of the above will work, but do not know if one is more
efficient than the other.

Finally, and I don't if this is even possible, is if it can all be done
within /etc/mail/mailertable. The first 2 ideas I had above are a bit
tedious to set up, because I need to enter the real email addresses for
every user that is external to my LAN.

Don't know if you can do something like this in mailertable

piggo.com local:
xyz@piggo.com smtp:smtpserver.myisp.com

So what do the experts think?

--
T R O Y P I G G I N S
e : usenet@piggo.com