Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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 "myuser@mydomain.com", 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 "myuser@mydomain.com" password "12345" is "myuser"
fetchall keep



/etc/postfix/virtusertable

myuser@mydomain.com     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?

share|improve this question
add comment

1 Answer

up vote 9 down vote accepted

Local aliases go into

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

alias: destination. After that run newaliases.

share|improve this answer
    
I'm getting a warning: "warning: /etc/aliases, line 3: name must be local". I added the entry "user@mydomain.com: user" into /etc/aliases. the user isn't a user on the machine, it's a Cyrus mailbox/user. –  Nick Apr 17 '10 at 8:34
1  
No, the correct format is user: anotheruser@domain.com, localuser –  David Rickman Apr 17 '10 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 '10 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 '10 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 '10 at 20:43
show 1 more comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.