carlos
2014-06-17 13:37:41 UTC
What I did is really simple to handle this:
1) mailbox_command = path/to/mycript.py
2) luser_relay = unknown
3) add, unknown = "|/path/to/myscript.py" to aliases file.
4) myscript.py reads from stdin line by line and writes the lines to file.
These lines redirects any incoming mail, no matter whether user exists
or not, to my script. My script reads data from stdin and writes it to file. If my script receives mail with one recipient it creates one file. But if it receives with 2 recipients, it creates 2 files. What I want is that it still should create 1 file. I want to make number of files created by script not related to number of recipients but related to number of messages received.
Thanks,
1) mailbox_command = path/to/mycript.py
2) luser_relay = unknown
3) add, unknown = "|/path/to/myscript.py" to aliases file.
4) myscript.py reads from stdin line by line and writes the lines to file.
These lines redirects any incoming mail, no matter whether user exists
or not, to my script. My script reads data from stdin and writes it to file. If my script receives mail with one recipient it creates one file. But if it receives with 2 recipients, it creates 2 files. What I want is that it still should create 1 file. I want to make number of files created by script not related to number of recipients but related to number of messages received.
Thanks,