Sender address rejected: not owned by user

dovecotemailpostfix

I've a Postfix installation in my SBC running Parabola GNU/Linux-libre (Arch and ALARM-based) plus Dovecot.

It works pretty well, and I've set up an account in Thunderbird. The only issue I've found is that when sending emails I get:

Sender address rejected: not owned by user megver83

And I have looked for the solution everywhere, for e.g.

but nothing, it's really insane. Sometimes in the issues they solve are by using MySQL but pitifully MySQL doesn't work in my server, so I've installed PostgreSQL just in case.

mail.log:

Aug 28 16:27:30 localhost postfix/smtpd[12064]: connect from gateway[192.168.50.1]
Aug 28 16:27:31 localhost postfix/smtpd[12064]: Anonymous TLS connection established from gateway[192.168.50.1]: TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)
Aug 28 16:27:31 localhost postfix/trivial-rewrite[12070]: warning: do not list domain eumela.ga in BOTH mydestination and virtual_alias_domains
Aug 28 16:27:31 localhost postfix/trivial-rewrite[12070]: warning: do not list domain eumela.ga in BOTH mydestination and virtual_mailbox_domains
Aug 28 16:27:31 localhost postfix/smtpd[12064]: NOQUEUE: reject: RCPT from gateway[192.168.50.1]: 553 5.7.1 <megver83@eumela.ga>: Sender address rejected: not owned by user megver83; from=<megver83@eumela.ga> to=<megver83@eumela.ga> proto=ESMTP helo=<[192.168.50.10]>
Aug 28 16:27:33 localhost postfix/smtpd[12064]: disconnect from gateway[192.168.50.1] ehlo=2 starttls=1 auth=1 mail=1 rcpt=0/1 quit=1 commands=6/7

Here^ I tried to auto send me a mail, but happens with all the addresses I write to.

$ postconf -n
alias_database = $alias_maps
alias_maps = hash:/etc/postfix/aliases
append_dot_mydomain = no
biff = no
broken_sasl_auth_clients = yes
command_directory = /usr/bin
compatibility_level = 2
daemon_directory = /usr/lib/postfix/bin
data_directory = /var/lib/postfix
debug_peer_level = 2
debugger_command = PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin ddd $daemon_directory/$process_name $process_id & sleep 5
home_mailbox = Maildir/
html_directory = no
inet_interfaces = all
inet_protocols = ipv4
mail_owner = postfix
mailbox_size_limit = 134217728
mailq_path = /usr/bin/mailq
manpage_directory = /usr/share/man
message_size_limit = 134217728
meta_directory = /etc/postfix
mydestination = localhost.$mydomain, localhost, $mydomain, smtp.$mydomain
mydomain = eumela.ga
myhostname = pi.eumela.ga
myorigin = $mydomain
newaliases_path = /usr/bin/newaliases
queue_directory = /var/spool/postfix
readme_directory = /usr/share/doc/postfix
relay_domains = *
relayhost =
sample_directory = /etc/postfix
sendmail_path = /usr/bin/sendmail
setgid_group = postdrop
shlib_directory = /usr/lib/postfix
smtp_tls_note_starttls_offer = yes
smtp_tls_security_level = may
smtpd_helo_required = yes
smtpd_recipient_restrictions = permit_sasl_authenticated,permit_mynetworks,reject_unauth_destination
smtpd_sasl_auth_enable = yes
smtpd_sasl_local_domain =
smtpd_sasl_path = private/auth
smtpd_sasl_security_options = noanonymous
smtpd_sasl_type = dovecot
smtpd_sender_login_maps = $virtual_mailbox_maps
smtpd_tls_cert_file = /etc/letsencrypt/live/smtp.eumela.ga/fullchain.pem
smtpd_tls_key_file = /etc/letsencrypt/live/smtp.eumela.ga/privkey.pem
smtpd_tls_loglevel = 1
smtpd_tls_received_header = yes
smtpd_tls_security_level = may
unknown_local_recipient_reject_code = 550
virtual_alias_maps = hash:/etc/postfix/virtual
virtual_mailbox_domains = hash:/etc/postfix/virtual-mailbox-domains
virtual_mailbox_maps = hash:/etc/postfix/virtual-mailbox-users

Best Answer

your SASL config parameters look proper - Postfix will rely on Dovecot for the authenticating part. I presume your authentication is working[1]. The user you authenticate with can differ from the email sender address. You want to tell Postfix which authenticated users do map to additional senders. It's by the way the same for receiving, where you can alias recipients to system users in /etc/aliases or via other means.

These lines show where to look

smtpd_sender_login_maps = $virtual_mailbox_maps
virtual_mailbox_maps = hash:/etc/postfix/virtual-mailbox-users

And edit the file accordingly, for example

#  envelope sender   owner (SASL login names)
sender@example.com   user

Then run postmap -f /etc/postfix/virtual-mailbox-users and reload the postfix service. After this, postfix will allow you to send with the mapped entries.

[1]: for example: userdb {driver = passwd} and passdb {driver = pam} which would point to system user auth - or virtual users via passwd/userdb-file or SQL backend