Valid Message-Id: tagged as bad?
rra at stanford.edu
Sat Jul 21 18:21:29 UTC 2001
Christopher P Lindsey <isc.org at spamfodder.com> writes:
> With that in mind, is there a recommended pre-processor that can be used
> to wrap the mailing list/Web interface with the same types of checks?
> Yes, I can pull the code from the inn source and write a C binary to do
> it, but I would actually prefer a snippet of Perl code. Yes, I can
> write one myself, but if there's one already out there...
Here's what I use:
# Check the mail message ID and see if it looks reasonable. If not,
# rename it so that we'll generate our own. Note that news servers may
# reject message IDs with a trailing period, so don't allow them. This
# is not a complete check; a complete check should really use the code
# from INN and needs more than a simple regex.
my $id = $article->header ('message-id');
$article->rename_header ('message-id', 'x-original-message-id', 'add')
if ($id && $id !~ /^<[^\s\@>]+\@[^\s.>]+(\.[^.\s>]+)+>$/);
It seems to work pretty well.
> Also, is there any problem with me replacing bad Message-Ids with a
> properly generated one? All messages will come from authenticated
> sources, so I'm not concerned about spam. I just need to make sure that
> anything that comes through from any of the three input sources gets
> sent to all output media.
It can break threading, but other than that, no.
Russ Allbery (rra at stanford.edu) <http://www.eyrie.org/~eagle/>
More information about the inn-workers