Wietse Venema via Postfix-users <[email protected]> wrote:
> 
> Michael Grimm via Postfix-users:
>> Wietse Venema via Postfix-users <[email protected]> wrote:
>>> Michael Grimm via Postfix-users:

>>>> Thus, I am thinking about "duplicating" my current LMTP virtual_transport 
>>>> to either dovecot and dbmail-lmtpd.

>>> Use different transports for dovecot and dbmail, then use
>>> recipient_bcc_maps to add a recipient and use a tranpsort_maps entry
>>> with that recipient address.
>>> 
>>> If necessary I can do a configuration example.
>> 
>> I am sorry to say, yes, that would be necessary for me ;-)

First of all I want to thank you for the example configuration given below. I 
would never have come up with such a mailflow by myself.

Let me rephrase your proposal and ask if I got it right:

(Example incoming mail to: [email protected] <mailto:[email protected]>)

1) Different transports for both LMTP delivery steps:
        lmtp:unix:private/dovecot-smtp
        dbmail-lmtp:[10.0.1.11]:24
        
2) "Duplicate" incoming mail using recipient_bcc_maps
        [email protected] <mailto:[email protected]> -> 
[email protected]

3) Use lmtp:unix:private/dovecot-smtp for [email protected] 
<mailto:[email protected]>
   Use dbmail-lmtp:[10.0.1.11]:24 for [email protected]

Correct?

I am sorry to say that this is not working as expected in my case (lmtp excerpt 
from maillog):

Feb  7 14:54:33 mail postfix/lmtp[29180]: 4f7XWS4zHyz1XZP: 
to=<[email protected]>, orig_to=<[email protected]>, 
relay=mx1.enfer-du-nord.net[private/dovecot-lmtp], delay=4.9, 
delays=4.8/0.01/0.02/0.01, tls=none, dsn=2.0.0, status=sent (250 2.0.0 
<[email protected]> ELWUHhlEh2n+cQAAOoNhLw Saved)

Feb  7 14:54:33 mail postfix/lmtp[29181]: 4f7XWS4zHyz1XZP: 
to=<[email protected]>, relay=10.0.1.11[10.0.1.11]:24, delay=4.9, 
delays=4.8/0.01/0/0.05, tls=none, dsn=5.0.0, status=bounced (host 
10.0.1.11[10.0.1.11] said: 550 Recipient <[email protected]> FAIL (in reply 
to RCPT TO command))

Thus, lmtp:unix:private/dovecot-smtp is delivering this mail as expected to my 
final destination as defined in virtual_mailbox_maps:
[email protected]                          empty

But, dbmail-lmtp:[10.0.1.11]:24 is delivering to [email protected] 
<mailto:[email protected]> and not my final destination at dmail which is 
[email protected] <mailto:[email protected]>

Here is my configuration based on yours (slightly modified because I do host 8 
domains)

> Assuming that [email protected] is already delivered like:
> 
> /etc/postfix/main.cf:
>    virtual_transport = lmtp:[dovecot host and maybe port]

virtual_transport = lmtp:unix:private/dovecot-lmtp

> 
> You would add a recipient BCC mapping, so that [email protected]
> will also receive a copy as [email protected]
> 
> /etc/postfix/main.cf:
>    recipient_bcc_maps = pcre:/etc/postfix/recipient_bcc.pcre

recipient_bcc_maps = 
pcre:/usr/local/etc/postfix/POSTCONF_PCRE_recipient_bcc_maps

> /etc/postfix/recipient_bcc.pcre:
>    /^(.*)@example\.com$/ ${1}@db.example.com/

/^(.*)@(.*)$/   ${1}@dbmail.${2}

> Then we need to route that extra recipient to a dbmail delivery
> agent that strips the fake 'db' subdomain before delivery to dbmail.
> 
> First, the transport mapping for the BCC recipients:
> 
> /etc/postfix/main.cf:
>    # instead of cdb you can use hash or lmdb
>    transport_maps = cdb:/etc/postfix/transport

transport_maps = lmdb:/usr/local/etc/postfix/POSTCONF_LMDB_transport_maps

> /etc/postfix/transport:
>    db.example.com lmtp-db:[dbmail host and maybe port]

dbmail.ellael.org               dbmail-lmtp:[10.0.1.11]:24

> Then, the delivery agent:
> 
> /etc/postfix/master.cf:
>    lmtp-db unix ..     ..      ..      ..      ..  lmtp
>        -o lmtp_generic_maps = pcre:/etc/postfix/lmtp_generic.pcre

dbmail-lmtp       unix  -       -       n       -       -       lmtp
  -o 
lmtp_generic_maps=pcre:/usr/local/etc/postfix/POSTCONF_PCRE_lmtp_generic_maps

> /etc/postfix/lmtp_generic.pcre:
>    /^(.*)@db.example.com ${1}@example.com

/^(.*)@dbmail\.(.*)$/   ${1}@${2}


Any hint on why incoming [email protected] <mailto:[email protected]> will 
become delivered as:
        lmtp=.. to=<[email protected]>, orig_to=<[email protected]> .. 
<[email protected]>
while [email protected] <mailto:[email protected]> will 
become delivered as:
        lmtp=.. to=<[email protected]> .. <[email protected]>


BTW, a locally injected mail to [email protected] 
<mailto:[email protected]> is delivered to both IMAP servers as expected:

Feb  7 16:20:03 mail postfix/lmtp[31497]: 4f7ZQC2t4nz1XmZ: 
to=<[email protected]>, relay=mx1.enfer-du-nord.net[private/dovecot-lmtp], 
delay=0.09, delays=0.08/0/0/0.01, tls=none, dsn=2.0.0, status=sent (250 2.0.0 
<[email protected]> gLGzGiNYh2kKewAAOoNhLw Saved)
Feb  7 16:20:04 mail postfix/lmtp[31496]: 4f7ZQC2t4nz1XmZ: 
to=<[email protected]>, relay=10.0.1.11[10.0.1.11]:24, delay=0.73, 
delays=0.08/0/0/0.64, tls=none, dsn=2.0.0, status=sent (215 Recipient 
<[email protected]> OK)



Sorry for this lengthy mail and regards,
Michael

_______________________________________________
Postfix-users mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to