Done some experiments
I can have sieve working, but I lost spam/virus filtering.
If I change default /etc/procmailrc from:
LOGFILE=/var/log/procmail.log
TRAP=/etc/webmin/virtual-server/procmail-logger.pl
:0wi
VIRTUALMIN=|/etc/webmin/virtual-server/lookup-domain.pl $LOGNAME
EXITCODE=$?
:0
* ?/bin/test "$EXITCODE" = "73"
/dev/null
EXITCODE=0
:0
* ?/bin/test "$VIRTUALMIN" != ""
{
INCLUDERC=/etc/webmin/virtual-server/procmail/$VIRTUALMIN
}
ORGMAIL=$HOME/Maildir/
DEFAULT=$HOME/Maildir/
DROPPRIVS=yes
:0
$DEFAULT
to:
DELIVER=/usr/libexec/dovecot/deliver LOGFILE=/var/log/procmail.log
LOG="
"
VERBOSE=yes
#
TRAP=/etc/webmin/virtual-server/procmail-logger.pl
:0wi
VIRTUALMIN=|/etc/webmin/virtual-server/lookup-domain.pl --exitcode 73 $LOGNAME
EXITCODE=$?
:0 w
| $DELIVER -d $LOGNAME
#
:0
* ?/bin/test "$EXITCODE" = "73"
/dev/null
EXITCODE=0
:0
* ?/bin/test "$VIRTUALMIN" != ""
{
INCLUDERC=/etc/webmin/virtual-server/procmail/$VIRTUALMIN
}
ORGMAIL=$HOME/Maildir/
DEFAULT=$HOME/Maildir/
DROPPRIVS=yes
I have mail delivered by Dovecot, but it skips the filtering that come after
:0 w
| $DELIVER -d $LOGNAME
If I try to move delivering after filtering I have permission errors:
procmail: [13087] Fri Jun 7 00:16:38 2024
procmail: Assigning "TRAP=/etc/webmin/virtual-server/procmail-logger.pl"
procmail: Assigning "VIRTUALMIN="
procmail: Executing "/etc/webmin/virtual-server/lookup-domain.pl,--exitcode,73,generico-placehold.com"
procmail: [13087] Fri Jun 7 00:16:39 2024
procmail: Assigning "EXITCODE=0"
procmail: Executing "/bin/test,0,=,73"
procmail: Non-zero exitcode (1) from "/bin/test"
procmail: No match on "/bin/test 0 = 73"
procmail: Assigning "EXITCODE=0"
procmail: Executing "/bin/test,1712600346195566,!=,"
procmail: Match on "/bin/test 1712600346195566 != "
procmail: Assigning "INCLUDERC=/etc/webmin/virtual-server/procmail/1712600346195566"
procmail: Assigning "DROPPRIVS=yes"
procmail: Assuming identity of the recipient, VERBOSE=off
ERROR: Could not connect to clamd on LocalSocket /run/clamd.scan/clamd.sock: Permission denied
lda(generico-placehold.com): Error: net_connect_unix(/run/dovecot/stats-writer) failed: Permission denied
Can't open log file /var/log/mail/maillog: Permission denied
procmail: Program failure (75) of "/usr/libexec/dovecot/deliver"
From root@srv2a.placehold.com Fri Jun 7 00:16:38 2024
Subject: 0015
Folder: /home/placehold.com/homes/generico/Maildir/new/1717712203.13087 2630
Time:1717712203 From:root@srv2311a.placehold.com To:generico@placehold.com User:generico-placehold.com Size:2682 Dest:/home/placehold.com/homes/
generico/Maildir/new/1717712203.13087_0.netc.placehold.com Mode:None
Tried to insert DROPPRIVS=no , move delivery into an INCLUDERC, … no differences
It seems that after having executed a DROPPRIVS=yes it can’t come back to DROPPRIVS=no (ignored).
If I use:
:0 cw
| $DELIVER -d $LOGNAME
I have message duplicated. obviuosly. One is managed by dovecot deliver (no filtering), another by procmail (filtered).
If someone that know procmail have some hints …
Thanks, P.
``