[Dovecot] Calling dovecot-lda from within Antispam pipe script (bash) seems to have no effect

Bob Miller bob at computerisms.ca
Thu Jun 20 07:14:32 EEST 2013


Hi Ben,

I checked over your script, and I don't see the problem either.  You
already checked everything that comes to my mind.

Maybe using something like set -e to try and get some output from the
script?  

-- 
Computerisms
Bob Miller      
867-334-7117 / 867-633-3760
http://computerisms.ca


On Wed, 2013-06-19 at 14:52 -0400, Ben Johnson wrote:
> Hello,
> 
> I'm attempting to configure the Dovecot Antispam plug-in on Ubuntu 12.04
> LTS with Dovecot 2.0.19.
> 
> Everything seems to be in order with one considerable exception: when my
> pipe script (a simple Bash shell script) calls the dovecot-lda
> executable, absolutely nothing seems to result.
> 
> If I copy/paste the exact same command into the terminal, the mail is
> delivered to the target mailbox, as expected.
> 
> Here's my pipe script: http://pastebin.com/DBXAZqsN
> 
> When I move a message from INBOX -> Junk, or from Junk -> INBOX, the
> pipe script is called, and here's the output:
> 
> ---------------------------------------------------------------
> 31465-start (--debug --username=amavis --ham)
> Checking if the command-line input argument string (--debug
> --username=amavis --ham) contains the string "ham" or "spam"
> Mode is "HAM"
> Calling (as user vmail) '/usr/lib/dovecot/deliver -d
> "sa-training at example.com" -m "Training.HAM" -p
> "/tmp/sendmail-msg-31465.txt"'
> 31465-end
> ---------------------------------------------------------------
> 
> But, for some reason, the call to "/usr/lib/dovecot/deliver" doesn't
> seem to do anything.
> 
> If I copy the above output and paste it into the terminal:
> 
> /usr/lib/dovecot/deliver -d "sa-training at example.com" -m "Training.HAM"
> -p "/tmp/sendmail-msg-31465.txt"
> 
> Dovecot does indeed deliver the message. This works whether I execute
> the above command as "root" or "vmail".
> 
> Why does this command have no effect when called from within the pipe
> script?
> 
> Here is my "doveconf -n" output:
> 
> # 2.0.19: /etc/dovecot/dovecot.conf
> # OS: Linux 2.6.32-042stab076.8 x86_64 Ubuntu 12.04.2 LTS
> auth_mechanisms = plain login
> disable_plaintext_auth = no
> listen = *,[::]
> log_timestamp = "%Y-%m-%d %H:%M:%S "
> mail_privileged_group = vmail
> passdb {
>   args = /etc/dovecot/dovecot-sql.conf
>   driver = sql
> }
> plugin {
>   antispam_backend = pipe
>   antispam_debug_target = syslog
>   antispam_pipe_program = /usr/bin/sa-learn-pipe.sh
>   antispam_pipe_program_args = --debug;--username=amavis
>   antispam_pipe_program_notspam_arg = --ham
>   antispam_pipe_program_spam_arg = --spam
>   antispam_pipe_tmpdir = /tmp
>   antispam_spam_pattern_ignorecase = SPAM;JUNK
>   antispam_trash_pattern_ignorecase = trash;Deleted *
>   antispam_verbose_debug = 1
>   quota = dict:user::file:/var/vmail/%d/%n/.quotausage
>   quota_rule2 = Trash:storage=+100M
>   quota_rule3 = Junk:ignore
>   quota_warning = storage=95%% quota-warning 95 %u %d
>   quota_warning2 = storage=80%% quota-warning 80 %u %d
>   quota_warning3 = -storage=100%% quota-below below %u %d
>   sieve = /var/vmail/%d/%n/.sieve
> }
> protocols = imap pop3
> service auth {
>   unix_listener /var/spool/postfix/private/auth {
>     group = postfix
>     mode = 0660
>     user = postfix
>   }
>   unix_listener auth-userdb {
>     group = vmail
>     mode = 0600
>     user = vmail
>   }
>   user = root
> }
> service quota-below {
>   executable = script /usr/local/bin/quota-below.sh
>   user = vmail
> }
> service quota-warning {
>   executable = script /usr/local/bin/quota-warning.sh
>   user = vmail
> }
> ssl_cert = </etc/postfix/smtpd.cert
> ssl_key = </etc/postfix/smtpd.key
> userdb {
>   args = /etc/dovecot/dovecot-sql.conf
>   driver = sql
> }
> protocol imap {
>   mail_plugins = quota imap_quota antispam
> }
> protocol pop3 {
>   mail_plugins = quota
>   pop3_uidl_format = %08Xu%08Xv
> }
> protocol lda {
>   info_log_path = /var/log/dovecot-lda.log
>   log_path = /var/log/dovecot-lda-errors.log
>   mail_plugins = sieve quota
> }
> 
> 
> Thank you,
> 
> -Ben



More information about the dovecot mailing list