[Dovecot] Dovecot LMTP does not pass envelope recipient +detail to sieve

Greg Rivers gcr+dovecot at tharned.org
Mon Jan 13 06:40:13 EET 2014


On Sat, 11 Jan 2014, Steffen wrote:

> I have:
> ... deliverable: mailer local, user uid+detail
> instead of "deliverable: mailer local, host detail, user gcr"
>
> Hmm, see 
> http://etutorials.org/Server+Administration/Sendmail/Part+I+Build+and+Install/Chapter+4.+Configure+sendmail.cf+with+m4/FEATUREpreserve_local_plus_detail/
>
> My mc-file has this setting commented out (prefixed by dnl). Ah, I see
> where the processing differs. I had added this:
>
> SLocal_localaddr
> R< $* > $1      Remove <> from address
> R$+ + $*                $: $1   Remove detail from address
> R$+             $: <$(localuser $1 $: TEMPFAIL $)> $1   Query socket
> map server, if that's a local user
> R<OK> $*        $# ok   yes, this preserves detail
> R<REJECT> $*    $# error $@ 5.7.1 $: 550 User unknown
> R<TEMPFAIL> $*  $# error $@ TEMPFAIL $: $1 try again later      Does
> it work????
>
> See the R<OK> line. The map is to verify if the user is local or not.
> In my system sendmail cannot do so on its own. Maybe the FEATURE above
> works for the standard config.
>

"FEATURE(`preserve_local_plus_detail')" is actually one of the first 
things I tried when I started working on this problem, but it doesn't 
quite work with the standard configuration:

$ sendmail -bv -d21.12 gcr+XYZZY at badger.tharned.org
...
rewrite: ruleset final            returns: gcr + XYZZY
rewrite: ruleset localaddr          input: gcr + xyzzy
-----trying rule: $+
-----rule matches: $: $1 $| $> "Local_localaddr" $1
-----skip subr Local_localaddr (197)
rewritten as: gcr + xyzzy $| gcr + xyzzy
-----trying rule: $+ $| $# ok
----- rule fails
-----trying rule: $+ $| $# $*
----- rule fails
-----trying rule: $+ $| $*
-----rule matches: $: $1
rewritten as: gcr + xyzzy
-----trying rule: $+
-----rule matches: $: < > $1
rewritten as: < > gcr + xyzzy
-----trying rule: < > $+
-----rule matches: $@ $1
rewritten as: gcr + xyzzy
rewrite: ruleset localaddr        returns: gcr + xyzzy
gcr+XYZZY at badger.tharned.org... User unknown

It does preserve the +detail, but according to the trace, it has a problem 
with Local_localaddr, and apparently fails because it's including the 
+detail when it does the local account look-up.

Here's what my Local_localaddr ruleset looks like with the 
preserve_local_plus_detail feature:

###########################################################################
###   Ruleset 5 -- special rewriting after aliases have been expanded   ###
###########################################################################
SLocal_localaddr
Slocaladdr=5
R$+			$: $1 $| $>"Local_localaddr" $1
R$+ $| $#ok		$@ $1			no change
R$+ $| $#$*		$#$2
R$+ $| $*		$: $1
# prepend an empty "forward host" on the front
R$+			$: <> $1
R< > $+			$@ $1
R< local : $* > $*	$: $>MailerToTriple < local : $1 > $2	no host extension
R< error : $* > $*	$: $>MailerToTriple < error : $1 > $2	no host extension
R< $~[ : $+ > $+	$: $>MailerToTriple < $1 : $2 > $3 < @ $2 >
R< $+ > $+		$@ $>MailerToTriple < $1 > $2 < @ $1 >

Perhaps I should file this as a bug at sendmail.org?

-- 
Greg


More information about the dovecot mailing list