1

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.

4 Answers 4

2

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.

1
  • 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, 2012 at 17:36
2

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.

/etc/postfix/main.cf:

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

/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]
0

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.

0

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.

1
  • 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, 2011 at 16:24

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .