| Linode Forum https://forum.linode.com/ |
|
| Postfixroot aliases not working https://forum.linode.com/viewtopic.php?f=11&t=5496 |
Page 1 of 2 |
| Author: | jollyjumper [ Fri Apr 23, 2010 9:58 am ] |
| Post subject: | Postfixroot aliases not working |
Hi Linoders, I'm fighting with Postix and I don't want let it win... I've installed Postfix and made it work with my GoogeApps account. Just work fine, I can send emails. Excepted for when it comes to root to forward its emails to my GA email account, which is what I need. I've read many posts about it, but still I can't find my mistake. Any fresh eyes to look at my below config and advice me? So, I set up the aliases file: Code: # /etc/aliases I've also tried: Code: root: myLocaluserAccount I then did the usual newaliases command and reloaded Postfix. None work. Root don't use the email aliase I provide him. So I've cheched if the aliase for root is well registered: # postmap -q root hash:/etc/aliases and it's fine, gives me my correct email, myUser@exemple.com. Sending an email to root for test, I get the following: Code: # echo test | /usr/sbin/sendmail -f anmailaddress root Looking at how home_mail box is configure I get: Code: # sudo postconf | grep -E 'spool|mailbox' My postfix main.cf seems to be set correctly, but... : Code: # /etc/postfix/main.ch Any ideas, what I I'm missing? Thanks for your input |
|
| Author: | sleddog [ Fri Apr 23, 2010 10:04 am ] |
| Post subject: | |
Well, all I do is drop a .forward file containing my email address into root's home directory. |
|
| Author: | jollyjumper [ Fri Apr 23, 2010 11:57 am ] |
| Post subject: | |
Thanks for your feedback. I've tried without big success. I keep on receiving same kind of error messages. GooleApps receive it from root account. Code: Delivery to the following recipient failed permanently: |
|
| Author: | Stever [ Fri Apr 23, 2010 12:23 pm ] |
| Post subject: | |
/etc/aliases only applies to mail that reaches the local delivery agent. Since you are relaying all your mail to google, those mails never get seen by the LDA. You might be able to find what you want in here: http://www.postfix.org/ADDRESS_REWRITING_README.html |
|
| Author: | sleddog [ Fri Apr 23, 2010 12:32 pm ] |
| Post subject: | |
It is my understanding that mail that is generated on the server and addressed simply to "root" (not "root@domain.com") will be delivered locally. Delivering a local message to "root" is different than dispatching an email to root@domain.com. |
|
| Author: | Stever [ Fri Apr 23, 2010 12:45 pm ] |
| Post subject: | |
sleddog wrote: It is my understanding that mail that is generated on the server and addressed simply to "root" (not "root@domain.com") will be delivered locally. Delivering a local message to "root" is different than dispatching an email to root@domain.com. I think postfix appends the domain before it does anything else. From the Address Rewriting doc I referenced above: Quote: Rewrite addresses to standard form
Before the cleanup(8) daemon runs an address through any address mapping lookup table, it first rewrites the address to the standard "user@fully.qualified.domain" form, by sending the address to the trivial-rewrite(8) daemon. The purpose of rewriting to standard form is to reduce the number of entries needed in lookup tables. The Postfix trivial-rewrite(8) daemon implements the following hard-coded address manipulations: (snip) Rewrite "user" to "user@$myorigin" This feature is controlled by the boolean append_at_myorigin parameter (default: yes). You should never turn off this feature, because a lot of Postfix components expect that all addresses have the form "user@domain". If your machine is not the main machine for $myorigin and you wish to have some users delivered locally without going via that main machine, make an entry in the virtual alias table that redirects "user@$myorigin" to "user@$myhostname". See also the "delivering some users locally" section in the STANDARD_CONFIGURATION_README document. |
|
| Author: | jollyjumper [ Fri Apr 23, 2010 1:12 pm ] |
| Post subject: | |
Thanks for the feedbacks. This is why I receive an email at root@exemple.com Looking at the doc you point me out I'm not clear about what would be the way to send an other user. Thus at this stage the mail goes to root@exemple.com and I would need myuser@exemple.com. Therefore virtual email domain or canonical wouldn't help. Am I right? If so, what else could it be tried? |
|
| Author: | sleddog [ Fri Apr 23, 2010 1:21 pm ] |
| Post subject: | |
Stever wrote: I think postfix appends the domain before it does anything else.
This is true. But I think what what happens after that will depend on the server's hostname, the Postfix myhostname setting, and probably the content of /etc/hosts. For example I have a local dev box... hostname: sun.mydomain.ca Postfix config: myhostname = sun.mydomain.ca relayhost = [smtp.myISP.com] /etc/hosts: 192.168.0.10 sun.mydomain.ca sun If I send a command-line message to "root" it is expanded to "root@sun.mydomain.ca" and it is delivered locally. By "locally" I mean it is delivered to root's mail without invoking an SMTP process: Code: Apr 23 14:18:53 sun postfix/pickup[15495]: 9854CE10072: uid=0 from=<root> If I send a command-line message to "root@mydomain.ca" then Postfix relays the message to my ISP's mailserver, which attempts to deliver it to mydomain.ca (where it bounces, as root@mydomain.ca is not a valid address). |
|
| Author: | jollyjumper [ Fri Apr 23, 2010 1:49 pm ] |
| Post subject: | |
I see. so the durty fix is the create a root@exemple.com, but this is what I wanted to avoid, because spam and the potential risk... So what you suggest is it to created a Virtual email host exemple.com? |
|
| Author: | jollyjumper [ Fri Apr 23, 2010 1:52 pm ] |
| Post subject: | |
(when I say create root@exemple.comI mean a root email account at GoogleApps level) |
|
| Author: | sleddog [ Fri Apr 23, 2010 4:13 pm ] |
| Post subject: | |
jollyjumper wrote: I see. so the durty fix is the create a root@exemple.com, but this is what I wanted to avoid, because spam and the potential risk...
So what you suggest is it to created a Virtual email host exemple.com? No. I apologize if I've confused things. Here's what I suggest you do: First, undo any changes to /etc/alias and run newaliases, so it is back to the default. Then... 1. Assign your Linode a unique, fully-qualified domain name (FQDN). For example, if your domain is "example.com", you might use "server1.example.com" as your FQDN. It must be unique, not used anywhere else. 2. Setup DNS for your FQDN. In the Linode DNS Manager (or wherever you manage DNS for your domain) create an A record for server1.example.com. Give it an appropriate amount of time to take effect then check it with a DNS lookup, e.g., [me@server1] host server1.example.com ...Should return your Linode's IP. 3. Setup reverse DNS for your Linode's IP. You do this in the Linode Manager ("Network" tab). Give it an appropriate amount of time to take effect then check it. e.g., if your Linode IP is 192.168.1.1: [me@server1] host 192.168.1.1 ...Should return your FQDN (server1.example.com). 4. Set your hostname in Postfix. Edit /etc/postfix/main.cf and find the "myhostname" setting. Set it to: myhostname = server1.example.com Restart Postfix. 5. Create a .forward file that redirects root's email to someone else. For example, as root make sure you're in root's home directory (/root) and do: [root@server1 ~] echo myName@gmail.com > .forward Now, local mail destined for "root" will be sent by Postfix to myName@gmail.com. When Gmail receives the message it will do a DNS lookup on the sending mailserver -- server1.example.com -- and find a good A record. It might do a reverse DNS lookup on the IP -- and find that it reverse-resolves correctly to server1.example.com. Then -- provided the message doesn't trigger some other spam-filter -- Gmail will accept the message and deliver it to myName@gmail.com This works for me... |
|
| Author: | jollyjumper [ Fri Apr 23, 2010 8:05 pm ] |
| Post subject: | |
Fantastic Sledog. What a complete description, very clear, thanks for your time. When you say: Quote: 3. Setup reverse DNS for your Linode's IP.
You do this in the Linode Manager ("Network" tab). Give it an appropriate amount of time to take effect then check it. e.g., if your Linode IP is 192.168.1.1: [me@server1] host 192.168.1.1 ...Should return your FQDN (server1.example.com) does it mean Linode manager can only have one rDNS per IP? host email.exemple.com now send me myLinodeIP, perfect. So at this stage I'm only waiting for host myLinodeIP to send me the new rDNS, still sending the old linode rDNS. |
|
| Author: | sleddog [ Fri Apr 23, 2010 8:17 pm ] |
| Post subject: | |
Yes, there should be just just one reverse DNS -- to your FQDN. All mail sent from your Linode server is identified by your FQDN -- server1.example.com You might host 20 different domains on your Linode, but still all mail is identified as coming from your FQDN - server1.example.com. So you ensure that reverse DNS for server1.example.com is set to your Linode's IP. |
|
| Author: | jollyjumper [ Fri Apr 23, 2010 9:00 pm ] |
| Post subject: | |
Thanks Learning thanks to your DNS expertise, just discoverd there are only 13 root servers worlwide. Quote: The domain name system is a distributed database that translates names into ip addresses. When an update occours, it is possible to have non syncronized records across the internet. This tool shows you all the process of name resolving, starting from root server
If you want to try: http://www.dnsqueries.com/en/dns_traversal.php |
|
| Author: | jollyjumper [ Tue Apr 27, 2010 6:04 am ] |
| Post subject: | |
Hi Sleddog, So rDNS work fine! But... I still have the same error So I've started investigated differently. Maybe you have an idea? To summurise: The email sending the error says /bin/sh: root: not found: Code: Subject: Cron <root@exemple> root clamscan -R /var/www So I went to see if the symlink to what root shell points is correct and then check valide login shells: Code: #cat /etc/passwd | grep $USER That seems to be ok, but just to be sure: Code: # ls -l /bin/*sh Let's now see Cron Code: #crontab -e I don't see anything really wrong but maybe you do... thanks |
|
| Page 1 of 2 | All times are UTC-04:00 |
| Powered by phpBB® Forum Software © phpBB Group http://www.phpbb.com/ |
|