| Linode Forum https://forum.linode.com/ |
|
| [SOLVED] no emails from outside https://forum.linode.com/viewtopic.php?f=11&t=8107 |
Page 1 of 1 |
| Author: | freeweaver [ Sun Nov 27, 2011 11:01 am ] |
| Post subject: | [SOLVED] no emails from outside |
Hi all, For two days now I have been trying to resolve a problem which seems simple (i'm sure it is) but is causing me a lot of confusion. my setup is Debian, postfix, dovecot To summarize what I have done so far New domain added to my linode 1 month ago which I will call "mydomain.com" and added to my linode DNS manager control panel with the default entries. postfix main.cf is as follows Code: # See /usr/share/postfix/main.cf.dist for a commented, more complete version Note that up until a day ago the "myhostname = mydomain.com" entry was "myhostname = FQ.mydomain.com". My reverse dns in the linode control panel is set to "mydomain.com". I also changed this from "FQ.mydomain.com" a day ago. Now, when I send a mail from gmail to me@mydomain.com I get the following bounce message. Quote: <me@FQ.mydomain.com> (expanded from <me@mydomain.com>): mail for FQ.mydomain.com loops back to myself Final-Recipient: rfc822;me@FQ.mydomain.com Original-Recipient: rfc822;me@mydomain.com Action: failed Status: 5.4.6 Diagnostic-Code: X-Postfix; mail for FQ.mydomain.com loops back to myself ---------- Forwarded message ---------- From: me <me@gmail.com> To: me <me@mydomain.com> Date: Sun, 27 Nov 2011 13:57:18 +0000 Subject: test test Here is my mail.log Code: Nov 27 10:53:20 server postfix/smtpd[4617]: warning: database /etc/postfix/virtual.db is older than source file /etc/postfix/virtual And, if i go to say mxtoolbox.com and run their diagnosis test on "smtp:mydomain.com" I get Quote: 220 mydomain.com ESMTP Postfix (Debian/GNU)
OK - my.ip.add.ress. resolves to mydomain.com OK - Reverse DNS matches SMTP Banner 0 seconds - Good on Connection time Not an open relay. 0.749 seconds - Good on Transaction time Session Transcript: HELO please-read-policy.mxtoolbox.com 250 mydomain.com [109 ms] MAIL FROM: <supertool@mxtoolbox.com> 250 2.1.0 Ok [125 ms] RCPT TO: <test@example.com> 554 5.7.1 <test@example.com>: Relay access denied [125 ms] QUIT 221 2.0.0 Bye [125 ms] So what is it that I'm missing? Is postfix main.cf configured correctly? Any insights would be appreciated Thanks |
|
| Author: | hoopycat [ Sun Nov 27, 2011 1:38 pm ] |
| Post subject: | |
First, it sounds like you edited /etc/postfix/virtual without rebuilding its database; "postmap /etc/postfix/virtual" will fix that error. Second problem is that it sounds like you want to use /etc/postfix/virtual to handle mail to mydomain.com. If so, you will need to ensure your system's hostname, the postfix myhostname setting, and postfix's mydestination list do not contain mydomain.com. something.mydomain.com is ok, they just cannot contain mydomain.com if you are planning to use /etc/postfix/virtual for mail to that domain. May I ask why you changed that? It sounds like it was configured correctly before, but if there's a reason for the change, there are some workarounds possible. (Nothing quite as nice as having it all in virtual_alias_maps, of course.) |
|
| Author: | freeweaver [ Sun Nov 27, 2011 2:57 pm ] |
| Post subject: | |
Hi hoopycat Quote: First, it sounds like you edited /etc/postfix/virtual without rebuilding its database; "postmap /etc/postfix/virtual" will fix that error. this is true Quote: Second problem is that it sounds like you want to use /etc/postfix/virtual to handle mail to mydomain.com. If so, you will need to ensure your system's hostname, the postfix myhostname setting, and postfix's mydestination list do not contain mydomain.com. something.mydomain.com is ok, they just cannot contain mydomain.com if you are planning to use /etc/postfix/virtual for mail to that domain. Ahh, so I have messed up in all 3 places. just so I understand completely, hostname - something.mydomain.com main.cf - myhostname = something.mydomain.com main.cf - mydestination = something.mydomain.com As for the rDNS setting in linode control panel, should this also be set to something.mydomain.com? Quote: May I ask why you changed that? It sounds like it was configured correctly before, but if there's a reason for the change, there are some workarounds possible. (Nothing quite as nice as having it all in virtual_alias_maps, of course.)
As you can probably tell, I am quite new to all this and don't as yet have a clear understanding of dns or email delivery. I changed it all because It would not work. And after reading some forum comments I thought I understood what to do. Thanks for the quick reply. thanks for the quick reply |
|
| Author: | hoopycat [ Mon Nov 28, 2011 6:04 pm ] |
| Post subject: | |
freeweaver wrote: Ahh, so I have messed up in all 3 places. just so I understand completely,
hostname - something.mydomain.com main.cf - myhostname = something.mydomain.com main.cf - mydestination = something.mydomain.com As for the rDNS setting in linode control panel, should this also be set to something.mydomain.com? It doesn't matter too much, as long as it's set to something. It's easiest to have them all the same, though. The hostname and the reverse DNS(*) both refer to the server, so keeping everything the same across the board for a single server is a good idea. Like a person, a server is its own distinct entity with its own unique name (and personality, and mortality, and...). This does not directly relate to the service(s) it provides(**). So, there's no expectation that the server that handles web traffic for example.com be named www.example.com, nor even anything within example.com. Same with mail servers. It's just expected that something loved it enough to give it some name. So don't sweat it too much (*) Well, really, the reverse DNS refers to an IP address, but there's usually a 1:1 relationship between servers and IP addresses. When there isn't, things can get a little more abstract. (**) Someone with the last name of "Miller" is not necessarily a diluter of horse urine, and, to the best of my knowledge, none of the children of Linode employees have the last name "Cloudier." Yet. |
|
| Author: | freeweaver [ Sat Dec 03, 2011 12:27 pm ] |
| Post subject: | I'm almost there... |
Sorry I have not replied, I have been in hospital a fair bit. I very much appreciate the help. I made the changes suggested by hoopcat 5 days ago which were Server hostname = server.mydomain.com rDNS = server.mydomain.com postfix myhostname= server.mydomain.com mydestination= server.mydomain.com So now i can receive mails from outside except, they have to be sent to me@server.mydomain.com instead of me@mydomain.com Thanks |
|
| Author: | hoopycat [ Sat Dec 03, 2011 2:21 pm ] |
| Post subject: | |
No need to apologize; I've been in l'Hôpital a fair bit this week and haven't been following the forums. Division by zero is no excuse, of course, but that's water under the ducks now. Believe it or not, it's a good thing that it doesn't work. It means you can now explicitly tell it where to stick your mail through the virtual alias maps. You should still have a line in your main.cf stating: Code: virtual_alias_maps = hash:/etc/postfix/virtual This will cause postfix to look for two things in /etc/postfix/virtual when it gets an e-mail for you@example.com: Code: example.com DOMAIN The first is the domain in the left-hand side, and something in the right-hand side. (It doesn't really matter what, but I use DOMAIN in all caps.) The second is the e-mail address in the left-hand side, and some destination(s) in the right-hand side. (You can specify more than one by separating with commas.) Whenever you edit /etc/postfix/virtual, always remember to "postmap /etc/postfix/virtual" to rebuild its index. The example.com DOMAIN entry is probably the one that's missing, since it isn't an obvious need: it could just go straight to a lookup for you@example.com and save you some time. Turns out that postfix lets you configure virtual_alias_domains separately from virtual_alias_maps, which can be handy if you have, say, an LDAP server in Tuvalu that doesn't need or want to be queried for every single message transiting your system on the off chance that hugh@jorgan.net is now a user. |
|
| Author: | freeweaver [ Sat Dec 03, 2011 4:13 pm ] |
| Post subject: | Hey, it works! |
Hi again hoopycat, Quote: The example.com DOMAIN entry is probably the one that's missing, since it isn't an obvious need: it could just go straight to a lookup for you@example.com and save you some time.
Yep, that was it and I would not have thought to add it. All mail now sent to any domain I have on this server is redirecting to the system user I have specified in /etc/postfix/virtual. because of your help it is now working exactly as it should and everything is a little clearer. I owe you a beer! Many thanks hoopycat Nick |
|
| Author: | hoopycat [ Sun Dec 04, 2011 12:10 am ] |
| Post subject: | |
\o/ Yay beer! |
|
| Page 1 of 1 | All times are UTC-04:00 |
| Powered by phpBB® Forum Software © phpBB Group http://www.phpbb.com/ |
|