The documentation claims that I can add aliases in a file (like /etc/postfix/virtusertable) and then use the "virtual_maps" directive to point to it. This does not appear to be working, however.
My mail is bouncing with:
Recipient address rejected: User unknown in local recipient table;
If I mail the user from the server using the mail command, it works.
mail myuser
The message goes through postfix and inserts itself in the Cyrus inbox correctly.
When I use fetchmail to get the user's messages off a pop3 server, postfix fails. The user's email is "[email protected]", but it doesn't seem to be mapping correctly to "myuser", the cyrus mailbox name.
/etc/postfix/main.cf
myhostname = localhost alias_maps = hash:/etc/aliases alias_database = hash:/etc/aliases myorigin = /etc/mailname mydestination = localhost relayhost = mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128 mailbox_size_limit = 0 recipient_delimiter = + inet_interfaces = all mailbox_transport = lmtp:unix:/var/run/cyrus/socket/lmtp #lmtp:unix:/var/run/lmtp virtual_alias_domains = mydomain.com virtual_maps = hash:/etc/postfix/virtusertable
/etc/fetchmailrc
et syslog; set daemon 20; poll "mail.pop3server.com" with protocol pop3 user "[email protected]" password "12345" is "myuser" fetchall keep
/etc/postfix/virtusertable
[email protected] myuser
postconf -n
alias_database = hash:/etc/aliases alias_maps = hash:/etc/aliases append_dot_mydomain = no biff = no config_directory = /etc/postfix inet_interfaces = all mailbox_size_limit = 0 mailbox_transport = lmtp:unix:/var/run/cyrus/socket/lmtp mydestination = localhost myhostname = localhost mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128 myorigin = /etc/mailname readme_directory = no recipient_delimiter = + relayhost = smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu) smtpd_tls_cert_file = /etc/ssl/certs/ssl-cert-snakeoil.pem smtpd_tls_key_file = /etc/ssl/private/ssl-cert-snakeoil.key smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache smtpd_use_tls = yes virtual_alias_domains = mydomain.com
Why is it ignoring my alias?
Local aliases go into
alias_database = hash:/etc/aliases
(not in/etc/postfix/virtusertable
) in the following format:alias: destination
. After that runnewaliases
.Just ran into this issue... and found that oddly enough my issue was not cyrus related...
As I could deliver direct including "+" addresses but aliased addresses were getting rejected... FYI what I found is the alias addresses were getting rewritten.
[myalias]
became[[email protected]]
So until I figured out how to turn the expansion off or change it to drop
[myhost]
, workaround was to expand in aliases file[[email protected]]
instead of[myalias]
Finally stumbled on it when I finally noticed the log showing
FQDN
instead of just the domain as I used to in sendmail.