sendmail not invoking dovecot-lda
alvin
alvin.sm at Mail.Linux-Consulting.com
Tue Jan 27 19:29:18 UTC 2015
hi steffen
- thanx for your reply
sendmail-8.15.1 + dovecot-2.2.15 + OpenSSL is working ..
my sendmail is also configured for smtp-auth and saslauth
and seems to work with dovecot
one other thing to note, sendmail requires CA signed *.pem certs
vs self-signed ... in my case, dovecot uses the same *.pem certs
http://www.sendmail.org/~ca/email/other/cagreg.html
# # ================
# # testing dovecot to fetch the emails
# # ================
#
# dovecot.user is only defined in /etc/dovecot/passwd
#
# echo "test mail" | mail -v dovecot.user at vmail.example.com
# echo "test mutt" | mutt -s mutt dovecot.user at vmail.example.com
#
# echo "sendmail" | sendmail -d60.5 -d27.2 -bv dovecot.user at vmail.example.com
#
# telnet vmail.example.com 110
# openssl s_client -connect vmail.example.com:995 # pop3s
# user dovecot.user
# pass passwd
# list
# retr 1
# quit
#
# telnet vmail.example.com 143
# openssl s_client -connect vmail.example.com:993 # imaps
# a1 login dovecot.user passwd
# a2 LIST "" "*"
# a3 select INBOX
# a4 FETCH 1 BODY[]
# a5 logout
#
# # replace gmail.com with your ssl-enabled dovecot server
# openssl s_client -connect pop.gmail.com:995 -showcerts
# openssl s_client -connect imap.gmail.com:993 -showcerts
#
# # replace gmail.com with your SASL enabled STMPT server
# openssl s_client -connect smtp.gmail.com:587 -starttls smtp
#
> On Sun, 18 Jan 2015, alvin wrote:
> >
> > ------------------------------------------------------------------------------
> > - status of what works and what does NOT work while testing dovecot's LDA ...
> > ------------------------------------------------------------------------------
> > #
> > # fyi.. recepient user is in the form of user, user at localhost and user at domain.com
> > #
> > sendmail -bv user.in/etc/passwd = deliverable
> > sendmail -bv user.in/etc/mail/virtusertable = deliverable to sendmail virtual user
> >
> > -->> sendmail -bv dovecot.user.in/dovecot/virtual.passwd.file == user unknown
>
> 1) is the virtual domain a local name?
> http://compgroups.net/comp.mail.sendmail/sendmail-dovecot-mailertable-and-passwd-li/1316451
> http://www.dovecot.org/list/dovecot/2010-June/049500.html
it turns out, the hostname must NOT be listed in /etc/mail/local-host-names
and that it still must resolve ( /etc/hosts )
> 2) your mailer is named "dovecot", therefore the mailertable entry in the
> Wiki:
>
> virtualdomain.example.com vmail:vmail
and again, virtualdomain -- should NOT be listed in /etc/mail/local-host-names
- when i removed it from local-host-names, things started be more debuggable and fixed
yup
> virtualdomain.example.com dovecot:dovecot
> (2nd dovecot has no meaning, but there must be present something)
yup
> 3) Post a sensable output:
> echo '3,0 dovecotuser at dovecot.domain' | sendmail -bt -d21.4
it's working ... other sendmail tests ...
# sendmail -d60.5 -d27.2 -bv dovecot.user
# dovecot.user... User unknown
#
# sendmail -d60.5 -d27.2 -bv dovecot.user at fake
# dovecot.yser at fake... deliverable: mailer esmtp, host fake, user dovecot.plain at fake
#
# sendmail -d60.5 -d27.2 -bv dovecot.user
# # -d60.5 should trace map lookups (including mailertable)
# # -d27.2 should trace alias expansion
#
# echo '3,0 dovecot.user at localhost ' | sendmail -bt -d21.12 -d60.5
# # -d60.5 tracking maps (virtusertable) lookups
# # -d21.12 tracking processing of R lines in sendmail.cf
#
# sendmail -d27.2 -bv dovecot.user
# # -d27.2 tracking processing of aliases
#
# sendmail -Am -bv dovecot.user at vmail < /dev/null
# echo '3,0 dovecot.user at vmail.example.com' | sendmail -Am -bv dovecot.user at vmail.example.com
# dovecot.user at vmail.example.com.. deliverable: mailer dovecot, host vmail, user dovecot.user at vmail.example.com
> 4) there had been a post about trying to improve virtual user support in
> sendmail incl. some ongoing talk. Maybe you find it and get some info back
> into this list.
few posts showed another sendmail file that needs to be configured
/etc/mail/access
# vmail must be defined in /etc/hosts ... NOT listed in local-host-named
To: vmail.example.com RELAY
> > dovecot user dovecot.user == returns UID/GID/home/mailbox ( deliverable )
these are good tests to show dovecot is able to deliver its emails
in my case, dovecot resolves users in /etc/passwd, /etc/mail/virtusertable, /etc/dovecot/password
and hopefully, it will also resolve /usr/local/mysql database users
> > # --------------------------------------------------------------------
> > # dovecot's LDA delivers the test email to the dovecot/mysql recepient
> > # --------------------------------------------------------------------
> > cat test-email-with-headers.txt | dovecot-lda -d dovecot.user ( email delivered )
these are good tests to show dovecot is able to deliver its emails
> > # ----------------------------------------------------------------
> > -->> # mail/mutt/sendmail canNOT deliver to dovecot recepient == FAILS
> > # ----------------------------------------------------------------
> > -->> sendmail -bv dovecot.user.in/dovecot/virtual.passwd.file == user unknown
> > 3
> > echo "testing mail to dovecot" | mail -v -s "testing mail to dovecot" doveccot.user
> > == user unknown ==
"user unknown" comes from misconfigured since sendmail is still confused
- /etc/mail/mailertable
- /etc/mail/local-host-names
- /etc/mail/access
my final sendmail config .... only import stuff shown ..
> > -------------------------------------------------------
> > - my (relevant to dovecot ) sendmail.mc file looks like:
> > -------------------------------------------------------
> >
> > dnl #
> > dnl # local mail delivery
> > dnl #
> > define(`PROCMAIL_MAILER_PATH', `/usr/local/bin/procmail')dnl
> >
> > FEATURE(local_procmail,`',`procmail -t -Y -a $h -d $u')dnl
REMOVE define/feature to do with procmail
-----------------------------------------
> > dnl #
> > dnl # I'm trying to get sendmail to use dovecot.m4 to deliver local mail
> > dnl # to dovecot's LDA ( dovecot-lda ) for mysql virtual users
> > dnl #
> > dnl uncomment and use either feature(...dovecot-lda) or mailer(dovecot.m4)
> > dnl
> > dnl FEATURE(`local_procmail', `/usr/local/libexec/dovecot/dovecot-lda',`/usr/local/libexec/dovecot/dovecot-lda -d $u')
use Mailer(dovecot) instead .... Feature and Mailer is mutually exclusive in this case
> > MAILER(local)
> > MAILER(smtp)
> > dnl
> > dnl # trying to use procmail to deliver local mail to system users ( /etc/passwd )
> > MAILER(procmail)
> > dnl
> > dnl
> > MAILER(dovecot)dnl # see below
> > dnl
> > dnl End of File
> >
> > -------------------------------------------------------
> > - my (relevant to dovecot ) sendmail.cf file looks like:
> > -------------------------------------------------------
take out procmail stuff
> > #####################################
> > ### SMTP Mailer specification ###
> > #####################################
> >
> > #
> > # lots of deleted ... ??not?? important until procmail stuff ---> MAILER(procmail)
> > #
> >
> > ######################*****##############
> > ### PROCMAIL Mailer specification ###
> > ##################*****##################
> > ##### $Id: procmail.m4,v 8.23 2013-11-22 20:51:14 ca Exp $ #####
> >
> > Mprocmail, P=/usr/local/bin/procmail, F=DFMSPhnu9, S=EnvFromSMTP/HdrFromSMTP, R=EnvToSMTP/HdrFr
> > omSMTP,
> > T=DNS/RFC822/X-Unix,
> > A=procmail -Y -m $h $f $u
> >
> > ######################*****#########################
> > ### ###
> > ### 10-Jan-15 amo Dovecot.m4 ###
> > ### ###
> > ### dovecot.m4 stuff ###
> > ### ###
> > ##############################*****#################
> > Mdovecot, P=/usr/local/libexec/dovecot/dovecot-lda, F=DFMPhnu9,
> > S=EnvFromL/HdrFromL, R=EnvToL/HdrToL,
> > T=DNS/RFC822/X-Unix,
> > A=/usr/local/libexec/dovecot/dovecot-lda -d $u
note i'm using "S=EnvFromL/HdrFromL" NOT "S=EnvFromSMTP/HdrFromSMTP"
and similarly for R=
> > #
> > # End of sendmail.cf
> > http://wiki2.dovecot.org/LDA/Sendmail
> >
> > #########################################
> > ### DOVECOT Mailer specification ###
> > #########################################
> > Mdovecot, P=/usr/local/libexec/dovecot/dovecot-lda, F=DFMPhnu9,
> > S=EnvFromSMTP/HdrFromSMTP, R=EnvToSMTP/HdrFromSMTP,
should wiki2.dovecot.org be updated to show
S=EnvFromL/HdrFromL, R=EnvToL/HdrToL,
> > T=DNS/RFC822/X-Unix,
> > A=/usr/local/libexec/dovecot/dovecot-lda -d $u
for debugging purproses .... it is very helpful to use a wrapper script ( wraplda.sh )
around dovecot-lda to get UID/GID info of who is calling dovecot-lda
http://dovecot.org/pipermail/dovecot/2013-January/087658.html
> > http://wiki2.dovecot.org/LDA/Sendmail
> > also states that one could use these 3 statements in lieu of dovecot.m4
> >
> > #
> > # this replaces sendmail.cf Mlocal P=mail.local with P=dovecot-lda
> > #
> > FEATURE(`local_procmail', `/usr/local/libexec/dovecot/dovecot-lda', \
> > `/usr/local/libexec/dovecot/dovecot-lda -d $u')
> > dnl MODIFY_MAILER_FLAGS(`LOCAL', `-f')
> > MAILER(procmail)
didn't work for me
> > ------------------------------------
> > - my relevant dovecot config options
> > ------------------------------------
> > #
> > # are there any other major options i'm missing in the dovecot config files
> > #
> > doveconf
> > dovecot -a
> > #
> > # for /etc/passwd
> > passdb {
> > args =
> > driver = pam
> > ..
> > }
> > #
> > # ------------------------------------------------------------------------
> > # need to get these dovecot's virtual users to be able send/receive emails
> > # ------------------------------------------------------------------------
> > # sendmail -bv dovecot.VirtualUser at localhost
> > # dovecot.VirtuaUser at localhost... User unknown
> > #
> > passdb {
> > args = /etc/dovecot/passwd
> > #
> > # dovecot.VirtualUser:{PLAIN}password:::::
> > #
> > # end of file
> > driver = passwd-file
> > ..
> > }
> > #
> > passdb {
> > args = /etc/dovecot/dovecot-sql.conf.ext
> > driver = sql
> > ..
> > }
> > ...
> > ...
> > ...
> > userdb {
> > args =
> > driver = passwd
> > ..
> > }
> > #
> > userdb {
> > args = /etc/dovecot/password
> > driver = passwd-file
> > ..
> > }
> > #
> > userdb {
> > args = /etc/dovecot/dovecot-sql.conf.ext
> > driver = sql
> > ..
> > }
.....
> > # end of txt
> >
>
> - --
> Steffen Kaiser
More information about the dovecot
mailing list