<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Error using Office 365 SMTP relay in Administration and Deployment</title>
    <link>https://communities.sas.com/t5/Administration-and-Deployment/Error-using-Office-365-SMTP-relay/m-p/692084#M20438</link>
    <description>&lt;P&gt;How did you test it from powershell?&lt;/P&gt;</description>
    <pubDate>Fri, 16 Oct 2020 09:27:34 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2020-10-16T09:27:34Z</dc:date>
    <item>
      <title>Error using Office 365 SMTP relay</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/Error-using-Office-365-SMTP-relay/m-p/692080#M20437</link>
      <description>&lt;P&gt;Hello community,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i try to send an email from a Microsoft Office 365 account from a SAS programm via SMTP over an SMTP relay.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Setup: i followed the documentation for "Option 3" (&lt;A href="https://docs.microsoft.com/en-us/Exchange/mail-flow-best-practices/how-to-set-up-a-multifunction-device-or-application-to-send-email-using-microsoft-365-or-office-365#option-3-configure-a-connector-to-send-mail-using-microsoft-365-or-office-365-smtp-relay" target="_self"&gt;https://docs.microsoft.com/en-us/Exchange/mail-flow-best-practices/how-to-set-up-a-multifunction-device-or-application-to-send-email-using-microsoft-365-or-office-365#option-3-configure-a-connector-to-send-mail-using-microsoft-365-or-office-365-smtp-relay&lt;/A&gt; ).&lt;/P&gt;&lt;P&gt;The other options will not work for us.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;All technical aspects of the connection are fullfilled. I can successfully send an email from the SAS server over the gateway via powershell.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If i try to send the email from SAS code with the same settings i get an error:&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;ERROR: Login failure&lt;BR /&gt;ERROR: Email: 504 5.7.4 Unrecognized authentication type [BE0DEU01FT015.eop-deu01.prod.protection.outlook.com]&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is the code i use:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;options emailhost=("xxx.mail.protection.outlook.com" 
AUTH=LOGIN STARTTLS PORT=25
PWD="xxx" USERID="xxx@mydomain.com" );

Filename EmailOut Email 
                        From     = "xxx@mydomain.com"
                        To       = "me@someotherdomain.com"
                        Subject  = "test from SAS"
                        debug
;
Data _NULL_;
   File EmailOut;
   Put "test";
Run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;This is the full SMTP communication:&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;R: 220 FR2DEU01FT017.mail.protection.outlook.com Microsoft ESMTP MAIL Service ready at Fri, 16 Oct 2020 08:52:03 +0000&lt;BR /&gt;S: EHLO test.mydomain.com&lt;BR /&gt;R: 250-FR2DEU01FT017.mail.protection.outlook.com Hello [13.80.23.30]&lt;BR /&gt;R: 250-SIZE 157286400&lt;BR /&gt;R: 250-PIPELINING&lt;BR /&gt;R: 250-DSN&lt;BR /&gt;R: 250-ENHANCEDSTATUSCODES&lt;BR /&gt;R: 250-STARTTLS&lt;BR /&gt;R: 250-8BITMIME&lt;BR /&gt;R: 250-BINARYMIME&lt;BR /&gt;R: 250-CHUNKING&lt;BR /&gt;R: 250 SMTPUTF8&lt;BR /&gt;S: STARTTLS&lt;BR /&gt;R: 220 2.0.0 SMTP server ready&lt;BR /&gt;S: EHLO test.mydomain.com&lt;BR /&gt;R: 250-FR2DEU01FT017.mail.protection.outlook.com Hello [13.80.23.30]&lt;BR /&gt;R: 250-SIZE 157286400&lt;BR /&gt;R: 250-PIPELINING&lt;BR /&gt;R: 250-DSN&lt;BR /&gt;R: 250-ENHANCEDSTATUSCODES&lt;BR /&gt;R: 250-8BITMIME&lt;BR /&gt;R: 250-BINARYMIME&lt;BR /&gt;R: 250-CHUNKING&lt;BR /&gt;R: 250 SMTPUTF8&lt;BR /&gt;S: AUTH LOGIN&lt;BR /&gt;R: 504 5.7.4 Unrecognized authentication type [FR2DEU01FT017.eop-deu01.prod.protection.outlook.com]&lt;BR /&gt;ERROR: Login failure&lt;BR /&gt;ERROR: Email: 504 5.7.4 Unrecognized authentication type [FR2DEU01FT017.eop-deu01.prod.protection.outlook.com]&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For me it looks like SAS does not correctly implement the SMTP protocol and cannot process the response from the MS Outlook server.&lt;/P&gt;&lt;P&gt;I also tried different SAS emailhost options including the use of SSL instead of STARTTLS. Nothing worked.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Has anybody successfully used the Office 365 SMTP gateway or an idea how i can fix the problem?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you in advance!&lt;/P&gt;&lt;P&gt;Andreas&lt;/P&gt;</description>
      <pubDate>Fri, 16 Oct 2020 09:00:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/Error-using-Office-365-SMTP-relay/m-p/692080#M20437</guid>
      <dc:creator>AndreasMenrath</dc:creator>
      <dc:date>2020-10-16T09:00:40Z</dc:date>
    </item>
    <item>
      <title>Re: Error using Office 365 SMTP relay</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/Error-using-Office-365-SMTP-relay/m-p/692084#M20438</link>
      <description>&lt;P&gt;How did you test it from powershell?&lt;/P&gt;</description>
      <pubDate>Fri, 16 Oct 2020 09:27:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/Error-using-Office-365-SMTP-relay/m-p/692084#M20438</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-10-16T09:27:34Z</dc:date>
    </item>
    <item>
      <title>Re: Error using Office 365 SMTP relay</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/Error-using-Office-365-SMTP-relay/m-p/692125#M20441</link>
      <description>&lt;P&gt;here is the code&lt;/P&gt;&lt;PRE&gt;$cred = Get-Credential

Send-MailMessage -To "me@someotherdomain.com" -Subject "test" -Body "test" -SmtpServer "xxx.mail.protection.outlook.com" -From "xxx@mydomain.com" -Credential $cred -Port 25 -UseSsl&lt;/PRE&gt;</description>
      <pubDate>Fri, 16 Oct 2020 13:37:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/Error-using-Office-365-SMTP-relay/m-p/692125#M20441</guid>
      <dc:creator>AndreasMenrath</dc:creator>
      <dc:date>2020-10-16T13:37:01Z</dc:date>
    </item>
    <item>
      <title>Re: Error using Office 365 SMTP relay</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/Error-using-Office-365-SMTP-relay/m-p/692132#M20442</link>
      <description>&lt;P&gt;So you test a MS server with a MS client. Given the long and deep history of MS doing subtle changes to standards and protocols so only their software works with their environments, I would suspect that this is another case of MS software not fully complying with standards. AKA vendor-lock-in.&lt;/P&gt;
&lt;P&gt;After all, it is the &lt;EM&gt;server&lt;/EM&gt; that rejects the authentication type sent by SAS. And I am quite confident that this part of the &amp;nbsp; FILENAME EMAIL (which is quite old now) has been thoroughly tested with standard-complying servers.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Anyway, this is something that SAS TS should look into, so I recommend to open a track with them.&lt;/P&gt;</description>
      <pubDate>Fri, 16 Oct 2020 14:14:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/Error-using-Office-365-SMTP-relay/m-p/692132#M20442</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-10-16T14:14:21Z</dc:date>
    </item>
    <item>
      <title>Re: Error using Office 365 SMTP relay</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/Error-using-Office-365-SMTP-relay/m-p/692143#M20443</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/16887"&gt;@AndreasMenrath&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;a couple of little, perhaps silly questions.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1- are you sure you need to use port 25 and not&amp;nbsp;587 or another?&lt;/P&gt;
&lt;P&gt;2- did you download the public certificates from the SMTP server and added them to your SAS Private Java Runtime Environment certificate store? Otherwise, I see hard that the SAS JVM client will be able to handshake TLS with the SMTP server.&lt;/P&gt;</description>
      <pubDate>Fri, 16 Oct 2020 15:04:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/Error-using-Office-365-SMTP-relay/m-p/692143#M20443</guid>
      <dc:creator>JuanS_OCS</dc:creator>
      <dc:date>2020-10-16T15:04:40Z</dc:date>
    </item>
    <item>
      <title>Re: Error using Office 365 SMTP relay</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/Error-using-Office-365-SMTP-relay/m-p/692154#M20445</link>
      <description>&lt;P&gt;Thank you all for the feedback (except the Microsoft rant).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In the meantime i set up an local email relay with postfix on the SAS server (if anybody is interested here is a manual:&lt;A href="https://www.middlewareinventory.com/blog/postfix-relay-office-365/" target="_blank"&gt;https://www.middlewareinventory.com/blog/postfix-relay-office-365/&lt;/A&gt;).&lt;/P&gt;&lt;P&gt;This solution works perfectly when i connect from SAS to localhost:25 and postfix does the heavy lifting.&lt;/P&gt;</description>
      <pubDate>Fri, 16 Oct 2020 15:50:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/Error-using-Office-365-SMTP-relay/m-p/692154#M20445</guid>
      <dc:creator>AndreasMenrath</dc:creator>
      <dc:date>2020-10-16T15:50:04Z</dc:date>
    </item>
    <item>
      <title>Re: Error using Office 365 SMTP relay</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/Error-using-Office-365-SMTP-relay/m-p/692163#M20446</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/35204"&gt;@JuanS_OCS&lt;/a&gt;&amp;nbsp;From the responses&lt;/P&gt;
&lt;PRE&gt;S: STARTTLS
R: 220 2.0.0 SMTP server ready
S: EHLO test.mydomain.com
R: 250-FR2DEU01FT017.mail.protection.outlook.com Hello [13.80.23.30]
R: 250-SIZE 157286400
R: 250-PIPELINING
R: 250-DSN
R: 250-ENHANCEDSTATUSCODES
R: 250-8BITMIME
R: 250-BINARYMIME
R: 250-CHUNKING
R: 250 SMTPUTF8
&lt;/PRE&gt;
&lt;P&gt;I take it that the STARTTLS worked, and the problem arises later here:&lt;/P&gt;
&lt;PRE&gt;S: AUTH LOGIN
R: 504 5.7.4 Unrecognized authentication type [FR2DEU01FT017.eop-deu01.prod.protection.outlook.com]
&lt;/PRE&gt;</description>
      <pubDate>Fri, 16 Oct 2020 16:25:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/Error-using-Office-365-SMTP-relay/m-p/692163#M20446</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-10-16T16:25:04Z</dc:date>
    </item>
  </channel>
</rss>

