I have a mailing list like:

sa...@example.com:
        pe...@example.com
        s...@example.com
        jenni...@example.com
        a...@example.com

in which, a...@example.com is forwarded to:
        y...@example.com
        yuko.exam...@gmail.com

Sending an email to: "sa...@example.com" will reach the inbox in "
y...@example.com", but not "yuko.exam...@gmail.com". However, sending an
email directly to: "a...@example.com" will reach both inboxes.

I have read about similar issues when using virtual mailboxes. I'm using
MySQL:

virtual_alias_maps = mysql:/etc/postfix/mysql.aliases.cf
virtual_mailbox_maps = mysql:/etc/postfix/mysql.users.cf
virtual_mailbox_domains = mysql:/etc/postfix/mysql.domains.cf
smtpd_sender_login_maps = mysql:/etc/postfix/mysql.users.cf

in which, *mysql.users.cf <http://mysql.users.cf>* is:

SELECT home FROM v_login WHERE user='%s'

Example output:
example.com/yuko/

NOTE:If the user only forwards to another account (has no inbox), or it
doesn't exists, it will not return an output.

*mysql.aliases.cf <http://mysql.aliases.cf>* is:

SELECT address FROM v_alias WHERE email='%s'

Example output:
yuko.exam...@gmail.com,yuko3000

NOTE: 'yuko3000' is the actual account used by the SMTP/POP3/IMAP services
for the email 'y...@example.com'. In that way, when "user" is "yuko3000" we
know it has a local inbox and it is not a forward only (matching at
mysql.users.cf).

NOTE: It was necessary to remove $myhostname from 'mydestination' while
adding $myhostname (e.g. mail.example.com) as a domain (without accounts)
in order to postfix to accept emails for @example.com accounts. You can
read some details in my answer here: https://serverfault.com/a/1129891/72881

My current setup works fine except for that minor detail.

I'm attaching `postconf -n` output (postfix.conf) and my database structure
(relevant to this issue) and views (mysql.sql).

How can I fix it? If more information is needed, please let me know.

Environment:
Postfix 3.7.3-r0 running in Alpine Linux 3.16.3 inside a Docker container.

Thank you in advance.

Attachment: postfix.conf
Description: Binary data

Attachment: mysql.sql
Description: application/sql

_______________________________________________
Postfix-users mailing list -- postfix-users@postfix.org
To unsubscribe send an email to postfix-users-le...@postfix.org

Reply via email to