see ChangeLog

Monotone-Revision: 9054022ef1ca8aeba6e34842d27d9b94ce002b89

Monotone-Author: dev-unix.inverse.qc.ca
Monotone-Date: 2006-06-15T19:34:10
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
dev-unix.inverse.qc.ca committed 2006-06-15 19:34:10 +00:00
commit f18c764ffa
965 files changed
+99196

No files matched your search

+45
View File
@@ -0,0 +1,45 @@
2005-07-15 Helge Hess <helge.hess@opengroupware.org>
* SOGoSieveScriptObject.m: fixed a gcc 4.0 warning (v0.9.11)
2005-07-11 Helge Hess <helge.hess@opengroupware.org>
* SOGoSieveBaseObject.[hm]: removed unused -imap4Client method
(v0.9.10)
* SOGoSieveBaseObject.m: updated to use new NGImap4 API (v0.9.9)
2005-02-10 Helge Hess <helge.hess@opengroupware.org>
* SOGoSieveScriptObject.m: fixed a compile warning on MacOSX (v0.9.8)
2005-02-06 Helge Hess <helge.hess@opengroupware.org>
* SOGoSieveScriptObject.m, SOGoSieveScriptsFolder.m: assigned
folder/message class (v0.9.7)
2005-01-30 Helge Hess <helge.hess@opengroupware.org>
* SOGoSieveScriptObject.m: implemented Sieve script upload (v0.9.6)
* some work on script upload (v0.9.5)
2004-12-03 Helge Hess <helge.hess@skyrix.com>
* SOGoSieveScriptObject.m, SOGoSieveScriptsFolder.m: added script
activation action (v0.9.4)
* v0.9.3
* SOGoSieveScriptObject.m: added ability to fetch content
* SOGoSieveScriptsFolder.m: added ability to lookup/construct
SOGoSieveScriptObject's
2004-11-28 Helge Hess <helge.hess@skyrix.com>
* added list capability, does not work with 'dotted' logins? (v0.9.2)
2004-11-27 Helge Hess <helge.hess@skyrix.com>
* started Sieve product
+22
View File
@@ -0,0 +1,22 @@
# GNUstep makefile
include ../common.make
BUNDLE_NAME = Sieve
Sieve_PRINCIPAL_CLASS = SOGoSieveProduct
Sieve_OBJC_FILES += \
Product.m \
SOGoSieveBaseObject.m \
SOGoSieveScriptsFolder.m\
SOGoSieveScriptObject.m \
Sieve_RESOURCE_FILES += \
Version \
product.plist \
-include GNUmakefile.preamble
include $(GNUSTEP_MAKEFILES)/bundle.make
-include GNUmakefile.postamble
include ../../fhsbundle.make
+3
View File
@@ -0,0 +1,3 @@
# compilation settings
ADDITIONAL_INCLUDE_DIRS += -I../Mailer
+32
View File
@@ -0,0 +1,32 @@
/*
Copyright (C) 2004 SKYRIX Software AG
This file is part of OpenGroupware.org.
OGo is free software; you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the
Free Software Foundation; either version 2, or (at your option) any
later version.
OGo is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
License for more details.
You should have received a copy of the GNU Lesser General Public
License along with OGo; see the file COPYING. If not, write to the
Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA.
*/
#import <Foundation/NSObject.h>
@interface SOGoSieveProduct : NSObject
{
}
@end
@implementation SOGoSieveProduct
@end /* SOGoSieveProduct */
+8
View File
@@ -0,0 +1,8 @@
# README for Sieve SoObjects
Class Overview
==============
Defaults
========
+60
View File
@@ -0,0 +1,60 @@
/*
Copyright (C) 2004-2005 SKYRIX Software AG
This file is part of OpenGroupware.org.
OGo is free software; you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the
Free Software Foundation; either version 2, or (at your option) any
later version.
OGo is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
License for more details.
You should have received a copy of the GNU Lesser General Public
License along with OGo; see the file COPYING. If not, write to the
Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA.
*/
#ifndef __Sieve_SOGoSieveBaseObject_H__
#define __Sieve_SOGoSieveBaseObject_H__
#include <SOGo/SOGoObject.h>
/*
SOGoSieveBaseObject
Common base class for Sieve SoObjects.
*/
@class NSString, NSArray, NSURL;
@class NGSieveClient;
@class NGImap4ConnectionManager;
@class SOGoMailAccount;
@interface SOGoSieveBaseObject : SOGoObject
{
NGSieveClient *sieveClient;
}
/* hierarchy */
- (SOGoMailAccount *)mailAccountFolder;
/* IMAP4 */
- (NGImap4ConnectionManager *)mailManager;
- (NSURL *)imap4URL;
- (NSString *)imap4Password;
- (void)flushMailCaches;
/* Sieve */
- (NGSieveClient *)sieveClient;
@end
#endif /* __Sieve_SOGoSieveBaseObject_H__ */
+117
View File
@@ -0,0 +1,117 @@
/*
Copyright (C) 2004-2005 SKYRIX Software AG
This file is part of OpenGroupware.org.
OGo is free software; you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the
Free Software Foundation; either version 2, or (at your option) any
later version.
OGo is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
License for more details.
You should have received a copy of the GNU Lesser General Public
License along with OGo; see the file COPYING. If not, write to the
Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA.
*/
#include "SOGoSieveBaseObject.h"
#include <Mailer/SOGoMailManager.h>
#include <Mailer/SOGoMailAccount.h>
#include "common.h"
#include <NGImap4/NGSieveClient.h>
#include <NGObjWeb/SoObject+SoDAV.h>
#include <NGObjWeb/SoHTTPAuthenticator.h>
#include <NGExtensions/NSURL+misc.h>
@implementation SOGoSieveBaseObject
- (void)dealloc {
[self->sieveClient release];
[super dealloc];
}
/* hierarchy */
- (SOGoMailAccount *)mailAccountFolder {
if (![[self container] respondsToSelector:_cmd]) {
[self logWithFormat:@"WARNING: weird container of mailfolder: %@",
[self container]];
return nil;
}
return [[self container] mailAccountFolder];
}
/* IMAP4 */
- (NGImap4ConnectionManager *)mailManager {
return [[self mailAccountFolder] mailManager];
}
- (NSURL *)imap4URL {
return [[self mailAccountFolder] imap4URL];
}
- (NSString *)imap4Password {
return [[self mailAccountFolder] imap4Password];
}
- (void)flushMailCaches {
}
/* Sieve */
- (NGSieveClient *)sieveClient {
id res;
if (self->sieveClient != nil)
return self->sieveClient;
/* check container */
res = [self container];
if ([res respondsToSelector:_cmd]) {
if ((res = [res sieveClient]) != nil) {
self->sieveClient = [res retain];
return self->sieveClient;
}
}
/* create client */
self->sieveClient =
[[NGSieveClient alloc] initWithHost:[[self imap4URL] host]];
if (self->sieveClient == nil)
return nil;
/* login */
res = [self->sieveClient
login:[[self imap4URL] user]
password:[self imap4Password]];
if (![[res valueForKey:@"result"] boolValue]) {
[self logWithFormat:
@"ERROR: could not login '%@'(%@) into Sieve server: %@: %@",
[[self imap4URL] user], [self imap4Password],
self->sieveClient, res];
[self->sieveClient release]; self->sieveClient = nil;
return nil;
}
return self->sieveClient;
}
/* debugging */
- (NSString *)loggingPrefix {
/* improve perf ... */
return [NSString stringWithFormat:@"<0x%08X[%@]:%@>",
self, NSStringFromClass([self class]),
[self nameInContainer]];
}
@end /* SOGoSieveBaseObject */
+50
View File
@@ -0,0 +1,50 @@
/*
Copyright (C) 2004-2005 SKYRIX Software AG
This file is part of OpenGroupware.org.
OGo is free software; you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the
Free Software Foundation; either version 2, or (at your option) any
later version.
OGo is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
License for more details.
You should have received a copy of the GNU Lesser General Public
License along with OGo; see the file COPYING. If not, write to the
Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA.
*/
#ifndef __Sieve_SOGoSieveScriptObject_H__
#define __Sieve_SOGoSieveScriptObject_H__
#include "SOGoSieveBaseObject.h"
/*
SOGoSieveScriptObject
Parent object: SOGoSieveScriptsFolder
Child objects: none
The SOGoSieveScriptObject represents a single sieve script on a Cyrus folder.
*/
@class NSData, NSString, NSException;
@interface SOGoSieveScriptObject : SOGoSieveBaseObject
{
}
/* content */
- (NSString *)contentAsString;
- (NSData *)content;
- (NSException *)writeContent:(id)_content;
@end
#endif /* __Sieve_SOGoSieveScriptObject_H__ */
+139
View File
@@ -0,0 +1,139 @@
/*
Copyright (C) 2004-2005 SKYRIX Software AG
This file is part of OpenGroupware.org.
OGo is free software; you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the
Free Software Foundation; either version 2, or (at your option) any
later version.
OGo is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
License for more details.
You should have received a copy of the GNU Lesser General Public
License along with OGo; see the file COPYING. If not, write to the
Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA.
*/
#include "SOGoSieveScriptObject.h"
#include "SOGoSieveScriptsFolder.h"
#include "common.h"
#include <NGImap4/NGSieveClient.h>
@implementation SOGoSieveScriptObject
/* script */
- (NSString *)fetchScript {
NGSieveClient *client;
if ((client = [self sieveClient]) == nil)
return nil;
return [client getScript:[self nameInContainer]];
}
/* content */
- (NSString *)contentAsString {
return [self fetchScript];
}
- (NSData *)content {
return [[self contentAsString] dataUsingEncoding:NSUTF8StringEncoding];
}
- (NSException *)exceptionForFailedPutResult:(NSDictionary *)_result {
NSString *reason;
/* Note: valueForKey:@"reason" does not work?! */
reason = [(NSDictionary *)[_result valueForKey:@"RawResponse"]
objectForKey:@"reason"];
if (![reason isNotNull])
reason = @"Failed to upload Sieve script.";
return [NSException exceptionWithHTTPStatus:500 /* Server Error */
reason:reason];
}
- (NSException *)writeContent:(id)_content {
NGSieveClient *client;
NSDictionary *result;
if (_content == nil) {
return [NSException exceptionWithHTTPStatus:400 /* Bad Request */
reason:@"Missing content to write!"];
}
if ((client = [self sieveClient]) == nil) {
return [NSException exceptionWithHTTPStatus:500 /* Server Error */
reason:@"Failed to create NGSieveClient object"];
}
result = [client putScript:[self nameInContainer] script:_content];
if (![[result valueForKey:@"result"] boolValue])
return [self exceptionForFailedPutResult:result];
return nil; /* everything is great */
}
/* operations */
- (NSException *)delete {
NSDictionary *res;
NSString *r;
res = [[self sieveClient] deleteScript:[self nameInContainer]];
if ([[res valueForKey:@"result"] boolValue])
return nil;
// TODO: make it a debug log
[self logWithFormat:@"sieve delete failed: %@", res];
r = [@"Sieve delete failed: " stringByAppendingString:[res description]];
return [NSException exceptionWithHTTPStatus:500 /* Server Error */
reason:r];
}
- (NSException *)activate {
return [[self container] activateScript:[self nameInContainer]];
}
/* name lookup */
- (id)lookupName:(NSString *)_key inContext:(id)_ctx acquire:(BOOL)_flag {
id obj;
/* first check attributes directly bound to the object */
if ((obj = [super lookupName:_key inContext:_ctx acquire:NO]))
return obj;
/* return 404 to stop acquisition */
return [NSException exceptionWithHTTPStatus:404 /* Not Found */];
}
/* operations */
- (id)PUTAction:(id)_context {
NSException *e;
NSString *content;
content = [[(WOContext *)_context request] contentAsString];
if ((e = [self writeContent:content]))
return e;
return self;
}
/* message type */
- (NSString *)outlookMessageClass {
return @"IPM.Filter";
}
@end /* SOGoSieveScriptObject */
+50
View File
@@ -0,0 +1,50 @@
/*
Copyright (C) 2004 SKYRIX Software AG
This file is part of OpenGroupware.org.
OGo is free software; you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the
Free Software Foundation; either version 2, or (at your option) any
later version.
OGo is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
License for more details.
You should have received a copy of the GNU Lesser General Public
License along with OGo; see the file COPYING. If not, write to the
Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA.
*/
#ifndef __Sieve_SOGoSieveScriptsFolder_H__
#define __Sieve_SOGoSieveScriptsFolder_H__
#include "SOGoSieveBaseObject.h"
/*
SOGoSieveScriptsFolder
Parent object: the SOGoMailAccount
Child objects: SOGoSieveScriptObject
The SOGoSieveScriptsFolder represents a list of sieve scripts on a Cyrus
server.
*/
@class NSString, NSException, NSDictionary;
@interface SOGoSieveScriptsFolder : SOGoSieveBaseObject
{
NSDictionary *listedScripts;
}
/* operations */
- (NSException *)activateScript:(NSString *)_name;
@end
#endif /* __Sieve_SOGoSieveScriptsFolder_H__ */
+98
View File
@@ -0,0 +1,98 @@
/*
Copyright (C) 2004 SKYRIX Software AG
This file is part of OpenGroupware.org.
OGo is free software; you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the
Free Software Foundation; either version 2, or (at your option) any
later version.
OGo is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
License for more details.
You should have received a copy of the GNU Lesser General Public
License along with OGo; see the file COPYING. If not, write to the
Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA.
*/
#include "SOGoSieveScriptsFolder.h"
#include <NGImap4/NGSieveClient.h>
#include "common.h"
@implementation SOGoSieveScriptsFolder
- (void)dealloc {
[self->listedScripts release];
[super dealloc];
}
/* listing */
- (NSDictionary *)fetchScripts {
if (self->listedScripts != nil)
return self->listedScripts;
self->listedScripts = [[[self sieveClient] listScripts] copy];
return self->listedScripts;
}
/* standard methods */
- (NSArray *)toOneRelationshipKeys {
return [[self fetchScripts] allKeys];
}
/* operations */
- (NSException *)activateScript:(NSString *)_name {
NSDictionary *res;
NSString *r;
res = [[self sieveClient] setActiveScript:_name];
if ([[res valueForKey:@"result"] boolValue])
return nil;
// TODO: make it a debug log
[self logWithFormat:@"sieve activate failed: %@", res];
r = [@"Script activation failed: "
stringByAppendingString:[res description]];
return [NSException exceptionWithHTTPStatus:500 /* Server Error */
reason:r];
}
/* name lookup */
- (NSString *)lookupScript:(NSString *)_key inContext:(id)_ctx {
Class clazz;
clazz = NSClassFromString(@"SOGoSieveScriptObject");
return [[[clazz alloc] initWithName:_key inContainer:self] autorelease];
}
- (id)lookupName:(NSString *)_key inContext:(id)_ctx acquire:(BOOL)_flag {
id obj;
/* first check attributes directly bound to the object */
if ((obj = [super lookupName:_key inContext:_ctx acquire:NO]))
return obj;
/* lookup script */
if ((obj = [self lookupScript:_key inContext:_ctx]))
return obj;
/* return 404 to stop acquisition */
return [NSException exceptionWithHTTPStatus:404 /* Not Found */];
}
/* folder type */
- (NSString *)outlookFolderClass {
return @"IPF.Filter";
}
@end /* SOGoSieveScriptsFolder */
+7
View File
@@ -0,0 +1,7 @@
# Version file
SUBMINOR_VERSION:=11
# v0.9.9 requires libNGMime v4.5.223
# v0.9.6 requires libNGMime v4.5.207
# v0.9.1 requires libNGMime v4.3.194
+34
View File
@@ -0,0 +1,34 @@
/*
Copyright (C) 2002-2005 SKYRIX Software AG
This file is part of OpenGroupware.org.
OGo is free software; you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the
Free Software Foundation; either version 2, or (at your option) any
later version.
OGo is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
License for more details.
You should have received a copy of the GNU Lesser General Public
License along with OGo; see the file COPYING. If not, write to the
Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA.
*/
#import <Foundation/Foundation.h>
#import <Foundation/NSObjCRuntime.h>
#if NeXT_Foundation_LIBRARY || COCOA_Foundation_LIBRARY
# include <NGExtensions/NGObjectMacros.h>
# include <NGExtensions/NSString+Ext.h>
#endif
#include <NGExtensions/NGExtensions.h>
#include <NGObjWeb/NGObjWeb.h>
#include <NGObjWeb/SoObjects.h>
#include <NGImap4/NGImap4Client.h>
+23
View File
@@ -0,0 +1,23 @@
{
requires = ( MAIN, Mailer );
publicResources = (
);
factories = {
};
classes = {
SOGoSieveBaseObject = {
superclass = "SOGoObject";
};
SOGoSieveScriptsFolder = {
superclass = "SOGoSieveBaseObject";
};
SOGoSieveScriptObject = {
superclass = "SOGoSieveBaseObject";
};
};
}