Procmailrc
Материал из Gentoo Linux Wiki
- Вернуться в раздел прочее
Выдержки из ~/.procmailrc для фильтрации спама.
[править] Общие параметры
| Файл: ~/.procmailrc |
|
В начале файла нужно указать общие параметры MAILDIR=$HOME/.maildir/ # расположение почты DEFAULT=$MAILDIR # тип почтового ящика VERBOSE=no # насколько детальны сообщения #VERBOSE=yes LINEBUF=4096 SHELL=/bin/bash # какой шелл LOGFILE=$HOME/.getmail/.procmail.log # куда пишем лог #******** # Fix Headers != 0 # http://linux.kiev.ua/materials/Mutt-FAQ.html :0 Bfh * H ?? ~^Lines: * -1^0 * 1^1 ^.*$ | formail -A "Lines: $="
# Correct incorrect Subject lines
# change "AW:" ("Antwort") to "Re:" (reply)
:0 fHw
* ^Subject:.*AW:
| sed -e 's/AW:/Re:/g'
# Correct wrong sig-dashes, ie add a space for lines with only "--" in them: # http://linuxbrit.co.uk/downloads/dot.procmailrc # from: ^--$ # to: ^-- $ :0 fBw * ^--$ | sed -e 's/^--$/-- /'
# preconverts all plain-text mail arriving in certain encoded
# MIME formats into a more compact 8-bit format which can be
# used and displayed more easily by most programs.
:0
* ^Content-Type: *text/plain
{
:0 fbw
* ^Content-Transfer-Encoding: *quoted-printable
| mimencode -u -q
:0 Afhw
| formail -I "Content-Transfer-Encoding: 8bit"
:0 fbw
* ^Content-Transfer-Encoding: *base64
| mimencode -u -b
:0 Afhw
| formail -I "Content-Transfer-Encoding: 8bit"
}
#********
# Spam
:0
* ^(To|CC):.*(res05564|[Uu]ndisclosed-[Rr]ecipients|undisclosed-recipients|spambot)\
* ^From:.*(galamail\.com|agentoflove|absoluteagency\.com|delphi\.com|238525)\
* ^Subject:.*(offer|free|pay|[Vv][Ii1][Aa][Gg][Rr][Aa]|wanted|penis|offer|chip|inch|please|pill|[Hh]ydrocodone|remember|f(w:|wd|orward))\
* ^X-Advertisement:.*\
* ^X-Mailer:.*(Advanced Mass)\
* ^X-Spam-Status: Yes\
* ^X-Spam-Flag: YES\
* ^Message-ID.*<>
.Trash/
# anything that has more than one Fwd in the subject bar is unlikely to
# be any good, so filter it away
#:0
#* Subject:.*(f(w:|wd|orward)).*(f(w:|wd|orward))
#.Trash/
# http://www.ccs.neu.edu/howto/howto-procmail.html
# Normally, the regular expressions in the condition lines in a recipe
# are only checked against the headers of the message.
# To test them against the body instead, add the B flag to the first (`:0...') line of the recipe.
#:0B:
:0B
* ([Vv]iagra|prescription|1-800|inch|remove|XXX|sex|adults|business opportunity|unsuscribe|LANGUAGE CENTER|visit today|penis|longer|size|GUARANTEE|[Ll] [Aa] [Nn] [Gg] [Uu] [Aa] [Gg] [Ee]|[Ll][Aa][Nn][Gg][Uu][Aa][Gg][Ee])
.Trash/
.... #******** # Finally Everything else :0: $DEFAULT
|
[править] Дополнительная информация
|
Посоветовать или спросить, |
