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've setup some virtual users for certain domains. I've got a local domain (and plan to add some virtual mailboxes but I'll save that for later).

localhost postfix/smtpd[23466]: NOQUEUE: reject: RCPT from somedomain.com[173.xxx.198.xxx]: 554 5.7.1 <user@domaina.com>: Relay access denied; from=<bounce@somedomain.com> to=<user@domaina.com> proto=ESMTP helo=<somedomain.com>

I've been over these settings. Each time I've adjusted /etc/postfix/valiases I've run postmap valiases. I've then run postfix reload (and /etc/init.d/postfix restart to be sure).

My main.cf (substituting domain.com in):

$ postconf -n
alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
append_dot_mydomain = no
biff = no
broken_sasl_auth_clients = yes
config_directory = /etc/postfix
inet_interfaces = all
inet_protocols = all
mailbox_size_limit = 0
mydestination = $myhostname, localhost, localhost.localdomain
myhostname = domain.com
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128 109.123.86.72/32
myorigin = /etc/mailname
readme_directory = no
recipient_delimiter = +
relayhost = 
smtp_tls_note_starttls_offer = yes
smtp_tls_security_level = may
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtpd_banner = $myhostname ESMTP $mail_name (Linux)
smtpd_recipient_restrictions = permit_sasl_authenticated,permit_mynetworks,reject_unauth_destination
smtpd_sasl_auth_enable = yes
smtpd_sasl_local_domain = 
smtpd_sasl_path = private/auth-client
smtpd_sasl_security_options = noanonymous
smtpd_sasl_type = dovecot
smtpd_tls_auth_only = no
smtpd_tls_cert_file = /etc/ssl/certs/server.crt
smtpd_tls_key_file = /etc/ssl/private/server.key
smtpd_tls_loglevel = 1
smtpd_tls_received_header = yes
smtpd_tls_security_level = may
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtpd_tls_session_cache_timeout = 3600s
smtpd_use_tls = yes
tls_random_source = dev:/dev/urandom
virtual_alias_domains = hash:/etc/postfix/vdomains
virtual_alias_maps = hash:/etc/postfix/valiases

/etc/postfix/vdomains

domaina.com
domainb.com

/etc/postfix/valiases

hello@domain.com        account@gmail.com # works
@domainb.com            account@gmail.com # doesn't work
user@domaina.com        other@gmail.com   # doesn't work
user2@domaina.com       another@gmail.com # doesn't work

Any ideas?

share|improve this question

1 Answer 1

up vote 1 down vote accepted

You must put something on the right hand side here: /etc/postfix/vdomains

like

domaina.com x
domainb.com x

as Postfix uses it as a lookup table, so it needs some dummy value in the right hand side. Or you can directly list it in main.cf instead of the lookup table.

share|improve this answer
    
Ah, if I remove the hash: prefix, can I go with my current vdomains file? –  Greg K Jun 20 '11 at 20:43
    
I inlined the domains and it now works: virtual_alias_domains = domaina.com, domainb.com, domainc.com. Adding x on each line so it can parse a hash didn't work after I reloaded postfix, unless I was supposed to run postmap vdomains? Thanks! –  Greg K Jun 20 '11 at 20:55
    
sorry for the delay. Yes you supposed to run postmap as it is an indexed file (hash). Inlining is fine. –  cstamas Jun 21 '11 at 19:49

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.