View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0003774 | SOGo | ActiveSync | public | 2016-07-23 19:55 | 2017-07-05 03:08 |
Reporter | alexeilevinzon | Assigned To | ludovic | ||
Priority | high | Severity | crash | Reproducibility | always |
Status | resolved | Resolution | fixed | ||
Platform | [Server] Linux | OS | RHEL/CentOS | OS Version | 6 |
Product Version | 3.1.4 | ||||
Fixed in Version | 3.2.0 | ||||
Summary | 0003774: Sogo AES not reporting outlook about SMTP code '554' | ||||
Description | Sogo AES not reporting back to outlook about 554 error. When the message is not sent by postfix, and error 554 returned, sogo not report it to outlook. the message stays in outlook and outlook tries to resend it every minute. in smpt its works, outlook process the message and return back message that the mail not sent, but in aes its got no report and keep try to resend the message for ever. | ||||
Additional Information | thats what i got in sogo log: Jul 23 02:40:32 sogod [18139]: |SOGo| starting method 'POST' on uri '/SOGo/Microsoft-Server-ActiveSync?Cmd=SendMail&User=10@barcol.pw&DeviceId=B713B26DE524468096AC3D8FB194FF79&DeviceType=WindowsOutlook15' Jul 23 02:40:32 sogod [18147]: <0x0x7fa2e5181788[SOGoActiveSyncDispatcher]> Sleeping 15 seconds while detecting changes in Ping... Jul 23 02:40:33 sogod [18139]: [ERROR] <0x0x7fa2e56af7c8[NSMutableDataMalloc]> Original data written to: /tmp/localhost4_46db_1d4348a5_1.data and thats waht i got in /tmp/localhost4_46db_1d4348a5_1.data FATAL ERROR occured during SendMail | ||||
Tags | No tags attached. | ||||
SOGo should return the original SMTP code (and text) to the MUA. |
|
I'd like to add some more details about this issue since the reporter is an iRedMail user.We have blacklisting for outbound email, and this user is not allowed to send email to, for example, @gmail.com. So when he tries to send email to <someone>@gmail.com on SOGo web UI, the mail will be rejected with SMTP code/text "554 REJECT Blacklisted", SOGo web ui reports error like "All recipients are invalid". If send with Outlook (via ActiveSync), then mail cannot be sent out, and Outlook slightly defers it and keep trying to send it out again and again in the background, until raise a error which causes user really confused. According to the debug message (pasted in reporter's post), SOGo didn't send the original SMTP code/text to Outlook, so this is the root cause. |
|
Currently, when sendMail fails the requests returns with a HTTP-500. |
|
3774.diff (4,568 bytes)
diff --git a/ActiveSync/SOGoActiveSyncDispatcher.m b/ActiveSync/SOGoActiveSyncDispatcher.m index 20c5ba6..bd43069 100644 --- a/ActiveSync/SOGoActiveSyncDispatcher.m +++ b/ActiveSync/SOGoActiveSyncDispatcher.m @@ -2925,7 +2925,7 @@ void handle_eas_terminate(int signum) from = [message headersForKey: @"from"]; - from = [NSMutableArray arrayWithObject: @"lala@lala.com"]; + //from = [NSMutableArray arrayWithObject: @"lala@lala.com"]; if (![from count] || ![self _isEMailValid: [[from objectAtIndex: 0] pureEMailAddress]] || [[[from objectAtIndex: 0] pureEMailAddress] isEqualToString: [from objectAtIndex: 0]] || @@ -2950,7 +2950,7 @@ void handle_eas_terminate(int signum) else new_from_header = [[NSString stringWithFormat: @"From: %@\r\n", email] dataUsingEncoding: NSUTF8StringEncoding]; - new_from_header = [[NSString stringWithString:@"lala@lala.com"] dataUsingEncoding: NSUTF8StringEncoding]; +// new_from_header = [[NSString stringWithString:@"lala@lala.com"] dataUsingEncoding: NSUTF8StringEncoding]; bytes = [data bytes]; len = [data length]; @@ -3026,8 +3026,28 @@ void handle_eas_terminate(int signum) if (error) { - [theResponse setStatus: 500]; - [theResponse appendContentString: @"FATAL ERROR occured during SendMail"]; + if ([[context objectForKey: @"ASProtocolVersion"] floatValue] >= 14.0) + { + NSMutableString *s; + NSData *d; + + s = [NSMutableString string]; + + [s appendString: @"<?xml version=\"1.0\" encoding=\"utf-8\"?>"]; + [s appendString: @"<!DOCTYPE ActiveSync PUBLIC \"-//MICROSOFT//DTD ActiveSync//EN\" \"http://www.microsoft.com/\">"]; + [s appendString: @"<SendMail xmlns=\"ComposeMail:\">"]; + [s appendString: @"<Status>120</Status>"]; + [s appendString: @"</SendMail>"]; + + d = [[s dataUsingEncoding: NSUTF8StringEncoding] xml2wbxml]; + + [theResponse setContent: d]; + } + else + { + [theResponse setStatus: 500]; + [theResponse appendContentString: @"FATAL ERROR occured during SendMail"]; + } } } @@ -3534,8 +3554,28 @@ void handle_eas_terminate(int signum) if (error) { - [theResponse setStatus: 500]; - [theResponse appendContentString: @"FATAL ERROR occured during SmartForward"]; + if ([[context objectForKey: @"ASProtocolVersion"] floatValue] >= 14.0) + { + NSMutableString *s; + NSData *d; + + s = [NSMutableString string]; + + [s appendString: @"<?xml version=\"1.0\" encoding=\"utf-8\"?>"]; + [s appendString: @"<!DOCTYPE ActiveSync PUBLIC \"-//MICROSOFT//DTD ActiveSync//EN\" \"http://www.microsoft.com/\">"]; + [s appendFormat: @"<%@ xmlns=\"ComposeMail:\">", (isSmartForward) ? @"SmartForward" : @"SmartReply"]; + [s appendString: @"<Status>120</Status>"]; + [s appendFormat: @"</%@>", (isSmartForward) ? @"SmartForward" : @"SmartReply"]; + + d = [[s dataUsingEncoding: NSUTF8StringEncoding] xml2wbxml]; + + [theResponse setContent: d]; + } + else + { + [theResponse setStatus: 500]; + [theResponse appendContentString: @"FATAL ERROR occured during SmartForward"]; + } } else if (!isSmartForward) { @@ -3743,7 +3783,7 @@ void handle_eas_terminate(int signum) [theResponse setHeader: @"Sync,SendMail,SmartForward,SmartReply,GetAttachment,GetHierarchy,CreateCollection,DeleteCollection,MoveCollection,FolderSync,FolderCreate,FolderDelete,FolderUpdate,MoveItems,GetItemEstimate,MeetingResponse,Search,Settings,Ping,ItemOperations,ResolveRecipients,ValidateCert" forKey: @"MS-ASProtocolCommands"]; [theResponse setHeader: @"2.5,12.0,12.1,14.0,14.1" forKey: @"MS-ASProtocolVersions"]; - if (debugOn && [[theResponse headerForKey: @"Content-Type"] isEqualToString:@"application/vnd.ms-sync.wbxml"] && [[theResponse content] length]) + if (debugOn && [[theResponse headerForKey: @"Content-Type"] isEqualToString:@"application/vnd.ms-sync.wbxml"] && [[theResponse content] length] && !([(WOResponse *)theResponse status] == 500)) [self logWithFormat: @"EAS - response for device %@: %@", [context objectForKey: @"DeviceId"], [[[NSString alloc] initWithData: [[theResponse content] wbxml2xml] encoding: NSUTF8StringEncoding] autorelease]]; RELEASE(context); |
|
any news on this issue? |
|
I think it is the same issue, here is what I got in my sogo.log: Sep 20 15:15:31 sogod [66]: nginx-mail_2.mail "POST /SOGo/Microsoft-Server-ActiveSync?Cmd=Sync&User=user@domain&DeviceId=SEC1C150B835F637&DeviceType=SAMSUNGGTI8552B HTTP/1.1" 200 12/18 0.045 - - 140K Sep 20 15:15:33 sogod [66]: [ERROR] <0x0x5593fabb3c10[NSMutableDataMalloc]> Original data written to: /tmp/d495ff03feb8_42_1d91b443_1.data In my case, the file .data is a binary file. |
|
No, send it to me privately - gzip -9 it before. |
|
Hello, I updated to 3.2 (where the issue should be fixed). thats what I see in the logs: Outlook version 2016 the outlook should stop to resend the email and notify me that there is an error or something... Thanks |
|
Ask Microsoft to do that, not us. If Outlook keeps trying to send the mail, there's nothing SOGo can do about this. We report the proper error code. |
|
sogo: master 9bbffe48 2016-09-23 11:28 Details Diff |
(fix) handle 120 EAS status code when message submission fails (fixes 0003774) |
Affected Issues 0003774 |
|
mod - ActiveSync/SOGoActiveSyncDispatcher.m | Diff File | ||
sogo: v2 8c81d550 2016-09-23 11:28 Details Diff |
(fix) handle 120 EAS status code when message submission fails (fixes 0003774) |
Affected Issues 0003774 |
|
mod - ActiveSync/SOGoActiveSyncDispatcher.m | Diff File |
Date Modified | Username | Field | Change |
---|---|---|---|
2016-07-23 19:55 | alexeilevinzon | New Issue | |
2016-07-25 02:12 | zhb | Note Added: 0010539 | |
2016-07-25 02:30 | zhb | Note Added: 0010540 | |
2016-07-25 07:32 | tfu | Note Added: 0010542 | |
2016-07-25 07:35 | tfu | File Added: 3774.diff | |
2016-09-11 08:18 | alexeilevinzon | Note Added: 0010640 | |
2016-09-20 19:05 | emilio.fonseca | Note Added: 0010650 | |
2016-09-20 19:06 | ludovic | Note Added: 0010651 | |
2016-09-23 15:30 | ludovic | Changeset attached | => sogo master 9bbffe48 |
2016-09-23 15:30 | ludovic | Assigned To | => ludovic |
2016-09-23 15:30 | ludovic | Resolution | open => fixed |
2016-09-23 15:32 | ludovic | Changeset attached | => sogo v2 8c81d550 |
2016-09-23 15:34 | ludovic | Status | new => resolved |
2016-09-23 15:34 | ludovic | Fixed in Version | => 3.2.0 |
2016-10-05 20:05 | alexeilevinzon | Note Added: 0010722 | |
2016-10-05 20:05 | alexeilevinzon | Status | resolved => feedback |
2016-10-05 20:05 | alexeilevinzon | Resolution | fixed => reopened |
2016-10-05 20:07 | ludovic | Note Added: 0010723 | |
2016-10-05 20:07 | ludovic | Status | feedback => resolved |
2016-10-05 20:07 | ludovic | Resolution | reopened => fixed |