procmail
[Top] [All Lists]

Re: Correcting broken Message-ID:

2007-07-22 08:01:40
Am 2007-07-13 23:45:23, schrieb Dallman Ross:
Well, first of all, I'm not sure why I'm bothering to
offer help, because I doubt you'll see it: you said more
than once in the past that you trash automatically all
Microsoft-client emails, and I'm sending this from Outlook.

You E-Mail is whitelisted...  :-)
I do not rely like to trash Messages from competent guys...

So if you don't reply, I'll assume you didn't see this.  Oh, well.

My first thought is, broken Message-IDs are an extremely
good indicator of spam and with low false-positive rate.

I get over the PHP, PostgreSQL and some other lists such broken things.

But right, 97% of Messages with missing Message-ID: header are spam.

So why do you want to repair them?  Do some tiny bit of
corroboratory inspection of the message (in procmail) and
trash it as spam, which is what it almost surely is.

This is alredy done, since I do not want to bother my
FileServer by adding per day 30000 Message-ID: headers.

But if you insist -- well, you're already looking for Message-ID
in procmail, so you certainly don't need formail two separate
times in the recipe set.  Once will do.

  SHELL = /bin/sh

  :0 fw h  # in brackets just below are a space and a tab
  * ^Message-ID:.*\/[^        ].+
  * ! MATCH ?? ^^<.*>^^
  | formail -I "Message-ID: <`echo \"$MATCH\" | tr -d '> <'`>"

Nice...

Tested, including on Message-IDs with whitespace and angle brackets
in the middle.  You need a Bourne-y shell for the quoted internal
quotes to work.

Since I use BASH it just working.

You could do more and not bother with the backtick stuff unless
there are internal angles or whitespace, but I'll leave that up to
you.

Greetings
    Michelle Konzack


-- 
Linux-User #280138 with the Linux Counter, http://counter.li.org/
##################### Debian GNU/Linux Consultant #####################
Michelle Konzack   Apt. 917                  ICQ #328449886
                   50, rue de Soultz         MSN LinuxMichi
0033/6/61925193    67100 Strasbourg/France   IRC #Debian (irc.icq.com)
____________________________________________________________
procmail mailing list   Procmail homepage: http://www.procmail.org/
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

<Prev in Thread] Current Thread [Next in Thread>