SOGoOtherUsersFolderName IMAP4-Name
- corresponds to the Cyrus setting: userprefix
-SOGoInternetMailSuffix String - suffix to add to mails sent via Internet
+SOGoInternetMailSuffix String-Pattern
+ - suffix to add to mails sent via Internet
- eg: -SOGoInternetMailSuffix \
'"*** This email was composed using SOGo on the public Internet ***"'
+ you can access request values inside the pattern, eg:
+ "$headers.host$"
static NSString *userAgent = @"SOGoMail 1.0";
static BOOL draftDeleteDisabled = NO; // for debugging
static BOOL debugOn = NO;
-static BOOL showTextAttachmentsInline = NO;
-static NSString *fromInternetSuffix = nil;
-static NSData *fromInternetSuffixData = nil;
+static BOOL showTextAttachmentsInline = NO;
+static NSString *fromInternetSuffixPattern = nil;
+ (int)version {
return [super version] + 0 /* v1 */;
if ((draftDeleteDisabled = [ud boolForKey:@"SOGoNoDraftDeleteAfterSend"]))
NSLog(@"WARNING: draft delete is disabled! (SOGoNoDraftDeleteAfterSend)");
- fromInternetSuffix = [ud stringForKey:@"SOGoInternetMailSuffix"];
- if ([fromInternetSuffix length] == 0)
+ fromInternetSuffixPattern = [ud stringForKey:@"SOGoInternetMailSuffix"];
+ if ([fromInternetSuffixPattern length] == 0)
NSLog(@"Note: no 'SOGoInternetMailSuffix' is configured.");
else {
- fromInternetSuffix = [@"\n" stringByAppendingString:fromInternetSuffix];
- fromInternetSuffixData =
- [fromInternetSuffix dataUsingEncoding:NSUTF8StringEncoding];
+ fromInternetSuffixPattern =
+ [@"\n" stringByAppendingString:fromInternetSuffixPattern];
}
TextPlainType = [[NGMimeType mimeType:@"text" subType:@"plain"] copy];
- (NGMimeMessage *)mimeMessageForContentWithHeaderMap:(NGMutableHashMap *)map {
NSDictionary *lInfo;
NGMimeMessage *message;
- BOOL addSuffix;
- id body;
+ WOContext *ctx;
+ NSString *fromInternetSuffix;
+ BOOL addSuffix;
+ id body;
if ((lInfo = [self fetchInfo]) == nil)
return nil;
- addSuffix =
- [[[WOApplication application] context] isAccessFromIntranet] ? NO : YES;
- if (addSuffix)
+ ctx = [[WOApplication application] context];
+ addSuffix = [ctx isAccessFromIntranet] ? NO : YES;
+ if (addSuffix) {
+ fromInternetSuffix =
+ [fromInternetSuffixPattern stringByReplacingVariablesWithBindings:
+ [ctx request]
+ stringForUnknownBindings:@""];
+
addSuffix = [fromInternetSuffix length] > 0 ? YES : NO;
+ }
[map setObject:@"text/plain" forKey:@"content-type"];
if ((body = [lInfo objectForKey:@"text"]) != nil) {
}
else if ([body isKindOfClass:[NSData class]] && addSuffix) {
body = [[body mutableCopy] autorelease];
- [(NSMutableData *)body appendData:fromInternetSuffixData];
+ [(NSMutableData *)body appendData:
+ [fromInternetSuffix dataUsingEncoding:
+ NSUTF8StringEncoding]];
}
else if (addSuffix) {
[self warnWithFormat:@"Note: cannot add Internet marker to body: %@",
}
}
else if (addSuffix)
- body = fromInternetSuffixData;
+ body = [fromInternetSuffix dataUsingEncoding:NSUTF8StringEncoding];
message = [[[NGMimeMessage alloc] initWithHeader:map] autorelease];
[message setBody:body];
# Version file
-SUBMINOR_VERSION:=110
+SUBMINOR_VERSION:=111
-# v0.9.96 requires libNGMime v4.5.223
-# v0.9.91 requires libNGMime v4.5.222
-# v0.9.69 requires libNGMime v4.5.210
-# v0.9.55 requires libNGExtensions v4.5.136
-# v0.9.44 requires libNGMime v4.3.194
-# v0.9.41 requires libNGMime v4.3.190
-# v0.9.35 requires libSOGoLogic v0.9.24
-# v0.9.34 requires libSOGoLogic v0.9.22
+# v0.9.111 requires libNGExtensions v4.5.163
+# v0.9.96 requires libNGMime v4.5.223
+# v0.9.91 requires libNGMime v4.5.222
+# v0.9.69 requires libNGMime v4.5.210
+# v0.9.55 requires libNGExtensions v4.5.136
+# v0.9.44 requires libNGMime v4.3.194
+# v0.9.41 requires libNGMime v4.3.190
+# v0.9.35 requires libSOGoLogic v0.9.24
+# v0.9.34 requires libSOGoLogic v0.9.22