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

I have postfix installed on a machine named smtp.mydomain.com with a a virtual domain of mydomain.com. If any email arrives at smtp.mydomain.com for a local user on that machine from an external SMTP server then it gets delivered locally as expected.

However if user1@mydomain.com sends to user2@mydomain.com using smtp.mydomain.com then the email is not delivered locally to user2 as expected but instead is relayed to the catch all alias someone@otherdomain.com for the domain mydomain.com.

So basically local user to local user using the Postfix machine does not work. Any suggestions on how I fix or diagnose this? It has to be something really obvious.

I post my config here in case it helps:

postconf -n:

alias_maps = hash:/etc/aliases
broken_sasl_auth_clients = yes
command_directory = /usr/sbin
config_directory = /etc/postfix
daemon_directory = /usr/libexec/postfix
debug_peer_level = 2
html_directory = no
mailq_path = /usr/bin/mailq.postfix
manpage_directory = /usr/share/man
myhostname = smtp.mydomain.com
myorigin = mydomain.com
newaliases_path = /usr/bin/newaliases.postfix
readme_directory = /usr/share/doc/postfix-2.3.3/README_FILES
sample_directory = /usr/share/doc/postfix-2.3.3/samples
sendmail_path = /usr/sbin/sendmail.postfix
setgid_group = postdrop
smtp_tls_note_starttls_offer = yes
smtp_use_tls = yes
smtpd_recipient_restrictions = permit_mynetworks permit_sasl_authenticated reject_unauth_destination check_policy_service inet:127.0.0.1:10023 reject_unknown_reverse_client_hostname
smtpd_sasl_auth_enable = yes
smtpd_sasl_path = private/auth
smtpd_sasl_security_options = noanonymous noplaintext
smtpd_sasl_type = dovecot
smtpd_tls_auth_only = yes
smtpd_tls_cert_file = /etc/pki/tls/certs/smtp.mydomain.com.cert
smtpd_tls_key_file = /etc/pki/tls/private/smtp.mydomain.com.key
smtpd_tls_loglevel = 1
smtpd_tls_received_header = yes
smtpd_tls_session_cache_database = btree:/var/spool/postfix/smtpd_tls_cache
smtpd_tls_session_cache_timeout = 3600s
smtpd_use_tls = no
tls_random_source = dev:/dev/urandom
unknown_local_recipient_reject_code = 550
virtual_alias_maps = hash:/etc/postfix/virtual

cat /etc/postfix/virtual:

mydomain.com  mydomain.com
@mydomain.com someone@otherdomain.com
user1@mydomain.com       user1.mydomain.com
user2@mydomain.com     user2.mydomain.com
share|improve this question

1 Answer 1

Move the line @mydomain.com someone@otherdomain.com to the end of the file. That's all.

Oh and I see it now: There should be @s in the destination addresses. So your file should look like this:

mydomain.com    mydomain.com
user1@mydomain.com    user1@mydomain.com
user2@mydomain.com    user2@mydomain.com
@mydomain.com    someone@otherdomain.com
share|improve this answer
    
Moved "@mydomain.com someone@otherdomain.com" to the end of the line and then ran postmap /etc/postfix/virtual and restarted postfix. Still has the same behaviour. Also the second column user1.mydomain is supposed to represent a local user account so the @ is not required? Suffice to say I still have the same unwanted behaviour originally described. –  TheEdge Aug 24 '11 at 16:26
    
You have to name the user in "full-qualified" form. Or where are your virtual_mailbox_maps with these user-mailbox mappings? –  mailq Aug 24 '11 at 16:38

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.