SOLVED SMTP from Incredible in Ubuntu 18.04

unsichtbarre

Member
Joined
May 17, 2009
Messages
139
Reaction score
3
I have Incredible + Enchelada on UpCloud 18.04 and having trouble getting mail to work. I have set up SMTP relay through my Google Apps and whitelisted my PBX IP on port 25 and I have configured smtp-relay.gmail.com:25 in webmin.

Gmail seems to be accepting the message, but it never gets delivered - not to trash, not to spam, nowhere.

I think the problem is my user: [email protected] - how would I change this to [email protected] so Google would forward it. Here are the logs:
Code:
Sep  9 20:40:23 pbx1 sendmail[13162]: x8A0eNQV013162: to="John Borhek" <[email protected]>, ctladdr=asterisk (1000/1000), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=43599, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (x8A0eNae013163 Message accepted for delivery)
Sep  9 20:41:41 pbx1 sm-mta[12839]: restarting /usr/sbin/sendmail-mta due to signal
Sep  9 20:41:42 pbx1 sm-mta[13368]: starting daemon (8.15.2): [email protected]:10:00
Sep  9 20:42:30 pbx1 sm-mta[13165]: x8A0eNae013163: to=<[email protected]>, ctladdr=<[email protected]> (1000/1000), delay=00:02:07, xdelay=00:02:07, mailer=relay, pri=133731, relay=25, dsn=4.0.0, stat=Deferred
Sep  9 20:42:34 pbx1 sendmail[13493]: x8A0gX60013493: from=asterisk, size=20095, class=0, nrcpts=1, msgid=<[email protected]>, [email protected]
Sep  9 20:42:34 pbx1 sm-mta[13494]: x8A0gY6i013494: <[email protected]>... User unknown
Sep  9 20:42:34 pbx1 sendmail[13493]: x8A0gX60013493: to="John Borhek" <[email protected]>, ctladdr=asterisk (1000/1000), delay=00:00:01, xdelay=00:00:00, mailer=relay, pri=50095, relay=[127.0.0.1] [127.0.0.1], dsn=5.1.1, stat=User unknown
Sep  9 20:42:34 pbx1 sm-mta[13494]: x8A0gY6i013494: from=<[email protected]>, size=20095, class=0, nrcpts=0, proto=ESMTP, daemon=MTA-v4, relay=localhost [127.0.0.1]
Sep  9 20:46:32 pbx1 sm-mta[13368]: restarting /usr/sbin/sendmail-mta due to signal
Sep  9 20:46:32 pbx1 sm-mta[14087]: starting daemon (8.15.2): [email protected]:10:00
Sep  9 20:48:10 pbx1 sendmail[14272]: x8A0mAMG014272: from=asterisk, size=18409, class=0, nrcpts=1, msgid=<[email protected]>, [email protected]
Sep  9 20:48:10 pbx1 sm-mta[14273]: x8A0mAQW014273: from=<[email protected]>, size=18541, class=0, nrcpts=1, msgid=<[email protected]>, proto=ESMTP, daemon=MTA-v4, relay=localhost [127.0.0.1]
Sep  9 20:48:10 pbx1 sendmail[14272]: x8A0mAMG014272: to="John Borhek" <[email protected]>, ctladdr=asterisk (1000/1000), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=48409, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (x8A0mAQW014273 Message accepted for delivery)
Sep  9 20:48:42 pbx1 sm-mta[14088]: x8A0eNae013163: to=<[email protected]>, ctladdr=<[email protected]> (1000/1000), delay=00:08:19, xdelay=00:02:10, mailer=relay, pri=223731, relay=25, dsn=4.0.0, stat=Deferred
Sep  9 20:50:10 pbx1 sm-mta[14275]: x8A0mAQW014273: to=<[email protected]>, ctladdr=<[email protected]> (1000/1000), delay=00:02:00, xdelay=00:02:00, mailer=relay, pri=138541, relay=25, dsn=4.0.0, stat=Deferred
[CODE]
 
Last edited:

unsichtbarre

Member
Joined
May 17, 2009
Messages
139
Reaction score
3
More data. I think it is the local asterisk that is rejecting the message 'User unknown"
Code:
Final-Recipient: RFC822; [email protected]
Action: failed
Status: 5.1.1
Remote-MTA: DNS; [127.0.0.1]
Diagnostic-Code: SMTP; 550 5.1.1 <[email protected]>... User unknown
Last-Attempt-Date: Sun, 15 Sep 2019 13:25:57 -0400

--x8FHPvDZ001888.1568568357/pbx1.mydomain.com
Content-Type: message/rfc822

Return-Path: <[email protected]>
Received: (from [email protected])
        by pbx1.mydomain.com (8.15.2/8.15.2/Submit) id x8FHPvDY001888;
        Sun, 15 Sep 2019 13:25:57 -0400
Date: Sun, 15 Sep 2019 13:25:57 -0400
From: root <[email protected]>
Message-Id: <[email protected]>
Subject: testmessage
To: <[email protected]>
X-Mailer: mail (GNU Mailutils 3.4)
 

wardmundy

Nerd Uno
Joined
Oct 12, 2007
Messages
15,239
Reaction score
2,667
Using your actual FQDN, edit hosts file in etc directory and enter the FQDN after 127.0.0.1, e.g.

127.0.0.1 mydomain.com localhost localhost.localdomain

Then issue command: hostname mydomain.com
 
Last edited:
  • Like
Reactions: unsichtbarre

wardmundy

Nerd Uno
Joined
Oct 12, 2007
Messages
15,239
Reaction score
2,667
Sorry. My fault. Remove your email name and @. Just use your FQDN in both places.
 

unsichtbarre

Member
Joined
May 17, 2009
Messages
139
Reaction score
3
OK. After making the changes with only mydomain.com in hosts and hostname, I get this:
Code:
[email protected]:/var/mail# echo "test" | mail -s testmessage [email protected]
mail: cannot send message: Process exited with a non-zero status
[email protected]:/var/mail#
and in the log file, it acknowledges the relay=mydomain.com, bu tthe sender is still pbx1.mydomain.com


Code:
Sep 16 15:16:06 pbx1 sendmail[2243]: x8GJG6iA002243: [email protected], size=93, class=0, nrcpts=1, msgid=<[email protected]>, [email protected]
Sep 16 15:16:06 pbx1 sm-mta[2244]: x8GJG6Jw002244: <[email protected]>... User unknown
Sep 16 15:16:06 pbx1 sendmail[2243]: x8GJG6iA002243: to=<[email protected]>, [email protected] (0/0), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=30093, relay=[127.0.0.1] [127.0.0.1], dsn=5.1.1, stat=User unknown
Sep 16 15:16:06 pbx1 sm-mta[2244]: x8GJG6Jw002244: from=<[email protected]>, size=93, class=0, nrcpts=0, proto=ESMTP, daemon=MTA-v4, relay=mydomain.com [127.0.0.1]
Sep 16 15:16:06 pbx1 sendmail[2243]: x8GJG6iA002243: x8GJG6iB002243: DSN: User unknown
Sep 16 15:16:06 pbx1 sm-mta[2244]: x8GJG6K0002244: from=<>, size=2095, class=0, nrcpts=1, msgid=<[email protected]>, proto=ESMTP, daemon=MTA-v4, relay=mydomain.com [127.0.0.1]
Sep 16 15:16:06 pbx1 sendmail[2243]: x8GJG6iB002243: [email protected], delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=31117, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (x8GJG6K0002244 Message accepted for delivery)
Sep 16 15:16:06 pbx1 sm-mta[2245]: x8GJG6K0002244: to=<[email protected]>, delay=00:00:00, xdelay=00:00:00, mailer=local, pri=32302, dsn=2.0.0, stat=Sent
THX
 

unsichtbarre

Member
Joined
May 17, 2009
Messages
139
Reaction score
3
Hi there - I'm getting somewhere! UpCloud blocks port 25

How do I change the send port on sendmail to 465?

THX
 

unsichtbarre

Member
Joined
May 17, 2009
Messages
139
Reaction score
3
OK - here it is: UpCloud just started blocking port 25 - no docs or notice or warning or tech pages!

I didn't think that could be the issue because sendmail kept saying 'Message accepted for delivery' but apparently it meant that the message had been accepted locally by 127.0.0.1

Holy cow, I rebuilt from scratch twice and finally thought to install telnet.

I provided UpCloud Support several new orifices through which to expel waste and they finally opened up port 25 - now Incredible works stock out of the box!

FYI: I'm pretty sure if you are going to use a port other than 25 on smtp-relay.gmail.com you need to authenticate your emaild as is described in several other posts recently.

THX for reading!
 

kenn10

A lesser geek
Joined
Dec 16, 2007
Messages
1,011
Reaction score
207
Just put appropriate firewall rules in play to block inbound traffic on port-25 or you'll be continually attacked by the script-kiddies.
 
  • Like
Reactions: unsichtbarre

hawk#1

Active Member
Joined
Nov 3, 2015
Messages
110
Reaction score
37
Glad to see you got your problem resolved. It is a shame but understandable why hosting services block port 25. Instead of blocking port 25, they should delete and ban the ones that abuse use of port 25. Too often hosting providers just take the easy way out and just block port 25.
 
  • Like
Reactions: unsichtbarre

unsichtbarre

Member
Joined
May 17, 2009
Messages
139
Reaction score
3
Just put appropriate firewall rules in play to block inbound traffic on port-25 or you'll be continually attacked by the script-kiddies.
I've got the full package as provided by Incredible. You can't even see my server without a port knocker!
 

Members online

PIAF 5 - Powered by 3CX

Forum statistics

Threads
22,450
Messages
138,038
Members
14,613
Latest member
roshan2019