LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > CentOS
User Name
Password
CentOS This forum is for the discussion of CentOS Linux. Note: This forum does not have any official participation.

Notices


Reply
  Search this Thread
Old 11-06-2017, 06:18 AM   #1
er_sachin_gupta
LQ Newbie
 
Registered: Nov 2017
Posts: 5

Rep: Reputation: Disabled
mails are not being sent from Centos Linux based cloud server


Hello Friends
Please Help me, i am doing it first time.
Our company has purchased a cloud based server with Linux Centos Version 7. Apache, Mysql, Postfix, Sendmail all installed on it previously.
We do not have domain name purchased yet.I am facing an issue, mails are not being sent.
Even I tried sending mails using
echo "Subject: sendmail test" | sendmail -v sgs.engineer@gmail.com
but emails are not being recieved.
After execution of this statement - echo "Subject: sendmail test" | sendmail -v sgs.engineer@gmail.com.
I got "Message coming is Mail Delivery Status Report will be mailed to jboss"
where jboss is login user.

I tried to see mails under /etc/spool/mail/jboss
Following message is here:

<sgs.engineer@gmail.com>: connect to
alt2.gmail-smtp-in.l.google.com[2404:6800:4003:c01::1b]:25: Network is
unreachable

--4435CB4FA9.1509949534/localhost.localdomain
Content-Description: Delivery report
Content-Type: message/delivery-status

Reporting-MTA: dns; localhost.localdomain
X-Postfix-Queue-ID: 4435CB4FA9
X-Postfix-Sender: rfc822; jboss@localhost.localdomain
Arrival-Date: Mon, 6 Nov 2017 06:24:34 +0000 (UTC)

Final-Recipient: rfc822; mehta.nikhil.27@gmail.com
Action: delayed
Status: 4.4.1
Diagnostic-Code: X-Postfix; connect to
alt2.gmail-smtp-in.l.google.com[2404:6800:4003:c01::1b]:25: Network is
unreachable

--4435CB4FA9.1509949534/localhost.localdomain
Content-Description: Message Headers
Content-Type: text/rfc822-headers

Return-Path: <jboss@localhost.localdomain>
Received: by localhost.localdomain (Postfix, from userid 1001)
id 4435CB4FA9; Mon, 6 Nov 2017 06:24:34 +0000 (UTC)
Subject: sendmail test
Message-Id: <20171106062434.4435CB4FA9@localhost.localdomain>
Date: Mon, 6 Nov 2017 06:24:34 +0000 (UTC)
From: jboss@localhost.localdomain

--4435CB4FA9.1509949534/localhost.localdomain--

Please help. why i am not getting emails?

Thanks in advance.
 
Old 11-06-2017, 12:29 PM   #2
heytimc
LQ Newbie
 
Registered: Nov 2003
Distribution: Centos 7/Ubuntu 20.04.2
Posts: 14

Rep: Reputation: 6
This is the piece with the clues:
Final-Recipient: rfc822; (redacted)@gmail.com
Action: delayed
Status: 4.4.1
Diagnostic-Code: X-Postfix; connect to
alt2.gmail-smtp-in.l.google.com[2404:6800:4003:c01::1b]:25: Network is
unreachable

and its saying that the mail service (postfix in your case) cannot connect to the google network to deliver the mail. This tells me that DNS is working properly; postfix has looked up a mail service for your ...@gmail.com address and has a good name for it but then can't connect. Network connectivity per se seems ok since DNS is good so two reasons spring to mind:
1) you have a firewall yourself blocking the outbound connection on port 25
2) your ISP is blocking outbound on port 25 from your server.

heytimc
 
Old 11-06-2017, 11:56 PM   #3
er_sachin_gupta
LQ Newbie
 
Registered: Nov 2017
Posts: 5

Original Poster
Rep: Reputation: Disabled
Thanks heytimc, I think the problem is with email whitelisting ?

Thanks heytimc for your reply.

I think the problem is with email whitelisting. Emails can only be sent on same domain.

May i ask, how can i remove this email whitelisting for same domain.


Thanks Again
 
Old 11-07-2017, 01:07 AM   #4
heytimc
LQ Newbie
 
Registered: Nov 2003
Distribution: Centos 7/Ubuntu 20.04.2
Posts: 14

Rep: Reputation: 6
By "email whitelisting" are you suggesting that google will only allow you to send email to a google account from another google domain? That can't be true.

More likely is that the company you bought the cloud server from are blocking outbound email. Read their documentation on the provision of their service. Its much more likely that you'll simply have to prove good email setup on your server (not being an open relay, having DKIM and/or SPF set up) before they allow you to send.
 
Old 11-07-2017, 04:13 AM   #5
TenTenths
Senior Member
 
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6 / 7
Posts: 3,475

Rep: Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553
Quote:
Originally Posted by er_sachin_gupta View Post
Diagnostic-Code: X-Postfix; connect to
alt2.gmail-smtp-in.l.google.com[2404:6800:4003:c01::1b]:25: Network is
unreachable
This indicates that postfix is trying to use IPV6, you'll need to ensure that your provider has correctly configured IPV6 for that server.

Try setting postfix to only use IPV4: http://www.postfix.org/IPV6_README.html
 
Old 11-07-2017, 11:29 PM   #6
er_sachin_gupta
LQ Newbie
 
Registered: Nov 2017
Posts: 5

Original Poster
Rep: Reputation: Disabled
Help Regrading Connection time out error

Quote:
Originally Posted by TenTenths View Post
This indicates that postfix is trying to use IPV6, you'll need to ensure that your provider has correctly configured IPV6 for that server.

Try setting postfix to only use IPV4: http://www.postfix.org/IPV6_README.html
Hello Sir,
First of all Many thanks for your reply.
As you suggested, i tried by setting default ipv4. But unfortunately, it did not worked.

Here is email log

Enclosed is the mail delivery report that you requested.

The mail system

<sgs.engineer@gmail.com>: connect to
alt4.gmail-smtp-in.l.google.com[74.125.28.26]:25: Connection timed out

--54208B4FA4.1510118650/localhost.localdomain
Content-Description: Delivery report
Content-Type: message/delivery-status

Reporting-MTA: dns; localhost.localdomain
X-Postfix-Queue-ID: 54208B4FA4
X-Postfix-Sender: rfc822; jboss@localhost.localdomain
Arrival-Date: Wed, 8 Nov 2017 05:21:40 +0000 (UTC)

Final-Recipient: rfc822; sgs.engineer@gmail.com
Action: delayed
Status: 4.4.1
Diagnostic-Code: X-Postfix; connect to
alt4.gmail-smtp-in.l.google.com[74.125.28.26]:25: Connection timed out

--54208B4FA4.1510118650/localhost.localdomain
Content-Description: Message Headers
Content-Type: text/rfc822-headers

Return-Path: <jboss@localhost.localdomain>
Received: by localhost.localdomain (Postfix, from userid 1001)
id 54208B4FA4; Wed, 8 Nov 2017 05:21:40 +0000 (UTC)
Subject: sendmail test
Message-Id: <20171108052140.54208B4FA4@localhost.localdomain>
Date: Wed, 8 Nov 2017 05:21:40 +0000 (UTC)
From: jboss@localhost.localdomain

--54208B4FA4.1510118650/localhost.localdomain--
 
Old 11-08-2017, 03:46 AM   #7
TenTenths
Senior Member
 
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6 / 7
Posts: 3,475

Rep: Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553
Quote:
Originally Posted by er_sachin_gupta View Post
Diagnostic-Code: X-Postfix; connect to
alt4.gmail-smtp-in.l.google.com[74.125.28.26]:25: Connection timed out
So you're now getting a different error message. Try pinging that IP address, if that works then there's something blocking traffic on port 25 to that host, maybe a firewall or something. If it doesn't ping then you've a more serious network problem.

Or your provider is blacklisted.
 
Old 11-08-2017, 03:55 AM   #8
er_sachin_gupta
LQ Newbie
 
Registered: Nov 2017
Posts: 5

Original Poster
Rep: Reputation: Disabled
Hello Sir
Thanks again for your reply
I tried to ping both
ping gmail-smtp-in.l.google.com
ping 74.125.28.26
Yes they both are working fine.
Please guide me what to do next.

Thanks in advance.

Quote:
Originally Posted by TenTenths View Post
So you're now getting a different error message. Try pinging that IP address, if that works then there's something blocking traffic on port 25 to that host, maybe a firewall or something. If it doesn't ping then you've a more serious network problem.

Or your provider is blacklisted.
 
Old 11-08-2017, 03:58 AM   #9
TenTenths
Senior Member
 
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6 / 7
Posts: 3,475

Rep: Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553
Quote:
Originally Posted by er_sachin_gupta View Post
Hello Sir
Thanks again for your reply
I tried to ping both
ping gmail-smtp-in.l.google.com
ping 74.125.28.26
Yes they both are working fine.
Please guide me what to do next.

Thanks in advance.
I already told you:
Quote:
Originally Posted by TenTenths View Post
Try pinging that IP address, if that works then there's something blocking traffic on port 25 to that host, maybe a firewall or something.
Check to see if there's a local firewall on your VPS, if not then check with your VPS provider.
 
Old 11-08-2017, 06:12 AM   #10
er_sachin_gupta
LQ Newbie
 
Registered: Nov 2017
Posts: 5

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by TenTenths View Post
I already told you:
Check to see if there's a local firewall on your VPS, if not then check with your VPS provider.
Hello Sir
I just tried telnet with these, to see port 25 is blocked or not
[jboss@localhost ~]$ telnet example.com 25
Trying 93.184.216.34...
telnet: connect to address 93.184.216.34: Connection timed out
Trying 2606:2800:220:1:248:1893:25c8:1946...
telnet: connect to address 2606:2800:220:1:248:1893:25c8:1946: Network is unreachable
[jboss@localhost ~]$ telnet localhost 25
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
220 localhost.localdomain ESMTP Postfix
^]

I think port 25 is blocked for outbound connections. Is it the case?
Please help me, how can i fix this

Thanks in advance.
 
Old 11-08-2017, 06:30 AM   #11
heytimc
LQ Newbie
 
Registered: Nov 2003
Distribution: Centos 7/Ubuntu 20.04.2
Posts: 14

Rep: Reputation: 6
We've said repeatedly; its probably your server vendor being secure. Contact them.
 
Old 11-08-2017, 06:40 AM   #12
TenTenths
Senior Member
 
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6 / 7
Posts: 3,475

Rep: Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553
Quote:
Originally Posted by heytimc View Post
We've said repeatedly; its probably your server vendor being secure. Contact them.
Yup, this. Contact your provider.
 
  


Reply



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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Securing my cloud based server? Ryanms3030 Linux - Security 22 03-06-2014 12:13 PM
How to Receive mails on CentOS server if postfix is already installed unclesamcrazy Linux - Server 1 09-29-2013 02:29 AM
Setup a personal cloud server on Centos. aadeshgandhi Linux - Server 4 04-07-2013 08:27 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > CentOS

All times are GMT -5. The time now is 09:40 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
Open Source Consulting | Domain Registration