sieve vacation alias handling problem

Karol Augustin karol at augustin.pl
Sun Mar 4 13:08:16 EET 2018


On 2018-03-03 21:47, Karol Augustin wrote:
> On 2018-03-03 21:28, Stephan Bosch wrote:
>> Op 3/2/2018 om 3:35 PM schreef Karol Augustin:
>>> Hi,
>>>
>>> I am using Dovecot LDA as LMTP renders envelope extension unusable.
>>>
>>> The problem I have noticed is that when user has multiple aliases sieve
>>> responds to all of them, not only to :addresses specified.
>>>
>>> From testing it seems that :addresses only adds addresses to the list of
>>> "known" emails to check against. It is not limiting it.
>>>
>>> As I understand, sieve should check if To: header is consistent with
>>> addresses known to be users. But how Dovecot knows about aliases
>>> assigned to the user?
>>>
>>> From my testing if header To: address is consistent with envelope To:
>>> address the reply is fired. I have sieve_vacation_use_original_recipient
>>> left at it's default value (no), so that shouldn't be the case. Now if
>>> user address at example.com has alias alias at example.com specified, the
>>> vacation reply will be sent to email addressed to alias at example.com,
>>> which is weird, because this behavior should be enabled by switching
>>> sieve_vacation_use_original_recipient to yes.
>>>
>>> When user receives an email that was originally sent to his gmail
>>> account (forwarded) there is no reply. If I add gmail address to
>>> :addresses reply is generated as expected.
>>>
>>> So my main question is if this is expected? I would like to enable only
>>> delivery to primary address and to + extensions to that address by
>>> default.
>>>
>>> I think that it might be that Postfix is expanding aliases and passing
>>> the final recipient (as to=<XXX>) to dovecot. Then dovecot is using that
>>> address to check for explicit delivery, but something fails, as this
>>> address is obviously not in To: header. So it looks like orig_to has to
>>> be used as well which should be disabled by
>>> sieve_vacation_use_original_recipient?
>>>
>>>
>>> My address is: karol at augustin.pl, alias is: carol at augustin.pl
>>>
>>>
>>> Mar  2 12:37:32 mail dovecot: lda(karol at augustin.pl): sieve:
>>> msgid=<3ba0578a5f6b170e942b5bac1b19be36 at posteo.net>: sent vacation
>>> response to <sender at example.com>
>>> Mar  2 12:37:32 mail postfix/qmgr[4744]: 3zt82h4CG4z2xlw: from=<>,
>>> size=732, nrcpt=1 (queue active)
>>> Mar  2 12:37:32 mail dovecot: lda(karol at augustin.pl): sieve:
>>> msgid=<3ba0578a5f6b170e942b5bac1b19be36 at posteo.net>: stored mail into
>>> mailbox 'INBOX'
>>> Mar  2 12:37:32 mail postfix/pipe[8793]: 3zt82f3x4xz2xmw:
>>> to=<karol at augustin.pl>, orig_to=<carol at augustin.pl>, relay=dovecot,
>>> delay=2.2, delays=2.2/0/0/0.06, dsn=2.0.0, status=sent (delivered via
>>> dovecot service)
>>>
>>>
>>> Forward from from gmail:
>>>
>>> Mar  2 11:38:19 mail postfix/qmgr[4744]: 3zt6kL1yF7z2xgg:
>>> from=<karolaug+caf_=karol=augustin.pl at gmail.com>, size=5831, nrcpt=1
>>> (queue active)
>>> Mar  2 11:38:19 mail dovecot: lda(karol at augustin.pl): sieve:
>>> msgid=<e610a47934f9aabb31f833c025075cff at posteo.net>: discarding vacation
>>> response for implicitly delivered message; no known (envelope) recipient
>>> address found in message headers (recipient=<karol at augustin.pl>, and
>>> additional `:addresses' are specified)
>>> Mar  2 11:38:19 mail dovecot: lda(karol at augustin.pl): sieve:
>>> msgid=<e610a47934f9aabb31f833c025075cff at posteo.net>: stored mail into
>>> mailbox 'INBOX'
>>> Mar  2 11:38:19 mail postfix/pipe[5362]: 3zt6kL1yF7z2xgg:
>>> to=<karol at augustin.pl>, relay=dovecot, delay=1.3, delays=1.2/0/0/0.05,
>>> dsn=2.0.0, status=sent (delivered via dovecot service)
>>>
>>>
>>> from my master.cf:
>>> dovecot unix - n n - - pipe
>>>    flags=DRhu user=vmail:vmail argv=/usr/lib/dovecot/dovecot-lda -f
>>> ${sender} -a ${original_recipient} -d ${user}@${nexthop}
>>
>> What is your configuration. Please provide output from `dovecot -n`.
>>
>> Regards,
>>
>> Stephan.
> 
> To clarify the problem. After more testing I figured that the vacation
> works as specified in RFC, taking known address from envelope recipient
> and comparing it with To and Cc. If it matches, which is true also for
> aliases, the reply is generated.
> 
> My problem is that from documentation I understand that this behavior
> (RFC5230 point 4.5 par 2.) is controlled by
> sieve_vacation_use_original_recipient parameter, which doesn't disable
> envelope address check if set at default "no" and also if explicitly set
> in the config.
> 

Sorry for causing problems and wasting time. The problem was with
lacking -r parameter in LDA invocation:

"-r <address>: Final envelope recipient address. Defaults to -a address,
but may differ if e.g. aliases are used or when dropping the +ext part.
(v2.0.3+)"
So the final recipient that is used by vacation was always set to the
original recipient value.

With the following Postfix config everything works exactly as expected.
Response is generated if mail is send to +exct address and is not
generated if it is send to an alias unless the alias is configured in
"addresses variable.

Also the sieve_vacation_use_original_recipient parameter works as
expected.

dovecot unix - n n - - pipe
   flags=OXDRhu user=vmail:vmail argv=/usr/lib/dovecot/dovecot-lda -f
${sender} -a ${original_recipient} -r ${recipient} -d ${user}@${nexthop}


Thanks,
Karol

-- 
Karol Augustin
karol at augustin.pl
http://karolaugustin.pl/
+353 85 775 5312


More information about the dovecot mailing list