Postfix: change sender in queued messages

Posted by ring0 on Server Fault See other posts from Server Fault or by ring0
Published on 2014-08-22T02:28:49Z Indexed on 2014/08/22 4:22 UTC
Read the original article Hit count: 519

Filed under:
|
|
|
|

Following a complete re-installation we got a problem with the configuration: the sender address was wrong and some recipients (mail servers) rejected them.

So there is a bunch of mails stuck in the Postfix queue.

Ideally, a change of the sender address directly in the queued mails, and then flushing the queue would be optimal.

I tried this answer that addresses this very problem. But messages don't seem to be easily modifiable in the version I have (2.11.0).

For instance there is no /var/spool/mqueue dir, but, instead, /var/spool/postfix/...

active
bounce
corrupt
defer
deferred
dev
etc
flush
hold
incoming
lib
maildrop
pid
private
public
saved
trace
usr

and the dir of interest is deferred. I tried to modify a few files there changing the wrong domain with the correct one (and was careful to ensure only those were changed).

But then, those mails were moved to corrupt, meaning that a simple text change doesn't seem to work (done with vi).

Any other cleaner way to change the sender in queued mails?

© Server Fault or respective owner

Related posts about postfix

Related posts about queue