Mailinglist Archive: opensuse (908 mails)

< Previous Next >
[opensuse] /etc/procmailrc permissions problem
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@xxxxxxxxxxxxxx.address
* ^X-Spam-Virus: Yes
| formail -A "X-Loop: yourname@xxxxxxxxxxxxxx.address" | \
$SENDMAIL -oi yourname@the.other.account

Can this be solved more elegantly?

Greetings,
Björn
--
To unsubscribe, e-mail: opensuse+unsubscribe@xxxxxxxxxxxx
To contact the owner, e-mail: opensuse+owner@xxxxxxxxxxxx

< Previous Next >