[Dovecot] Dovecot LMTP does not pass envelope recipient +detail to sieve
Greg Rivers
gcr+dovecot at tharned.org
Fri Jan 10 01:25:39 EET 2014
On Thu, 9 Jan 2014, Steffen Kaiser wrote:
> On Tue, 7 Jan 2014, Greg Rivers wrote:
>
>> [snip]
>>
>> So for the archives, to get sieve's "envelope :detail ..." working with
>> sendmail and dovecot LMTP, do the following:
>>
>> 1) Add "lda_original_recipient_header = X-Original-To" to 15-lda.conf
>>
>> 2) Add the following rule to sendmail.mc to add a X-Original-To: header to
>> every message:
>>
>> LOCAL_CONFIG
>> H?${u}?X-Original-To: $u
>
> First: This won't work, if the message has two or more recipients, $u is
> empty then.
>
Right. Miquel van Smoorenburg pointed that out too earlier in this thread.
> Do you serialize messages per recipient?
>
Yes, to mitigate this issue, I plan to enforce one recipient per LMTP
session with: define(`LOCAL_MAILER_MAXMSGS', `1'). This will result in
adding "m=1" to the local mailer definition.
But I'd really rather have +detail passed via LMTP.
> Second: My Debian sendmail v8.14.4 does pass +detail to LMTP.
>
> Mlocal, P=[IPC], F=lsDFMAw5:/|@qPSXnz9, S=EnvFromSMTP/HdrFromL,
> R=EnvToL/HdrToL,
> T=DNS/RFC822/SMTP,
> A=FILE /var/run/dovecot2.2/lmtp
>
> looks like just:
>
> FEATURE(`local_lmtp',`[IPC]',`FILE /var/run/dovecot2.2/lmtp')dnl
>
> of my mc-file effects it.
>
Now this is a really useful data point! I have exactly the same
configuration on FreeBSD running sendmail v8.14.7:
FEATURE(`local_lmtp',`[IPC]',`FILE /var/run/dovecot/lmtp')
Mlocal, P=[IPC], F=lsDFMAw5:/|@qPSXmnz9, S=EnvFromSMTP/HdrFromL, R=EnvToL/HdrToL,
T=DNS/RFC822/SMTP,
A=FILE /var/run/dovecot/lmtp
> The use of forwarding, aliases or virtuser table might strip the detail, you
> need to do explicitly preserve the +detail with those. Retry with a recipient
> without any rewriting and from the local host.
>
> echo TEST | sendmail -v recpient+detail at yourdomain.tld
>
> Received: from ux-2s11.inf.fh-bonn-rhein-sieg.de
> by ux-2s11.inf.fh-bonn-rhein-sieg.de (Dovecot) with LMTP id
> aC4NEHRMzlK7dgAALie3fw
> for <uid+detail>; Thu, 09 Jan 2014 08:15:00 +0100
>
I'm not using any aliases or virtuser table in my tests, yet my sendmail
DOES NOT pass +detail to LMTP:
$ echo TEST | sendmail -v gcr+detail at badger.tharned.org
gcr+detail at badger.tharned.org... Connecting to [127.0.0.1] via relay...
220 badger.tharned.org ESMTP Sendmail 8.14.7/8.14.7; Thu, 9 Jan 2014 16:19:46 -0600 (CST)
>>> EHLO badger.tharned.org
250-badger.tharned.org Hello localhost [127.0.0.1], pleased to meet you
250-ENHANCEDSTATUSCODES
250-PIPELINING
250-EXPN
250-VERB
250-8BITMIME
250-SIZE
250-DSN
250-ETRN
250-DELIVERBY
250 HELP
>>> VERB
250 2.0.0 Verbose mode
>>> MAIL From:<gcr at badger.tharned.org> SIZE=5
250 2.1.0 <gcr at badger.tharned.org>... Sender ok
>>> RCPT To:<gcr+detail at badger.tharned.org>
>>> DATA
250 2.1.5 <gcr+detail at badger.tharned.org>... Recipient ok
354 Enter mail, end with "." on a line by itself
>>> .
050 <gcr+detail at badger.tharned.org>... Connecting to /var/run/dovecot/lmtp via local...
050 220 badger.tharned.org Dovecot ready.
050 >>> LHLO badger.tharned.org
050 250-badger.tharned.org
050 250-8BITMIME
050 250-ENHANCEDSTATUSCODES
050 250 PIPELINING
050 >>> MAIL From:<gcr at badger.tharned.org>
050 250 2.1.0 OK
050 >>> RCPT To:<gcr>
050 >>> DATA
050 250 2.1.5 OK
050 354 OK
050 >>> .
050 250 2.0.0 <gcr> OD97EoIgz1L04QAAwQnkQQ Saved
050 <gcr+detail at badger.tharned.org>... Sent
250 2.0.0 s09MJkLK057843 Message accepted for delivery
gcr+detail at badger.tharned.org... Sent (s09MJkLK057843 Message accepted for delivery)
Closing connection to [127.0.0.1]
>>> QUIT
221 2.0.0 badger.tharned.org closing connection
Return-Path: <gcr at badger.tharned.org>
Delivered-To: <gcr>
Received: from badger.tharned.org
by badger.tharned.org (Dovecot) with LMTP id OD97EoIgz1L04QAAwQnkQQ
for <gcr>; Thu, 09 Jan 2014 16:19:46 -0600
Return-Path: <gcr at badger.tharned.org>
Received: from badger.tharned.org (localhost [127.0.0.1])
by badger.tharned.org (8.14.7/8.14.7) with ESMTP id s09MJkLK057843
for <gcr+detail at badger.tharned.org>; Thu, 9 Jan 2014 16:19:46 -0600 (CST)
(envelope-from gcr at badger.tharned.org)
Received: by badger.tharned.org (8.14.7/8.14.7/Submit) id s09MJjbI057842
for gcr+detail at badger.tharned.org; Thu, 9 Jan 2014 16:19:45 -0600 (CST)
(envelope-from gcr)
Date: Thu, 9 Jan 2014 16:19:45 -0600 (CST)
From: Greg Rivers <gcr at badger.tharned.org>
Message-Id: <201401092219.s09MJjbI057842 at badger.tharned.org>
To: undisclosed-recipients:;
TEST
So I clearly have a sendmail problem. Maybe there's been a regression in
sendmail since 8.14.4, or there's some other platform specific issue.
This gives me something to go on; thanks a lot for your feedback!
--
Greg Rivers
More information about the dovecot
mailing list