postfix incoming bounce problem
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. Here's my main.cf: Code:
queue_directory = /var/spool/postfix |
I would recommend reading the following documents:
http://www.postfix.org/BASIC_CONFIGURATION_README.html http://www.postfix.org/VIRTUAL_READM...irtual_mailbox It is best to get everything working with a single domain and local users first. Then you can add virtual domains and virtual users. I think you need to change this. Quote:
Quote:
Quote:
|
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): Code:
virtual_alias_domains = example.net, example.org Code:
info@example.net info |
What value do you have for myorigin in your main.cf?
Example.com is the local domain, not any of the virtual ones. What happens when you send mail to info@example.com? What happens when you send mail to info? Which of the 3 options did you choose for mydestination? |
I didn't have a value set for myorigin. Now I've set it to $mydomain, which results in all mails being rerouted to @example.com.
This is my mydestination setting: Code:
mydestination = $myhostname, localhost.$mydomain, $mydomain, localhost |
Take a look at your logs.
cat /var/log/maillog 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. http://www.postfix.org/virtual.5.html |
Yes, I've run the postmap command and then reloaded postfix.
The log is not really helpful (at least not for me): Code:
Aug 27 18:12:57 mladi postfix/local[7971]: BB74C54EA254: to=<root@example.com>, orig_to=<info@example.net>, relay=local, delay=0.2, delays=0.12/0.05/0/0.03, dsn=2.0.0, status=sent (delivered to maildir) |
I see what you mean. The mails are being forwarded to root without any error messages. I will try to reproduce this over the weekend.
Please post the results of "postconf -n". This will show your Postfix configuration. On another issue. Did you edit the aliases file to map root to a regular user account? |
Here's the result from postconf -n:
Code:
alias_database = hash:/etc/aliases |
Okay then...
Quote:
Quote:
postmap /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. Thanks again for your effort and all the help! |
All times are GMT -5. The time now is 01:10 AM. |