So we have a little more than usual deferred mail on our Postfix server, so I started to look through the messages to make sure we weren't hacked and sending out spam. Everything is fine and it turns out that a bot had filled out our Request Info form multiple times with bad info. However, I did find one that was a legitimate request for more information about our company and I noticed that it isn't sending because they fat-fingered the address with gmal.com. Is there a way I can correct that and have Postfix send it out? This is on a CentOS server.


Delete the mail (postsuper -D <QUEUEID>). Correct the spelling error in the mail client. Resent. Done.

Postfix (and you as a sysadmin) is not responsible for "users-do-mistakes"- or "users-are-dumb"-errors. What the users did is stupid, but not an error or something that breaks the system/environment. It is just how Email works.

  • Well there is no mail client. It's being done through php on a web form. So essentially that would require refilling out the web form to send it which I don't care enough to do. Like I said, this was a casual check and I was more curious about whether it was possible to do rather than I absolutely need to get this sent. – Safado Jan 3 '12 at 17:36

You will probably want to look into http://www.postfix.org/ADDRESS_REWRITING_README.html#canonical

This is what I just did for my recent case, although this is on the receiving side. "travelmate.lan" is the bad domain that got held.


# rewriting bad addresses (enable on demand)
# http://www.postfix.org/ADDRESS_REWRITING_RE
#canonical_maps = hash:/etc/postfix/canonical


@travelmate.lan     leho

After having that set up to your need, you would create the map and rerun the queue with:

# cd /etc/postfix
# postmap canonical
# postsuper -r [id | ALL]

I asked a similar question a few months ago.

My question was about fixing them with DNS and the result of the question was that you can't do it with DNS. There are also quite a few tricky edge cases that you should think about before trying to correct user typos.

You can probably do something with smtp_generic_maps and regular expressions.


I would hope postfix would have similar functionality the address functionality provided by Exim. It is possible add addresses or mark them delivered while they are held. Then when they are reprocessed, the delivery will go to the correct address.

The data requiring changing is only the envelope data. (Although if it is going to customer service you may want to notify them of the change.) This is similar to the postman correcting the address on mail sent to the wrong street number.

EDIT: It appears you may be able to use virtual aliases to get the message delivered to you so you can re-inject it.

  • No. Postfix does not provide queue file editing tools. I think they are on the TODO list, but aren't implemented for at least a decade. – mailq Dec 31 '11 at 16:24

Your Answer

By clicking "Post Your Answer", you agree to our terms of service, privacy policy and cookie policy

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