sendmail not invoking dovecot-lda

Steffen Kaiser skdovecot at smail.inf.fh-brs.de
Mon Jan 26 08:28:30 UTC 2015


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Sun, 18 Jan 2015, alvin wrote:
>
> - Configuration
>    FreeBSD-9.3
>    sendmail -d0.1	== sendmail-8.14.9	<<--
>    dovecot --version	== dovecot-2.2.15
>
> # ===================================================================
> # I'm trying to get sendmail to invoke dovecot.m4 ( dovecot-lda ) to
> # deliver emails to dovecot's virtual users ( /etc/dovecot/passwd )
> # or mysql/postgresql virtual users
> #
> #
> # sendmail -bv dovecot.VirtualUser at localhost  --> returns "User Unknown"
> #
> # cat test.msg.txt | dovecot-lda -d  dovecot.VirtualUser  ===> works
> #	email is delivered to dovecot.VirtualUser inbox
> #
> # ===================================================================
>
> - there are tons of howto and comments for dovecot + postfix
>  and very little for dovecot + sendmail ... therefore, it'd be
>  great if we/i can get this dovecot.m4 problem resolved
>
> ------------------------------------------------------------------------------
> - 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

Take note of the remark "reject unknown users early".

2) your mailer is named "dovecot", therefore the mailertable entry in the 
Wiki:

virtualdomain.example.com vmail:vmail

should spell, IMHO:

virtualdomain.example.com dovecot:dovecot

(2nd dovecot has no meaning, but there must be present something)

3) Post a sensable output:

echo '3,0 dovecotuser at dovecot.domain' | sendmail -bt -d21.4

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.

>
> 	dovecot user user.in/etc/passwd	== returns UID/GID/home/mailbox ( deliverable )
> 	dovecot user dovecot.user	== returns UID/GID/home/mailbox ( deliverable )
>
>
> 	# --------------------------------------------------------------------
> 	# 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 )
>
>
> 	# ----------------------------------------------------------------
> -->>	# 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 ==
>
> -------------------------------------------------------
> - 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
>
> 	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')
> 	dnl
>
> 	MAILER(local)
> 	MAILER(smtp)
> 	dnl
> 	dnl MAILER(dovecot)dnl	# did NOT work either
> 	dnl
> 	dnl # trying to use procmail to deliver local mail to system users ( /etc/passwd )
> 	MAILER(procmail)
> 	dnl
> 	dnl # is the ordering of dovecot.m4 important relative to (local) and (procmail)
> 	dnl
> 	dnl # trying to use dovecot-lda to deliver email to dovecot's virtual users
> 	dnl # defined in /etc/dovecot/password
> 	dnl
> 	MAILER(dovecot)dnl	# see below
> 	dnl
> 	dnl End of File
>
> -------------------------------------------------------
> - my (relevant to dovecot ) sendmail.cf file looks like:
> -------------------------------------------------------
>
> 	#
> 	# lots of deleted ... ??not?? important until Mlocal  ---> MAILER(local)
> 	#
>
> Mlocal,         P=/usr/libexec/mail.local, F=lsDFMAw5:/|@qPSXmnz9, S=EnvFromSMTP/HdrFromL, R=EnvToL/
> HdrToL,
>                T=DNS/RFC822/SMTP,
>                A=mail.local -l
> Mprog,          P=/bin/sh, F=lsDFMoqeu9, S=EnvFromL/HdrFromL, R=EnvToL/HdrToL, D=$z:/,
>                T=X-Unix/X-Unix/X-Unix,
>                A=sh -c $u
>
> #####################################
> ###   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
> #
> # End of sendmail.cf
>
>
> =====================================================================
> - dovecot has an example dovecot.m4 ... but it doesn't allow sendmail
>  to call dovecot to deliver local mail with dovecot-lda
> =====================================================================
>
>    http://wiki2.dovecot.org/LDA/Sendmail
>
>    #########################################
>    ###   DOVECOT Mailer specification    ###
>    #########################################
>    #                                       #
>    # dovecot virtual users defined in: /etc/dovecot/password #
>    #                                       #
>    #  cp /etc/mail/dovecot.m4  /usr/share/sendmail/cf/mailer #
>    #                                       #
>    #  cd /etc/mail && make                 #
>    #  /etc/rc.d/sendmail restart           #
>    #                                       #
>    # the dovecot.m4 stanza are in the resulting sendmail.cf  #
>    #                                       #
>    #########################################
>    Mdovecot,   P=/usr/local/libexec/dovecot/dovecot-lda, F=DFMPhnu9,
> 	S=EnvFromSMTP/HdrFromSMTP, R=EnvToSMTP/HdrFromSMTP,
> 	T=DNS/RFC822/X-Unix,
> 	A=/usr/local/libexec/dovecot/dovecot-lda -d $u
>    #
>    # i've tried using these other options in lieu of the above :
>    #
>    #	F=DFMPShnu9			# added "S" option
>    #	F=lsDFMAw5:/|@qSPfhn9,
>    #
>    #	S=EnvFromL/HdrFromL, R=EnvToL/HdrToL,
>    #   #
>    #	# tried adding U= between S= and T= lines
>    #	U=root:mail	U=dovecot:mail	U=dovenull:mail
>    #
>    # End of dovecot.m4
>
>    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)
>
>    vi /etc/mail/mailertable
> 	#
> 	# cd /etc/mail && make && /etc/rc.d/sendmail restart
> 	#
> 	# make and restart sendmail after editing
> 	#
> 	virtualdomain.example.com vmail:vmail
>
> 	# other options where sendmail still wasn't able to execute dovecot-lda
> 	# virtualdomain.example.com dovecot:local
> 	# virtualdomain.example.com local:mail
> 	# virtualdomain.example.com root:mail
>
> ------------------------------------
> - 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
> 	  ..
> 	}
>
> #
> # ---------------------------------------------------------------------
> # -- How do i get sendmail to execute dovecot-lda for incoming emails
> # -- directed to dovecot virtual users and/or mysql users ??
> # ---------------------------------------------------------------------
> #
> # end of txt
>

- -- 
Steffen Kaiser
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1

iQEVAwUBVMX6r3z1H7kL/d9rAQKGPwf9Ei/dGybYnAMxHkdYt/GAtD2oMkbwtx6t
frX0GC3Np1cfeiYWGGcOlV7RYXlBp/J1wxWYz3gzE4g9NhZjbIrvlIDBARD6WGzi
R3OCvW/eCnJoKwNSe4lY3e2PnnFB2pxiB4ybSbTb5h1+/GQ4+IsCXoxb0cy/41q1
zgdpUTBo4gmt8DsnbViTTsaQbkEPlUsI73nSEFqOlKPDsa0Cuh/EnFRZc1RnDwT4
I2hXHLSlfJyZi2wslRdMeFQCtkx/81E1hsiPr+9K3ozXrgCp6BLUNCbTsdy8zfCw
JDjoh1DX2toErElJMyQWITcKZyIn3jzxR67VRnN3Bf6ZjUTwfFwBhw==
=qufZ
-----END PGP SIGNATURE-----


More information about the dovecot mailing list