You probably could instead, make it add an additional X-Note: header that indicates postfix had to repair the headers and filter on this. It would not be a bad idea if all mail servers indicated when they had to repair broken headers.
Chuck Frolick ArgoNet, Inc. -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Tom Baker | Netsmith Inc Sent: Thursday, August 22, 2002 7:31 AM To: '[EMAIL PROTECTED]' Subject: RE: [Declude.JunkMail] They are getting sneaky! The great thing about open-source, if it doesn't already do it, you can make it do it yourself. >From what I can tell examining the source, there is no config variable that will control this behavior. If you are more advanced you could probably write in your own variable so you can toggle it via main.cf, or if you are like me, just comment it out in the source. You will need to make the below changes, the recompile & re-install postfix (and probably shutdown all postfix processes & reload to ensure the new files are loaded) ... In your postfix-source directory, locate this file Src/cleanup/cleanup_message.c You will see a section as follows: static void cleanup_missing_headers(CLEANUP_STATE *state) { char time_stamp[1024]; /* XXX locale dependent? */ struct tm *tp; TOK822 *token; /* * Add a missing (Resent-)Message-Id: header. The message ID gives the * time in GMT units, plus the local queue ID. */ if ((state->headers_seen & (1 << (state->resent[0] ? HDR_RESENT_MESSAGE_ID : HDR_MESSAGE_ID))) == 0) { tp = gmtime(&state->time); strftime(time_stamp, sizeof(time_stamp), "%Y%m%d%H%M%S", tp); cleanup_out_format(state, REC_TYPE_NORM, "%sMessage-Id: <%s.%s@%s>", state->resent, time_stamp, state->queue_id, var_myhostname); msg_info("%s: %smessage-id=<%s.%s@%s>", state->queue_id, *state->resent ? "resent-" : "", time_stamp, state->queue_id, var_myhostname); } /* * Add a missing (Resent-)Date: header. The date is in local time units, * with the GMT offset at the end. */ if ((state->headers_seen & (1 << (state->resent[0] ? HDR_RESENT_DATE : HDR_DATE))) == 0) { cleanup_out_format(state, REC_TYPE_NORM, "%sDate: %s", state->resent, mail_date(state->time)); } ... The cleanup_missing_headers() section goes on to check for many other headers, but these are the two you are most concerned about. You can just comment out these two by surrounding the if statements with comments Below is an example of what you need /* * Add a missing (Resent-)Message-Id: header. The message ID gives the * time in GMT units, plus the local queue ID. */ /* [8/22/02 - YOURNAME - REMINDER WHY YOU DID THIS ] COMMENTED OUT FOR DECLUDE TO CATCH if ((state->headers_seen & (1 << (state->resent[0] ? HDR_RESENT_MESSAGE_ID : HDR_MESSAGE_ID))) == 0) { tp = gmtime(&state->time); strftime(time_stamp, sizeof(time_stamp), "%Y%m%d%H%M%S", tp); cleanup_out_format(state, REC_TYPE_NORM, "%sMessage-Id: <%s.%s@%s>", state->resent, time_stamp, state->queue_id, var_myhostname); msg_info("%s: %smessage-id=<%s.%s@%s>", state->queue_id, *state->resent ? "resent-" : "", time_stamp, state->queue_id, var_myhostname); } END COMMENTED OUT SECTION */ /* * Add a missing (Resent-)Date: header. The date is in local time units, * with the GMT offset at the end. */ /* [8/22/02 - YOURNAME - REMINDER WHY YOU DID THIS ] COMMENTED OUT FOR DECLUDE TO CATCH if ((state->headers_seen & (1 << (state->resent[0] ? HDR_RESENT_DATE : HDR_DATE))) == 0) { cleanup_out_format(state, REC_TYPE_NORM, "%sDate: %s", state->resent, mail_date(state->time)); } END COMMENTED OUT SECTION */ Note: if you do not know the C programming language the following are comments /* = begin comment section */ = end comment section // = comment out ONLY this current line ( just like # in global.cfg with declude) **** I TAKE NO RESPONSIBILITY IF THIS BREAKS POSTFIX! I have not tested this, I have only located the code for you, I do not know if postfix relies on these headers for anything else, I do not know the inner working of postfix, I just know how to tear software apart to make it do what I want to :) Good luck -Tom -----Original Message----- From: R. Scott Perry [mailto:[EMAIL PROTECTED]] Sent: Wednesday, August 21, 2002 7:48 PM To: [EMAIL PROTECTED] Subject: Re: [Declude.JunkMail] They are getting sneaky! > > The E-mail looks like it would have failed both the SPAMHEADERS test > > (for a missing Message-ID: header) and the BADHEADERS test (for a > > missing Date: header), but it looks like your gateway server added > > those headers when it received the E-mail. > >Postfix did this? Is there a way to correct this? It's not a matter of correcting, actually; it's a matter of changing (if possible), because Postfix is doing a "good" thing (it's adding those headers, which were missing in the original E-mail). It's fixing problems that it finds in the E-mail, which if you *want* the E-mail, is a good thing (it may let you see an E-mail that otherwise might not be seen, for example). I don't know if Postfix has a way to override this behavior, though. -Scott --- [This E-mail was scanned for viruses by Declude Virus (http://www.declude.com)] --- This E-mail came from the Declude.JunkMail mailing list. To unsubscribe, just send an E-mail to [EMAIL PROTECTED], and type "unsubscribe Declude.JunkMail". The archives can be found at http://www.mail-archive.com. --- [This E-mail was scanned for viruses by Declude Virus (http://www.declude.com)] --- This E-mail came from the Declude.JunkMail mailing list. To unsubscribe, just send an E-mail to [EMAIL PROTECTED], and type "unsubscribe Declude.JunkMail". The archives can be found at http://www.mail-archive.com. --- [This E-mail was scanned for viruses by Declude Virus (http://www.declude.com)] --- This E-mail came from the Declude.JunkMail mailing list. To unsubscribe, just send an E-mail to [EMAIL PROTECTED], and type "unsubscribe Declude.JunkMail". The archives can be found at http://www.mail-archive.com.
