mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-08-20 06:03:20 +00:00
feat(mail): download message as .eml file
This commit is contained in:
@@ -370,4 +370,24 @@
|
||||
return response;
|
||||
}
|
||||
|
||||
- (id <WOActionResults>) exportAction
|
||||
{
|
||||
NSString *disposition, *source;
|
||||
SOGoMailObject *co;
|
||||
WOResponse *response;
|
||||
|
||||
co = [self clientObject];
|
||||
source = [co contentAsString];
|
||||
|
||||
response = [self responseWithStatus: 200];
|
||||
[response setHeader: @"message/rfc822; charset=utf-8"
|
||||
forKey: @"content-type"];
|
||||
disposition = [NSString stringWithFormat: @"attachment; filename=\"%@.eml\"", [co nameInContainer]];
|
||||
[response setHeader: disposition forKey: @"Content-Disposition"];
|
||||
[response setContent: [source dataUsingEncoding: NSUTF8StringEncoding]];
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
|
||||
@end
|
||||
|
||||
Reference in New Issue
Block a user