I like to write a procmail recipe which does the following:
All malware mails (tagged with header "^X-Spam-Virus: Yes") should be
delivered to a specific mailbox (e.g. /home/malware/Maildir/) regardless
of the recipient of the mail.
I tried this with
/etc/procmailrc
# ... malware scanner etc.
:0:
* ^X-Spam-Virus: Yes
/home/malware/Maildir/
The problem is, that all mails delivered to /home/malware/Maildir/ get
uid "root" and gid "mail". DROPPRIVS=yes also does not work, because
DROPPRIVS changes uid/gid to the recipient user and this uid/gid usually
has no write permission for /home/malware/Maildir/.
Mails in /home/malware/Maildir/ should get gid/uid of user "malware".
Similar problems I solved with first forwarding such mails with recipes
like the following first to the target recipient. The target user's
$HOME/.procmailrc does the second part of filtering.
:0
* !^X-Loop: yourname(a)your.main.mail.address
* ^X-Spam-Virus: Yes
| formail -A "X-Loop: yourname(a)your.main.mail.address" | \
$SENDMAIL -oi yourname(a)the.other.account
Can this be solved more elegantly?
Greetings,
Björn
--
To unsubscribe, e-mail: opensuse+unsubscribe(a)opensuse.org
To contact the owner, e-mail: opensuse+owner(a)opensuse.org