Hello misc,
after the configuration of smtpd for external mail, I can't understand
the behaviour of my local mail anymore.

When I send a mail from root to root like this:
# mail root
Subject: test
123
.
EOF
The message is not shown in roots mailbox. Instead it's in my other
admin account (say, liqor). Strange is that the from field also equals
liqor.
Message 1:
>From li...@mail.example.com Thu May  6 13:53:12 2021
Delivered-To: r...@mail.example.com
From: System admin <li...@mail.example.com>
To: r...@example.com
Subject: test

123
&
After I messed with the aliases file, I decided it's best to revert it
back to standard. Theres also a dovecot and rspamd involved, but both don't
touch local.

This is /etc/mail.rc:
set append dot save asksub
ignore Received Message-Id Resent-Message-Id Status Mail-From Return-Path Via

This is /etc/mail/smtpd.conf:
table aliases file:/etc/mail/aliases
table secrets passwd:/etc/mail/secrets
table virtuals file:/etc/mail/virtuals
pki "mail.example.com" cert "..."
pki "mail.example.com" key "..."
filter "rspamd" proc-exec ".../filter-rspamd"
listen on socket
listen on lo0
listen on vio0 tls-require pki "..." port 587 auth <secrets> filter "rspamd"
listen on vio0 tls-require pki "..." filter "rspamd"
action "relay" relay
action "local_mail" mbox alias <aliases>
action "domain_mail" maildir "/var/vmail/..." virtual <virtuals>
match from local for local action "local_mail"
match from any for domain "example.com" action "domain_mail"
match from local for any action "relay"
match auth from any for any action "relay"
----

Here is an expand trace:
$ doas smtpctl trace expand
$ doas smtpd -d
273790b183546d3b smtp connected address=local host=mail.example.com
expand: 0xf51d799f018: expand_insert() called for 
address:r...@mail.example.org[parent=0x0, rule=0x0]
expand: 0xf51d799f018: inserted node 0xf51f6223000
expand: lka_expand: address: r...@mail.example.org [depth=0]
expand: 0xf51d799f018: expand_insert() called for 
username:root[parent=0xf51f6223000, rule=0xf51f621b680, 
dispatcher=0xf51f6205710]
expand: 0xf51d799f018: inserted node 0xf51f6227000
expand: lka_expand: username: root [depth=1, sameuser=0]
expand: 0xf51d799f018: expand_insert() called for 
username:liqor[parent=0xf51f6227000, rule=0xf51f621b680, 
dispatcher=0xf51f6205710]
expand: 0xf51d799f018: inserted node 0xf51f6226000
expand: lka_expand: username: liqor [depth=2, sameuser=0]
expand: no .forward for user liqor, just deliver
expand: 0xf51d799f018: clearing expand tree 273790b183546d3b smtp message 
msgid=6744f12f size=381 nrcpt=1 proto=ESMTP
debug: scheduler: evp:6744f12fd8c9c19a scheduled (mda)
273790b183546d3b smtp envelope evpid=6744f12fd8c9c19a 
from=<li...@mail.example.org> to=<r...@mail.example.org>
273790b183546d3b smtp disconnected reason=quit
273790b336f1db80 mda delivery evpid=6744f12fd8c9c19a 
from=<li...@mail.example.org> to=<r...@mail.example.org> 
rcpt=<r...@mail.example.org> user=liqor delay=0s result=Ok stat=Delivered

I'd gladly take any pointers.

Reply via email to