[Dovecot] Problem with sieve
Hello List!
I have a tiny-teeny problem with dovecot + sieve: it seems that the LDA doesn't run sieve, and thus doesn't filter my emails.
Here's the sieve configuration:
plugin { # Used by both the Sieve plugin and the ManageSieve protocol sieve=/var/local/vmail/%n/dovecot.sieve sieve_dir=/var/local/vmail/%n/sieve sieve_extensions = +notify +imapflags }
The managesiege:
protocol managesieve { # Specify an alternative address:port the daemon must listen on # (default: *:2000) listen = localhost:2000 managesieve_logout_format = bytes ( in=%i : out=%o ) } (this one is working fine, I can edit the filters through roundcube webmail, and the correct file (/var/local/vmail/%n/dovecot.sieve) is edited)
the lda part:
protocol lda { postmaster_address = foo@bar.com mail_plugins = sieve }
I think all is in place to allow dovecot to use sieve... ?
One more thing:
dovecot --version 1.2.15
Any help will be welcomed :).
Thanks in advance !
Cheers,
C.
2012/3/19 Cédric Jeanneret cjeanneret@internux.ch
Hello List!
I have a tiny-teeny problem with dovecot + sieve: it seems that the LDA doesn't run sieve, and thus doesn't filter my emails.
Here's the sieve configuration:
plugin { # Used by both the Sieve plugin and the ManageSieve protocol sieve=/var/local/vmail/%n/**dovecot.sieve sieve_dir=/var/local/vmail/%n/**sieve sieve_extensions = +notify +imapflags }
The managesiege:
protocol managesieve { # Specify an alternative address:port the daemon must listen on # (default: *:2000) listen = localhost:2000 managesieve_logout_format = bytes ( in=%i : out=%o ) } (this one is working fine, I can edit the filters through roundcube webmail, and the correct file (/var/local/vmail/%n/dovecot.**sieve) is edited)
the lda part:
protocol lda { postmaster_address = foo@bar.com mail_plugins = sieve }
I think all is in place to allow dovecot to use sieve... ?
One more thing:
dovecot --version 1.2.15
Any help will be welcomed :).
Thanks in advance !
Cheers,
C.
Have you checked the MTA configuration. Does it use dovecot's LDA ?
Antoine
On 19.03.2012 14:27, Antoine Nguyen wrote:
2012/3/19 Cédric Jeanneret cjeanneret@internux.ch
Hello List!
I have a tiny-teeny problem with dovecot + sieve: it seems that the LDA doesn't run sieve, and thus doesn't filter my emails.
Here's the sieve configuration:
plugin { # Used by both the Sieve plugin and the ManageSieve protocol sieve=/var/local/vmail/%n/**dovecot.sieve sieve_dir=/var/local/vmail/%n/**sieve sieve_extensions = +notify +imapflags }
The managesiege:
protocol managesieve { # Specify an alternative address:port the daemon must listen on # (default: *:2000) listen = localhost:2000 managesieve_logout_format = bytes ( in=%i : out=%o ) } (this one is working fine, I can edit the filters through roundcube webmail, and the correct file (/var/local/vmail/%n/dovecot.**sieve) is edited)
the lda part:
protocol lda { postmaster_address = foo@bar.com mail_plugins = sieve }
I think all is in place to allow dovecot to use sieve... ?
One more thing:
dovecot --version 1.2.15
Any help will be welcomed :).
Thanks in advance !
Cheers,
C.
Have you checked the MTA configuration. Does it use dovecot's LDA ?
Antoine
Hello Antoine (and List),
Well, it should use dovecot, as the mails are delivered to the user inbox - and I don't think postfix knows about them.. How may I be sure otherwise that postfix really uses dovecot?
Cheers,
C.
On 3/20/2012 2:49 AM, Cédric Jeanneret wrote:
On 19.03.2012 14:27, Antoine Nguyen wrote:
2012/3/19 Cédric Jeanneret cjeanneret@internux.ch
Hello List!
I have a tiny-teeny problem with dovecot + sieve: it seems that the LDA doesn't run sieve, and thus doesn't filter my emails.
Here's the sieve configuration:
plugin { # Used by both the Sieve plugin and the ManageSieve protocol sieve=/var/local/vmail/%n/**dovecot.sieve sieve_dir=/var/local/vmail/%n/**sieve sieve_extensions = +notify +imapflags }
The managesiege:
protocol managesieve { # Specify an alternative address:port the daemon must listen on # (default: *:2000) listen = localhost:2000 managesieve_logout_format = bytes ( in=%i : out=%o ) } (this one is working fine, I can edit the filters through roundcube webmail, and the correct file (/var/local/vmail/%n/dovecot.**sieve) is edited)
the lda part:
protocol lda { postmaster_address = foo@bar.com mail_plugins = sieve }
I think all is in place to allow dovecot to use sieve... ?
One more thing:
dovecot --version 1.2.15
Any help will be welcomed :).
Thanks in advance !
Cheers,
C.
Have you checked the MTA configuration. Does it use dovecot's LDA ?
Antoine
Hello Antoine (and List),
Well, it should use dovecot, as the mails are delivered to the user inbox - and I don't think postfix knows about them.. How may I be sure otherwise that postfix really uses dovecot?
Cheers,
C.
If you are using dovecot 1.2, I think lda should show lines like the following in your log.
Mar 11 14:14:06 mailstor1 dovecot: deliver(user@domain.tld): sieve: msgid=<xxxxx>: stored mail into mailbox 'INBOX'
'deliver' refers to lda.
On Tue, 20 Mar 2012 03:12:51 -0400 Gedalya gedalya@gedalya.net wrote:
On 3/20/2012 2:49 AM, Cédric Jeanneret wrote:
On 19.03.2012 14:27, Antoine Nguyen wrote:
2012/3/19 Cédric Jeanneret cjeanneret@internux.ch
Hello List!
I have a tiny-teeny problem with dovecot + sieve: it seems that the LDA doesn't run sieve, and thus doesn't filter my emails.
Here's the sieve configuration:
plugin { # Used by both the Sieve plugin and the ManageSieve protocol sieve=/var/local/vmail/%n/**dovecot.sieve sieve_dir=/var/local/vmail/%n/**sieve sieve_extensions = +notify +imapflags }
The managesiege:
protocol managesieve { # Specify an alternative address:port the daemon must listen on # (default: *:2000) listen = localhost:2000 managesieve_logout_format = bytes ( in=%i : out=%o ) } (this one is working fine, I can edit the filters through roundcube webmail, and the correct file (/var/local/vmail/%n/dovecot.**sieve) is edited)
the lda part:
protocol lda { postmaster_address = foo@bar.com mail_plugins = sieve }
I think all is in place to allow dovecot to use sieve... ?
One more thing:
dovecot --version 1.2.15
Any help will be welcomed :).
Thanks in advance !
Cheers,
C.
Have you checked the MTA configuration. Does it use dovecot's LDA ?
Antoine
Hello Antoine (and List),
Well, it should use dovecot, as the mails are delivered to the user inbox - and I don't think postfix knows about them.. How may I be sure otherwise that postfix really uses dovecot?
Cheers,
C.
If you are using dovecot 1.2, I think lda should show lines like the following in your log.
Mar 11 14:14:06 mailstor1 dovecot: deliver(user@domain.tld): sieve: msgid=<xxxxx>: stored mail into mailbox 'INBOX'
'deliver' refers to lda.
Hmm... strange, doesn't show up like that in logs: Mar 20 08:14:54 sqdf3 postfix/smtpd[27509]: connect from host.foo.bar[...] Mar 20 08:15:16 sqdf3 postfix/smtpd[27509]: 892335659F4: client=host.foo.bar[...] Mar 20 08:15:35 sqdf3 postfix/cleanup[27516]: 892335659F4: message-id=<> Mar 20 08:15:35 sqdf3 postfix/qmgr[11614]: 892335659F4: from=me@foo.bar, size=279, nrcpt=1 (queue active) Mar 20 08:15:35 sqdf3 postfix/virtual[27518]: 892335659F4: to=rcpt@domain.ltd, relay=virtual, delay=27, delays=27/0.03/0/0.14, dsn=2.0.0, status=sent (delivered to maildir) Mar 20 08:15:35 sqdf3 postfix/qmgr[11614]: 892335659F4: removed
Maybe the problem is there (postfix main.cf): virtual_transport = virtual I have virtual users and a mailman running on the same domain :/.
If postfix doesn't use dovecot, how comes that mails are put in the right place ?
On Tue, 20 Mar 2012 03:36:51 -0400 Gedalya gedalya@gedalya.net wrote:
On 3/20/2012 3:20 AM, Cedric Jeanneret wrote:
status=sent (delivered to maildir) Your log clearly says postfix is delivering directly to the maildir. Postfix must be configured to find the user's maildir using things like virtual_mailbox_base and / or virtual_mailbox_maps ?
Geez.. right - taking it from ldap... should only comment out the following lines: virtual_mailbox_base = / virtual_mailbox_maps = ldap:/etc/postfix/ldap-accounts.cf
?
On 3/20/2012 3:44 AM, Cedric Jeanneret wrote:
On Tue, 20 Mar 2012 03:36:51 -0400 Gedalyagedalya@gedalya.net wrote:
On 3/20/2012 3:20 AM, Cedric Jeanneret wrote:
status=sent (delivered to maildir) Your log clearly says postfix is delivering directly to the maildir. Postfix must be configured to find the user's maildir using things like virtual_mailbox_base and / or virtual_mailbox_maps ?
Geez.. right - taking it from ldap... should only comment out the following lines: virtual_mailbox_base = / virtual_mailbox_maps = ldap:/etc/postfix/ldap-accounts.cf
? If you want postfix to use the dovecot LDA then you have to set it up, you can get a general idea here http://wiki.dovecot.org/LDA/Postfix and adapt it to your circumstances.
Basically you have to add the appropriate lines to master.cf and put virtual_transport = dovecot in main.cf.
On Tue, 20 Mar 2012 04:01:08 -0400 Gedalya gedalya@gedalya.net wrote:
On 3/20/2012 3:44 AM, Cedric Jeanneret wrote:
On Tue, 20 Mar 2012 03:36:51 -0400 Gedalyagedalya@gedalya.net wrote:
On 3/20/2012 3:20 AM, Cedric Jeanneret wrote:
status=sent (delivered to maildir) Your log clearly says postfix is delivering directly to the maildir. Postfix must be configured to find the user's maildir using things like virtual_mailbox_base and / or virtual_mailbox_maps ?
Geez.. right - taking it from ldap... should only comment out the following lines: virtual_mailbox_base = / virtual_mailbox_maps = ldap:/etc/postfix/ldap-accounts.cf
? If you want postfix to use the dovecot LDA then you have to set it up, you can get a general idea here http://wiki.dovecot.org/LDA/Postfix and adapt it to your circumstances.
Basically you have to add the appropriate lines to master.cf and put virtual_transport = dovecot in main.cf.
won't work as I also have a mailman on the same domain - and dovecot doesn't know about mailman lists... That's why I used virtual. It _should_ take transport_maps = hash:/etc/postfix/transport which specify "use mailman for foo@domain.com" and "use dovecot for @domain.com" (at the end)... but doesn't seem to work as expected :(
On 3/20/2012 4:23 AM, Cedric Jeanneret wrote:
On Tue, 20 Mar 2012 04:01:08 -0400 Gedalyagedalya@gedalya.net wrote:
On 3/20/2012 3:44 AM, Cedric Jeanneret wrote:
On Tue, 20 Mar 2012 03:36:51 -0400 Gedalyagedalya@gedalya.net wrote:
On 3/20/2012 3:20 AM, Cedric Jeanneret wrote:
status=sent (delivered to maildir) Your log clearly says postfix is delivering directly to the maildir. Postfix must be configured to find the user's maildir using things like virtual_mailbox_base and / or virtual_mailbox_maps ?
Geez.. right - taking it from ldap... should only comment out the following lines: virtual_mailbox_base = / virtual_mailbox_maps = ldap:/etc/postfix/ldap-accounts.cf
? If you want postfix to use the dovecot LDA then you have to set it up, you can get a general idea here http://wiki.dovecot.org/LDA/Postfix and adapt it to your circumstances.
Basically you have to add the appropriate lines to master.cf and put virtual_transport = dovecot in main.cf.
won't work as I also have a mailman on the same domain - and dovecot doesn't know about mailman lists... That's why I used virtual. It _should_ take transport_maps = hash:/etc/postfix/transport which specify "use mailman for foo@domain.com" and "use dovecot for @domain.com" (at the end)... but doesn't seem to work as expected :( Once you have dovecot set up in your master.cf you should be able to put as the last line simply domain.com dovecot What do your logs look like when this is set?
won't work as I also have a mailman on the same domain - and dovecot doesn't know about mailman lists... That's why I used virtual. It _should_ take transport_maps = hash:/etc/postfix/transport which specify "use mailman for foo@domain.com" and "use dovecot for @domain.com" (at the end)... but doesn't seem to work as expected :( Once you have dovecot set up in your master.cf you should be able to put as the last line simply domain.com dovecot What do your logs look like when this is set?
I guess it may be easier if I paste my whole config in here:
postfix main.cf: smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU) biff = no
# appending .domain is the MUA's job. append_dot_mydomain = no
# Uncomment the next line to generate "delayed mail" warnings #delay_warning_time = 4h
alias_maps = hash:/etc/aliases alias_database = hash:/etc/aliases mydestination = public_fqdn, localhost mynetworks = 127.0.0.0/8 inet_interfaces = all recipient_delimiter = +
smtpd_sasl_security_options = noanonymous myorigin = domain.ltd smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache smtpd_sasl_path = private/auth smtpd_sasl_type = dovecot
owner_request_special = no
smtpd_tls_CAfile = /etc/postfix/ssl/ca.crt smtpd_tls_cert_file = /etc/postfix/ssl/cert.crt smtpd_tls_key_file = /etc/postfix/ssl/keyForApache2.key smtpd_use_tls = yes smtpd_sasl_tls_security_options = $smtpd_sasl_security_options smtpd_sasl_auth_enable = yes
default_process_limit = 5 smtpd_recipient_restrictions = check_recipient_access hash:/etc/postfix/access, permit_sasl_authenticated, permit_mynetworks, reject_unauth_destination, reject_unlisted_recipient smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
broken_sasl_auth_clients = yes transport_maps = hash:/etc/postfix/transport
virtual_transport = dovecot transport_maps = hash:/etc/postfix/transport virtual_alias_maps = ldap:/etc/postfix/ldap-aliases.cf, hash:/var/lib/mailman/data/virtual-mailman virtual_gid_maps = static:104 virtual_minimum_uid = 8 virtual_uid_maps = static:8 virtual_mailbox_base = / mailman_destination_recipient_limit = 1 virtual_mailbox_domains = avocats-ch.ch virtual_mailbox_maps = ldap:/etc/postfix/ldap-accounts.cf
With this configuration, here's what I get: sending to a virtual user: Mar 20 10:02:48 sqdf3 postfix/smtpd[1525]: connect from remote.host.ltd[...] Mar 20 10:02:48 sqdf3 postfix/smtpd[1525]: improper command pipelining after EHLO from remote.host.ltd[...] Mar 20 10:02:48 sqdf3 postfix/smtpd[1525]: DC9285659F4: client=remote.host.ltd[...] Mar 20 10:02:48 sqdf3 postfix/cleanup[1528]: DC9285659F4: message-id=<> Mar 20 10:02:49 sqdf3 postfix/qmgr[1462]: DC9285659F4: from=me@me.ltd, size=279, nrcpt=1 (queue active) Mar 20 10:02:49 sqdf3 dovecot: deliver(camptocamp): msgid=: saved mail to INBOX Mar 20 10:02:49 sqdf3 postfix/pipe[1529]: DC9285659F4: to=virtual_user@domain.ltd, relay=dovecot, delay=0.45, delays=0.18/0.01/0/0.26, dsn=2.0.0, status=sent (delivered via dovecot service) Mar 20 10:02:49 sqdf3 postfix/qmgr[1462]: DC9285659F4: removed
so it uses dovecot. but mail is not filtered as it should :((
And now, sending a mail to a mailman list:
Mar 20 10:06:25 sqdf3 postfix/smtpd[1525]: connect from remote.host.ltd[...]
Mar 20 10:06:25 sqdf3 postfix/smtpd[1525]: improper command pipelining after EHLO from remote.host.ltd[...]
Mar 20 10:06:25 sqdf3 postfix/smtpd[1525]: NOQUEUE: reject: RCPT from remote.host.ltd[...]: 550 5.1.1 my-list@domain.ltd: Recipient address rejected: User unknown in virtual mailbox table; from=me@me.ltd to=my-list@domain.ltd proto=ESMTP helo=
may I cry ? :(
On 20/03/2012 11:08, Cedric Jeanneret wrote:
I guess it may be easier if I paste my whole config in here: you didnt sent the virtual_transport file content. i will quote from the man pages of the transport: [quote] user@domain transport:nexthop Deliver mail for user@domain through transport to nexthop. [\quote] means you can specify specific transport such as maliman to specific user. but because you are using the virtual maps table\lookup you also must have a vaild ldap user with the same name for the list.
Regards, Eliezer
-- Eliezer Croitoru https://www1.ngtech.co.il IT consulting for Nonprofit organizations elilezer <at> ngtech.co.il
On Tue, 20 Mar 2012 11:42:21 +0200 Eliezer Croitoru eliezer@ngtech.co.il wrote:
On 20/03/2012 11:08, Cedric Jeanneret wrote:
I guess it may be easier if I paste my whole config in here: you didnt sent the virtual_transport file content. i will quote from the man pages of the transport: [quote] user@domain transport:nexthop Deliver mail for user@domain through transport to nexthop. [\quote] means you can specify specific transport such as maliman to specific user. but because you are using the virtual maps table\lookup you also must have a vaild ldap user with the same name for the list.
Regards, Eliezer
Hello,
while trying to remove/add options to my postfix, this part is now working now - it uses dovecot for virtual users, and mailman for lists :). Now that's good, I'll go back to sieve and ensure there's no missing configuration in dovecot. I had to remove "virtual_transport" option, and remove an "@" in my transport map.
I'll come back on this thread if I still have problem with sieve.
Cheers,
C.
participants (5)
-
Antoine Nguyen
-
Cedric Jeanneret
-
Cédric Jeanneret
-
Eliezer Croitoru
-
Gedalya