====== Сервис MDA ======
===== procmail =====
==== Настройка MTA на использование procmail ====
=== sendmail (FreeBSD) ===
[server:/etc/mail] # pkg_add -r procmail
[server:/etc/mail] # cat server.corpX.mc
OSTYPE(freebsd6)
FEATURE(local_procmail)
FEATURE(`use_cw_file')
FEATURE(access_db, `hash -o -T /etc/mail/access')
FEATURE(virtusertable, `hash -o /etc/mail/virtusertable')
MAILER(local)
MAILER(smtp)
MAILER(procmail)
[server:/etc/mail] # make cf
[server:/etc/mail] # make install
[server:/etc/mail] # /etc/rc.d/sendmail restart
=== postfix (Ubuntu) ===
root@server:~# apt-get install procmail
root@server:~# rcsdiff /etc/postfix/main.cf
43a44
> mailbox_command = /usr/bin/procmail -d "$USER"
root@server:~# /etc/init.d/postfix force-reload
==== Примеры рецептов ====
[[http://www.freebsd.org/doc/ru/books/handbook/mail-procmail.html]]
[[http://reonaydo.org.ru/perenos-pochty-s-mbox-na-maildirsendmaildovecot/]]
=== Простейший рецепт ===
server# cat ~user1/.procmailrc
:0c
backup_mail
=== Проверка письма на вирусы ===
server# cat ~user1/.procmailrc
:0
* multipart
{
VIRUS=`/usr/bin/clamdscan --mbox --disable-summary --stdout -`
:0 Di
* VIRUS ?? FOUND
/dev/null
}
=== Разбор почты из общего ящика ===
server# cat ~user1/.procmailrc
:0
* ^To.*ivanov\@specialist\.ru.*
! ivanov
:0 ^To.*petrov\@specialist\.ru.*
! petrov