[Dovecot] problem with dovecot and sieve
Hi
We've been using dovecot with great success so far. We are trying to add sieve support for our users. We enabled managesieve and users can define rules from the webmail (roundcube) with sieverules plugin for roundcube.
Everything goes ok, but here's a problem I couldn't figure yet.
When I define a redirect rule, the mail is forwarded but a local copy is stored too. Weird thing is that the logs say redirecting failed but the mail gets forwarded. Let me show you some of this (personal data masked):
# cat .dovecot.sieve ## Generated by Roundcube Webmail SieveRules Plugin ## # rule:[teste] if anyof (true) { redirect "xxxxx@xxxxxxxxx"; }
And the log from the user's sieve log
sieve: info: started log at Jun 15 18:05:49. error: msgid=BANLkTik1OzJEreF0qW000OvFpkaR7nOhCQ@mail.gmail.com: failed to redirect message to xxxxxx@xxxxxxx (refer to server log for more information).
syslog:
Jun 16 11:40:26 mailstore5 dovecot: lmtp(8458, xxxxxxx@xxxxxx.com): Error: /eMhMNoV+k0KIQAAmtbU9A: sieve: execution of script /var/maildir++/99/xxxxxx@xxxxxxxx/.dovecot.sieve failed, but implicit keep was successful (user logfile /var/maildir++/99/xxxxxx@xxxxx.com/.dovecot.sieve.log may reveal additional details)
And gets redirected anyway Jun 16 11:40:26 mailstore5 postfix/smtp[13041]: CB4D1C79FE: to=xxxx@xxxxxxx, delay=0.12, delays=0.02/0/0.01/0.08, dsn=2.0.0, status=sent (250 2.0.0 Ok: queued as E24FAB0880)
There's no explicit keep anywhere in the sieve rule, nor a global rule, so Im confused, the email should be forwarded only. The error message confuses me too, as it says failed but the mail gets through.
dovecot -n # 2.0.9: /opt/mail/dovecot/etc/dovecot.conf # OS: Linux 2.6.36.2 x86_64 Debian 5.0.8 auth_mechanisms = plain login base_dir = /opt/mail/dovecot/var disable_plaintext_auth = no listen = * mail_location = maildir:~/Maildir mail_plugins = create_mbox quota managesieve_notify_capability = mailto managesieve_sieve_capability = fileinto reject envelope encoded-character vacation subaddress comparator-i;ascii-numeric relational regex imap4flags copy include varia passdb { args = socket=/opt/mail/auth_server/var/socket timeout=10 driver = courier } plugin { quota = maildir:User quota quota_rule = Trash:ignore quota_rule2 = Spam:ignore sieve = ~/.dovecot.sieve } protocols = imap pop3 lmtp sieve service imap-login { inet_listener imap { port = 30143 ssl = no } } service lmtp { inet_listener lmtp { address = 0.0.0.0 port = 30024 } process_min_avail = 4 } service pop3-login { inet_listener pop3 { port = 30110 } } ssl = no ssl_parameters_regenerate = 0 userdb { args = socket=/opt/mail/auth_server/var/socket timeout=10 driver = courier } protocol pop3 { mail_plugins = create_mbox quota maildiraccess pop3_client_workarounds = outlook-no-nuls oe-ns-eoh pop3_reuse_xuidl = no pop3_save_uidl = no pop3_uidl_format = %f } protocol imap { mail_plugins = create_mbox quota imap_quota maildiraccess } protocol lmtp { mail_plugins = create_mbox quota sieve } protocol sieve { mail_debug = yes }
Your help is appreciated. Thanks! Javier
Maybe it is useful to know, that vacation does the same thing, an error in the logs but the response arrives to the sender.
Log file also show some error with waitpid()
Jun 16 13:18:27 mailstore5 dovecot: lmtp(8460, xxxx@xxxxxxx.com): Error: waitpid() failed: No child processes Jun 16 13:18:27 mailstore5 dovecot: lmtp(8460, xxxxxx@xxxxxx.com): Error: +F/dFJQm+k0MIQAAmtbU9A: sieve: msgid=BANLkTin7b5ucfhZmZfqpuuP4TyGwyo9cAg@mail.gmail.com: failed to send vacation response to xxxxxx@gmail.com (refer to server log for more information) Jun 16 13:18:27 mailstore5 dovecot: lmtp(8460, xxxxxx@xxxxxx.com): +F/dFJQm+k0MIQAAmtbU9A: sieve: msgid=BANLkTin7b5ucfhZmZfqpuuP4TyGwyo9cAg@mail.gmail.com: sent vacation response to xxxxxxx@gmail.com
Thanks Javier
On Thu, Jun 16, 2011 at 12:01 PM, Javier japi76@gmail.com wrote:
Hi
We've been using dovecot with great success so far. We are trying to add sieve support for our users. We enabled managesieve and users can define rules from the webmail (roundcube) with sieverules plugin for roundcube.
Everything goes ok, but here's a problem I couldn't figure yet.
When I define a redirect rule, the mail is forwarded but a local copy is stored too. Weird thing is that the logs say redirecting failed but the mail gets forwarded. Let me show you some of this (personal data masked):
# cat .dovecot.sieve ## Generated by Roundcube Webmail SieveRules Plugin ## # rule:[teste] if anyof (true) { redirect "xxxxx@xxxxxxxxx"; }
And the log from the user's sieve log
sieve: info: started log at Jun 15 18:05:49. error: msgid=BANLkTik1OzJEreF0qW000OvFpkaR7nOhCQ@mail.gmail.com: failed to redirect message to xxxxxx@xxxxxxx (refer to server log for more information).
syslog:
Jun 16 11:40:26 mailstore5 dovecot: lmtp(8458, xxxxxxx@xxxxxx.com): Error: /eMhMNoV+k0KIQAAmtbU9A: sieve: execution of script /var/maildir++/99/xxxxxx@xxxxxxxx/.dovecot.sieve failed, but implicit keep was successful (user logfile /var/maildir++/99/xxxxxx@xxxxx.com/.dovecot.sieve.log may reveal additional details)
And gets redirected anyway Jun 16 11:40:26 mailstore5 postfix/smtp[13041]: CB4D1C79FE: to=xxxx@xxxxxxx, delay=0.12, delays=0.02/0/0.01/0.08, dsn=2.0.0, status=sent (250 2.0.0 Ok: queued as E24FAB0880)
There's no explicit keep anywhere in the sieve rule, nor a global rule, so Im confused, the email should be forwarded only. The error message confuses me too, as it says failed but the mail gets through.
dovecot -n # 2.0.9: /opt/mail/dovecot/etc/dovecot.conf # OS: Linux 2.6.36.2 x86_64 Debian 5.0.8 auth_mechanisms = plain login base_dir = /opt/mail/dovecot/var disable_plaintext_auth = no listen = * mail_location = maildir:~/Maildir mail_plugins = create_mbox quota managesieve_notify_capability = mailto managesieve_sieve_capability = fileinto reject envelope encoded-character vacation subaddress comparator-i;ascii-numeric relational regex imap4flags copy include varia passdb { args = socket=/opt/mail/auth_server/var/socket timeout=10 driver = courier } plugin { quota = maildir:User quota quota_rule = Trash:ignore quota_rule2 = Spam:ignore sieve = ~/.dovecot.sieve } protocols = imap pop3 lmtp sieve service imap-login { inet_listener imap { port = 30143 ssl = no } } service lmtp { inet_listener lmtp { address = 0.0.0.0 port = 30024 } process_min_avail = 4 } service pop3-login { inet_listener pop3 { port = 30110 } } ssl = no ssl_parameters_regenerate = 0 userdb { args = socket=/opt/mail/auth_server/var/socket timeout=10 driver = courier } protocol pop3 { mail_plugins = create_mbox quota maildiraccess pop3_client_workarounds = outlook-no-nuls oe-ns-eoh pop3_reuse_xuidl = no pop3_save_uidl = no pop3_uidl_format = %f } protocol imap { mail_plugins = create_mbox quota imap_quota maildiraccess } protocol lmtp { mail_plugins = create_mbox quota sieve } protocol sieve { mail_debug = yes }
Your help is appreciated. Thanks! Javier
Op 16-6-2011 18:24, Javier schreef:
Maybe it is useful to know, that vacation does the same thing, an error in the logs but the response arrives to the sender.
Log file also show some error with waitpid()
First thing to notice is that your Dovecot is relatively old, so this problem may be fixed already. Also, recent Dovecot (v2.0) versions support sending messages directly to an SMTP (smart)host instead of using the sendmail binary.
Looks like your sendmail binary terminates inappropriately (or Dovecot thinks it does). Can you successfully send mail from the command line using the sendmail tool?
Regards,
Stephan.
Thanks for the response. I'll try updating dovecot to latest version but this will take me some time, so other options are welcome. It seems like submission_host is from v2.0.10+ and I have 2.0.9 :(
Sending mail with
echo "test" | sendmail xxxx@xxxx.com
works fine. Thanks Javier
On Sun, Jun 19, 2011 at 8:17 AM, Stephan Bosch stephan@rename-it.nl wrote:
Op 16-6-2011 18:24, Javier schreef:
Maybe it is useful to know, that vacation does the same thing, an error in the logs but the response arrives to the sender.
Log file also show some error with waitpid()
First thing to notice is that your Dovecot is relatively old, so this problem may be fixed already. Also, recent Dovecot (v2.0) versions support sending messages directly to an SMTP (smart)host instead of using the sendmail binary.
Looks like your sendmail binary terminates inappropriately (or Dovecot thinks it does). Can you successfully send mail from the command line using the sendmail tool?
Regards,
Stephan.
No other hint? Only option is to upgrade to latest?
Thanks Javier
On Tue, Jun 21, 2011 at 4:38 PM, Javier japi76@gmail.com wrote:
Thanks for the response. I'll try updating dovecot to latest version but this will take me some time, so other options are welcome. It seems like submission_host is from v2.0.10+ and I have 2.0.9 :(
Sending mail with
echo "test" | sendmail xxxx@xxxx.com
works fine. Thanks Javier
On Sun, Jun 19, 2011 at 8:17 AM, Stephan Bosch stephan@rename-it.nl wrote:
Op 16-6-2011 18:24, Javier schreef:
Maybe it is useful to know, that vacation does the same thing, an error in the logs but the response arrives to the sender.
Log file also show some error with waitpid()
First thing to notice is that your Dovecot is relatively old, so this problem may be fixed already. Also, recent Dovecot (v2.0) versions support sending messages directly to an SMTP (smart)host instead of using the sendmail binary.
Looks like your sendmail binary terminates inappropriately (or Dovecot thinks it does). Can you successfully send mail from the command line using the sendmail tool?
Regards,
Stephan.
Upgrade is an option, just want to know how many I have. But, as being a medium sized mail system, I have to take little steps.
Thanks Javier
On Mon, Jun 27, 2011 at 8:52 AM, Benny Pedersen me@junc.org wrote:
On Fri, 24 Jun 2011 11:33:26 -0300, Javier wrote:
No other hint? Only option is to upgrade to latest?
or backport the needed things from later sources, its GPL v2 remember ? :)
On Tue, 21 Jun 2011 16:38:32 -0300, Javier wrote:
Sending mail with
echo "test" | sendmail xxxx@xxxx.com
gives invalid mailheaders, and sieve fails
# cat testmail From: "testmail" testmail@example.net To: "abuse" abuse@example.com Subject: testmail <empty line> testmail
# fire it to seive
sendmail -f testmail abuse now its syntax is correct, but i have long time forgothen to add Date:
:=)
On 16.6.2011, at 19.24, Javier wrote:
Jun 16 13:18:27 mailstore5 dovecot: lmtp(8460, xxxx@xxxxxxx.com): Error: waitpid() failed: No child processes
This is the main problem. It just shouldn't be happening. You could try stracing an lmtp process while it sends a mail, and see if there are two waitpid() calls or of the first one is giving this error. If there is only this one waitpid() call this would seem like a kernel problem.
(Easy way to strace: 1) connect to lmtp socket & quit, 2) strace -p <lmtp pid>, 3) send a mail)
On Fri, 2011-06-24 at 18:23 +0300, Timo Sirainen wrote:
On 16.6.2011, at 19.24, Javier wrote:
Jun 16 13:18:27 mailstore5 dovecot: lmtp(8460, xxxx@xxxxxxx.com): Error: waitpid() failed: No child processes
This is the main problem. It just shouldn't be happening. You could try stracing an lmtp process while it sends a mail, and see if there are two waitpid() calls or of the first one is giving this error. If there is only this one waitpid() call this would seem like a kernel problem.
I think this fixes the bug: http://hg.dovecot.org/dovecot-2.0/rev/748b0fd169d1
Of course, since you can't upgrade that's not very helpful.. You could try to figure out why your sendmail binary is forking and not make it do that..
I'll be planning on upgrade soon then, if that cures the problem (ie: i will use submission_host instead of sendmail binary)
Another (maybe) unrelated question. It is possible to add extra parameters so the connection made to submission_host uses user's credentials ? (for authenticated smtp) Or I'm asking something ridiculous?
Thanks Timo, Thanks list.
Javier
On Mon, Jun 27, 2011 at 8:42 PM, Timo Sirainen tss@iki.fi wrote:
On Fri, 2011-06-24 at 18:23 +0300, Timo Sirainen wrote:
On 16.6.2011, at 19.24, Javier wrote:
Jun 16 13:18:27 mailstore5 dovecot: lmtp(8460, xxxx@xxxxxxx.com): Error: waitpid() failed: No child processes
This is the main problem. It just shouldn't be happening. You could try stracing an lmtp process while it sends a mail, and see if there are two waitpid() calls or of the first one is giving this error. If there is only this one waitpid() call this would seem like a kernel problem.
I think this fixes the bug: http://hg.dovecot.org/dovecot-2.0/rev/748b0fd169d1
Of course, since you can't upgrade that's not very helpful.. You could try to figure out why your sendmail binary is forking and not make it do that..
On Mon, 2011-06-27 at 21:51 -0300, Javier wrote:
I'll be planning on upgrade soon then, if that cures the problem (ie: i will use submission_host instead of sendmail binary)
Another (maybe) unrelated question. It is possible to add extra parameters so the connection made to submission_host uses user's credentials ? (for authenticated smtp) Or I'm asking something ridiculous?
No possibility to do SMTP AUTH. Way too much trouble, at least for now.
participants (4)
-
Benny Pedersen
-
Javier
-
Stephan Bosch
-
Timo Sirainen