[Dovecot] Sieve is not getting the propper RCPT from the LMTP daemon
Hi!
Since the setup I use is a bit strange let's go for it first:
* The system uses postfix as MTA and dovecot as LDA after alias
translation by local via LMTP
* The dovecot version is 2.2.5 and the pigeonhole version is 0.4.1
* The SMTP server at gentoo.org is configured to send me a backup of my
emails to klondike+gentoo (at) xiscosoft.es using sendmail
* The email is received by the server and then (hopefully filtered).
* The email comes with two Delivered-To: headers, the first one has the
correct address, the second one has the gentoo address.
The interesting part of the filter is this:
if envelope :detail "to" "gentoo"
{
addflag "\\Seen";
fileinto "gentoo";
stop;
}
But this doesn't seem to work, I enable debugging with the following lines:
require "vnd.dovecot.debug";
require "envelope";
require "variables";
if envelope :matches "to" "*" { debug_log "envelope to `${1}'"; }
if envelope :matches "from" "*" { debug_log "envelope from `${1}'"; }
The relevant lines for the test e-mail I sent are these:
sieve: info: started log at Dec 24 13:37:23.
main script: line 9: info: DEBUG: envelope to `klondike (at) gentoo.org'.
main script: line 10: info: DEBUG: envelope from `klondike (at) gentoo.org'.
info: msgid=<52B97FF7.6050109@gentoo.org>: stored mail into mailbox 'INBOX'.
The thing is that the to envelope should be instead klondike+gentoo (at)
xiscosoft.es as show by the lmtp logs:
Dec 24 13:37:23 localhost dovecot: lmtp(26249): Connect from local
Dec 24 13:37:23 localhost dovecot: lmtp(26249, klondike):
Cd6YHwOAuVKJZgAA0J78UA: sieve: msgid=<52B97FF7.6050109@gentoo.org>:
stored mail into mailbox 'INBOX'
Dec 24 13:37:23 localhost dovecot: lmtp(26249): Disconnect from local:
Successful quit
Dec 24 13:37:23 localhost postfix/lmtp[26248]: 657D9101E5E:
to=
El 24/12/13 14:15, klondike escribió:
Hi!
Since the setup I use is a bit strange let's go for it first: translation by local via LMTP
- The system uses postfix as MTA and dovecot as LDA after alias
- The dovecot version is 2.2.5 and the pigeonhole version is 0.4.1 Tried also today with 2.2.6 and 0.4.2 with the same results
BTW Timo, thanks for the verbose error messages, LMTP refused to work until postmaster_address wasn't set (despite the config still states it will go back to a default) and the logs clearly pointed that :-)
klondike
On 12/24/2013 2:15 PM, klondike wrote:
The relevant lines for the test e-mail I sent are these: sieve: info: started log at Dec 24 13:37:23. main script: line 9: info: DEBUG: envelope to
klondike (at) gentoo.org'. main script: line 10: info: DEBUG: envelope from
klondike (at) gentoo.org'. info: msgid=52B97FF7.6050109@gentoo.org: stored mail into mailbox 'INBOX'.
A similar issue was mentioned and solved a little later on the mailing list, so that is why I forgot about this one. That involved Sendmail though:
http://www.dovecot.org/list/dovecot/2014-January/094385.html
So, did you manage to solve this yourself?
If not:
- What is your config: dovecot -n
- Do you have an example message?
- Can you capture the LMTP protocol exchange between Postfix and Dovecot somehow?
Regards,
Stephan.
On Tue, 11 Feb 2014, Stephan Bosch wrote:
On 12/24/2013 2:15 PM, klondike wrote:
The relevant lines for the test e-mail I sent are these: sieve: info: started log at Dec 24 13:37:23. main script: line 9: info: DEBUG: envelope to
klondike (at) gentoo.org'. main script: line 10: info: DEBUG: envelope from
klondike (at) gentoo.org'. info: msgid=52B97FF7.6050109@gentoo.org: stored mail into mailbox 'INBOX'.A similar issue was mentioned and solved a little later on the mailing list, so that is why I forgot about this one. That involved Sendmail though:
http://www.dovecot.org/list/dovecot/2014-January/094385.html
If you read further down that thread, you'll see that both Miquel van Smoorenburg and Steffen Kaiser pointed out that this solution only works in the case where there is one and only one recipient. So it's not a general solution.
Because of that, I am using dovecot LDA instead of LMTP until I can write a custom sendmail ruleset to pass +detail to LMTP. Here's my sendmail LDA configuration ($h contains the detail part of the ID):
FEATURE(local_procmail',
/usr/local/libexec/dovecot/dovecot-lda', `dovecot-lda -a $u+$h -d $u')
-- Greg
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On Tue, 11 Feb 2014, Greg Rivers wrote:
On Tue, 11 Feb 2014, Stephan Bosch wrote:
On 12/24/2013 2:15 PM, klondike wrote:
The relevant lines for the test e-mail I sent are these: sieve: info: started log at Dec 24 13:37:23. main script: line 9: info: DEBUG: envelope to
klondike (at) gentoo.org'. main script: line 10: info: DEBUG: envelope from
klondike (at) gentoo.org'. info: msgid=52B97FF7.6050109@gentoo.org: stored mail into mailbox 'INBOX'.A similar issue was mentioned and solved a little later on the mailing list, so that is why I forgot about this one. That involved Sendmail though:
http://www.dovecot.org/list/dovecot/2014-January/094385.html
If you read further down that thread, you'll see that both Miquel van Smoorenburg and Steffen Kaiser pointed out that this solution only works in the case where there is one and only one recipient. So it's not a general solution.
That is true, if you want to fetch the envelope recipient from "Recieved" headers.
Because of that, I am using dovecot LDA instead of LMTP until I can write a custom sendmail ruleset to pass +detail to LMTP. Here's my sendmail LDA configuration ($h contains the detail part of the ID):
FEATURE(
local_procmail',
/usr/local/libexec/dovecot/dovecot-lda', `dovecot-lda -a $u+$h -d $u')
LMTP in sendmail has the problem, that you need to accept "user+detail" as local recipient, in order to be passed to the local mailer. I did this with a socket map, because I use one anyway. Also, if getpwnam() is not working, you loose the .forward feature. Therefore I patched a Dovecot mailbox backend, similiar to the already existing LDAP mailbox backend, into sendmail.
Steffen Kaiser -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux)
iQEVAwUBUv3JonD1/YhP6VMHAQI7/ggAm4BjnZUBGgA6f2hvIHhGQqxR6CLsxrtr r+JQRHR0EQPpkf6z/zPorMdQ7H2zK3gtA+rQk4nxQYPNRSMoOQEXtj/QTJ7sKP3o tNQLOPMNuKgWkkcSLHiE9f9zcX2uKY9OJ6qoFe0gxV9xsvsSHoXuJx4hymIInqY7 LqTKxA/CUrOHi6BwF0DeAUVYC6JYMnvPFAwVLDIr096KudvgMXzj+GpHaEx1uB9F 6qyiShx4ci/cLJ1lPk4xaEqmhIAI9E612jxcYZzTWYkt00F67nOt8FPTCJus7EGs iMxR/DpBkdGhBXqIKQhBXashsT+LYUI8DhJD5VcTVVOnthbRQZZ8qw== =hh7s -----END PGP SIGNATURE-----
participants (4)
-
Greg Rivers
-
klondike
-
Steffen Kaiser
-
Stephan Bosch