14

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?

2 Answers 2

25

Local aliases go into

alias_database = hash:/etc/aliases (not in /etc/postfix/virtusertable) in the following format:

alias: destination. After that run newaliases.

6
  • I'm getting a warning: "warning: /etc/aliases, line 3: name must be local". I added the entry "[email protected]: user" into /etc/aliases. the user isn't a user on the machine, it's a Cyrus mailbox/user.
    – Nick
    Apr 17, 2010 at 8:34
  • 3
    No, the correct format is user: [email protected], localuser Apr 17, 2010 at 9:01
  • Ok, changed the format and the warning went away, but mail is still bouncing. I'm getting "550-Mailbox unknown".
    – Nick
    Apr 17, 2010 at 9:28
  • It seems like Fetchmail is accepting the message, trying to send it on to Cyrus, but now Cyrus is bouncing it. I'm thinking that postfix isn't sending it in with the right alias? Or does Cyrus need it's own alias table?
    – Nick
    Apr 17, 2010 at 20:28
  • I'm going to mark this as solved, and create a new question for the Cyrus issue, since technically it's a different question.
    – Nick
    Apr 17, 2010 at 20:43
0

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.

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .