SOLVED SMTP from Incredible in Ubuntu 18.04

unsichtbarre

Member
Joined
May 17, 2009
Messages
140
Reaction score
5
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): SMTP+queueing@00: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]>, relay=asterisk@localhost
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): SMTP+queueing@00:10:00
Sep  9 20:48:10 pbx1 sendmail[14272]: x8A0mAMG014272: from=asterisk, size=18409, class=0, nrcpts=1, msgid=<[email protected]>, relay=asterisk@localhost
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
140
Reaction score
5
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 root@localhost)
        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
19,168
Reaction score
5,199
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:

unsichtbarre

Member
Joined
May 17, 2009
Messages
140
Reaction score
5
It doesn't like my email address/username. In fact, it seems any use of '@' is not permitted with the hostname command. I could edit /etc/hostname, but i suspect that might cause errors.

Thoughts?

Code:
root@pbx1:~# hostname [email protected]
hostname: the specified hostname is invalid
root@pbx1:~#
 

wardmundy

Nerd Uno
Joined
Oct 12, 2007
Messages
19,168
Reaction score
5,199
Sorry. My fault. Remove your email name and @. Just use your FQDN in both places.
 

unsichtbarre

Member
Joined
May 17, 2009
Messages
140
Reaction score
5
OK. After making the changes with only mydomain.com in hosts and hostname, I get this:
Code:
root@pbx1:/var/mail# echo "test" | mail -s testmessage [email protected]
mail: cannot send message: Process exited with a non-zero status
root@pbx1:/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]>, relay=root@localhost
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
140
Reaction score
5
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
140
Reaction score
5
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

Well-Known Member
Joined
Dec 16, 2007
Messages
3,764
Reaction score
2,173
Just put appropriate firewall rules in play to block inbound traffic on port-25 or you'll be continually attacked by the script-kiddies.
 

hawk#1

Well-Known Member
Joined
Nov 3, 2015
Messages
716
Reaction score
309
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.
 

unsichtbarre

Member
Joined
May 17, 2009
Messages
140
Reaction score
5
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!
 
Get 3CX - Absolutely Free!

Link up your team and customers Phone System Live Chat Video Conferencing

Hosted or Self-managed. Up to 10 users free forever. No credit card. Try risk free.

3CX
A 3CX Account with that email already exists. You will be redirected to the Customer Portal to sign in or reset your password if you've forgotten it.
Top