is there a way to configure delay with which emails will be processed by postfix? What I'm aiming for is e.g. 5 minute lag between receiving mail from MUA and transferring it to mailbox or other MTA.
Thanks.
is there a way to configure delay with which emails will be processed by postfix? What I'm aiming for is e.g. 5 minute lag between receiving mail from MUA and transferring it to mailbox or other MTA.
Thanks.
This functionally should be implemented in the MUA. If you have a webmail you can install a plugin implementing this function. There is an extension available for Thunderbird. If a user sends an email and later changes her mind then she can cancel herself. I see no other way. Making nasty hacks on the server will just make things worse if one does not know all the answers already.
There is a way but it is such a stupid thing that I only provide the steps.
Put this into your recipient_restrictions:
recipient_restrictions = ..., static:HOLD, ...
Then you will get an output ofpostqueue -p
where all mails in hold-queue are marked with an!
(exclamation mark) and the arrival date. Use a cron-job and a script to parse and examine this output. If a mail is longer than x minutes in the queue you can reinject it to the Postfix delivery process by issuing apostsuper -H [queue_id]
. The [queue_id] is in the first column ofpostqueue -p
.And please don't ask for the script to automate this!
You could pretty easily do this by specifying a new master transport in the smtpd section of main.cf:
Then in master.cf:
In /path/to/your_script, just have it sleep(X) and exit(0). You can use this script/config as an example of how to implement external script interaction with postfix:
http://www.howtoforge.com/postfix_spf