I'm using this howto to setup virtual mailboxes for non-linux accounts using postfix.

This part of my main.cnf:

myhostname = localhost
mydomain = aviacao.pt
myorigin = aviacao.pt
mynetworks =
mailbox_size_limit = 0
virtual_mailbox_domains = aviacao.pt
virtual_mailbox_base = /home/vmail
virtual_mailbox_maps = hash:/etc/postfix/vmaps
virtual_minimum_uid = 1000
virtual_uid_maps = static:5000
virtual_gid_maps = static:5000
relay_host = 
recipient_delimiter = +
inet_interfaces = all
unknown_local_recipient_reject_code = 550

This works, but only when myhostname is set to localhost. If I set myhostname to aviacao.pt, it won't receive emails:

550 5.1.1 : Recipient address rejected: User unknown in local recipient table

Why is this the case? The howto even says that setting the myhostname as localhost can cause problems:

Using localhost as myhostname can cause problems since this variable is used > in the EHLO message the server sends.

Is this the best way? Will problems will this cause?

  • Apart from anything else, in mynetwork you should also put the IPv6 address of localhost, postfix.org/postconf.5.html#mynetworks, since you have inet_interfaces = all (which means Ipv4 and Ipv6) – Lexib0y Oct 2 '15 at 9:15
  • aviacao.pt is a domain name, not a hostname. (eg mx.aviacao.pt is a hostname) – Lexib0y Oct 2 '15 at 9:17

Set myhostname back to "aviacao.pt"

Add the line:

mydestination = aviacao.pt, localhost, localhost.localdomain

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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