Exim Mail Filtering Tips

Использование Exim для фильтрации Списков Рассылок в почтовых директориях

Следующие сообщения файлов извлечения от всех списков адресатов я иду (и thats много) каждый в их собственную папку. Я использую почтовые ящики формата Maildir, и списки - все подпапки под папкой списка под ВХОДНЫМ ПОЧТОВЫМ ЯЩИКОМ. Названия списка санированы (чтобы предотвратить кого - то пробующего написать материал в ../../кое-что или подобный - если они не соответствуют, основная вереница тогда наполняют, подан в .list.unknown (в значительной степени, ничто не поражает это в настоящее время).

# split out the various list forms
# Mailman & other lists using list-id
if "${if def:header_list-id:{true}}" is true then
if $header_list-id: matches "<([a-z0-9-]+)[.@]" then
save Maildir/.list.${lc:$1}/
else
if $header_list-id: matches "^\\s*<?([a-z0-9-]+)[.@]" then
save Maildir/.list.${lc:$1}/
else
save Maildir/.list.unknown/
endif
endif
finish
# Listar and mailman like
elif "${if def:header_x-list-id:{true}}" is true then
if $header_x-list-id: matches "<([a-z0-9-]+)\\\\." then
save Maildir/.list.${lc:$1}/
else
save Maildir/.list.unknown/
endif
finish
# Ezmlm
elif "${if def:header_mailing-list:{true}}" is true then
if $header_mailing-list: matches "([a-z0-9-]+)@" then
save Maildir/.list.${lc:$1}/
else
save Maildir/.list.unknown/
endif
finish
# York lists service
elif "${if def:header_x-mailing-list:{true}}" is true then
if $header_x-mailing-list: matches "^\\s*([a-z0-9-]+)@?" then
save Maildir/.list.${lc:$1}/
else
save Maildir/.list.unknown/
endif
finish
# Smartlist
elif "${if def:header_x-loop:{true}}" is true then
# I don't have any of these to compare against now
save Maildir/.list.unknown/
finish
# poorly identified
elif $sender_address contains "owner-" then
if $sender_address matches "owner-([a-z0-9-]+)-outgoing@" then
save Maildir/.list.${lc:$1}/
elif $sender_address matches "owner-([a-z0-9-]+)@" then
save Maildir/.list.${lc:$1}/
elif $header_sender: matches "owner-([a-z0-9-]+)@" then
save Maildir/.list.${lc:$1}/
else
save Maildir/.list.unknown/
endif
finish
# other poorly identified
elif $sender_address contains "-request" then
if $sender_address matches "([a-z0-9-]+)-request@" then
save Maildir/.list.${lc:$1}/
else
save Maildir/.list.unknown/
endif
finish
endif


CategoryHowTo

http://www.exim.org/eximwiki/MailFilteringTips?highlight=%28CategoryHowTo%29