Not sure if it's necessary, but it wouldn't hurt to try restarting smtpd and 
see if it works.
On May 5, 2019 4:59 PM, Sergey Bronnikov <este...@gmail.com> wrote:
>
> Hello!
>
> I've found that smtpd behaves suspiciously with different values with
> the same key in aliases file.
>
> aliases(5) allows to append messages to file, so I added
> ay:                    /etc/mail/messages
> to /etc/mail/aliases and update aliases db with newaliases(8).
> Mail sent to address ay@domain has been delivered and appended to
> /etc/mail/messages.
>
> expand: 0x6e46fce1018: expand_insert() called for
> address:a...@bronevichok.ru[parent=0x0, rule=0x0]
> expand: 0x6e46fce1018: inserted node 0x6e3e4edd000
> expand: lka_expand: address: a...@bronevichok.ru [depth=0]
> lookup: match "" as STRING in table static:<dynamic:4> -> false
> lookup: match "209.85.167.42" as NETADDR in table static:<localhost> -> false
> lookup: match "209.85.167.42" as NETADDR in table static:<localhost> -> false
> lookup: match "209.85.167.42" as NETADDR in table static:<anyhost> -> true
> lookup: match "bronevichok.ru" as DOMAIN in table static:domains -> true
> rule #4 matched: match from any for domain domains => local
> expand: 0x6e46fce1018: expand_insert() called for
> username:ay[parent=0x6e3e4edd000, rule=0x6e466726c00, di
> spatcher=0x6e3a063db00]
> expand: 0x6e46fce1018: inserted node 0x6e47f71a800
> expand: lka_expand: username: ay [depth=1, sameuser=0]
> lookup: lookup "ay" as ALIAS in table db:aliases -> "/etc/mail/messages"
> expand: 0x6e483569280: expand_insert() called for
> filename:/etc/mail/messages[parent=0x0, rule=0x0]
> expand: 0x6e483569280: inserted node 0x6e3e4edd800
> expand: 0x6e46fce1018: expand_insert() called for
> filename:/etc/mail/messages[parent=0x6e47f71a800, rule=0x6e466726c00,
> dispatcher=0x6e3a063db00]
> expand: 0x6e46fce1018: inserted node 0x6e3e4edc000
> expand: 0x6e483569280: clearing expand tree
> expand: 0x6e483569280: freeing expand tree
> debug: aliases_get: returned 1 aliases
> expand: lka_expand: filename: /etc/mail/messages [depth=2]
>
>
> Let's replace file by valid email address:
> ay:                     este...@gmail.com
> and update aliases db with newaliases(8).
> Mail sent to address ay@domain has not been delivered with reason "550
> Invalid recipient: <ay@domain>".
>
> 523e4ad980, dispatcher=0x25248b3c440]
> expand: 0x25251721018: inserted node 0x25251724800
> expand: 0x252bdf33d40: clearing expand tree
>                                    expand: 0x252bdf33d40: freeing
> expand tree
> debug: aliases_get: returned 1 aliases
> expand: lka_expand: address: este...@gmail.com [depth=2]
> lookup: match "" as STRING in table static:<dynamic:4> -> false
> lookup: match "local" as NETADDR in table static:<localhost> -> true
> lookup: match "gmail.com" as DOMAIN in table static:<localnames> ->
> false
> lookup: match "local" as NETADDR in table static:<localhost> -> true
> lookup: match "gmail.com" as DOMAIN in table static:<anydestination>
> -> true
> lookup: match "local" as NETADDR in table static:<anyhost> -> true
> lookup: match "gmail.com" as DOMAIN in table static:domains -> false
> lookup: match "local" as NETADDR in table static:<anyhost> -> true
> lookup: match "gmail.com" as DOMAIN in table static:<anydestination>
> -> true
> no rule matched
> mproc: lka -> pony : 35 IMSG_SMTP_EXPAND_RCPT
> expand: 0x25251721018: clearing expand tree
> imsg: pony <- lka: IMSG_SMTP_EXPAND_RCPT (len=35)
> smtp: 0x1ad082966000: >>> 550 Invalid recipient: <a...@bronevichok.ru>
> mproc: pony -> lka : 62 IMSG_??? (130)
> 54787b61ff698f5f smtp failed-command command="RCPT
> TO:<a...@bronevichok.ru>" result="550 Invalid recipient:
> <a...@bronevichok.ru>"
>
> Could anyone explain why it happen?
>
> Sergey
>
> пн, 29 апр. 2019 г. в 23:15, Sergey Bronnikov <este...@gmail.com>:
> >
> > > Not sure if this is the only problem but domains is a table in this
> > > version so the line should be (missing <>):
> >
> > Good point, fixed it. But looks like there is more than one error in my 
> > config.
> > Still getting error "no such recipient".
> >
> > Sergey
> >
> > пн, 29 апр. 2019 г. в 11:47, John Cox <jc-opensm...@uphall.net>:
> > >
> > > Hi
> > >
> > > >Hello,
> > > >
> > > >I use aliases in an smtpd config and before upgrade to 6.5 it worked 
> > > >fine.
> > > >After upgrade and rewriting config smtpd starts to reject mails
> > > >addressed to aliases with a reason "550 Invalid recipient". What's
> > > >wrong with new config?
> > > >
> > > >/var/log/maillog:
> > > >
> > > >Apr 29 07:01:48 ns1 smtpd[71399]: e99e9db5916c8789 smtp connected
> > > >address=209.85.167.44 host=mail-lf1-f44.google.com
> > > >Apr 29 07:01:48 ns1 smtpd[71399]: e99e9db5916c8789 smtp tls
> > > >ciphers=TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256
> > > >Apr 29 07:01:49 ns1 smtpd[71399]: e99e9db5916c8789 smtp failed-command
> > > >command="RCPT TO:<sergeyb@XXXX>" result="550 Invalid recipient:
> > > ><sergeyb@XXXX>"
> > > >Apr 29 07:01:49 ns1 smtpd[71399]: e99e9db5916c8789 smtp disconnected 
> > > >reason=quit
> > > >
> > > >smtpd.conf before upgrade to 6.5:
> > > >
> > > >pki mx1.XXXX certificate "/etc/ssl/XXXX.crt"
> > > >pki mx1.XXXX key "/etc/ssl/private/XXXX.key"
> > > >
> > > >limit mta inet4
> > > >queue compression
> > > >
> > > >listen on lo0
> > > >listen on lo0 port 10028 tag DKIM_OUT
> > > >listen on egress port 25 tls pki mx1.XXXX
> > > >listen on egress port 465 smtps pki mx1.XXXX auth mask-source hostname 
> > > >mx1.XXXX
> > > >listen on egress port 587 tls-require pki mx1.XXXX auth mask-source
> > > >hostname mx1.XXXX
> > > >
> > > >table aliases db:/etc/mail/aliases.db
> > > >table secrets db:/etc/mail/secrets.db
> > > >table domains { XXXX }
> > > >
> > > >accept for local deliver to mbox
> > > >accept for local alias <aliases> deliver to mbox
> > > >accept for domain "XXXX" relay via
> > > >"tls+auth://gm...@smtp.gmail.com:587" auth <secrets>
> > > >accept from any for domain "XXXX" alias <aliases> deliver to mbox
> > > >#accept from local for any relay
> > > >
> > > >accept tagged DKIM_OUT for any relay
> > > >accept from local for any relay via smtp://127.0.0.1:10027
> > > >
> > > >expire 2d
> > > >bounce-warn 2h, 4h, 1d
> > > >--------------------------------------------
> > > >
> > > >pki mx1.XXXX cert "/etc/ssl/XXXX.crt"
> > > >pki mx1.XXXX key "/etc/ssl/private/XXXX.key"
> > > >
> > > >mta limit inet4
> > > >bounce warn-interval 2h, 4h, 1d
> > > >queue ttl 4d
> > > >queue compression
> > > >
> > > >listen on lo0
> > > >listen on lo0 port 10028 tag DKIM_OUT
> > > >listen on egress port 25 tls pki mx1.XXXX
> > > >#listen on egress port 25 tls pki mx1.XXXX auth-optional hostname 
> > > >mx1.XXXX
> > > >listen on egress port 465 smtps pki mx1.XXXX auth mask-source hostname 
> > > >mx1.XXXX
> > > >listen on egress port 587 tls-require pki mx1.XXXX auth mask-source
> > > >hostname mx1.XXXX
> > > >
> > > >table aliases db:/etc/mail/aliases.db
> > > >table secrets db:/etc/mail/secrets.db
> > > >table domains { XXXX }
> > > >
> > > >action "local" mbox alias <aliases>
> > > >action "gmail" relay host "smtp+tls://gm...@smtp.gmail.com:587" auth 
> > > ><secrets>
> > > >action "relay_dkim" relay host smtp://127.0.0.1:10027
> > > >action "relay" relay
> > > >
> > > >match tag DKIM_OUT for any action "relay"
> > > >match from local for local action "local"
> > > >match from local for any auth action "relay_dkim"
> > > >match from any for domain domains action "local"
> > >
> > > Not sure if this is the only problem but domains is a table in this
> > > version so the line should be (missing <>):
> > >
> > > match from any for domain <domains> action "local"
> > >
> > > >match from any for any auth action "gmail"
> > > >
> > > >
> > > >output from smtpd -dv -Texpand:
> > > >
> > > >queue: queue compression enabled
> > > >debug: pony: rsae_init
> > > >debug: pony: rsae_init
> > > >debug: smtp: will accept at most 498 clients
> > > >debug: smtpd: scanning offline queue...
> > > >debug: smtpd: offline scanning done
> > > >debug: queue: done loading queue into scheduler
> > > >1ae957d6afeb0dfa smtp connected address=209.85.208.171
> > > >host=mail-lj1-f171.google.com
> > > >debug: looking up pki "mx1.XXXX"
> > > >debug: session_start_ssl: switching to SSL
> > > >debug: pony: rsae_priv_enc
> > > >1ae957d6afeb0dfa smtp tls ciphers=TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256
> > > >smtp: 0x15892c37000: smtp_cert_verify_cb: no-client-cert
> > > >debug: smtp: SIZE in MAIL FROM command
> > > >expand: 0x1ed226c59018: expand_insert() called for
> > > >address:sergeyb@XXXX[parent=0x0, rule=0x0]
> > > >expand: 0x1ed226c59018: inserted node 0x1ed2341cb800
> > > >expand: lka_expand: address: sergeyb@XXXX [depth=0]
> > > >expand: 0x1ed226c59018: clearing expand tree
> > > >1ae957d6afeb0dfa smtp failed-command command="RCPT TO:<sergeyb@XXXX>"
> > > >result="550 Invalid recipient: <sergeyb@XXXX>"
> > > >1ae957d6afeb0dfa smtp disconnected reason=quit
> > > >
> > > >Sergey
> > >
> > > Hope that helps
> > >
> > > JC
> > >
>
> --
> You received this mail because you are subscribed to misc@opensmtpd.org
> To unsubscribe, send a mail to: misc+unsubscr...@opensmtpd.org
>

Reply via email to