Noel Jones wrote:
On 9/15/2009 8:02 AM, Vernon A. Fort wrote:
I had an internal server problem which ended up with 1000 or so messages
sitting in the mail queue with a HOP-COUNT exceeded. These are good
emails so i need to find a way to remove most of the Received lines in
the message header and re-queue (re-send) the email. I'm thinking of
using postcat queueid to a temporary file - striping the Received lines
as i write out the file. Then just resend the message. Are there any
gotchas with this approach?
Thanks
Vernon
This sounds like a bad idea... It's probably better to just let them
bounce back to the sender.
First you must find out why these have hop-count exceeded and fix the
problem. Otherwise you'll just end up in the same place again.
General procedure:
postcat -q QUEUEID > /tmp/file
Find the envelope sender and recipient(s) stored in the queued file.
Don't use the From: or To: headers.
Strip the postfix envelope records from the tmp file.
Resubmit with
sendmail -i -f sender -- recip1 recip2 recip3 ... < /tmp/file
It's very important to use the envelop sender and recipient(s), not
the addresses listed in the From: or To: or other headers. The
envelop sender and recipient(s) are listed in the *** ENVELOPE RECORDS
*** section of the queue file.
Postfix 2.7 and later has new options for the postcat command that
would make this a little easier.
http://www.postfix.org/postcat.1.html
-- Noel Jones
The mail loop/hop problem WAS/IS fix. Alot of these messages are
notifications which are time consuming to get reproduced. I would
prefer to strip the needed stuff from the header and re-send/queue.
THANKS for the examples with the envelope - i was planning on using the
to/from from the header. The envelope makes perfect since!
Vernon