[Dovecot] Calling dovecot-lda from within Antispam pipe script (bash) seems to have no effect
Ben Johnson
ben at indietorrent.org
Fri Jun 21 20:22:04 EEST 2013
On 6/20/2013 5:58 PM, Joseph Tam wrote:
> Ben Johnson writes:
>
>> It really boils-down to the fact that I can call the following on the
>> command-line and it functions as expected:
>>
>> su vmail -c '/usr/lib/dovecot/deliver -a "sa-training at example.com" -d
>> "sa-training at example.com" -m "Training.SPAM" -p
>> "/tmp/sendmail-msg-25794.txt"'
>>
>> Yet, when I attempt to do the exact same thing from within the pipe
>> script that Dovecot Antispam calls, I receive exit code 75 from
>> deliver/dovecot-lda and absolutely nothing is logged, with exception of
>> the information of which I'm already aware (logged to syslog).
>
> Have you also checked the environment variables? I think dovecot-lda
> gets some information from them. Also, it's possible the PATH or some
> other critical environment variables is different, causing the
> difference in outcome.
>
> Joseph Tam <jtam.home at gmail.com>
Thanks for the reply, Joseph. I appreciate your time.
I added debugging output to the script, which now prints the environment
variables. My script now outputs the following:
-----------------------------------------------------------------
25985-start (--spam)
ENV value is: DOVECOT_PRESERVE_ENVS=TZ
SSL_SOCKET_COUNT=0
DOVECOT_CHILD_PROCESS=1
CONFIG_FILE=/var/run/dovecot/config
SOCKET_COUNT=1
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
PWD=/var/vmail/example.com/ben
CLIENT_LIMIT=1
GENERATION=9
DOVECOT_VERSION=2.0.19
SHLVL=1
LOG_SERVICE=1
SERVICE_COUNT=1
_=/usr/bin/env
Checking if the command-line input argument string (--spam) contains the
string "ham" or "spam"
Mode is "SPAM"
Calling (as user vmail) '/usr/lib/dovecot/deliver -d
"sa-training at example.com" -m "Training.SPAM" -p
"/tmp/sendmail-msg-25985.txt"'
Exit status was 75
25985-end
-----------------------------------------------------------------
Does anything jump-out at you?
Thanks again,
-Ben
More information about the dovecot
mailing list