Microsoft 365 Email, Vmail attachments fail to send

Status
Not open for further replies.

wmyc_sbaude

Free User
Joined
Jan 14, 2022
Messages
3
Reaction score
0
3CX Enterprise Version 18.0 (Build 461) - OnPrem Install
Emails settings are set to use Microsoft 365, I have also tested Custom SMTP server pointing to smtp.office365.com which has the same issue

Emails are working. Under Email settings, Clicking test email successfully sends the test email which his received in mailbox
I can also resend Welcome emails to users successfully.

The issue is if i set Voicemail option to "Send vmail as attachment" the email never hits our Microsoft 365 Mail server.
If i set the Voicemail option to "Send email notification Only" It works and i get an email in my mailbox.

The 3cxservicesystem.log file has the following snippet which i believe is related to the issue. (Personal details have been masked)

2022/04/11 12:54:39.616|4872|0146|Info|VMMonitor: Creating email notification for xxxx
2022/04/11 12:54:39.616|4872|0146|Info|Transcribe is disabled
2022/04/11 12:54:39.616|4872|0146|Info|VMMonitor: Attaching vmail_0430xxxxxx_xxxx_20220411012234 to email
2022/04/11 12:54:39.616|4872|0146|Info|VMMonitor: Sending email notification to [email protected]
2022/04/11 12:54:44.653|4872|0009|Verb|WaitingEvent for updates:60000
2022/04/11 12:54:49.914|4872|0007|Trac|Updated.REGISTRAR.20164 - sip:[email protected]:5063;rinstance=c28eb87acbf1b471
2022/04/11 12:54:49.914|4872|0007|Verb|Enqueue Updated.REGISTRAR.20164
2022/04/11 12:54:49.914|4872|0010|Verb|Dequeue Updated.REGISTRAR.20164
2022/04/11 12:54:49.914|4872|0007|Verb|Enqueue Updated.REGISTRATION.20164
2022/04/11 12:54:49.914|4872|0010|Verb|Dequeue Updated.REGISTRATION.20164
2022/04/11 12:54:57.473|4872|0007|Trac|Updated.REGISTRAR.20124 - sip:[email protected]:5483;rinstance=c8c5ee49a6d0b96d
2022/04/11 12:54:57.473|4872|0007|Verb|Enqueue Updated.REGISTRAR.20124
2022/04/11 12:54:57.473|4872|0010|Verb|Dequeue Updated.REGISTRAR.20124
2022/04/11 12:54:57.473|4872|0007|Verb|Enqueue Updated.REGISTRATION.20124
2022/04/11 12:54:57.473|4872|0010|Verb|Dequeue Updated.REGISTRATION.20124
2022/04/11 12:54:59.750|4872|0146|Excpt|System.AggregateException: One or more errors occurred. (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.)
---> System.IO.IOException: 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.
---> System.Net.Sockets.SocketException (10060): 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.
at MailKit.Net.NetworkStream.ReadAsync(Byte[] buffer, Int32 offset, Int32 count, CancellationToken cancellationToken)
--- End of inner exception stack trace ---
at MailKit.Net.NetworkStream.ReadAsync(Byte[] buffer, Int32 offset, Int32 count, CancellationToken cancellationToken)
at System.Net.Security.SslStream.ReadAsyncInternal[TIOAdapter](TIOAdapter adapter, Memory`1 buffer)
at MailKit.Net.Smtp.SmtpStream.ReadAheadAsync(Boolean doAsync, CancellationToken cancellationToken)
at MailKit.Net.Smtp.SmtpStream.ReadResponseAsync(Boolean doAsync, CancellationToken cancellationToken)
at MailKit.Net.Smtp.SmtpClient.DataAsync(FormatOptions options, MimeMessage message, Int64 size, Boolean doAsync, CancellationToken cancellationToken, ITransferProgress progress)
at MailKit.Net.Smtp.SmtpClient.SendAsync(FormatOptions options, MimeMessage message, MailboxAddress sender, IList`1 recipients, Boolean doAsync, CancellationToken cancellationToken, ITransferProgress progress)
at TcxMail.SmtpMail.SendAsync(TcxMessage message, CancellationToken cancellationToken)
at TcxMail.SmtpMail.SendAsync(TcxMessage message, CancellationToken cancellationToken)
--- End of inner exception stack trace ---
at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
at TcxMail.MailSenderService.SendMail(TcxMessage message)
at _3cxSystemService.VoiceMailScanner.BoxesMonitor.Trigger(String entity)
2022/04/11 12:54:59.750|4872|0146|Info|VMMonitor: Email to [email protected] failed

Using the mail tracking in Office 365 reveals that no email is ever sent from the voicemail user I have setup. But does show all of the test and welcome emails.
Could Office 365 or the Azure App be blocking emails that have attachments?

Shaun
 
Last edited:
Hi Shaun,

I just checked with a test account we have and attachments should be just fine.

Just to start from the basics, if you choose to use the 3CX SMTP, are VMail attachments delivered OK?
 
Hi Nick, thanks for your reply
If i set to use 3CX SMTP Server i get 5.7.0 Denied.
 
If i set to use 3CX SMTP Server i get 5.7.0 Denied.
OK, this usually happens when the Public IP your 3CX is actually using is different than what you have set in Settings --> Network.

Please try this:
  1. Go to Settings --> Network, select "Static" and input your correct Public IP. If of course your Public IP is not static from your ISP, set it to "Dynamic".
  2. Go to Dashboard --> Services, select all services and press "Restart".
Once you do this, wait a few minutes, then go back to the Mail Server settings and while you have the "3CX SMTP server" selected, press the "TEST" button to see if it succeeds.
 
After trying what you suggested i still got the Denied 5.7.0 on the 3CX SMTP Server.
However we also cannot operate our on prem server this way. Our server must be published on a Tier 1 DMZ behind a firewall on a virtual IP address which cannot send outgoing requests. The outgoing requests are routed through a different internet connection that we cannot listen on. This is why i would prefer to use Microsoft 365 as our Mail server. What gets me is it works for everything else except for emails with a voicemail attachment, But it used to work fine.
I have changed everything back and now i am getting a different error in the 3cxSystemService.log

2022/04/12 08:31:59.890|6044|0021|Excpt|System.AggregateException: One or more errors occurred. (Code: generalException
Message: An error occurred sending the request.
)
---> Status Code: 0
Microsoft.Graph.ServiceException: Code: generalException
Message: An error occurred sending the request.

---> System.Net.Http.HttpRequestException: Error while copying content to a stream.
---> System.IO.IOException: Unable to write data to the transport connection: An existing connection was forcibly closed by the remote host..
---> System.Net.Sockets.SocketException (10054): An existing connection was forcibly closed by the remote host.
--- End of inner exception stack trace ---
at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.ThrowException(SocketError error, CancellationToken cancellationToken)
at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.System.Threading.Tasks.Sources.IValueTaskSource.GetResult(Int16 token)
at System.Net.Security.SslStream.<WriteSingleChunk>g__CompleteWriteAsync|177_1[TIOAdapter](ValueTask writeTask, Byte[] bufferToReturn)
at System.Net.Security.SslStream.WriteAsyncChunked[TIOAdapter](TIOAdapter writeAdapter, ReadOnlyMemory`1 buffer)
at System.Net.Security.SslStream.WriteAsyncInternal[TIOAdapter](TIOAdapter writeAdapter, ReadOnlyMemory`1 buffer)
at System.Net.Http.HttpConnection.WriteAsync(ReadOnlyMemory`1 source, Boolean async)
at System.Net.Http.HttpContent.<CopyToAsync>g__WaitAsync|56_0(ValueTask copyTask)
--- End of inner exception stack trace ---
at System.Net.Http.HttpContent.<CopyToAsync>g__WaitAsync|56_0(ValueTask copyTask)
at System.Net.Http.HttpConnection.SendRequestContentAsync(HttpRequestMessage request, HttpContentWriteStream stream, Boolean async, CancellationToken cancellationToken)
at System.Net.Http.HttpConnection.SendAsyncCore(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
at System.Net.Http.HttpConnection.SendAsyncCore(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
at System.Net.Http.HttpConnectionPool.SendWithRetryAsync(HttpRequestMessage request, Boolean async, Boolean doRequestAuth, CancellationToken cancellationToken)
at System.Net.Http.RedirectHandler.SendAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
at Microsoft.Extensions.Http.Logging.LoggingHttpMessageHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
at Microsoft.Extensions.Http.Logging.LoggingScopeHttpMessageHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
at System.Net.Http.HttpClient.SendAsyncCore(HttpRequestMessage request, HttpCompletionOption completionOption, Boolean async, Boolean emitTelemetryStartStop, CancellationToken cancellationToken)
at Microsoft.Graph.HttpProvider.SendRequestAsync(HttpRequestMessage request, HttpCompletionOption completionOption, CancellationToken cancellationToken)
--- End of inner exception stack trace ---
at Microsoft.Graph.HttpProvider.SendRequestAsync(HttpRequestMessage request, HttpCompletionOption completionOption, CancellationToken cancellationToken)
at Microsoft.Graph.HttpProvider.SendAsync(HttpRequestMessage request, HttpCompletionOption completionOption, CancellationToken cancellationToken)
at Microsoft.Graph.BaseRequest.SendRequestAsync(Object serializableObject, CancellationToken cancellationToken, HttpCompletionOption completionOption)
at Microsoft.Graph.BaseRequest.SendAsync(Object serializableObject, CancellationToken cancellationToken, HttpCompletionOption completionOption)
--- End of inner exception stack trace ---
at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
at System.Threading.Tasks.Task.Wait()
at TcxMail.MailSenderService.SendMail(TcxMessage message)
at _3cxSystemService.VoiceMailScanner.EmailNotif.SendMail()
at _3cxSystemService.VoiceMailScanner.BoxesMonitor.Trigger(String entity)
2022/04/12 08:31:59.890|6044|0021|Info|VMMonitor: Email to [email protected] failed
 
What got my attention was this error line:
Code:
---> System.Net.Sockets.SocketException (10054): An existing connection was forcibly closed by the remote host.
It seems to imply that far end, so MS, rejected the connection.

I can't help but think it may have something to do with this network configuration.
OK, different approach, if you try the Custom SMTP and try a different SMTP server other than Microsoft, just as a test, does it work then?
 
Status
Not open for further replies.