Click to See Complete Forum and Search --> : Forwarding mail using sendmail
The King Ant
08-18-2001, 10:14 AM
I'd like to set up something very simple (like an alias) which forwards mail for user bleh@domain.com to, say, my Yahoo! mail account. I have the following in my virtusertable:
gus@domain.com somebody@yahoo.com
@domain.com defaultlocaluser
But sending mail to gus@domain.com gets sent to the catch all person. It seems like I shouldn't be using the aliases file for this because I'm hosting multiple domains. Is this possible, without actually creating a user and forwarding the mail with a .forward?
andrzej
08-18-2001, 06:13 PM
You can easly achieve this with procmail. If your sendmail is configured to use procmail, create a .procmailrc for the defaultlocaluser.
eg:
:0
* ^TO(gus@domain.com)
! somebody@yahoo.com
:0
some default action
The King Ant
08-19-2001, 12:42 AM
Thanks for the example, I might end up doing that. If I did, I would have to create the local user gus though, right? I was trying to avoid having to do that, because it's much more convenient not to.
andrzej
08-19-2001, 06:28 AM
No. You don't have to create the user 'gus'.
All you have to do is to forward all mail coming to nonexistent local users to one existing user. (I thought you're already doing that with that defaultlocaluser). Then you just filter all mail to defaultlocaluser with procmail.
Just make sure your sendmail doesn't reject mail to unknown users. In Postfix there is a parameter 'luser relay', very handy for this occasion. I've no experience with sendmail, but there must be a way to do the same.
The King Ant
08-22-2001, 12:44 PM
Ok, the example I had in my first post works, I think I just had a typo when I was testing it before. Also, creating a .forward in the user's home directory with the same syntax as /etc/alias will forward mail.