Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.


share|improve this question
Obviously: why? – Steve-o Sep 17 '11 at 15:33
What? Who can proof-read you mails on the server? Somewhere deep in the queue-files-directories. Only in plain text. This still looks like a stupid idea. – mailq Sep 17 '11 at 23:56
Put down the chocolate-covered banana, step away from the European currency systems, and try telling people your actual goal here, rather than the wacky idea that you've had for achieving your goal that you don't know how to realize. – JdeBP Sep 18 '11 at 10:30
I respect your opinions and I respect my responsibilities in work. Answer by @cstamas is correct but was not approved by managers. I hope I don't need to clarify this more. Some comments quite surprised me. – zeratul021 Sep 18 '11 at 13:10
Tons of people proofread after sending and it's a big problem. Just about every forum (including this site) has the ability to edit comments for a few minutes. The ability to hold an email for a couple minutes just in case is very useful. – Tom Dworzanski Mar 23 '15 at 15:44
up vote -2 down vote accepted

You could pretty easily do this by specifying a new master transport in the smtpd section of

smtpd_recipient_restrictions = check_policy_service unix:private/sleep_delay, permit_mynetworks, reject_unauth_destination

Then in

# ==========================================================================
# service type  private unpriv  chroot  wakeup  maxproc command + args
#               (yes)   (yes)   (yes)   (never) (100)
# ==========================================================================
sleep_delay  unix  -       n       n       -       -       spawn
        user=nobody argv=/usr/bin/perl /path/to/your_script

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:

share|improve this answer
Better link to the original: – mailq Sep 17 '11 at 23:59
I am not sure if I get this right. Are you suggesting to instead of answering immediately, delay the answer of the policy server? If so this will not work. It will timeout and postfix will refuse the mail (with a temporary error, but it does not help if the other end is a MUA). – cstamas Sep 18 '11 at 3:39
Yeah you'd have to setup a global procmailrc for the MUA part, but you can safely delay up to 100s on the policy server without changing any timeouts. I wouldn't say its ideal but I think it would work. – polynomial Sep 18 '11 at 5:14

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.

share|improve this answer

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 of postqueue -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 a postsuper -H [queue_id]. The [queue_id] is in the first column of postqueue -p.

And please don't ask for the script to automate this!

share|improve this answer
You meant postsuper -H queue_id for releasing from hold, don't you? – cstamas Oct 10 '11 at 7:11
@cstamas Yes you are right. It is -H. – mailq Oct 10 '11 at 8:57

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.