-----Original Message----- From: dovecot-bounces+nick.lunt=patech-solutions.com@dovecot.org [mailto:dovecot-bounces+nick.lunt=patech-solutions.com@dovecot.org] On Behalf Of Nick Lunt Sent: 28 January 2010 08:50 To: dovecot@dovecot.org Subject: Re: [Dovecot] Cannot get dovecot-sieve to work
-----Original Message----- From: Tom Hendrikx [mailto:tom@whyscream.net] Sent: 27 January 2010 15:53 To: Nick Lunt; dovecot@dovecot.org Subject: Re: [Dovecot] Cannot get dovecot-sieve to work
Your sieve file will be processed at delivery time, when the MTA (f.i. postfix) will hand off mail to the dovecot LDA, deliver. Your log file shows only activity about an IMAP login. This has no use in debugging your problem.
- Check your MTA config and see if it calls deliver
- Send yourself a mail
- Check MTA logs and see if handing the mail to deliver works as intended
- Check dovecot logs for activity from deliver.
Were using sendmail as the MTA. I have edited sendmail.cf as documented at http://wiki.dovecot.org/LDA/Sendmail. However this documentation states the following:
"The following describes how to configure Sendmail to use deliver where root permission is not granted and Dovecot runs under a single user ID. It may need some adjustment for more typical setups. Other assumptions are that Sendmail is configured for virtual hosting and that local-system mail delivery is not handled by deliver."
Our sendmail setup is not configured for virtual hosting.
Here is what I have put in sendmail.cf
Mdovecot, P=/usr/libexec/dovecot/deliver, F=DFMPhnu9, S=EnvFromSMTP/HdrFromSMTP, R=EnvToSMTP/HdrFromSMTP, T=DNS/RFC822/X-Unix, A=deliver -d $u
I restarted both sendmail and dovecot but still my test emails do not get processed by dovecot/dovecot-sieve. There is nothing in the dovecot or sendmail logs pointing to dovecot-sieve.
All I want to do is discard mail depending on the subject.
Right, I've ditched sendmail and were now running postfix.
Here's my .dovecot.sieve
require "fileinto"; if not header :contains "subject" "ORG:11" { fileinto "discard"; stop; }
When I send a mail without "ORG:11" in the header, the mail goes into the discard folder, great. However when I send a mail with "ORG:11" in the header I get the following error:
==> /var/log/maillog <== Jan 28 12:36:26 psl-dev sendmail[16599]: o0SCaQAX016599: from=nickl, size=31, class=0, nrcpts=1, msgid=201001281236.o0SCaQAX016599@psl-dev.patech-solutions.com, relay=nickl@localhost Jan 28 12:36:26 psl-dev postfix/smtpd[16600]: connect from localhost.localdomain[127.0.0.1] Jan 28 12:36:26 psl-dev postfix/smtpd[16600]: B1BC9194D63: client=localhost.localdomain[127.0.0.1] Jan 28 12:36:26 psl-dev postfix/cleanup[16603]: B1BC9194D63: message-id=201001281236.o0SCaQAX016599@psl-dev.patech-solutions.com Jan 28 12:36:26 psl-dev postfix/qmgr[16096]: B1BC9194D63: from=nickl@psl-dev.patech-solutions.com, size=600, nrcpt=1 (queue active) Jan 28 12:36:26 psl-dev sendmail[16599]: o0SCaQAX016599: to=nickl, ctladdr=nickl (503/503), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=30031, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (Ok: queued as B1BC9194D63) Jan 28 12:36:26 psl-dev postfix/smtpd[16600]: disconnect from localhost.localdomain[127.0.0.1] Jan 28 12:36:26 psl-dev postfix/local[16604]: B1BC9194D63: to=nickl@psl-dev.patech-solutions.com, relay=local, delay=0.06, delays=0.05/0/0/0.01, dsn=4.3.0, status=deferred (temporary failure)
==> /var/log/dovecot.log <== Jan 28 12:36:26 deliver(nickl): Info: Loading modules from directory: /usr/lib/dovecot/lda Jan 28 12:36:26 deliver(nickl): Info: Module loaded: /usr/lib/dovecot/lda/lib90_sieve_plugin.so Jan 28 12:36:26 deliver(nickl): Info: mbox: data=/home/nickl/mail:INBOX=/var/mail/nickl Jan 28 12:36:26 deliver(nickl): Info: fs: root=/home/nickl/mail, index=, control=, inbox=/var/mail/nickl Jan 28 12:36:26 deliver(nickl): Info: sieve: using sieve path for user's script: /home/nickl/.dovecot.sieve Jan 28 12:36:26 deliver(nickl): Info: sieve: opening script /home/nickl/.dovecot.sieve Jan 28 12:36:26 deliver(nickl): Info: sieve: executing compiled script /home/nickl/.dovecot.sieve Jan 28 12:36:26 deliver(nickl): Error: file_dotlock_create(/var/mail/nickl) failed: Permission denied (euid=503(nickl) egid=503(nickl) missing +w perm: /var/mail) (set mail_privileged_group=mail) Jan 28 12:36:26 deliver(nickl): Error: sieve: msgid=201001281236.o0SCaQAX016599@psl-dev.patech-solutions.com: failed to store into mailbox 'INBOX': Internal error occurred. Refer to server log for more information. [2010-01-28 12:36:26] Jan 28 12:36:26 deliver(nickl): Error: sieve: script /home/nickl/.dovecot.sieve failed with unsuccessful implicit keep
Here are the permissions on /var/mail/ # ls -ld /var/spool/mail drwxrwxr-x 2 root mail 4096 Jan 28 11:02 /var/spool/mail
# ls -l /var/mail/ total 528 -rw-rw---- 1 nickl mail 0 Jan 28 11:02 nickl -rw------- 1 root root 517203 Jan 28 04:02 root
Here is dovecot -n
# dovecot -n # 1.2.10: /etc/dovecot.conf # OS: Linux 2.6.18-128.el5 x86_64 Red Hat Enterprise Linux Server release 5.3 (Tikanga) log_path: /var/log/dovecot.log info_log_path: /var/log/dovecot.log ssl: no login_dir: /var/run/dovecot/login login_executable(default): /usr/libexec/dovecot/imap-login login_executable(imap): /usr/libexec/dovecot/imap-login login_executable(pop3): /usr/libexec/dovecot/pop3-login mail_access_groups: mail mail_privileged_group: mail mail_location: mbox:~/mail:INBOX=/var/mail/%u mail_debug: yes mail_executable(default): /usr/libexec/dovecot/imap mail_executable(imap): /usr/libexec/dovecot/imap mail_executable(pop3): /usr/libexec/dovecot/pop3 mail_plugin_dir(default): /usr/lib/dovecot/imap mail_plugin_dir(imap): /usr/lib/dovecot/imap mail_plugin_dir(pop3): /usr/lib/dovecot/pop3 lda: postmaster_address: root@localhost mail_plugins: sieve auth default: debug: yes passdb: driver: pam userdb: driver: passwd plugin: sieve: ~/.dovecot.sieve sieve_dir: ~/ log_path: /var/log/dovecot.log
Many thanks, Nick.
__________ Information from ESET NOD32 Antivirus, version of virus signature database 4813 (20100128) __________
The message was checked by ESET NOD32 Antivirus.