Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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.

share|improve this question

5 Answers 5

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]
share|improve this answer

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.

share|improve this answer
    
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

If the message is stored in plaintext, can't you just use a text editor to edit the RCPT header, and then use postsuper to move it to the active queue?

share|improve this answer
    
Don't!. You will lose the warranty. –  mailq Dec 30 '11 at 23:45
    
@mailq Please explain, not that i doubt you, I'm just not a postfix wiz, just trying to apply some logic here :-) –  Mathias R. Jessen Dec 30 '11 at 23:47
1  
Postfix doesn't store plain text queue-files. They are at least some kind of binary. These files are in multiple locations (defer, deferred). So messing with files must be "in-sync" while Postfix is not running. If your editing fails, who do you blame? Who will help you? Not me; I warned you. –  mailq Dec 30 '11 at 23:57

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.

share|improve this answer

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.

share|improve this answer
    
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

 
discard

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.