Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
I set up postfix with dovecot and everything works fine (I can send e-mails both locally and from a client), except for incoming mails.
I checked my logs and whenever an email comes in, let's say that it was sent to john@example.com, postfix changes it to john@HOSTNAME.local. The message then of course bounces, because I set to accept messages only for domains that exist on my server.
Something important: I have multiple domains on my server, and I want all of them to be able to send e-mails. That's why I have setup virtual domains in postfix.
Line 2: The virtual_mailbox_domains setting tells Postfix that example.com is a so-called virtual mailbox domain. If you omit this setting then Postfix will reject mail (relay access denied) or will not be able to deliver it (mail for example.com loops back to myself).
NEVER list a virtual MAILBOX domain name as a mydestination domain!
I've changed the mydestination parameter to this setting as you suggested.
But this didn't change anything so I removed virtual_maps = hash:/etc/postfix/domains/addresses and now I can receive mail for my primary domain, but not for any other domain.
So I followed the http://www.postfix.org/VIRTUAL_README.html and set this (let's say example.com is my primary domain -> I set the parameter mydomain to list it as such):
What does it say about mail that is being sent to info@example.net? It should tell you why the mail is being forwarded to root@example.com.
Did you run the command "postmap /etc/postfix/virtual"? This creates the database from the hash:/etc/postfix/domains/addresses text file. Postfix reads the database in order to know the accounts to which the mail must be forwarded.
Here is some more information on setting up virtual domains.
The aliases file is untouched. I checked it and root isn't mapped to anything, there are however a lot of services mapped to root, but no e-mails among them. The only e-mail address mappings I have are in /etc/postfix/domains/addresses.
This will create a file called /etc/postfix/domains/addresses.db. This is the database that postfix will search. It seems as if /etc/postfix/virtuals is the default file.
If that doesn't work, you can try using a file in the /etc/postfix directory such as /etc/postfix/domain_addresses.
Thank you for your help jamrock, I really apreciate it!
I have run postmap with the file /etc/postfix/domains/addresses, but I guess you're right and it would be easier if I put that file in the postfix directory.
Since I was a bit pressed with time constraints I just set up a google apps account for handling e-mails. I have only about 10 e-mail addresses (for now) that need to be taken care, so I guess this will have to do it until I have enough time to set up postfix properly.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.