Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Postfix Question: executing scripts

Status
Not open for further replies.

Filippozeus

Technical User
Feb 27, 2007
6
IT
Hi All,
Postfix is a wonderful MTA but its man pages are not friendly-readable.
So I'm stll here asking for help on configuration.

I have setup postfix to receive mail for different virtual users and all seems to work fine.

Now i need to deliver mail for user@virtualdomain.com to user_mailbox_file and also to a bash script (it's not a daemon, so it should be launched every time).
(this script will read mail headers and will publish statistics to an html file.

so,
Is it possible to tell postifix (in the aliases file) to deliver mail to a mailbox and also to execute a script for every new incoming mail ?


I hope yes !

thanks in advance
 
I'd use procmail. You can execute scripts via aliases, but I don't think there's a way to set up a single alias to cover all users.
 
This is working for me:

/etc/aliases:
myscript: "|/usr/local/mailscript"

now simply forwarding a copy of every mail for a user to usermailbox and to myscript make the script run.


Thank you !!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top