+2005-01-26 Helge Hess <helge.hess@skyrix.com>
+
+ * v0.9.56
+
+ * SOGoMailManager.m, SOGoMailFolder.m: added method to save new
+ content in an SOGoMailFolder (to support #1054)
+
+ * SOGoMailAccount.m: minor code cleanup
+
2004-12-08 Marcus Mueller <znek@mulle-kybernetik.com>
* SOGoMailAccount.m, SOGoMailBaseObject.m, SOGoMailObject.m,
/*
- Copyright (C) 2004 SKYRIX Software AG
+ Copyright (C) 2004-2005 SKYRIX Software AG
This file is part of OpenGroupware.org.
/*
- Copyright (C) 2004 SKYRIX Software AG
+ Copyright (C) 2004-2005 SKYRIX Software AG
This file is part of OpenGroupware.org.
/*
- Copyright (C) 2004 SKYRIX Software AG
+ Copyright (C) 2004-2005 SKYRIX Software AG
This file is part of OpenGroupware.org.
Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA.
*/
-// $Id$
#ifndef __Mailer_SOGoDraftsFolder_H__
#define __Mailer_SOGoDraftsFolder_H__
/*
- Copyright (C) 2004 SKYRIX Software AG
+ Copyright (C) 2004-2005 SKYRIX Software AG
This file is part of OpenGroupware.org.
Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA.
*/
-// $Id: SOGoMailAccount.h 274 2004-08-26 13:10:49Z znek $
#ifndef __Mailer_SOGoMailAccount_H__
#define __Mailer_SOGoMailAccount_H__
/*
- Copyright (C) 2004 SKYRIX Software AG
+ Copyright (C) 2004-2005 SKYRIX Software AG
This file is part of OpenGroupware.org.
Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA.
*/
-// $Id: SOGoMailAccount.m 274 2004-08-26 13:10:49Z znek $
#include "SOGoMailAccount.h"
#include "SOGoMailFolder.h"
@implementation SOGoMailAccount
+static NSString *draftsFolderName = @"Drafts";
+static NSString *sieveFolderName = @"Filters";
+
/* listing the available folders */
- (NSArray *)toManyRelationshipKeys {
- (NSArray *)allFolderPathes {
NSArray *pathes;
-
+
pathes = [[self mailManager] allFoldersForURL:[self imap4URL]
password:[self imap4Password]];
pathes = [pathes sortedArrayUsingSelector:@selector(compare:)];
// TODO: those should be product.plist bindings? (can't be class bindings
// though because they are 'per-account')
- if ([_key isEqualToString:@"Drafts"]) {
+ if ([_key isEqualToString:draftsFolderName]) {
if ((obj = [self lookupDraftsFolder:_key inContext:_ctx]) != nil)
return obj;
}
- if ([_key isEqualToString:@"Filters"]) {
+ if ([_key isEqualToString:sieveFolderName]) {
if ((obj = [self lookupFiltersFolder:_key inContext:_ctx]) != nil)
return obj;
}
/*
- Copyright (C) 2004 SKYRIX Software AG
+ Copyright (C) 2004-2005 SKYRIX Software AG
This file is part of OpenGroupware.org.
/*
- Copyright (C) 2004 SKYRIX Software AG
+ Copyright (C) 2004-2005 SKYRIX Software AG
This file is part of OpenGroupware.org.
Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA.
*/
-// $Id$
#include "SOGoMailBaseObject.h"
#include "SOGoMailManager.h"
/*
- Copyright (C) 2004 SKYRIX Software AG
+ Copyright (C) 2004-2005 SKYRIX Software AG
This file is part of OpenGroupware.org.
The SOGoMailFolder maps to an IMAP4 folder from NGImap4.
*/
-@class NSArray;
+@class NSData, NSArray, NSException;
@interface SOGoMailFolder : SOGoMailBaseObject
{
- (NSArray *)fetchUIDsMatchingQualifier:(id)_q sortOrdering:(id)_so;
- (NSArray *)fetchUIDs:(NSArray *)_uids parts:(NSArray *)_parts;
+- (NSException *)postData:(NSData *)_data flags:(id)_flags;
+
@end
#endif /* __Mailer_SOGoMailFolder_H__ */
/*
- Copyright (C) 2004 SKYRIX Software AG
+ Copyright (C) 2004-2005 SKYRIX Software AG
This file is part of OpenGroupware.org.
Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA.
*/
-// $Id$
#include "SOGoMailFolder.h"
#include "SOGoMailObject.h"
password:[self imap4Password]];
}
+- (NSException *)postData:(NSData *)_data flags:(id)_flags {
+ return [[self mailManager] postData:_data flags:_flags
+ toFolderURL:[self imap4URL]
+ password:[self imap4Password]];
+}
+
/* name lookup */
- (BOOL)isMessageKey:(NSString *)_key inContext:(id)_ctx {
/*
- Copyright (C) 2004 SKYRIX Software AG
+ Copyright (C) 2004-2005 SKYRIX Software AG
This file is part of OpenGroupware.org.
- (NSException *)addFlags:(id)_f toURL:(NSURL *)_u password:(NSString *)_p;
- (NSException *)removeFlags:(id)_f toURL:(NSURL *)_u password:(NSString *)_p;
+- (NSException *)postData:(NSData *)_data flags:(id)_flags
+ toFolderURL:(NSURL *)_url password:(NSString *)_p;
+
/* managing folders */
- (NSException *)createMailbox:(NSString *)_mailbox atURL:(NSURL *)_url
/*
- Copyright (C) 2004 SKYRIX Software AG
+ Copyright (C) 2004-2005 SKYRIX Software AG
This file is part of OpenGroupware.org.
return [self addOrRemove:NO flags:_f toURL:_u password:_p];
}
+- (NSException *)postData:(NSData *)_data flags:(id)_f
+ toFolderURL:(NSURL *)_url password:(NSString *)_p
+{
+ NGImap4Client *client;
+ id result;
+
+ if (![_url isNotNull]) return nil;
+ if (![_f isNotNull]) _f = [NSArray array];
+
+ if ((client = [self imap4ClientForURL:_url password:_p]) == nil)
+ return nil;
+
+ if (![_f isKindOfClass:[NSArray class]])
+ _f = [NSArray arrayWithObjects:&_f count:1];
+
+ result = [client append:_data
+ toFolder:[self imap4FolderNameForURL:_url]
+ withFlags:_f];
+ if (![[result valueForKey:@"result"] boolValue]) {
+ [self logWithFormat:@"DEBUG: fail result %@", result];
+ return [NSException exceptionWithHTTPStatus:500 /* server error */
+ reason:@"failed to store message to IMAP4 message"];
+ }
+ /* result contains 'fetch' key with the current flags */
+ return nil;
+}
+
/* managing folders */
- (BOOL)isPermissionDeniedResult:(id)_result {
# Version file
-SUBMINOR_VERSION:=55
+SUBMINOR_VERSION:=56
# v0.9.55 requires NGExtensions v4.5.136
# v0.9.44 requires libNGMime v4.3.194
2005-01-26 Helge Hess <helge.hess@skyrix.com>
+ * v0.9.75
+
+ * UIxMailEditor.m: copy sent mails to INBOX/Sent folder, fixes issue
+ #1054
+
+ * product.plist: disabled unsupported delete button in mailviewer
+
* UIxMailListView.wox: removed unused mail checkboxes and folder-tree
popup (#1211) (v0.9.74)
*/
@class NSArray, NSString;
+@class SOGoMailFolder;
@interface UIxMailEditor : UIxComponent
{
NSArray *bcc;
NSString *subject;
NSString *text;
+ SOGoMailFolder *sentFolder;
}
@end
#include <SOGo/SoObjects/Mailer/SOGoDraftObject.h>
+#include <SOGo/SoObjects/Mailer/SOGoMailFolder.h>
+#include <SOGo/SoObjects/Mailer/SOGoMailAccount.h>
#include <NGMail/NGMimeMessage.h>
#include <NGMail/NGMimeMessageGenerator.h>
#include "common.h"
@implementation UIxMailEditor
static BOOL keepMailTmpFile = NO;
-static BOOL keepDraftAfterSend = NO;
static NSArray *infoKeys = nil;
+ (void)initialize {
@"subject", @"text", @"to", @"cc", @"bcc",
@"from", @"replyTo",
nil];
-
+
if (keepMailTmpFile)
NSLog(@"WARNING: keeping mail files.");
}
- (void)dealloc {
+ [self->sentFolder release];
[self->text release];
[self->subject release];
[self->to release];
return nil;
}
+- (id)lookupSentFolder {
+ /* lookup INBOX/Sent folder */
+ SOGoMailAccount *account;
+ SOGoMailFolder *folder;
+
+ if (self->sentFolder != nil)
+ return self;
+
+ account = [[self clientObject] mailAccountFolder];
+ if ([account isKindOfClass:[NSException class]]) return account;
+
+ folder = [account lookupName:@"INBOX" inContext:[self context] acquire:NO];
+ if ([folder isKindOfClass:[NSException class]]) return folder;
+
+ folder = [folder lookupName:@"Sent" inContext:[self context] acquire:NO];
+ if ([folder isKindOfClass:[NSException class]]) return folder;
+
+ if (![folder isNotNull]) {
+ return [NSException exceptionWithHTTPStatus:500 /* server error */
+ reason:@"did not find Sent folder!"];
+ }
+
+ self->sentFolder = [folder retain];
+ return self->sentFolder;
+}
+
- (NSException *)storeMailInSentFolder:(NSString *)_path {
- [self logWithFormat:@"TODO: store mail in Sent folder: %@", _path];
- return nil;
+ SOGoMailFolder *folder;
+ NSData *data;
+ id result;
+
+ folder = [self lookupSentFolder];
+ if ([folder isKindOfClass:[NSException class]]) return (id)folder;
+
+ if ((data = [[NSData alloc] initWithContentsOfMappedFile:_path]) == nil) {
+ return [NSException exceptionWithHTTPStatus:500 /* server error */
+ reason:@"could not temporary draft file!"];
+ }
+
+ result = [folder postData:data flags:@"seen"];
+ [data release]; data = nil;
+ return result;
}
/* actions */
/* delete draft */
- if (keepDraftAfterSend) {
- [self warnWithFormat:@"keeping draft object: '%@'",
- [self clientObject]];
- }
- else if ((error = [[self clientObject] delete]) != nil)
+ if ((error = [[self clientObject] delete]) != nil)
return error;
-
+
// if everything is ok, close the window (send a JS closing the Window)
return [self pageWithName:@"UIxMailWindowCloser"];
}
/*
- Copyright (C) 2004 SKYRIX Software AG
+ Copyright (C) 2004-2005 SKYRIX Software AG
This file is part of OpenGroupware.org.
# version file
-SUBMINOR_VERSION:=74
+SUBMINOR_VERSION:=75
-# v0.9.70 requires NGExtensions v4.5.136
-# v0.9.69 requires libNGMime v4.5.203
-# v0.9.50 requires libNGMime v4.3.190
-# v0.9.43 requires libNGObjWeb v4.3.73
-# v0.9.42 requires libNGObjWeb v4.3.72
+# v0.9.74 requires SoObjects/Mailer v0.9.56
+# v0.9.70 requires NGExtensions v4.5.136
+# v0.9.69 requires libNGMime v4.5.203
+# v0.9.50 requires libNGMime v4.3.190
+# v0.9.43 requires libNGObjWeb v4.3.73
+# v0.9.42 requires libNGObjWeb v4.3.72
{ link = "#"; cssClass = "tbicon_forward"; label = "Forward"; },
),
*/
- ( /* third group */
+/* TODO: enable when implemented
+ ( // third group
+// TODO: enable when delete works (#1212)
{ link = "#";
cssClass = "tbicon_delete"; label = "Delete"; },
-/* TODO: enable when we know how to mark junk (#971)
+// TODO: enable when we know how to mark junk (#971)
{ link = "#";
cssClass = "tbicon_junk"; label = "Junk"; },
-*/
),
+*/
( /* fourth group */
/* TODO: enable when we can print (#1207)
{ link = "#"; cssClass = "tbicon_print"; label = "Print"; },
cssClass = "tbicon_forward"; label = "Forward"; },
),
*/
- ( /* third group */
+/* TODO: enable when implemented
+ ( // third group
+// TODO: enable when delete works (#1212)
{ link = "#";
cssClass = "tbicon_delete"; label = "Delete"; },
-/* TODO: enable when we know how to mark junk (#971)
+// TODO: enable when we know how to mark junk (#971)
{ link = "#";
cssClass = "tbicon_junk"; label = "Junk"; },
-*/
),
+*/
( /* fourth group */
/* TODO: enable when we can print (#1207)
{ link = "#"; cssClass = "tbicon_print"; label = "Print"; },