I am trying to replace Sendmail with OpenSMTPd
<https://www.opensmtpd.org/>, which I like very much. It is sending
messages to remote mail servers successfully now. Email to local
addresses is also accepted, but not delivered to them — causing routing
loop:
|> mail Mail version 8.1 6/6/93. Type ? for help. "/var/mail/uolys":
14 messages 14 unread & m postmaster Subject: OpenSMTPd to Cyrus Hi,
how are you? . EOT & ( /var/log/maillog ) mta connecting
address=smtp://217.147.40.110:25 host=sala.online.lt mta connected
smtp connected address=217.147.40.110 host=sala.online.lt smtp message
msgid=… size=19755 nrcpt=1 proto=ESMTP smtp envelope evpid=… from=<>
to=<uo...@on.lt> mta delivery evpid=… from=<> to=<||uo...@on.lt||> rcpt=<-> source="217.147.40.110" relay="217.147.40.110
(sala.online.lt)" delay=1s result="Ok" stat="250 2.0.0 … Message
accepted for delivery" smtp message msgid=… size=19934 nrcpt=1
proto=ESMTP smtp envelope evpid=… from=<> to=<||uo...@on.lt||> mta delivery evpid=… from=<> to=<||uo...@on.lt||> rcpt=<-> source="217.147.40.110" relay="217.147.40.110
(sala.online.lt)" delay=1s result="Ok" stat="250 2.0.0 … Message
accepted for delivery" … warn: loop detected smtp failed-command
command="DATA" result="500 5.4.6 Routing loop detected: Loop detected"
mta delivery evpid=… from=<> to=<||uo...@on.lt||> rcpt=<-> source="217.147.40.110" relay="217.147.40.110
(sala.online.lt)" delay=1s result="PermFail" stat="500 5.4.6 Routing
loop detected: Loop detected"|
My Cyrus <https://www.cyrusimap.org/> 3.8.5_1 on FreeBSD 14.3-RELEASE is
working, active, and accepted mail from Sendmail on the following
socket, set in cyrus.conf
<https://man.freebsd.org/cgi/man.cgi?query=cyrus.conf&sektion=5>:
||action "cyrus" lmtp /var/cyrus/socket/lmtp||
I appended this string with aliases in smtpd.conf
<https://man.openbsd.org/smtpd.conf>:
|action "cyrus" lmtp "/var/cyrus/socket/lmtp" alias <aliases>|
Since I sent this message to ‹postmaster›, and smtpd
<https://man.openbsd.org/smtpd> overwrote it with my real mail name, I
have to assume that /etc/mail/aliases table (inherited from Sendmail)
acts properly. Where could my settings error be causing the delivery loop?
I have made quite simple smtpd.conf(5)
<https://man.freebsd.org/cgi/man.cgi?query=smtpd.conf&sektion=5&manpath=freebsd-release-ports>
(root:wheel 644):
|listen on 0.0.0.0 listen on :: pki sala key "/usr/home/uolys/.|acme.sh/sala.online.lt/sala.key|" pki sala cert "/usr/home/uolys/.|acme.sh/sala.online.lt/sala.cert|" ca zero cert "/usr/home/uolys/.|acme.sh/sala.online.lt/ca-zero.cert|" table aliases file:/etc/mail/aliases table domains
file:/etc/mail/local-host-names table ip file:/etc/mail/relay-ip
action "outbound" relay # action "local" alias <aliases> — syntax
error action "cyrus" lmtp "/var/cyrus/socket/lmtp" alias <aliases> #
match !from src <ip> mail-from "@online.lt" for any reject match !from
src <ip> mail-from "@on.lt" for any reject match !from local !for
domain <domains> reject match from local !for local action "outbound"
match from src <ip> !for domain <domains> action "outbound" match
!from local for domain <domains> action "cyrus" match from local for
local action "cyrus"|
I have redirected all Sendmail functions to OpenSMTPd in mailer.conf
<https://man.freebsd.org/cgi/man.cgi?query=mailer.conf&sektion=5>
according to OpenBSD manual <https://man.openbsd.org/mailer.conf.5>.
sendmail /usr/local/sbin/smtpctl
send-mail /usr/local/sbin/smtpctl
mailq /usr/local/sbin/smtpctl
makemap /usr/local/sbin/smtpctl
newaliases /usr/local/sbin/smtpctl
I have also tried appending aliases(5)
<https://man.freebsd.org/cgi/man.cgi?query=aliases&sektion=5&manpath=freebsd-release-ports>
with Cyrus commands for clarity — no effect:
# FreeBSD Handbook: Mail: Procmail example:
# procmail: "|/usr/local/bin/procmail"
#
procmail: "|/var/cyrus/proc"
lmtp: "|/usr/local/cyrus/libexec/master"
lmtpd: "|/usr/local/cyrus/libexec/lmtpd"
lmtpunix: "|/var/cyrus/socket/lmtp"
Do any of you have some experience of LMTP on the same localhost? How to
teach MTA to communicate with MDA? Sorry, I could not find an
appropriate guide nor examples online.
Vladas Palubinskas (a.k.a. Uolys)