2005-07-21 Helge Hess <helge.hess@opengroupware.org>
- * SOGoMailObject.m: added a -davEntityTag (v0.9.117)
+ * v0.9.118
+
+ * SOGoMailAccounts.m: reject access to the folder in case the name of
+ the home folder doesn't match the logged in account (a user tries to
+ access another users Mail application)
+ * started work on account based identities
+
+ * SOGoMailObject.m: added a -davEntityTag (v0.9.117)
+
2005-07-20 Helge Hess <helge.hess@opengroupware.org>
* SOGoMailObject.m: improved -doesMailExist check (do not refetch if
\
SOGoDraftsFolder.m \
SOGoDraftObject.m \
+ \
+ SOGoMailIdentity.m \
Mailer_RESOURCE_FILES += \
Version \
/*
- 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: SOGoMailAccounts.h 274 2004-08-26 13:10:49Z znek $
#ifndef __Mailer_SOGoMailAccounts_H__
#define __Mailer_SOGoMailAccounts_H__
The SOGoMailAccounts folder contains the mail accounts which are associated
with a user.
+ The list of accounts is currently retrieved from the context -activeUser.
Note: this is not yet an IMAP4 object. Its a wrapper which contains the root
IMAP4 objects.
*/
+@class NSArray;
+
@interface SOGoMailAccounts : SOGoObject
{
}
+- (NSArray *)fetchAllIdentities;
+
@end
#endif /* __Mailer_SOGoMailAccounts_H__ */
/* listing the available mailboxes */
+- (BOOL)isInHomeFolderBranchOfLoggedInAccount:(id)_ctx {
+ id user;
+
+ if (_ctx == nil) _ctx = [[WOApplication application] context];
+ if (_ctx == nil) {
+ [self errorWithFormat:@"Missing context!"];
+ return NO;
+ }
+
+ user = [_ctx activeUser];
+ return [[[self container] nameInContainer] isEqualToString:[user login]];
+}
+
- (NSArray *)toManyRelationshipKeys {
WOContext *ctx;
id user;
__PRETTY_FUNCTION__];
return nil;
}
- user = [ctx activeUser];
+
+ /*
+ Note: this is not strictly correct. The accounts being retrieved should be
+ the accounts based on the container object of this folder. Given
+ sufficient rights (eg delegation rights!), this would allow you to
+ browse the hierarchies of other users.
+
+ But then, the home-folder would need to know about mail
+ functionality which isn't perfect either.
+ => TODO
+ */
+ user = [ctx activeUser];
+
+ /* for now: return nothing if the home-folder does not belong to the login */
+ if (![self isInHomeFolderBranchOfLoggedInAccount:ctx]) {
+ [self warnWithFormat:@"User %@ tried to access mail hierarchy of %@",
+ [user login], [[self container] nameInContainer]];
+ return nil;
+ }
+
account = [user valueForKey:@"primaryIMAP4AccountString"];
if ([account isNotNull]) account = [NSArray arrayWithObject:account];
: [account arrayByAddingObjectsFromArray:shares];
}
+- (NSArray *)fetchAllIdentities {
+ [self logWithFormat:@"TODO: implement me: %s", __PRETTY_FUNCTION__];
+ return nil;
+}
+
/* name lookup */
- (BOOL)isValidMailAccountName:(NSString *)_key {
if ((obj = [super lookupName:_key inContext:_ctx acquire:NO]))
return obj;
+ if (![self isInHomeFolderBranchOfLoggedInAccount:_ctx]) {
+ [self warnWithFormat:@"User %@ tried to access mail hierarchy of %@",
+ [[_ctx activeUser] login], [[self container] nameInContainer]];
+
+ return [NSException exceptionWithHTTPStatus:403 /* Forbidden */
+ reason:@"Tried to access the mail of another user"];
+ }
+
if ([self isValidMailAccountName:_key]) {
/* forbid shares for requests coming from the Internet */
BOOL isSharedKey;
--- /dev/null
+/*
+ Copyright (C) 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 __Mailer_SOGoMailIdentity_H__
+#define __Mailer_SOGoMailIdentity_H__
+
+#import <Foundation/NSObject.h>
+
+/*
+ SOGoMailIdentity
+
+ A user identity bound to an account.
+
+ Note: currently this is not a SoObject. This might change later on.
+
+
+ In Thunderbird you have a set of accounts which in turn have a set of
+ identities. There is one default identity.
+
+ The identities then have:
+ - settings
+ - a name
+ - a from-email
+ - a reply-to
+ - an organization
+ - a signature
+ - a vcard (to be attached)
+ - folder settings
+ - Sent-Folder and bcc
+ - Drafts + Templates
+ - composition
+ - whether to use HTML
+ - whether to quote the source message (reply below, above the quote or
+ select the quote)
+*/
+
+@interface SOGoMailIdentity : NSObject
+{
+}
+
+@end
+
+#endif /* __Mailer_SOGoMailIdentity_H__ */
--- /dev/null
+/*
+ Copyright (C) 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 "SOGoMailIdentity.h"
+#include "common.h"
+
+@implementation SOGoMailIdentity
+
+@end /* SOGoMailIdentity */
# Version file
-SUBMINOR_VERSION:=117
+SUBMINOR_VERSION:=118
# v0.9.114 requires libNGMime v4.5.229
# v0.9.114 requires libNGExtensions v4.5.165