Hi,

Thanks for sharing. I was wonder about the dovecot-lda and how make it
work with opensmtpd instead of using procmail.

Thanks

Olivier Calzi
Le dimanche 01 dC)cembre 2013 C  02:49 +0100, Philippe LelC)dy a C)crit :
> I can't use LMTP, here is the raison why.
> 
> In contrast OpenSMTPD's own MDA and dovecot-lda both work well.
> 
> I have multiple domains and bob@domain1 has not to be confused with 
> bob@domain2.
> 
> Using OpenSMTPD's own MDA works well
> 
> --------------
> accept .... deliver to maildir 
> "/var/mail/users/%{dest.domain}/%{user.username}/Maildir"
> --------------
> 
> Using dovecot-lda works well
> 
> --------------
> accept .... deliver to mda "/usr/local/libexec/dovecot/dovecot-lda -f 
> %{sender} -d %{dest}"
> --------------
> 
> I find this second method better, because it is only up to one server to 
> mind about mailbox location, and dovecot can create all the tree to the 
> mailbox if configured to do so.
> 
> ----- dovecot.conf -----------
> mail_home=/var/mail/users/%d/%n
> ----------------------------
> 
> The better solution would be using LMTP, but OpenSMTP doesn't send 
> enough information for dovecot being able to be find out the intended 
> mail box location. The domain part is missing. I spied the dialog 
> between OpenSMTP and the LMTP server to get evidence of that.
> 
> First I sent manually to devcot-lmtp:
> --------
> socat - unix-connect:/var/run/dovecot/lmtp # YES I don't need socat, 
> netcat is enough !
> 220 mail.mondomaine.fr Dovecot ready.
> LHLO moi
> 250-mail.mondomaine.fr
> 250-8BITMIME
> 250-ENHANCEDSTATUSCODES
> 250 PIPELINING
> MAIL FROM:<[email protected]>
> 250 2.1.0 OK
> RCPT TO:<[email protected]>
> 250 2.1.5 OK
> DATA
> 354 OK
> un
> deux
> .
> 250 2.0.0 <[email protected]> 3yMeAY9qmlKOYQAADHi8dQ Saved
> ----------------
> ----- dovecot.log
> Nov 30 23:49:21 lmtp(24974,[email protected] : Debug: fs: 
> root=/var/mail/users/mondomaine.fr/phil/mdbox, index=, control=, inbox=, 
> alt=
> Nov 30 23:49:21 lmtp(24974, [email protected]): Info: 
> 3yMeAY9qmlKOYQAADHi8dQ: msgid=unspecified: saved mail to INBOX From:  
> Subject:
> ----------------
> So dovecot-lmtp did what I wanted it to do.
> 
> Now, let OpenSMTPD talk to dovecot-lmtp
> 
> ------ smtpd.conf ----------
> accept ...deliver to lmtp localhost:5000
> 
> --------- shell -------------
> mknod backpipe p
> nc -l 5000 < backpipe | tee -a in | nc -U /var/run/dovecot/lmtp | tee -a 
> out > backpipe
> ---------------------------
> 
> Here is what OpenSMTP sent:
> 
> --------- cat in ---
> cat in
> LHLO xxx.mondomaine.fr
> MAIL FROM:<[email protected]>
> RCPT TO:<phil>
> ....
> ------------------
> 
> I browsed the source
> 
> --------- delivery_lmtp.c----
> case LMTP_MAIL_FROM:
>               if (buffer[0] != '2')
>                   errx(1, "MAIL FROM rejected: %s\n", buffer);
>               fprintf(fp, "RCPT TO:<%s>\r\n", deliver->user);
>               state = LMTP_RCPT_TO;
>               break;
> ----------
> 
> The "RCPT TO:<%s>\r\n", deliver->user makes it clear.
> 
> I suggest that selecting which piece of info is to be passed in the RCPT 
> TO  be an option
> 
> ------
> accept .... deliver to lmtp <socket> rcpt-to %{dest}
> ------
> 
> would be fine for me.
> 
> I tried hard with OpenSMTPD tables ( virtual and userbase ) to bypass 
> this limitation, without any succes. I am going back to dovecot-lda.
> 
> Hope my experiments will help some.
> 
> Ph. L.
> 
> 
> 
> 
> 



-- 
You received this mail because you are subscribed to [email protected]
To unsubscribe, send a mail to: [email protected]

Reply via email to