Postfix: Need to deliver all local mail to 1 account, then forward
Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Postfix: Need to deliver all local mail to 1 account, then forward
Hey All,
I have a 3rd party mail server installed on my system, but unfortunately at this point it does not handle local mail properly. It has it's own sendmail binary, but in it's current state it does not accept regular sendmail options, and therefore local mail, such as cron output is not delivered correctly.
I currently have postfix installed, but disabled. What I'd like to do is have all local forwarded to the other mail server that is installed. Any idea how I can accomplish this?
If any postfix guru's are around and can solve this problem, can you provide what configurations I would need to make to postfix in order to accomplis this?
postfix has an option called a luser_relay. You should be able to find this description in the /etc/postfix/main.cf
Code:
# The luser_relay parameter specifies an optional destination address
# for unknown recipients. By default, mail for unknown local recipients
# is bounced.
#
# The following expansions are done on luser_relay: $user (recipient
# username), $shell (recipient shell), $home (recipient home directory),
# $recipient (full recipient address), $extension (recipient address
# extension), $domain (recipient domain), $local (entire recipient
# localpart), $recipient_delimiter. Specify ${name?value} or
# ${name:value} to expand value only when $name does (does not) exist.
#
# luser_relay works only for the default Postfix local delivery agent.
#
#luser_relay = $user@other.host
#luser_relay = $local@other.host
#luser_relay = admin+$local
This means that ALL mail that would have bounced now forwards to user@domain.com
If you have any local accounts dont forget to use the /etc/aliases file to forward local mail (such as root) on to that email address as well. I'm not exactly sure if this is what your asking but I hope it helps.
OK cool, yeah that looks like it will take care of collecting all of the mail. Now how do I have it delivered to my other mail server application that is running on the same server? I assume I need to send it through SMTP? I've read a few post that mentions something about forwarding to a "smart host"?
Or if I setup the luser_relay variable to an external email address that exists on the other mail server, it will automatically deliver to that mail server?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.