LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 12-04-2022, 11:08 AM   #1
john.wythe@activant.com
Member
 
Registered: Nov 2009
Location: Burnaby BC
Posts: 77

Rep: Reputation: 1
sendmail TLS relay configuration


I have setup sendmail to relay mail from the local server destined for external email addresses to use a SMART HOST. I have set this up many times on other systems with no problems. All use the same version of sendmail 8.14.4. I have set up configurations with and without authentication using access when needed. This server was working until we switch the SMART HOST over to smtp.office365.com which requires TLS

How do I setup sendmail to use TLS when talking to the relay server?
How can I debug/trace the communication between sendmail and the replay server.

I have setup the certificates for TLS as per the documentation in sendmail.mc

dnl # Rudimentary information on creating certificates for sendmail TLS:
dnl # cd /etc/pki/tls/certs; make sendmail.pem
dnl # Complete usage:
dnl # make -C /etc/pki/tls/certs usage
dnl #
define(`confCACERT_PATH', `/etc/pki/tls/certs')dnl
define(`confCACERT', `/etc/pki/tls/certs/ca-bundle.crt')dnl
define(`confSERVER_CERT', `/etc/pki/tls/certs/sendmail.pem')dnl
define(`confSERVER_KEY', `/etc/pki/tls/certs/sendmail.pem')dnl
dnl #

I have feeling this only configures TLS for incoming connections to the server, and not out going connections to the relay server from sendmail. Perhaps I need to set something up in submit.mc

This is the error I get in the bounce back email:
(reason: 530 5.7.57 Client not authenticated to send mail. [MW2PR16CA0045.namprd16.prod.outlook.com])

I believe the client is not authenticated because it is not using TLS.

Linux is CentOS 6.10.
 
Old 12-05-2022, 04:42 AM   #2
TenTenths
Senior Member
 
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6 / 7
Posts: 3,484

Rep: Reputation: 1556Reputation: 1556Reputation: 1556Reputation: 1556Reputation: 1556Reputation: 1556Reputation: 1556Reputation: 1556Reputation: 1556Reputation: 1556Reputation: 1556
You don't say if your domain on O365 has SMTP AUTH disabled (I'm guessing that's it's enabled as default)

If SMTP AUTH is enabled then you need both TLS and SMTP AUTH configured on your relaying host.

It's also likely that you'll only be able to configure auth settings for a single mailbox in sendmail, so all the mail will appear to be coming from that O365 account.

Last edited by TenTenths; 12-05-2022 at 10:44 AM.
 
Old 12-05-2022, 10:43 AM   #3
john.wythe@activant.com
Member
 
Registered: Nov 2009
Location: Burnaby BC
Posts: 77

Original Poster
Rep: Reputation: 1
I don't have access to the O365 setup. I am guessing it is enabled, because TLS is required by the other client I am using, and it has no problems. That is why I am wanting to configure sendmail to use TLS when it is acting as a client in relay mode.
 
Old 12-05-2022, 11:30 AM   #4
john.wythe@activant.com
Member
 
Registered: Nov 2009
Location: Burnaby BC
Posts: 77

Original Poster
Rep: Reputation: 1
This is what I get in maillog when I try to send an email that requires relaying.

Dec 5 10:26:16 wmat sendmail[187480]: STARTTLS=client, relay=smtp.office365.com, version=TLSv1/SSLv3, verify=OK, cipher=ECDHE-RSA-AES256-GCM-SHA384, bits=256/256
Dec 5 10:26:21 wmat sendmail[187480]: 2B5HMGDG187478: to=<xxxxxxx@gmail.com>, ctladdr=<root@domain> (0/0), delay=00:04:05, xdelay=00:04:05, mailer=relay, pri=120468, relay=smtp.office365.com [52.96.121.2], dsn=5.0.0, stat=Service unavailable
Dec 5 10:26:21 wmat sendmail[187480]: 2B5HMGDG187478: 2B5HQLDF187480: DSN: Service unavailable

Last edited by john.wythe@activant.com; 12-05-2022 at 11:32 AM.
 
Old 12-05-2022, 12:09 PM   #5
TenTenths
Senior Member
 
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6 / 7
Posts: 3,484

Rep: Reputation: 1556Reputation: 1556Reputation: 1556Reputation: 1556Reputation: 1556Reputation: 1556Reputation: 1556Reputation: 1556Reputation: 1556Reputation: 1556Reputation: 1556
Make use of this site: https://www.appmaildev.com/en/dkim (yes, it's their DKIM checker but it will also tell you if the mail was sent with SSL/TLS or unencrypted.
 
Old 12-06-2022, 12:55 AM   #6
john.wythe@activant.com
Member
 
Registered: Nov 2009
Location: Burnaby BC
Posts: 77

Original Poster
Rep: Reputation: 1
I solved the problem. I had two issues. First my access file had an extra period at the end of the server name in the AuthInfo line, so it wasn't using the username/password at all.
After fixing that it complained about Mechanisms not being sufficient, so I followed the instructions in sendmail.mc to enable saslauthd, and uncomment the 2 lines for mechanisms.

TRUST_AUTH_MECH(`EXTERNAL DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')dnl
define(`confAUTH_MECHANISMS', `EXTERNAL GSSAPI DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')
 
Old 12-06-2022, 03:10 AM   #7
TenTenths
Senior Member
 
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6 / 7
Posts: 3,484

Rep: Reputation: 1556Reputation: 1556Reputation: 1556Reputation: 1556Reputation: 1556Reputation: 1556Reputation: 1556Reputation: 1556Reputation: 1556Reputation: 1556Reputation: 1556
Excellent glad you got sorted. I kinda felt the main issue would be AUTH related.
 
  


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
Configuring sendmail using sendmail-slackware-tls-sasl.mc statguy Slackware 2 08-11-2014 07:26 AM
[SENDMAIL]relay only to auth users if FROM: user@mydom and no relay for staff@mydom damien235 Linux - Server 0 02-23-2011 08:35 AM
Sendmail (with TLS) relay denied freealx Linux - General 1 03-12-2005 04:10 PM
Sendmail TLS relay freealx Linux - Networking 1 03-12-2005 04:09 PM
relay mail to sendmail relay server??? lemay_jeff Linux - Newbie 0 07-06-2004 04:54 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

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