The postfix server puts sometimes mails in corrupt queue. These mails are never checked because there is an error in the file (I see "bad record type: 43 in message content"). In the documentation, I can see "Unreadable or damaged queue files are moved here for inspection".

OK. I can read them with postcat, but after that, what should I do ? Can I remove them without error ? What should I do to put them back in send queue ? I found somewhere to move the files to maildrop but nothing happens.

Thanks !

Dom

link|improve this question
feedback

2 Answers

up vote 4 down vote accepted

It's quite a strange behaviour, I've never seen postfix doing that, ever, you either have a very old postfix, or you must have some sort of hardware problem somewhere, like memory corruption or hard drive corruption.

To put back your email into the queue, the easiest way would be to do so with postcat and a bit of awk, something like (but YMMV) :

postcat -q <m-id>  |
awk 'BEGIN {data=0}
     /^*** HEADER EXTRACTED/ {data=0;print "."; print "quit"}
     data==1 {if ($0 == ".") { $0 = ".."}; print}
     /^*** MESSAGE CONTENTS/ {data=1; print "DATA"}
     data==0 && /^sender:/ {print "MAIL FROM: " $2}
     data==0 && /^original_recipient: / {print "RCPT TO: " $2}' |
sendmail -bs
link|improve this answer
Ok your script remove the postfix tags, and works well, but can I put the result in a queue to restart the distribution ? Is there an other way ? – Dom Feb 2 '10 at 9:44
1  
I've completed the pipeline, it should be ok now. I don't see another way, but you really, really have a problem somewhere else, postfix does not creates bad files by itself. – mat Feb 2 '10 at 10:00
Thanks it works perfectly ! – Dom Feb 2 '10 at 11:54
feedback

Can you provide a postfix version number? Which distribution is this?

(Still most likely this indicates a hardware problem.)

EDIT: then its filesystem corruption and/or memory problem. Try to run memtest.

link|improve this answer
On Debian Lenny, Postfix stable 2.5.5 – Dom Feb 2 '10 at 9:34
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.