>In all my years of handling email I cannot recall a single time that I >saw spam that included multiple To or Cc headers, so I'm curious how >effective it is as an indicator and cause for rejection. The restriction >apparently comes from an interpretation of RFC 5322 Section 3.6. Field >Definitions which includes a table of the number of times a given header >is permitted in a message.
"Apparently"? I mean, it seems very unambiguous to me. I don't really see how you could interpret that any other way. The minimum number of "To:" and "cc:" headers permitted are zero, and the maximum permitted is one. Pretty cut and dried. I'll admit that I also haven't seen spam messages with multiple To or Cc headers, but I don't examine 99% of my spam messages that closely so it's possible it's common. >Now, for Mark's problem, I'm surprised his local postfix MSA (mail >submission agent) doesn't clean up the message already. I tried >sending some messages that included multiple To headers and new-inject >condensed them into one To header, however, I notice that the original >qmail-inject does not. Postfix should be able to handle this but I don't >use postfix so someone else will have to comment---it might be possible >to use a postfix "milter" to handle this. I'm not surprised things don't clean that up, because by that point the assumption is that you're getting a compliant message. nmh gives you a lot of flexibility in that you can edit the header fields directly, but the flip side of that is the assumption is the user is going to be smart enough not to generate a noncompliant message (seriously, dude, WHY are you doing that??). I think nearly all other MUAs don't let you do that so I think actual legitimate messages that have multiple To or Cc headers are probably extremely rare. But, fine, solutions. It turns out I was wrong; nmh probably can't help you here. I was thinking that certain headers get concatenated by the format engine, but it seems like they don't. E.g: % cat /tmp/testfile To: [email protected] To: [email protected] To: [email protected] cc: [email protected] cc: [email protected] Foo % scan -format '%{to}' -file /tmp/testfile [email protected] % scan -format '%{cc}' -file /tmp/testfile [email protected] You could do something that would check the outgoing message and reject it early enough to fix it if you had multiple To or Cc headers. It looks like anno(1) can't take a -file argument so it's hard to get it to work on something that's not in an nmh folder, so you're probably stuck with traditional Unix text processing tools. --Ken
