Exchange 2016 SMTP Intermittent Error 5.7.57 - smtp

I have configured a new Exchange 2016 server and I use it to send emails over a self-written .net application, using the standard MailMessage and SmtpClient. Everything works fine about 90% of the time and then suddenly without any change (neither on the server, nor on the code) this error is returned:
The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.7.57 SMTP; Client was not authenticated to send anonymous mail during MAIL FROM
Then some time later (could be a minute or an hour) everything works fine again, without any change on either component. Any ideas what might be causing this?

Related

What causes this very unusual SMTP error?

Sending SMTP mail via an Office 365 mail server, using .NET System.Net.Mail.SmtpClient I'm getting the following error:
The server response was: 4.3.21 Mailbox server busy; mail intentionally delayed
I can't find any reference to this specific code anywhere - the closest thing I can find is 4.3.2 mailbox busy
It seems to be a transient error, but I'm getting a lot of them.
Any idea what the code means?

Failure Sending Mail using GSuite SMTP

I have a very curious issue with an application. When debugging locally, I can send emails just fine using a client's G Suite email credentials:
<smtp deliveryMethod="Network" from="client#customdomain.com">
<network defaultCredentials="false"
host="smtp.gmail.com"
port="587"
userName="client#customdomail.com"
password="supersecret"
enableSsl="true" />
</smtp>
Now, it's very important to note that the application will send just fine with the credentials when running on localhost using Visual Studio. However, when deploying to LIVE and using the exact same credentials, the application refuses to send and I only get the canned response back saying "Failure Sending mail".
I have enabled "less secure applications" in the settings and have verified the "suspicious activity" from the server's IP address. I can also log in to the Gmail account from the server using RDP and opening Firefox to go to Gmail.com.
No firewall rule has been set to block SMTP or anything on port 587.
UPDATE: the materialized error message is
A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond 74.125.192.108:587
74.125.192.108 being smtp.gmail.com's IP Address (or one of them, at least)
UPDATE 2: I can also not get Thunderbird on the remote server to send an email using the supplied credentials, however it can connect via IMAP and download the contents of the inbox just fine.
Well in this very specific case, it was the fault of the Amazon infrastructure this application ran on. Either amazon themselves, or the reseller changed a policy that ended up blocking communications on ports 465, 587 and 993 (and probably others too).
The "solution" was to nag them to sort it out.

PHP mail function not working on new Exchange 2010 Server

When trying to send mail (to email addresses within the domain) using PHP's mail() function on my new Exchange 2010 server I get the error:
mail(): SMTP server response: 501 5.1.3 Invalid address
I tried creating a new receive connector with anonymous authentication but that doesn't seem to help, and honestly I have little to no experience with Exchange Server.
The address is valid, btw.
Try adding this on top:
ini_set("sendmail_from", "email#yourdomian.com");
It'll work

Intermittant SMTP email exception - Service not available, closing transmission channel. The server response was: 4.4.2 service timed out

I have started to see an intermittant error when sending email via my application.
System.Net.Mail.SmtpException: Service not available, closing transmission channel. The server response was: 4.4.2 service timed out.
Now obviously it's timing out for some reason, but any ideas as to why this is happening now? This is the first time I've seen it happen.
Some things to check:
has anything on the server side changed? Did the admins add some kind of greylisting, perhaps?
what happens if you connect to the server directly via telnet on port 25?
does this occur from other applications, as well (e.g. your desktop E-mail client) ?

Are SMTP relay requirements for System.Net.Mail different than System.Web.Mail

I deployed my web app to our production IIS 6.0 server and everything is working except when my code attempts to send email to an address that is NOT in the domain of our email server. I've seen various symptoms but this seems the most straightforward to describe:
Syntax error in parameters or arguments. The server response was: 5.7.1 This system is not configured to relay mail
My web app getting this error msg uses System.Net.Mail. It resides along with the older web app it is supposed to replace which uses System.Web.Mail. There is one SMTP server on this same machine that seems to require some new configuration regarding relay.
Checking the SMTP server properties showed nothing configured for "Relay Restrictions". The older production web app sends email without errors with the SMTP server configured as described.
So, in summary, does use of System.Net.Mail require something different for relaying email than System.Web.Mail?
The web.config for the newer version that has relay issues contains:
<system.net><mailSettings><smtp><network host="mail.cbmiweb.com" port="25"/></smtp>
I used the values above for all my testing (first on my localhost with XP IIS 5.1; then on a staging IIS 6.0 server in our LAN) and never had any "relay" problems.
The web.config for the older version using System.Web.Mail contains nothing related to SMTP!
If I suddenly need a username and password added to the smtp setting above, how come I never needed "credentials" during development?
I don't know much about SMTP and really don't even know what to ask the mail server administrator. I am very confused about what to do...thanks.
Sounds to me like the old app is sending the message directly to the recipients server and is bypassing your local mail server completely. This would have happened because your app would not have had a mail server to use configured, so it defaults back to trying to send the mail itself.
This is usually a bad idea as it can cause delays in your application depending on the recipients mail server configuration (we're talking seconds here). Further if you aren't configured to deal with things like grey lists, etc, then you can have a high number of emails that you think was sent, but never really arrived.
You should ask the mail server administrator to properly configure your local mail server to allow relaying from your machine.
OR (and this is the more secure way)
You should set up a user on your local mail server and have your app use those login credentials when attempting to send email.
The systemnetmail.com site might be helpful. Specifically the page on smtp configuration.