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.

I have a few emails in my mailq which are bounced for a good reason, the email address is wrong. I was wondering if it is possible to modify the address of the recipient on the fly. I can see the directory where the mail deferred are stored and I could probably change something there, but i am wondering if there is a proper way to do this.

Any thought?

share|improve this question
    
As documented, direct manipulation of queue files is not supported. –  adaptr Oct 15 '12 at 15:12
    
@adaptr this is an answer, not a comment ;) –  Thomas Berger Oct 15 '12 at 19:42

1 Answer 1

up vote 4 down vote accepted

When you requeue the messages (postsuper -r <queue_id>|ALL): man postsuper:

The message is subjected again to mail address rewriting and substitution. This is useful when rewriting rules or virtual mappings have changed.

So the best way (or the least intrusive way) would be to have an address rewrite for that recipient. From the Postfix Address Rewriting

/etc/postfix/main.cf:
    smtp_generic_maps = hash:/etc/postfix/generic

/etc/postfix/generic:
    his@localdomain.local       hisaccount@hisisp.example

Following this example, you could try:

/etc/postfix/generic:
    yourbadlyspelledname@destination.com        you_name@destination.com
share|improve this answer
    
good stuff! thanks! –  momeunier Oct 15 '12 at 11:38
    
Since smtp_generic_maps is applied to mail delivery, there is no need to re-queue the mail. The smtp(8) daemon performs this rewrite. –  adaptr Oct 15 '12 at 15:12
    
Good one, and don't forget to issue postmap /etc/postfix/generic after editing /etc/postfix/generic. –  kasimir Jun 17 '13 at 19:00

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.