LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
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 11-09-2018, 06:27 AM   #1
NotionCommotion
Member
 
Registered: Aug 2012
Posts: 789

Rep: Reputation: Disabled
Cannot send email from server


New 1&1 VPS, and can't seem to send emails.

Per the log, they are "Sent and accepted for delivery". Who is accepting them, Google's and Comcast's server or some program on my server?

But then I get a timed out notice which is clearly from an external server (alt4.gmail-smtp-in.l.google.com and mx1.comcast.net). This makes me almost certain that my sent emails are reaching the applicable smtp servers (or maybe I should same just some remote server). Do these servers need to make a request back to my server to authenticate before sending the email?

Hardwire firewall only allows incoming ports 80, 8443, 22, 443, 3128, 3306, 123, and firewalld is turned off temporarily for testing. Do I need to allow incoming requests on a given port?

Any thoughts? Thanks!


Code:
[michael@myserver ~]$ echo "Subject: sendmail test" | sendmail -v michael@gmail.com
michael@gmail.com... Connecting to [127.0.0.1] via relay...
220 myserver.net ESMTP Sendmail 8.14.7/8.14.7; Fri, 9 Nov 2018 00:23:23 GMT
>>> EHLO myserver.net
250-myserver.net Hello localhost [127.0.0.1], pleased to meet you
250-ENHANCEDSTATUSCODES
250-PIPELINING
250-8BITMIME
250-SIZE
250-DSN
250-ETRN
250-DELIVERBY
250 HELP
>>> MAIL From:<michael@myserver.net> SIZE=23
250 2.1.0 <michael@myserver.net>... Sender ok
>>> RCPT To:<michael@gmail.com>
>>> DATA
250 2.1.5 <michael@gmail.com>... Recipient ok
354 Enter mail, end with "." on a line by itself
>>> .
250 2.0.0 wA90NNa9001589 Message accepted for delivery
michael@gmail.com... Sent (wA90NNa9001589 Message accepted for delivery)
Closing connection to [127.0.0.1]
>>> QUIT
221 2.0.0 myserver.net closing connection
[michael@myserver ~]$


Nov  9 00:23:23 myserver sendmail[1588]: wA90NNZ9001588: from=michael, size=23, class=0, nrcpts=1, msgid=<201811090023.wA90NNZ9001588@myserver.net>, relay=michael@localhost
Nov  9 00:23:23 myserver sendmail[1589]: wA90NNa9001589: from=<michael@myserver.net>, size=305, class=0, nrcpts=1, msgid=<201811090023.wA90NNZ9001588@myserver.net>, proto=ESMTP, daemon=MTA, relay=localhost [127.0.0.1]
Nov  9 00:23:23 myserver sendmail[1588]: wA90NNZ9001588: to=michael@gmail.com, ctladdr=michael (1000/1000), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=30023, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (wA90NNa9001589 Message accepted for delivery)

Nov  9 00:28:23 myserver sendmail[1591]: wA90NNa9001589: to=<michael@gmail.com>, ctladdr=<michael@myserver.net> (1000/1000), delay=00:05:00, xdelay=00:05:00, mailer=esmtp, pri=120305, relay=alt4.gmail-smtp-in.l.google.com. [74.125.193.27], dsn=4.0.0, stat=Deferred: Connection timed out with alt4.gmail-smtp-in.l.google.com.




[michael@myserver ~]$ echo "Subject: sendmail test" | sendmail -v michael@comcast.net
michael@comcast.net... Connecting to [127.0.0.1] via relay...
220 myserver.net ESMTP Sendmail 8.14.7/8.14.7; Fri, 9 Nov 2018 00:31:12 GMT
>>> EHLO myserver.net
250-myserver.net Hello localhost [127.0.0.1], pleased to meet you
250-ENHANCEDSTATUSCODES
250-PIPELINING
250-8BITMIME
250-SIZE
250-DSN
250-ETRN
250-DELIVERBY
250 HELP
>>> MAIL From:<michael@myserver.net> SIZE=23
250 2.1.0 <michael@myserver.net>... Sender ok
>>> RCPT To:<michael@comcast.net>
>>> DATA
250 2.1.5 <michael@comcast.net>... Recipient ok
354 Enter mail, end with "." on a line by itself
>>> .
250 2.0.0 wA90VCqa001621 Message accepted for delivery
michael@comcast.net... Sent (wA90VCqa001621 Message accepted for delivery)
Closing connection to [127.0.0.1]
>>> QUIT
221 2.0.0 myserver.net closing connection

Nov  9 00:31:12 myserver sendmail[1620]: wA90VCHI001620: from=michael, size=23, class=0, nrcpts=1, msgid=<201811090031.wA90VCHI001620@myserver.net>, relay=michael@localhost
Nov  9 00:31:12 myserver sendmail[1621]: wA90VCqa001621: from=<michael@myserver.net>, size=304, class=0, nrcpts=1, msgid=<201811090031.wA90VCHI001620@myserver.net>, proto=ESMTP, daemon=MTA, relay=localhost [127.0.0.1]
Nov  9 00:31:12 myserver sendmail[1620]: wA90VCHI001620: to=michael@comcast.net, ctladdr=michael (1000/1000), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=30023, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (wA90VCqa001621 Message accepted for delivery)

Nov  9 00:33:12 myserver sendmail[1623]: wA90VCqa001621: to=<michael@comcast.net>, ctladdr=<michael@myserver.net> (1000/1000), delay=00:02:00, xdelay=00:02:00, mailer=esmtp, pri=120304, relay=mx1.comcast.net. [96.114.157.80], dsn=4.0.0, stat=Deferred: Connection timed out with mx1.comcast.net.
[michael@myserver ~]$
 
Old 11-09-2018, 08:55 AM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Hi,

The mails were delivered by the local smtp server, but could not reach the recipients' smtp. (Probably your ISP is blocking outgoing mail, as most of them do)
These mails stay in queue until a certain amount of time ( usually 5d) and then discarded.
Run the following to verify:
Code:
mailq
Regards
 
Old 11-09-2018, 09:14 AM   #3
NotionCommotion
Member
 
Registered: Aug 2012
Posts: 789

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by bathory View Post
Hi,

The mails were delivered by the local smtp server, but could not reach the recipients' smtp. (Probably your ISP is blocking outgoing mail, as most of them do)
These mails stay in queue until a certain amount of time ( usually 5d) and then discarded.
Run the following to verify:
Code:
mailq
Regards
Thanks bathory,

Yes, I found them all in the queue. Ended up deleting the queue files and starting over (which was kind of a pain because I couldn't just use sudo rm /var/spool/mqueue/* for some odd reason).

So, you think my isp is blocking and I need to contact them?

Also, wonder if apache@myserver.net is part of the problem. Is this the user, or are does it imply a "from email"? Note that for this example, I used php to trigger sendmail thus the "apache" user instead of the "michael" user, but I don't think it should make a difference.

Code:
[michael@myserver ~]$ sudo mailq
                /var/spool/mqueue (2 requests)
-----Q-ID----- --Size-- -----Q-Time----- ------------Sender/Recipient-----------
wA9Evv2x004289*      25 Fri Nov  9 14:57 <apache@myserver.net>
                                         <michael@gmail.com>
wA9Evu6E004285       25 Fri Nov  9 14:57 <apache@myserver.net>
                 (Deferred: Connection timed out with mx1.comcast.net.)
                                         <michael@comcast.net>
                Total requests: 2
[michael@myserver ~]$
 
Old 11-09-2018, 09:24 AM   #4
NotionCommotion
Member
 
Registered: Aug 2012
Posts: 789

Original Poster
Rep: Reputation: Disabled
Also, I don't recall having to do so in the past, but maybe adjusting /etc/mail/sendmail.mc is the issue? Specifically, can localhost.localdomain be the problem?

Code:
sudo cat /etc/mail/sendmail.mc
...
DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')dnl
...
LOCAL_DOMAIN(`localhost.localdomain')dnl
EDIT. Doesn't seem to be any help.

Last edited by NotionCommotion; 11-09-2018 at 09:35 AM.
 
Old 11-09-2018, 09:46 AM   #5
NotionCommotion
Member
 
Registered: Aug 2012
Posts: 789

Original Poster
Rep: Reputation: Disabled
@bathory You are right! I called 1and1, and they had outgoing 25 blocked on their side! Evidently, this is the only port they block. Wish they made me aware of this first. Thanks!
 
Old 11-09-2018, 03:43 PM   #6
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Quote:
Originally Posted by NotionCommotion View Post
@bathory You are right! I called 1and1, and they had outgoing 25 blocked on their side! Evidently, this is the only port they block. Wish they made me aware of this first. Thanks!
You should ask them, if you can use their mailserver as a smarthost.
Usually ISPs block outgoing traffic to port 25, in order to stop spam, but they allow connections to theirs smtp server.

Or you can use the submission port (587) to relay email through gmail or similar services.

Cheers
 
Old 11-09-2018, 04:19 PM   #7
scasey
LQ Veteran
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.9.2009
Posts: 5,727

Rep: Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211
Quote:
Originally Posted by NotionCommotion View Post
@bathory You are right! I called 1and1, and they had outgoing 25 blocked on their side! Evidently, this is the only port they block. Wish they made me aware of this first. Thanks!
Did they open it for you? If you're buying hosting service from them, I'd think they would.

If not, then what bathory said, for sure.
 
Old 11-10-2018, 05:19 AM   #8
NotionCommotion
Member
 
Registered: Aug 2012
Posts: 789

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by scasey View Post
Did they open it for you? If you're buying hosting service from them, I'd think they would.

If not, then what bathory said, for sure.
Yes, they did. They told me that normally this port is automatically opened on all vps's after 40 days, but for some reason that it was never done so on mine. 5 minutes later, all was good. Evidently, port 25 is the only outgoing port that they put restrictions on. While I couldn't find anything in their documentation stating so, I must say 1&1 has been pretty good to work with.


Quote:
Originally Posted by bathory View Post
You should ask them, if you can use their mailserver as a smarthost.
Usually ISPs block outgoing traffic to port 25, in order to stop spam, but they allow connections to theirs smtp server.

Or you can use the submission port (587) to relay email through gmail or similar services.

Cheers
Ended up getting things working with port 25, but eventually abandoned doing so and am using 1&1 as a relayhost with port 587.

Thanks!
 
Old 11-10-2018, 02:02 PM   #9
quietright
LQ Newbie
 
Registered: Nov 2018
Posts: 8

Rep: Reputation: 0
I had this problem recently.
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] How to send email from relaying yahoo email server with mutt? luofeiyu Linux - Server 2 10-07-2017 03:49 AM
[SOLVED] [Email] I can't send email from my server thomas2004ch Linux - Software 10 04-08-2015 04:57 AM
Send email to specific SMTP servers per email from my server? neilius Linux - Server 6 06-25-2009 06:31 AM
Apache virtual host send email without email server SibLiant Linux - Software 6 06-03-2009 09:46 PM
Allowing an IP to send email using my email server... culprit Linux - Networking 7 09-09-2003 12:24 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:52 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