[Dovecot] Dovecot sieve with postfix.
Hi all,
I can't get dovecot working with postfix. If I leave virtual_transport set to "virtual", I can send and receive messages just fine in roundcube. If I set virtual_transport to "dovecot", I can only send messages in roundcube, but incoming messages never arrive. Seems I can't get dovecot-lda to work. I need dovecot-lda in order for sieve filters to work.
Any idea what I'm doing wrong?
Here's doveconf -n
:
http://pastie.org/5401133
postconf -n
:
http://pastie.org/5401157
and postconf -M
:
http://pastie.org/5401177
Note: All I have to do is change virtual_transport = dovecot to virtual_transport = virtual and all will be fine, except for that I won't have sieve filtering which is what I really want.
*/#!/*JoePea
At 6AM -0800 on 19/11/12 you (/#!/JoePea) wrote:
I can't get dovecot working with postfix. If I leave virtual_transport set to "virtual", I can send and receive messages just fine in roundcube. If I set virtual_transport to "dovecot", I can only send messages in roundcube, but incoming messages never arrive. Seems I can't get dovecot-lda to work. I need dovecot-lda in order for sieve filters to work.
Any idea what I'm doing wrong?
Here's
doveconf -n
: http://pastie.org/5401133
postconf -n
: http://pastie.org/5401157and
postconf -M
: http://pastie.org/5401177
The only obvious thing I can see wrong there is that you have
mail_plugins = " sieve"
in dovecot.conf, which should be
mail_plugins = sieve
but I don't know that that would prevent delivery.
Is Postfix deferring the message, or does it think it's been delivered? What do you see in your logs when a message is delivered (since you've redirected Dovecot away from syslog, you'd need to look at both Postfix's and Dovecot's logs)?
What happens if you feed a message to dovecot-lda manually, as 'mailman'? Check the exitcode of lda and the logs, as well as seeing if the message was delivered.
Since you've set up a dedicated transport for Dovecot, it would probably be worth using LMTP instead of the LDA. It should be more efficient, and since you're only using a single virtual user you can tell dovecot to run the LMTP server as 'mailman' instead of root.
Ben
Hi, thanks for the reply. I'm new to all this. How can I tell if postfix is deferring messages, or if it thinks they've been delieverd? Where is the postfix log?
How do I feed a message to dovecot-lda manually, as mailman?
How do I use LMTP instead of LDA?
*/#!/*JoePea
On Mon, Nov 19, 2012 at 8:47 AM, Ben Morrow <ben@morrow.me.uk> wrote:
At 6AM -0800 on 19/11/12 you (/#!/JoePea) wrote:
I can't get dovecot working with postfix. If I leave virtual_transport
set
to "virtual", I can send and receive messages just fine in roundcube. If I set virtual_transport to "dovecot", I can only send messages in roundcube, but incoming messages never arrive. Seems I can't get dovecot-lda to work. I need dovecot-lda in order for sieve filters to work.
Any idea what I'm doing wrong?
Here's
doveconf -n
: http://pastie.org/5401133
postconf -n
: http://pastie.org/5401157and
postconf -M
: http://pastie.org/5401177The only obvious thing I can see wrong there is that you have
mail_plugins = " sieve"
in dovecot.conf, which should be
mail_plugins = sieve
but I don't know that that would prevent delivery.
Is Postfix deferring the message, or does it think it's been delivered? What do you see in your logs when a message is delivered (since you've redirected Dovecot away from syslog, you'd need to look at both Postfix's and Dovecot's logs)?
What happens if you feed a message to dovecot-lda manually, as 'mailman'? Check the exitcode of lda and the logs, as well as seeing if the message was delivered.
Since you've set up a dedicated transport for Dovecot, it would probably be worth using LMTP instead of the LDA. It should be more efficient, and since you're only using a single virtual user you can tell dovecot to run the LMTP server as 'mailman' instead of root.
Ben
At 2AM -0800 on 26/11/12 you (/#!/JoePea) wrote:
Hi, thanks for the reply. I'm new to all this. How can I tell if postfix is deferring messages, or if it thinks they've been delieverd? Where is the postfix log?
You can tell if a message is still in the queue with 'mailq'. You can find out why by reading the log. If messages are being deferred they will eventually start bouncing, once Postfix decides they've spent too long in the queue.
Postfix normally logs through the 'mail' facility of syslog.
How do I feed a message to dovecot-lda manually, as mailman?
Something along the lines of
sudo -u mailman /usr/lib/dovecot/dovecot-lda -f some@user
-d some@user </some/mail/message
as root should work, depending on your sudo setup. Otherwise you will need to use su, which can be more awkward.
How do I use LMTP instead of LDA?
Read the wiki for the Dovecot end, and use
virtual_transport = lmtp:unix:/path/to/lmtp/socket
on the Postfix end. You will want to test the LMTP server is working manually (with nc -U or something) before trying to get Postfix to deliver to it.
Ben
Hi Ben, Indeed, the mailq command shows my test messages sitting there with "mail transport unavailable".
┌─[11:48:22/hypership/root/~] └─╼ mailq -Queue ID- --Size-- ----Arrival Time---- -Sender/Recipient------- 2DCCB580C01 1901 Mon Nov 26 11:45:02 trusktr@gmail.com (mail transport unavailable) trusktr@bettafootwear.com
B1449580C03 1895 Mon Nov 26 11:48:41 trusktr@gmail.com (mail transport unavailable) trusktr@bettafootwear.com
-- 5 Kbytes in 2 Requests.
I checked in /etc/syslog-ng/syslog-ng.conf and it shows destination d_mail { file("/var/log/mail.log"); }; but there is no such mail.log file so I created one.
I logged in as mailman by doing su -s /bin/bash mailman then ran
/usr/lib/dovecot/dovecot-lda -f trusktr@gmail.com -d trusktr@bettafootwear.com </home/mailman/test_msg.txt
where /home/mailman/test_msg.txt contains a plain text sentence. After doing that, mailq shows the new messages, but with the same "mail transport unavailable" message. However, in Roundcube I see a new blank message with no subject for each attempt of the dovecot-lda command.
Also, the after running the dovecot-lda command a few times, I noticed it was saying that the log files weren't writable (permission denied), so I fixed that... However, that doesn't seem to have fixed the problem as test emails from gmail still don't appear in Roundcube, but I see them with mailq with "mail transport unavailable".
I'll skip setting up LMTP until I get it working with LDA so I know what I'm doing before getting into more complications.
*/#!/*JoePea
On Mon, Nov 26, 2012 at 3:52 AM, Ben Morrow <ben@morrow.me.uk> wrote:
At 2AM -0800 on 26/11/12 you (/#!/JoePea) wrote:
Hi, thanks for the reply. I'm new to all this. How can I tell if postfix is deferring messages, or if it thinks they've been delieverd? Where is the postfix log?
You can tell if a message is still in the queue with 'mailq'. You can find out why by reading the log. If messages are being deferred they will eventually start bouncing, once Postfix decides they've spent too long in the queue.
Postfix normally logs through the 'mail' facility of syslog.
How do I feed a message to dovecot-lda manually, as mailman?
Something along the lines of
sudo -u mailman /usr/lib/dovecot/dovecot-lda -f some@user -d some@user </some/mail/message
as root should work, depending on your sudo setup. Otherwise you will need to use su, which can be more awkward.
How do I use LMTP instead of LDA?
Read the wiki for the Dovecot end, and use
virtual_transport = lmtp:unix:/path/to/lmtp/socket
on the Postfix end. You will want to test the LMTP server is working manually (with nc -U or something) before trying to get Postfix to deliver to it.
Ben
At 12PM -0800 on 26/11/12 /#!/JoePea wrote:
Hi Ben, Indeed, the mailq command shows my test messages sitting there with "mail transport unavailable".
┌─[11:48:22/hypership/root/~] └─╼ mailq -Queue ID- --Size-- ----Arrival Time---- -Sender/Recipient------- 2DCCB580C01 1901 Mon Nov 26 11:45:02 trusktr@gmail.com (mail transport unavailable) trusktr@bettafootwear.com
B1449580C03 1895 Mon Nov 26 11:48:41 trusktr@gmail.com (mail transport unavailable) trusktr@bettafootwear.com
-- 5 Kbytes in 2 Requests.
I checked in /etc/syslog-ng/syslog-ng.conf and it shows destination d_mail { file("/var/log/mail.log"); }; but there is no such mail.log file so I created one.
I don't know how syslog-ng works, but you need to be able to see the Postfix logs to have any chance of debugging this. Read your system documentation and get that working before trying anything else.
I logged in as mailman by doing su -s /bin/bash mailman then ran
/usr/lib/dovecot/dovecot-lda -f trusktr@gmail.com -d trusktr@bettafootwear.com </home/mailman/test_msg.txt
where /home/mailman/test_msg.txt contains a plain text sentence.
A single sentence is not a valid mail. Dovecot mostly doesn't care, but you will see odd client behaviour if you deliver invalid mails...
After doing that, mailq shows the new messages, but with the same "mail transport unavailable" message.
(I assume here that you only see the same list as before you attempted the new delivery? Delivering to LDA by hand shouldn't go anywhere near the Postfix queue.)
However, in Roundcube I see a new blank message with no subject for each attempt of the dovecot-lda command.
...such as this. It looks like the 'mail' is being successfully delivered; if you try with a proper mail, something like
From: root@localhost
To: root@localhost
Subject: testing dovecot-lda
1 2 3
it should show up properly in your client.
At this point I think this is a Postfix problem, not a Dovecot problem. You can apparently successfully deliver mail using dovecot-lda, so something in your Postfix config is not invoking it properly.
Ben
Hello Joe,
i use this: main.cf virtual_transport = dovecot
master.cf dovecot unix - n n - - pipe flags=DRhu user=vmail:vmail argv=/usr/lib/dovecot/deliver -f ${sender} -d ${recipient}
/etc/dovecot/conf.d/15-lda.conf protocol lda { log_path = /var/log/sieve.log mail_plugins = acl sieve }
and that works fine with my tested clients (tb,outlook,roundcube)
daniel
Am 19.11.2012 15:17, schrieb /#!/JoePea:
Hi all,
I can't get dovecot working with postfix. If I leave virtual_transport set to "virtual", I can send and receive messages just fine in roundcube. If I set virtual_transport to "dovecot", I can only send messages in roundcube, but incoming messages never arrive. Seems I can't get dovecot-lda to work. I need dovecot-lda in order for sieve filters to work.
Any idea what I'm doing wrong?
Here's
doveconf -n
: http://pastie.org/5401133
postconf -n
: http://pastie.org/5401157and
postconf -M
: http://pastie.org/5401177Note: All I have to do is change virtual_transport = dovecot to virtual_transport = virtual and all will be fine, except for that I won't have sieve filtering which is what I really want.
*/#!/*JoePea
--
Fischer Daniel FI4IT - that's it Messerschmittstrasse 17 89231 Neu Ulm
Email: dfischer@fi4it.de Web: www.fi4it.de Telefon: 073180019370 Fax: 073180019375 Mobil: 01729230731
Hi, I tried changing dovecot-lda to deliver in master.cf and also added the acl plugin to the lda protocol like yours. It still won't work though.
*/#!/*JoePea
On Mon, Nov 19, 2012 at 9:04 AM, Fi4IT - Daniel Fischer <dfischer@fi4it.de>wrote:
Hello Joe,
i use this: main.cf virtual_transport = dovecot
master.cf dovecot unix - n n - - pipe flags=DRhu user=vmail:vmail argv=/usr/lib/dovecot/deliver -f ${sender} -d ${recipient}
/etc/dovecot/conf.d/15-lda.**conf protocol lda { log_path = /var/log/sieve.log mail_plugins = acl sieve }
and that works fine with my tested clients (tb,outlook,roundcube)
daniel
Am 19.11.2012 15:17, schrieb /#!/JoePea:
Hi all,
I can't get dovecot working with postfix. If I leave virtual_transport set to "virtual", I can send and receive messages just fine in roundcube. If I set virtual_transport to "dovecot", I can only send messages in roundcube, but incoming messages never arrive. Seems I can't get dovecot-lda to work. I need dovecot-lda in order for sieve filters to work.
Any idea what I'm doing wrong?
Here's
doveconf -n
: http://pastie.org/5401133
postconf -n
: http://pastie.org/5401157and
postconf -M
: http://pastie.org/5401177Note: All I have to do is change virtual_transport = dovecot to virtual_transport = virtual and all will be fine, except for that I won't have sieve filtering which is what I really want.
*/#!/*JoePea
--
Fischer Daniel FI4IT - that's it Messerschmittstrasse 17 89231 Neu Ulm
Email: dfischer@fi4it.de Web: www.fi4it.de Telefon: 073180019370 Fax: 073180019375 Mobil: 01729230731
may be this is the best way
dovecot unix - n n - - pipe flags=DRhu user=vmail:vmail argv=/usr/lib/dovecot/deliver -f ${sender} -d ${recipient} -a ${recipient}
parameter-a $ {recipient} allow to keep the recipient's address in the headers "from:"
19.11.12 21:04, Fi4IT - Daniel Fischer пишет:
Hello Joe,
i use this: main.cf virtual_transport = dovecot
master.cf dovecot unix - n n - - pipe flags=DRhu user=vmail:vmail argv=/usr/lib/dovecot/deliver -f ${sender} -d ${recipient}
/etc/dovecot/conf.d/15-lda.conf protocol lda { log_path = /var/log/sieve.log mail_plugins = acl sieve }
and that works fine with my tested clients (tb,outlook,roundcube)
daniel
Am 19.11.2012 15:17, schrieb /#!/JoePea:
Hi all,
I can't get dovecot working with postfix. If I leave virtual_transport set to "virtual", I can send and receive messages just fine in roundcube. If I set virtual_transport to "dovecot", I can only send messages in roundcube, but incoming messages never arrive. Seems I can't get dovecot-lda to work. I need dovecot-lda in order for sieve filters to work.
Any idea what I'm doing wrong?
Here's
doveconf -n
: http://pastie.org/5401133
postconf -n
: http://pastie.org/5401157and
postconf -M
: http://pastie.org/5401177Note: All I have to do is change virtual_transport = dovecot to virtual_transport = virtual and all will be fine, except for that I won't have sieve filtering which is what I really want.
*/#!/*JoePea
Hi, thanks for the reply, What's the difference between dovecot-lda and deliver? Are they the same? The manpages are identical. I tried both and I also tried adding the -a ${recipient} argument but there was no change. It still doesn't work. Any other ideas?
*/#!/*JoePea
On Mon, Nov 26, 2012 at 11:26 AM, Николай Клименко <klimenko.n@theitidea.ru>wrote:
may be this is the best way
dovecot unix - n n - - pipe flags=DRhu user=vmail:vmail argv=/usr/lib/dovecot/deliver -f ${sender} -d ${recipient} -a ${recipient}
parameter-a $ {recipient} allow to keep the recipient's address in the headers "from:"
19.11.12 21:04, Fi4IT - Daniel Fischer пишет:
Hello Joe,
i use this: main.cf virtual_transport = dovecot
master.cf dovecot unix - n n - - pipe flags=DRhu user=vmail:vmail argv=/usr/lib/dovecot/deliver -f ${sender} -d ${recipient}
/etc/dovecot/conf.d/15-lda.**conf protocol lda { log_path = /var/log/sieve.log mail_plugins = acl sieve }
and that works fine with my tested clients (tb,outlook,roundcube)
daniel
Am 19.11.2012 15:17, schrieb /#!/JoePea:
Hi all,
I can't get dovecot working with postfix. If I leave virtual_transport set to "virtual", I can send and receive messages just fine in roundcube. If I set virtual_transport to "dovecot", I can only send messages in roundcube, but incoming messages never arrive. Seems I can't get dovecot-lda to work. I need dovecot-lda in order for sieve filters to work.
Any idea what I'm doing wrong?
Here's
doveconf -n
: http://pastie.org/5401133
postconf -n
: http://pastie.org/5401157and
postconf -M
: http://pastie.org/5401177Note: All I have to do is change virtual_transport = dovecot to virtual_transport = virtual and all will be fine, except for that I won't have sieve filtering which is what I really want.
*/#!/*JoePea
- clear the log
- Send message
- show mail.log mail.err
you should add following in main.cf
dovecot_destination_recipient_limit = 1
27.11.12 1:15, /#!/JoePea пишет:
Hi, thanks for the reply, What's the difference between dovecot-lda and deliver? Are they the same? The manpages are identical. I tried both and I also tried adding the -a ${recipient} argument but there was no change. It still doesn't work. Any other ideas?
*/#/!//*JoePea
On Mon, Nov 26, 2012 at 11:26 AM, Николай Клименко <klimenko.n@theitidea.ru <mailto:klimenko.n@theitidea.ru>> wrote:
may be this is the best way dovecot unix - n n - - pipe flags=DRhu user=vmail:vmail argv=/usr/lib/dovecot/deliver -f ${sender} -d ${recipient} -a ${recipient} parameter-a $ {recipient} allow to keep the recipient's address in the headers "from:" 19.11.12 21:04, Fi4IT - Daniel Fischer пишет: Hello Joe, i use this: main.cf <http://main.cf> virtual_transport = dovecot master.cf <http://master.cf> dovecot unix - n n - - pipe flags=DRhu user=vmail:vmail argv=/usr/lib/dovecot/deliver -f ${sender} -d ${recipient} /etc/dovecot/conf.d/15-lda.conf protocol lda { log_path = /var/log/sieve.log mail_plugins = acl sieve } and that works fine with my tested clients (tb,outlook,roundcube) daniel Am 19.11.2012 15:17, schrieb /#!/JoePea: Hi all, I can't get dovecot working with postfix. If I leave virtual_transport set to "virtual", I can send and receive messages just fine in roundcube. If I set virtual_transport to "dovecot", I can only send messages in roundcube, but incoming messages never arrive. Seems I can't get dovecot-lda to work. I need dovecot-lda in order for sieve filters to work. Any idea what I'm doing wrong? Here's `doveconf -n`: http://pastie.org/5401133 `postconf -n`: http://pastie.org/5401157 and `postconf -M`: http://pastie.org/5401177 Note: All I have to do is change virtual_transport = dovecot to virtual_transport = virtual and all will be fine, except for that I won't have sieve filtering which is what I really want. */#!/*JoePea
participants (4)
-
/#!/JoePea
-
Ben Morrow
-
Fi4IT - Daniel Fischer
-
Николай Клименко