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

Is it possible to change the sender address of mails that are already queued?

The relay-server we've used so far has silently changed its policy a few days ago and rejects now mails without a verified sender address. We've now adapted sendmail's settings but a few mails with the old sender address are already stuck in the queue (Sender address rejected: unverified address). Can I change their sender address?

share|improve this question

2 Answers 2

up vote 6 down vote accepted

Look in /var/spool/mqueue. There are two files for each mail. dfblah for the email text, qfblah for the headers. You can ignore the df files and concentrate of the qf files. Depending on whether you need to modify just the envelope-from or the header-from as well, you might need to modify one or two locations.

Save a copy before you start modifying these files. Kill sendmail too to avoid lock/race problems.

share|improve this answer
    
Thanks! Worked and mails are successfully sent. –  z00bs May 20 '11 at 8:24

Sendmail stores queued messages as text files, so this should be possible; howewer, the format of the queue files is somewhat complex (as everything in Sendmail...), so modifying them by hand is probably not so trivial.

Lots of info here:

http://osr507doc.sco.com/en/MailMsgG/sndmlT18.html
http://www.unixmexico.org/files/html/kore.hack.se/oreilly/networking/sendmail/ch23_02.htm
http://www.unixmexico.org/files/html/kore.hack.se/oreilly/networking/sendmail/ch23_09.htm

share|improve this answer

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.