I am using postfix in my production server which will receive all the emails related to mydomain.com In this context, I want to forward only emails related to few users to different email addresses. By which I mean, lets say I am a super user(superuser@mydomain.com). I want to forward all my emails(all mails with to:superuser@mydomain.com) to my personal email id: superuser@gmail.com. So I think I would some programming logic is needed here. So I want to write a custom python script which should read the postfix email inbox and forward all new emails depending on the said criteria. Can I do this? I heard about .forward file in the postfix arena. Can I use that to achieve the same(by totally bypassing pythonic solution)?
Take the 2-minute tour
×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.
closed as off-topic by Jason C, John Mee, EdChum, Soner Gönül, Paul Lo Mar 20 at 9:18This question appears to be off-topic. The users who voted to close gave this specific reason:
|
|||||
|
|||||
|
Procmail is the solution for mail filtering. You can call python scripts from your .procmailrc if you need more scripting. |
|||||||||
|
|
It sounds like you just need to set up aliases, not script anything. On most Unix/Linux systems, you simply add aliases to your /etc/aliases file:
then run:
Then mail sent to "superuser" would go to "marc" and "webmaster@my-site.com" instead. here's a tutorial, and here's the postfix 'aliases' man page. |
|||||||||
|