Linux - NewbieThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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 ~]$
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:
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 ~]$
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?
@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!
@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.
@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.
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
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.