LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-07-2014, 08:55 AM   #1
srijivdimri
Member
 
Registered: Jun 2013
Location: India.
Posts: 35

Rep: Reputation: Disabled
Post fix not working.


Hi Experts,

I have set-up mail server on 192.168.6.1 (Redhat 6.1 Santiago). This server is in Russia. The server has no internet connectivity, so I have configured Mail Relay Agent on it as mail.x.com (In India) under /etc/postfix/main.cfg. I have made an entry for mail.x.com under /etc/hosts with ip to name binding. I am able to ping mail.x.com and also able to telnet to it on port 25 (SMTP) from this Russia server.
I then restart the postfix service and it comes up without any error message. When I send mail using mailx or sendmail, and then check the logs under /var/log/maillog, I get the below error message :-

to=<srijiv@gmail.com>, relay=none, delay=1004, delays=999/0.02/5.1/0, dsn=4.4.3, status=deferred (Host or domain name not found. Name service error for name=mail.x.com type=MX: Host not found, try again)

The resolv.conf entry has a global dns server configured under it. But to my understanding, when I am able to telnet and ping this mail.x.com server, then why is the name resolution failing ?

Is there a way to get around this problem.

Appreciate all your help.

Last edited by srijivdimri; 02-07-2014 at 08:57 AM.
 
Old 02-08-2014, 05:57 PM   #2
descendant_command
Senior Member
 
Registered: Mar 2012
Posts: 1,380

Rep: Reputation: 353Reputation: 353Reputation: 353Reputation: 353
Quote:
Originally Posted by srijivdimri View Post
so I have configured Mail Relay Agent on it as mail.x.com (In India) under /etc/postfix/main.cfg.
Bad idea - that domain exists
Code:
dig mail.x.com

; <<>> DiG 9.9.3-rpz2+rl.13214.22-P2-Debian-1:9.9.3.dfsg.P2-4 <<>> mail.x.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 20299
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;mail.x.com.			IN	A

;; ANSWER SECTION:
mail.x.com.		3600	IN	CNAME	smtp-in.exosc.x.com.

;; AUTHORITY SECTION:
x.com.			60	IN	SOA	ppns1.phx.paypal.com. hostmaster.paypal.com. 2010064230 3600 1800 604800 60
Quote:
I have made an entry for mail.x.com under /etc/hosts with ip to name binding. I am able to ping mail.x.com and also able to telnet to it on port 25 (SMTP) from this Russia server.
I then restart the postfix service and it comes up without any error message. When I send mail using mailx or sendmail, and then check the logs under /var/log/maillog, I get the below error message :-

to=<srijiv@gmail.com>, relay=none, delay=1004, delays=999/0.02/5.1/0, dsn=4.4.3, status=deferred (Host or domain name not found. Name service error for name=mail.x.com type=MX: Host not found, try again)

The resolv.conf entry has a global dns server configured under it. But to my understanding, when I am able to telnet and ping this mail.x.com server, then why is the name resolution failing ?

Is there a way to get around this problem.

Appreciate all your help.
Also, it's not clear where you are trying to send mail from or to, or which is trying to lookup your bad hostname.
 
Old 02-08-2014, 10:23 PM   #3
srijivdimri
Member
 
Registered: Jun 2013
Location: India.
Posts: 35

Original Poster
Rep: Reputation: Disabled
Hi descendant_command,

Thanks for looking into this.

mail.x.com where 'X' is my company domain name. I have mapped mail.x.com to one of the Public ip assigned to our company. So if I make any request to this public ip, it gets re-directed to my mail-server. The private if for this mail-server is 192.168.1.5.

We have lease line connectivity between Bangalore and Russia.

I am trying to send mails from Russia Server to different recipients who have accounts in gmail, yahoo and also in my company domain. These settings are configured under '/etc/postfix/generic'. Because Russia Server does not have internet connectivity, so I want to send mails first to my mail server here in Bangalore, India and from there relay it to different recipients.

For all the co-locations which has Internet connectivity, I have configured the Relayhost under '/etc/postfix/main.cfg as the Public ip of my mail server in India. For co-locations which don't have internet connectivity, I have mentioned the private ip for the same. Routing is in place, as I am able to telnet on the private ip for the mail server on port 25 from those co-locations.

When I send a test mail, it throws me with the above mentioned error. Please let me know if I am missing something here.

Last edited by srijivdimri; 02-08-2014 at 10:25 PM.
 
Old 02-08-2014, 10:39 PM   #4
descendant_command
Senior Member
 
Registered: Mar 2012
Posts: 1,380

Rep: Reputation: 353Reputation: 353Reputation: 353Reputation: 353
OK.

It seems your relay transport (on the russia server) is not configured correctly
Quote:
to=<srijiv@gmail.com>, relay=none
It should be trying to relay any mail via your india server.
 
Old 02-08-2014, 10:52 PM   #5
srijivdimri
Member
 
Registered: Jun 2013
Location: India.
Posts: 35

Original Poster
Rep: Reputation: Disabled
This is how the /etc/postfix/main.cfg looks like

myhostname = W2W-SGX1
mydomain = x.com
myorigin = x.com
inet_interfaces = all
inet_protocols = all
mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain
relayhost = mail.x.com

When I send a test mail from Russia Server,
# echo "TEST" | sendmail "TEST" srijiv.w2w@gmail.com
in the logs I see:-
9 11:49:33 localhost postfix/smtp[2029]: 4FCE21A0633: to=<srijiv.w2w@gmail.com>, relay=none, delay=134919, delays=134909/0.01/10/0, dsn=4.4.3, status=deferred (Host or domain name not found. Name service error for name=mail.x.com type=MX: Host not found, try again)
 
Old 02-08-2014, 11:01 PM   #6
descendant_command
Senior Member
 
Registered: Mar 2012
Posts: 1,380

Rep: Reputation: 353Reputation: 353Reputation: 353Reputation: 353
Ah ok, that is making more sense.
It would seem to be the MX lookup that is failing.
If you put square brackets like [mail.x.com] it suppresses the MX lookup and just uses the hostname.
Or you could simply use [192.168.1.5] or such.
 
Old 02-08-2014, 11:18 PM   #7
srijivdimri
Member
 
Registered: Jun 2013
Location: India.
Posts: 35

Original Poster
Rep: Reputation: Disabled
If I put a square bracket as 'relayhost = [mail.x.com]' , The error message now is :-

Feb 9 12:12:48 localhost postfix/smtp[7937]: 9413D1A0630: to=<srijiv.w2w@gmail.com>, relay=none, delay=20, delays=0.03/0.01/20/0, dsn=4.4.3, status=deferred (Host or domain name not found. Name service error for name=mail.x.com type=AAAA: Host not found, try again)

If I put a host name in relayhost as 'relayhost = 192.168.1.5', the error message is:-

Feb 9 12:15:42 localhost postfix/qmgr[8707]: 68E511A064A: from=<root@x.com>, size=414, nrcpt=1 (queue active)
Feb 9 12:15:42 localhost postfix/smtp[8718]: 68E511A064A: to=<srijiv.w2w@gmail.com>, relay=192.168.1.5[192.168.1.5]:25, delay=0.45, delays=0.01/0/0.35/0.08, dsn=5.7.1, status=bounced (host 192.168.1.5[192.168.1.5] said: 554 5.7.1 <srijiv.w2w@gmail.com>: Relay access denied (in reply to RCPT TO command))

Still getting the error messages. Appreciate all your help.
 
Old 02-08-2014, 11:29 PM   #8
descendant_command
Senior Member
 
Registered: Mar 2012
Posts: 1,380

Rep: Reputation: 353Reputation: 353Reputation: 353Reputation: 353
Quote:
Originally Posted by srijivdimri View Post
Still getting the error messages.
No.
That is a new error message and means you are making progress

Your russia server is now working (although you should have sq brackets around the IP).

Now you just need to adjust your india server so it is not rejecting mail-to-be-relayed from your russia server.
Presumably, adding it to the $mynetworks should be sufficient.
 
Old 02-09-2014, 12:05 AM   #9
srijivdimri
Member
 
Registered: Jun 2013
Location: India.
Posts: 35

Original Poster
Rep: Reputation: Disabled
Thank you so much for helping me out with this. It now makes complete sense. I completely overlooked the reject message from 192.168.1.5. I will now check that and will update you about this accordingly.

Appreciate that.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
post fix backups kwaslee Linux - Server 1 09-16-2009 12:32 PM
Post fix pawan_lal Linux - Server 2 03-23-2009 10:55 AM
Post fix install tommytomato Ubuntu 2 06-09-2007 10:59 AM
Post fix tommytomato Linux - Software 6 06-08-2007 10:15 AM
using post fix with a static ip eobrieniv Linux - Newbie 2 08-20-2003 10:46 AM


All times are GMT -5. The time now is 01:48 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration