116 Commits

Author SHA1 Message Date
Matt Ronge eeeeaad741 CTCoreMessage now has flag attribute 2012-07-02 16:53:02 -05:00
Matt Ronge f082b9252f Fixed a up a few problems the static analyzer 2012-07-02 12:35:48 -05:00
Matt Ronge 88755514ba Fixed a bug where the uid validity was returned instead of UID 2012-07-02 12:11:27 -05:00
Matt Ronge fa1445389c Updated some documentation 2012-06-25 15:56:26 -05:00
Matt Ronge 7db87173dc - UIDs are now stored as integers
- Removed isUIDValid
- Added uidNext to CTCoreFolder
- Added a way to fetch messages by UID range
2012-06-25 15:50:17 -05:00
Matt Ronge 42c158ccb5 Added error for when the username/pass is wrong 2012-06-22 11:23:59 -05:00
Matt Ronge e5ef43acd1 Removed exception strings that aren't used anymore 2012-06-18 16:48:29 -05:00
Matt Ronge 854827d81f Removed use of exceptions completely from MailCore 2012-06-18 16:47:26 -05:00
Matt Ronge f7f9d945ba - Removed some old ways of requesting message lists and CTBareMessage
- In the process found a memory	      error in CTCoreMessage,	found and fixed
- Fixed	 a few broken tests
2012-06-08 14:55:27 -05:00
Matt Ronge a754f12ad4 More cleanup on message list fetching, also wrote some tests and documentation 2012-06-08 13:21:31 -05:00
Matt Ronge 40f92a2c4e Tests pass again 2012-06-07 12:03:10 -05:00
Matt Ronge 813b6aac2f Oops, forgot to commit the license file 2012-06-07 11:38:42 -05:00
Matt Ronge 238ae7c870 Added a license file, cleaned up one copyright notice 2012-06-07 11:38:26 -05:00
Matt Ronge 2cf22b7f10 Got tests running again 2012-06-07 11:02:13 -05:00
Matt Ronge 449eefb13b Started implementing a new way to fetch message lists 2012-06-07 11:02:01 -05:00
Matt Ronge 7c13b7b951 Converted sample projects to latest Xcode project format and converted files from tabs to spaces 2012-05-30 17:49:23 -05:00
Matt Ronge d6f68a684b Updated projects to fix build errors 2012-05-24 18:35:48 -05:00
Matt Ronge c7e8e069b6 Cleaned up errors and turned on warnings as errors 2012-05-24 16:20:54 -05:00
Matt Ronge 4cafeae3a2 Added fix for handling of attachments with incompatiable mime header 2012-05-24 16:13:22 -05:00
Matt Ronge 6b9b952da1 Turned the fetchBody method into fetchBodyStructure 2012-05-24 14:32:26 -05:00
Matt Ronge acdc204854 Forget to clear out the progress handler after finishing a fetch 2012-05-24 14:28:55 -05:00
Matt Ronge f9749c4362 Added a method to CTBareAttachment that allows you to get progress on the download, also added a method on CTMIME_SinglePart to get the downloaded size 2012-05-24 14:28:28 -05:00
Waseem Sadiq 4b86e865d8 Added IDLE 2012-05-24 14:20:17 -05:00
Waseem Sadiq 26793e2976 Added additional checks for html body types 2012-05-24 14:19:17 -05:00
Waseem Sadiq 4823189dc9 Fixed text/html detection 2012-05-24 14:15:19 -05:00
Waseem Sadiq f9bdaf35d4 Improved attachment handling (thanks to waseems) 2012-05-24 14:13:25 -05:00
Matt Ronge 29c3274bb8 Added isStarred (thanks Waseem) 2012-05-24 14:10:46 -05:00
Matt Ronge c812c21f9b Added .idea (AppCode) to .gitignore 2012-05-24 13:56:21 -05:00
Matt Ronge e510829760 Upgraded MailCore project and updated version of libetpan in use 2012-05-24 12:59:05 -05:00
Matt Ronge 4ab690dbdd Merge branch 'master' of github.com:mronge/MailCore 2012-05-23 14:36:33 -05:00
Matt Ronge d04c7c33aa Added TODO where code in CTCoreAttachment.m needs to be updated for iOS 2012-05-23 14:36:05 -05:00
Matt Ronge 068bff894b Merge pull request #9 from jils/master
Fix for crash in async SMTP connection cleanup
2012-03-14 09:31:23 -07:00
jils 1759893361 Detabbed recent changes. 2012-03-13 22:24:54 -07:00
jils a1811baa6b Fixed crash when cleaning up after a failed SMTP connection e.g. blocked smtp port 2012-03-13 22:19:34 -07:00
Matt Ronge a76486de0d Removed unnecessary step from readme 2012-02-21 19:09:48 -06:00
Matt Ronge 6930e8dff5 The copy headers step was missing from the iOS target 2012-02-21 19:07:33 -06:00
Matt Ronge 18a666603b Made some changes to the last merge request 2012-01-15 16:22:59 -06:00
Matt Ronge 345204f992 Merge pull request #7 from kaustubh-kabra/master
Added functionality for forwarding and replying a mail containing HTML content. Also, HTML content was made to be in editable format for implementing this functionality.
2012-01-15 13:36:20 -08:00
Kaustubh Kabra 076a43640b Ready for merge to enable editable HTML body for reply/forward and also,for sending the edited HTML 2012-01-09 11:29:40 +05:30
Kaustubh Kabra 89e09bcdab Changes to CTCoreMessage for handling html content -> To get editeble HTML and to set edited HTML as body 2012-01-09 11:16:28 +05:30
Kaustubh Kabra a6dd15fce9 Added CTMIME_HtmlPart for replying/ forwarding mail with HTML part content. 2012-01-09 11:09:52 +05:30
Matt Ronge 0099b84cb2 Modified how the example projects link against mailcore 2011-10-19 20:48:47 -05:00
Matt Ronge 08a6704b23 Forget to add libssl to example project 2011-10-19 19:37:39 -05:00
Matt Ronge 0eea0ccdd4 Merge branch 'master' of github.com:mronge/MailCore 2011-10-17 20:58:37 -05:00
Matt Ronge 959583fc71 Updated projects and added an iOS example project. very much still a work in progress 2011-10-17 20:58:23 -05:00
Matt Ronge d4a3ecb7a8 Update README.md 2011-10-16 22:06:46 -05:00
Matt Ronge 48620d0049 Added the wrong URL for the libetpan submodule 2011-10-16 21:38:29 -05:00
Matt Ronge fe7bf272b4 Change README file ext 2011-10-16 20:15:22 -05:00
Matt Ronge f7f69c9b9a Change the mailcore ASCII text to be a code block in markdown 2011-10-16 20:13:50 -05:00
Matt Ronge fbdd8a99b4 Edits to the readme file 2011-10-16 20:12:39 -05:00
Matt Ronge 3f8f4d8859 Added a really basic readme file 2011-10-16 20:10:07 -05:00
Matt Ronge 1071707943 Updated project so that it builds for iOS 2011-10-16 19:54:48 -05:00
Matt Ronge aad7cd55d3 Removing old libetpan 2011-10-16 16:12:32 -05:00
Matt Ronge c6e6b6ec57 Removing .hgignore replacing it with .gitignore 2011-10-16 15:50:57 -05:00
Matt Ronge 794eb61b01 Made some tweaks to libetpan where closing brace for an extern C was missing, will remove once Hoa commits to libetpan 2011-05-18 21:38:49 -05:00
Matt Ronge 529dad0e3b Updated MessageSender example project 2011-05-10 22:24:15 -05:00
Matt Ronge 7b38a2bd06 Added comments to two new methods in CTCoreMessage: rfc822 and messageAsEmlx 2011-05-10 21:56:53 -05:00
Matt Ronge a1bf39710a Added the date to the emlx data 2011-05-10 20:19:40 -05:00
Matt Ronge 16ca0c31bd Reformated the comments for the new date methods 2011-05-10 20:19:28 -05:00
Matt Ronge 89e8372e3b Fixing merge I messed up earlier 2011-05-10 19:59:22 -05:00
Matt Ronge a59a8c7c40 Flags are now written out properly in Emlx 2011-05-10 19:33:09 -05:00
Matt Ronge 81df54929d Flags are written out with emlx data 2011-05-09 20:24:07 -05:00
Matt Ronge 90f2639bc7 Fixed memory leak with downloading the rfc822 content of a message 2011-05-09 19:35:05 -05:00
Matt Ronge e2a4fe8313 Updated libetpan 2011-05-09 17:41:38 -05:00
Matt Ronge e3dbca8a91 Added some code to CTCoreMessage to return the message as an emlx file 2011-05-09 16:34:02 -05:00
Matt Ronge e4a4a6ed02 Some project tweaks, all examples are building again 2011-05-08 22:52:12 -05:00
Matt Ronge 922da5a671 Added Matt R Miller to contributors 2011-05-08 13:59:15 -05:00
Matt Ronge 8512e3f32b Merged 2011-05-08 13:57:56 -05:00
Matt Ronge ae4d764843 Merged 2011-05-08 13:54:34 -05:00
Matt Ronge ccaba6cabb Merged 2011-05-08 13:31:22 -05:00
jils 1781a1bb25 ignore personal Xcode files as well as svn stff
--HG--
branch : KJ-1.0
2010-08-12 19:28:44 -07:00
jils f4728b6d36 If filename is available set proper content-disposition attributes.
--HG--
branch : KJ-1.0
2010-08-12 19:28:06 -07:00
jils 2f7f6acf61 Minor cleanup
--HG--
branch : KJ-1.0
2010-05-26 02:16:04 -07:00
jils 35b9c2216c Correctly cancelling smtp thread (thanks to Hoa). Sending status along to delegate.
--HG--
branch : KJ-1.0
2010-05-26 02:10:35 -07:00
jils 86650ae1e8 Minor cleanup for async smtp connection. Still killing NSThread because libetpan's network timeout holds us up too long.
--HG--
branch : KJ-1.0
2010-05-19 00:31:49 -07:00
jils 3699061586 First cut at adding async smtp message sending
--HG--
branch : KJ-1.0
2010-05-10 02:10:00 -07:00
Matt Ronge 29aa63d5d9 Add support for sending attachments (thanks to Jaremy Creechley)
--HG--
branch : KJ-1.0
2010-05-03 21:36:29 -05:00
Matt Ronge fed513ff6d Removed my personal project files
--HG--
branch : KJ-1.0
2010-05-03 20:40:28 -05:00
Matt Ronge d4165e4edc Changed debug mode to only build active archs
--HG--
branch : KJ-1.0
2010-05-03 20:39:57 -05:00
Matt Ronge fa9234d25c Added new method bodyPreferringPlainText
--HG--
branch : KJ-1.0
2010-04-25 20:39:33 -05:00
mattrmiller 6d31e7dff3 * Changed copy message to use mesage reference instead of UID
* Implemented move message
* Fixed send date
2010-03-29 17:33:01 -04:00
Matt Ronge d7d0a27562 Debug now builds again 2010-03-10 15:18:03 -06:00
Matt Ronge 06f1d0c801 Added Gabor Cselle to list of contributors 2010-03-10 14:53:25 -06:00
Matt Ronge 74e085f43b Editing .hgignore file to ignore reMail (http://code.google.com/p/remail-iphone/) build script products 2010-03-08 20:37:59 -06:00
Matt Ronge 76a92b73ff Updated getting started to include new link to remail open source 2010-03-08 20:04:52 -06:00
Matt Ronge ac1698e3f6 Patch from Gabor Cselle, adds isUnread and changes isNew 2010-02-04 19:52:27 -06:00
Matt Ronge 7950379ab2 Fix from Gabor for isNew, had bad logic 2010-02-01 15:33:03 -06:00
Matt Ronge cadff79c96 Added in sentDate for KJ
--HG--
branch : KJ-1.0
2010-01-24 12:18:19 -06:00
Matt Ronge 89ea6081dd Added MailCoreDisableLogging to header 2010-01-19 11:50:27 -06:00
Matt Ronge 43a700159a Added iphone info to getting started 2010-01-07 11:19:42 -06:00
Matt Ronge f8d1d4aa6f Updated inline comments for totalMessageCount and unreadMessageCount 2010-01-04 20:52:52 -06:00
Matt Ronge 64abb83877 Changed how totalMessageCount works so a round trip is avoided, should be much faster 2010-01-04 20:45:07 -06:00
Matt Ronge 595ad0e721 More updates for libetpan 2010-01-04 20:44:40 -06:00
Matt Ronge 00db256f68 Forgot to include some new libetpan files 2010-01-04 20:09:25 -06:00
Matt Ronge e5af6dbac4 Updated to libetpan tip 2010-01-04 20:09:08 -06:00
Matt Ronge 188545b672 Updated libetpan 2009-12-18 17:49:56 -08:00
Matt Ronge dbe9e6aa99 No longer tries to build against expat 2009-12-18 12:53:50 -08:00
Matt Ronge 07091cd01f Included iphone target in mailcore 2009-12-18 11:49:43 -08:00
Matt Ronge b9e4aef7be Added Gabor's additions to mailimap.c for returning login errors 2009-12-18 11:49:12 -08:00
Matt Ronge 54e6b3b39d Changed imports 2009-12-18 11:35:39 -08:00
Matt Ronge 439cd441c8 Added Gabor's disable logging code 2009-12-18 11:35:28 -08:00
Matt Ronge abfea39e23 Integrated Gabor Cselle's MailCore changes 2009-12-16 13:37:21 -08:00
Matt Ronge b793f00e13 Added an authors file 2009-12-09 16:38:39 -06:00
Matt Ronge 222f8c8643 Fixes memory leak when fetching flags, thanks to Kyle Van Essen for the fix 2009-12-09 16:17:27 -06:00
Matt Ronge 81a16dd4dd Build scripts are no longer needed 2009-12-08 14:38:29 -06:00
Matt Ronge 2ee48a0c68 MailCore now links statically against libetpan 2009-12-08 14:29:03 -06:00
Matt Ronge 74d28582ec Added generated libetpan header files to repo for convenience 2009-12-08 14:19:59 -06:00
Matt Ronge 376420296d Added raw check of libetpan to repo 2009-12-08 14:05:37 -06:00
Matt Ronge fddb0de931 Fixed project so it builds for all archs and 64/32bit 2009-11-07 14:51:31 -06:00
Matt Ronge 3aa967a63a Fixed a major memory leak in CTCoreMessage, happened when init-ing from string 2009-11-01 11:44:10 -06:00
Matt Ronge d799f75a87 Switched to using libetpan as a companion framework 2009-11-01 11:39:05 -06:00
Matt Ronge 41eb5dee73 Fixed MailCore so that it uses unicode and properly converts incoming
messages from their charsets to UTF-8
2009-09-04 21:22:05 -05:00
Matt Ronge a8a489a7c4 Disabled Xcode unit tests GUI because it freezed in 10.6, temporary workaround with custom executable. Also turned off account unit tests that doesn't work 2009-09-03 18:00:40 -05:00
Matt Ronge 4bfc59f5e7 Reverse of my decision, decided to include source 2009-08-10 19:45:00 -05:00
Matt Ronge 431460caba Decided to not include the source with the build, since the source is easily fetchable on bitbucket 2009-08-10 19:42:27 -05:00
Matt Ronge 834a9d59e6 Added tag 0.2.7 for changeset c61c66cb67e8 2009-08-10 19:40:45 -05:00
110 changed files with 5946 additions and 6322 deletions
+6
View File
@@ -0,0 +1,6 @@
build
*~
xcuserdata
.DS_Store
include/
.idea
+6
View File
@@ -0,0 +1,6 @@
[submodule "libetpan"]
path = libetpan
url = https://github.com/mronge/libetpan.git
[submodule "iOSPorts"]
path = iOSPorts
url = https://github.com/bindle/iOSPorts.git
-9
View File
@@ -1,9 +0,0 @@
syntax: glob
TAGS
build
OpenSourceProjects/libetpan-*
OpenSourceProjects/include
Documentation
.DS_Store
*~
*.pyc
-3
View File
@@ -1,3 +0,0 @@
a17a1e69ca0519c1bb5f9b1b874159527bafefd0 0.2.7
a17a1e69ca0519c1bb5f9b1b874159527bafefd0 0.2.7
c4c13c836c8b153b18b416dd06828a43f503528b 0.2.7
+18
View File
@@ -0,0 +1,18 @@
Primary Authors:
* Matt Ronge
Contributors:
* Stefano Barbato - For a patch that fixes a memory leak
* Jaremy Creechley - Added support for sending attachments
* Julián Romero - For a patch that adds unicode support for addresses
* Kyle Van Essen - For a patch that fixes a flags memory leak
* Gabor Cselle - For tons of contributions, especially iPhone support and bug fixes
* Juan Leon - For adding async SMTP support
* Matthew R. Miller - For move message support and date utilities
* Kaustubh Kabra - For HTML mail support
Thanks to:
* Dinh Viet Hoa - For writing libetpan, which made MailCore possible
-67
View File
@@ -1,67 +0,0 @@
#import "MyController.h"
@implementation MyController
- (id)init
{
self = [super init];
if(self)
{
myAccount = [[CTCoreAccount alloc] init];
myMessages = [[NSMutableArray alloc] init];
}
return self;
}
- (void)dealloc
{
[myAccount release];
[myMessages release];
[super dealloc];
}
- (IBAction)connect:(id)sender
{
NSLog(@"Connecting...");
if ([useTLS state] == NSOnState )
{
[myAccount connectToServer:[server stringValue] port:[port intValue] connectionType:CONNECTION_TYPE_TLS
authType:IMAP_AUTH_TYPE_PLAIN login:[username stringValue] password:[password stringValue]];
}
else
{
[myAccount connectToServer:[server stringValue] port:[port intValue] connectionType:CONNECTION_TYPE_PLAIN
authType:IMAP_AUTH_TYPE_PLAIN login:[username stringValue] password:[password stringValue]];
}
CTCoreFolder *inbox = [myAccount folderWithPath:@"INBOX"];
NSLog(@"INBOX %@", inbox);
// set the toIndex to 0 so all messages are loaded
NSSet *messageSet = [inbox messageObjectsFromIndex:1 toIndex:0];
NSLog(@"Done getting list of messages...");
NSMutableSet *messagesProxy = [self mutableSetValueForKey:@"messages"];
NSEnumerator *objEnum = [messageSet objectEnumerator];
id msg;
while(msg = [objEnum nextObject]) {
[msg fetchBody];
[messagesProxy addObject:msg];
}
}
- (NSMutableSet *)messages
{
return myMessages;
}
- (void)setMessages:(NSMutableSet *)messages
{
[messages retain];
[myMessages release];
myMessages = messages;
}
@end
-79
View File
@@ -1,79 +0,0 @@
#import "MyController.h"
@implementation MyController
- (id)init
{
self = [super init];
if(self)
{
myMessage = [[CTCoreMessage alloc] init];
}
return self;
}
- (void)dealloc
{
[myMessage release];
[super dealloc];
}
- (IBAction)sendMessage:(id)sender
{
CTCoreMessage *msg = [[CTCoreMessage alloc] init];
[msg setTo:[myMessage to]];
[msg setFrom:[myMessage from]];
[msg setBody:[myMessage body]];
[msg setSubject:[myMessage subject]];
BOOL auth = ([useAuth state] == NSOnState);
BOOL tls = ([useTLS state] == NSOnState);
[CTSMTPConnection sendMessage:msg server:[server stringValue] username:[username stringValue]
password:[password stringValue] port:[port intValue] useTLS:tls useAuth:auth];
[msg release];
}
- (NSString *)to
{
return [[[myMessage to] anyObject] email];
}
- (void)setTo:(NSString *)aValue
{
CTCoreAddress *addr = [CTCoreAddress address];
[addr setEmail:aValue];
[myMessage setTo:[NSSet setWithObject:addr]];
}
- (NSString *)from
{
return [[[myMessage from] anyObject] email];
}
- (void)setFrom:(NSString *)aValue
{
CTCoreAddress *addr = [CTCoreAddress address];
[addr setEmail:aValue];
[addr setName:@""];
[myMessage setFrom:[NSSet setWithObject:addr]];
}
- (NSString *)subject
{
return [myMessage subject];
}
- (void)setSubject:(NSString *)aValue
{
[myMessage setSubject:aValue];
}
- (NSString *)body
{
return [myMessage body];
}
- (void)setBody:(NSString *)aValue
{
[myMessage setBody:aValue];
}
@end
@@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
objectVersion = 42;
objectVersion = 46;
objects = {
/* Begin PBXBuildFile section */
@@ -11,17 +11,45 @@
8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */; };
8D11072D0486CEB800E47090 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; settings = {ATTRIBUTES = (); }; };
8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */; };
F8A2FAEB144FAAB600C03DB4 /* MailCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F8A2FAE4144FAA8E00C03DB4 /* MailCore.framework */; };
F8A2FAED144FAAEE00C03DB4 /* MailCore.framework in Copy Files (1 item) */ = {isa = PBXBuildFile; fileRef = F8A2FAE4144FAA8E00C03DB4 /* MailCore.framework */; };
F8FF333E09D272810051FC62 /* MyController.m in Sources */ = {isa = PBXBuildFile; fileRef = F8FF333D09D272810051FC62 /* MyController.m */; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
F8A2FAE3144FAA8E00C03DB4 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = F8A2FACE144FAA8D00C03DB4 /* MailCore.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = 8DC2EF5B0486A6940098B216;
remoteInfo = MailCore;
};
F8A2FAE5144FAA8E00C03DB4 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = F8A2FACE144FAA8D00C03DB4 /* MailCore.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = F82D7C810F48AC8500ADA65C;
remoteInfo = Tests;
};
F8A2FAE7144FAA8E00C03DB4 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = F8A2FACE144FAA8D00C03DB4 /* MailCore.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = F8618B5710DADB5C00C41188;
remoteInfo = "MailCore iOS";
};
/* End PBXContainerItemProxy section */
/* Begin PBXCopyFilesBuildPhase section */
F8FF33DB09D2734E0051FC62 /* CopyFiles */ = {
F8FF33DB09D2734E0051FC62 /* Copy Files (1 item) */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647;
dstPath = "";
dstSubfolderSpec = 10;
files = (
F8A2FAED144FAAEE00C03DB4 /* MailCore.framework in Copy Files (1 item) */,
);
name = "Copy Files (1 item)";
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXCopyFilesBuildPhase section */
@@ -37,6 +65,8 @@
32CA4F630368D1EE00C91783 /* InboxLister_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InboxLister_Prefix.pch; sourceTree = "<group>"; };
8D1107310486CEB800E47090 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist; path = Info.plist; sourceTree = "<group>"; };
8D1107320486CEB800E47090 /* InboxLister.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = InboxLister.app; sourceTree = BUILT_PRODUCTS_DIR; };
F856BE1613779B5000D9C2ED /* MailCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MailCore.framework; path = ../../build/Debug/MailCore.framework; sourceTree = "<group>"; };
F8A2FACE144FAA8D00C03DB4 /* MailCore.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = MailCore.xcodeproj; path = ../../../MailCore.xcodeproj; sourceTree = "<group>"; };
F8FF333C09D272810051FC62 /* MyController.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = MyController.h; sourceTree = "<group>"; };
F8FF333D09D272810051FC62 /* MyController.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = MyController.m; sourceTree = "<group>"; };
/* End PBXFileReference section */
@@ -46,6 +76,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
F8A2FAEB144FAAB600C03DB4 /* MailCore.framework in Frameworks */,
8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
@@ -56,6 +87,8 @@
080E96DDFE201D6D7F000001 /* Classes */ = {
isa = PBXGroup;
children = (
F8FF333D09D272810051FC62 /* MyController.m */,
F8FF333C09D272810051FC62 /* MyController.h */,
);
name = Classes;
sourceTree = "<group>";
@@ -63,6 +96,7 @@
1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */ = {
isa = PBXGroup;
children = (
F856BE1613779B5000D9C2ED /* MailCore.framework */,
1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */,
);
name = "Linked Frameworks";
@@ -89,6 +123,7 @@
29B97314FDCFA39411CA2CEA /* InboxLister */ = {
isa = PBXGroup;
children = (
F8A2FACE144FAA8D00C03DB4 /* MailCore.xcodeproj */,
080E96DDFE201D6D7F000001 /* Classes */,
29B97315FDCFA39411CA2CEA /* Other Sources */,
29B97317FDCFA39411CA2CEA /* Resources */,
@@ -103,8 +138,6 @@
children = (
32CA4F630368D1EE00C91783 /* InboxLister_Prefix.pch */,
29B97316FDCFA39411CA2CEA /* main.m */,
F8FF333C09D272810051FC62 /* MyController.h */,
F8FF333D09D272810051FC62 /* MyController.m */,
);
name = "Other Sources";
sourceTree = "<group>";
@@ -128,6 +161,16 @@
name = Frameworks;
sourceTree = "<group>";
};
F8A2FACF144FAA8D00C03DB4 /* Products */ = {
isa = PBXGroup;
children = (
F8A2FAE4144FAA8E00C03DB4 /* MailCore.framework */,
F8A2FAE6144FAA8E00C03DB4 /* Tests.octest */,
F8A2FAE8144FAA8E00C03DB4 /* libmailcore.a */,
);
name = Products;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
@@ -138,7 +181,7 @@
8D1107290486CEB800E47090 /* Resources */,
8D11072C0486CEB800E47090 /* Sources */,
8D11072E0486CEB800E47090 /* Frameworks */,
F8FF33DB09D2734E0051FC62 /* CopyFiles */,
F8FF33DB09D2734E0051FC62 /* Copy Files (1 item) */,
);
buildRules = (
);
@@ -155,11 +198,24 @@
/* Begin PBXProject section */
29B97313FDCFA39411CA2CEA /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0430;
};
buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "InboxLister" */;
compatibilityVersion = "Xcode 2.4";
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
hasScannedForEncodings = 1;
knownRegions = (
en,
);
mainGroup = 29B97314FDCFA39411CA2CEA /* InboxLister */;
projectDirPath = "";
projectReferences = (
{
ProductGroup = F8A2FACF144FAA8D00C03DB4 /* Products */;
ProjectRef = F8A2FACE144FAA8D00C03DB4 /* MailCore.xcodeproj */;
},
);
projectRoot = "";
targets = (
8D1107260486CEB800E47090 /* InboxLister */,
@@ -167,6 +223,30 @@
};
/* End PBXProject section */
/* Begin PBXReferenceProxy section */
F8A2FAE4144FAA8E00C03DB4 /* MailCore.framework */ = {
isa = PBXReferenceProxy;
fileType = wrapper.framework;
path = MailCore.framework;
remoteRef = F8A2FAE3144FAA8E00C03DB4 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
F8A2FAE6144FAA8E00C03DB4 /* Tests.octest */ = {
isa = PBXReferenceProxy;
fileType = wrapper.cfbundle;
path = Tests.octest;
remoteRef = F8A2FAE5144FAA8E00C03DB4 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
F8A2FAE8144FAA8E00C03DB4 /* libmailcore.a */ = {
isa = PBXReferenceProxy;
fileType = archive.ar;
path = libmailcore.a;
remoteRef = F8A2FAE7144FAA8E00C03DB4 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
/* End PBXReferenceProxy section */
/* Begin PBXResourcesBuildPhase section */
8D1107290486CEB800E47090 /* Resources */ = {
isa = PBXResourcesBuildPhase;
@@ -215,18 +295,13 @@
isa = XCBuildConfiguration;
buildSettings = {
COPY_PHASE_STRIP = NO;
FRAMEWORK_SEARCH_PATHS = (
"$(FRAMEWORK_SEARCH_PATHS)",
"$(SRCROOT)/../../build/Debug",
"$(SRCROOT)/../../build/Release",
"$(SRCROOT)/../..",
"$(FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_1)",
);
FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_1 = "\"$(SRCROOT)/../../../../Library/Frameworks\"";
GCC_DYNAMIC_NO_PIC = NO;
GCC_ENABLE_FIX_AND_CONTINUE = YES;
GCC_MODEL_TUNING = G5;
GCC_OPTIMIZATION_LEVEL = 0;
HEADER_SEARCH_PATHS = (
"$(SRCROOT)/../../../libetpan/build-mac/include",
"$(SRCROOT)/../../../include/",
);
INFOPLIST_FILE = Info.plist;
INSTALL_PATH = "$(HOME)/Applications";
PRODUCT_NAME = InboxLister;
@@ -238,20 +313,12 @@
C01FCF4C08A954540054247B /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = (
ppc,
i386,
);
FRAMEWORK_SEARCH_PATHS = (
"$(FRAMEWORK_SEARCH_PATHS)",
"$(SRCROOT)/../../build/Debug",
"$(SRCROOT)/../../build/Release",
"$(SRCROOT)/../..",
"$(FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_1)",
);
FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_1 = "\"$(SRCROOT)/../../../../Library/Frameworks\"";
GCC_GENERATE_DEBUGGING_SYMBOLS = NO;
GCC_MODEL_TUNING = G5;
HEADER_SEARCH_PATHS = (
"$(SRCROOT)/../../../libetpan/build-mac/include",
"$(SRCROOT)/../../../include/",
);
INFOPLIST_FILE = Info.plist;
INSTALL_PATH = "$(HOME)/Applications";
PRODUCT_NAME = InboxLister;
@@ -264,8 +331,7 @@
buildSettings = {
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
PREBINDING = NO;
SDKROOT = /Developer/SDKs/MacOSX10.5.sdk;
SDKROOT = macosx;
};
name = Debug;
};
@@ -274,8 +340,7 @@
buildSettings = {
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
PREBINDING = NO;
SDKROOT = /Developer/SDKs/MacOSX10.5.sdk;
SDKROOT = macosx;
};
name = Release;
};
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "self:InboxLister.xcodeproj">
</FileRef>
</Workspace>
@@ -9,12 +9,12 @@
IBOutlet id port;
IBOutlet id server;
IBOutlet id username;
IBOutlet id useTLS;
IBOutlet id useTLS;
CTCoreAccount *myAccount;
NSMutableSet *myMessages;
CTCoreAccount *myAccount;
NSMutableArray *myMessages;
}
- (IBAction)connect:(id)sender;
- (NSMutableSet *)messages;
- (void)setMessages:(NSMutableSet *)messages;
- (NSMutableArray *)messages;
- (void)setMessages:(NSMutableArray *)messages;
@end
+67
View File
@@ -0,0 +1,67 @@
#import "MyController.h"
@implementation MyController
- (id)init
{
self = [super init];
if(self)
{
myAccount = [[CTCoreAccount alloc] init];
myMessages = [[NSMutableArray alloc] init];
}
return self;
}
- (void)dealloc
{
[myAccount release];
[myMessages release];
[super dealloc];
}
- (IBAction)connect:(id)sender
{
NSLog(@"Connecting...");
if ([useTLS state] == NSOnState )
{
[myAccount connectToServer:[server stringValue] port:[port intValue] connectionType:CONNECTION_TYPE_TLS
authType:IMAP_AUTH_TYPE_PLAIN login:[username stringValue] password:[password stringValue]];
}
else
{
[myAccount connectToServer:[server stringValue] port:[port intValue] connectionType:CONNECTION_TYPE_PLAIN
authType:IMAP_AUTH_TYPE_PLAIN login:[username stringValue] password:[password stringValue]];
}
CTCoreFolder *inbox = [myAccount folderWithPath:@"INBOX"];
NSLog(@"INBOX %@", inbox);
// set the toIndex to 0 so all messages are loaded
NSSet *messageSet = [inbox messageObjectsFromIndex:1 toIndex:0];
NSLog(@"Done getting list of messages...");
NSMutableSet *messagesProxy = [self mutableSetValueForKey:@"messages"];
NSEnumerator *objEnum = [messageSet objectEnumerator];
id msg;
while(msg = [objEnum nextObject]) {
[msg fetchBodyStructure];
[messagesProxy addObject:msg];
}
}
- (NSMutableArray *)messages
{
return myMessages;
}
- (void)setMessages:(NSMutableArray *)messages
{
[messages retain];
[myMessages release];
myMessages = messages;
}
@end
@@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
objectVersion = 42;
objectVersion = 46;
objects = {
/* Begin PBXBuildFile section */
@@ -12,8 +12,34 @@
8D11072D0486CEB800E47090 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; settings = {ATTRIBUTES = (); }; };
8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */; };
F805A72009D7CD7D0055EFC3 /* MyController.m in Sources */ = {isa = PBXBuildFile; fileRef = F805A71F09D7CD7D0055EFC3 /* MyController.m */; };
F8A2FB11144FB18A00C03DB4 /* MailCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F8A2FB0A144FB0AD00C03DB4 /* MailCore.framework */; };
F8A2FB12144FB19300C03DB4 /* MailCore.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = F8A2FB0A144FB0AD00C03DB4 /* MailCore.framework */; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
F8A2FB09144FB0AD00C03DB4 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = F8A2FAF4144FB0AC00C03DB4 /* MailCore.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = 8DC2EF5B0486A6940098B216;
remoteInfo = MailCore;
};
F8A2FB0B144FB0AD00C03DB4 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = F8A2FAF4144FB0AC00C03DB4 /* MailCore.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = F82D7C810F48AC8500ADA65C;
remoteInfo = Tests;
};
F8A2FB0D144FB0AD00C03DB4 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = F8A2FAF4144FB0AC00C03DB4 /* MailCore.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = F8618B5710DADB5C00C41188;
remoteInfo = "MailCore iOS";
};
/* End PBXContainerItemProxy section */
/* Begin PBXCopyFilesBuildPhase section */
F805A83009D7CDB80055EFC3 /* CopyFiles */ = {
isa = PBXCopyFilesBuildPhase;
@@ -21,6 +47,7 @@
dstPath = "";
dstSubfolderSpec = 10;
files = (
F8A2FB12144FB19300C03DB4 /* MailCore.framework in CopyFiles */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -39,6 +66,8 @@
8D1107320486CEB800E47090 /* MessageSender.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = MessageSender.app; sourceTree = BUILT_PRODUCTS_DIR; };
F805A71E09D7CD7D0055EFC3 /* MyController.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = MyController.h; sourceTree = "<group>"; };
F805A71F09D7CD7D0055EFC3 /* MyController.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = MyController.m; sourceTree = "<group>"; };
F856BE2313779C2000D9C2ED /* MailCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MailCore.framework; path = ../../build/Debug/MailCore.framework; sourceTree = "<group>"; };
F8A2FAF4144FB0AC00C03DB4 /* MailCore.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = MailCore.xcodeproj; path = ../../../MailCore.xcodeproj; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
@@ -46,6 +75,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
F8A2FB11144FB18A00C03DB4 /* MailCore.framework in Frameworks */,
8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
@@ -73,6 +103,7 @@
1058C7A2FEA54F0111CA2CBB /* Other Frameworks */ = {
isa = PBXGroup;
children = (
F856BE2313779C2000D9C2ED /* MailCore.framework */,
29B97324FDCFA39411CA2CEA /* AppKit.framework */,
13E42FB307B3F0F600E4EEF1 /* CoreData.framework */,
29B97325FDCFA39411CA2CEA /* Foundation.framework */,
@@ -91,6 +122,7 @@
29B97314FDCFA39411CA2CEA /* MessageSender */ = {
isa = PBXGroup;
children = (
F8A2FAF4144FB0AC00C03DB4 /* MailCore.xcodeproj */,
080E96DDFE201D6D7F000001 /* Classes */,
29B97315FDCFA39411CA2CEA /* Other Sources */,
29B97317FDCFA39411CA2CEA /* Resources */,
@@ -128,6 +160,16 @@
name = Frameworks;
sourceTree = "<group>";
};
F8A2FAF5144FB0AC00C03DB4 /* Products */ = {
isa = PBXGroup;
children = (
F8A2FB0A144FB0AD00C03DB4 /* MailCore.framework */,
F8A2FB0C144FB0AD00C03DB4 /* Tests.octest */,
F8A2FB0E144FB0AD00C03DB4 /* libmailcore.a */,
);
name = Products;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
@@ -155,11 +197,24 @@
/* Begin PBXProject section */
29B97313FDCFA39411CA2CEA /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0430;
};
buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "MessageSender" */;
compatibilityVersion = "Xcode 2.4";
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
hasScannedForEncodings = 1;
knownRegions = (
en,
);
mainGroup = 29B97314FDCFA39411CA2CEA /* MessageSender */;
projectDirPath = "";
projectReferences = (
{
ProductGroup = F8A2FAF5144FB0AC00C03DB4 /* Products */;
ProjectRef = F8A2FAF4144FB0AC00C03DB4 /* MailCore.xcodeproj */;
},
);
projectRoot = "";
targets = (
8D1107260486CEB800E47090 /* MessageSender */,
@@ -167,6 +222,30 @@
};
/* End PBXProject section */
/* Begin PBXReferenceProxy section */
F8A2FB0A144FB0AD00C03DB4 /* MailCore.framework */ = {
isa = PBXReferenceProxy;
fileType = wrapper.framework;
path = MailCore.framework;
remoteRef = F8A2FB09144FB0AD00C03DB4 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
F8A2FB0C144FB0AD00C03DB4 /* Tests.octest */ = {
isa = PBXReferenceProxy;
fileType = wrapper.cfbundle;
path = Tests.octest;
remoteRef = F8A2FB0B144FB0AD00C03DB4 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
F8A2FB0E144FB0AD00C03DB4 /* libmailcore.a */ = {
isa = PBXReferenceProxy;
fileType = archive.ar;
path = libmailcore.a;
remoteRef = F8A2FB0D144FB0AD00C03DB4 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
/* End PBXReferenceProxy section */
/* Begin PBXResourcesBuildPhase section */
8D1107290486CEB800E47090 /* Resources */ = {
isa = PBXResourcesBuildPhase;
@@ -215,18 +294,13 @@
isa = XCBuildConfiguration;
buildSettings = {
COPY_PHASE_STRIP = NO;
FRAMEWORK_SEARCH_PATHS = (
"$(FRAMEWORK_SEARCH_PATHS)",
"$(SRCROOT)/../../build/Debug",
"$(SRCROOT)/../../build/Release",
"$(SRCROOT)/../..",
"$(FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_1)",
);
FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_1 = "\"$(SRCROOT)/../../../../Library/Frameworks\"";
GCC_DYNAMIC_NO_PIC = NO;
GCC_ENABLE_FIX_AND_CONTINUE = YES;
GCC_MODEL_TUNING = G5;
GCC_OPTIMIZATION_LEVEL = 0;
HEADER_SEARCH_PATHS = (
"$(SRCROOT)/../../../libetpan/build-mac/include",
"$(SRCROOT)/../../../include",
);
INFOPLIST_FILE = Info.plist;
INSTALL_PATH = "$(HOME)/Applications";
PRODUCT_NAME = MessageSender;
@@ -238,20 +312,12 @@
C01FCF4C08A954540054247B /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = (
ppc,
i386,
);
FRAMEWORK_SEARCH_PATHS = (
"$(FRAMEWORK_SEARCH_PATHS)",
"$(SRCROOT)/../../build/Debug",
"$(SRCROOT)/../../build/Release",
"$(SRCROOT)/../..",
"$(FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_1)",
);
FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_1 = "\"$(SRCROOT)/../../../../Library/Frameworks\"";
GCC_GENERATE_DEBUGGING_SYMBOLS = NO;
GCC_MODEL_TUNING = G5;
HEADER_SEARCH_PATHS = (
"$(SRCROOT)/../../../libetpan/build-mac/include",
"$(SRCROOT)/../../../include",
);
INFOPLIST_FILE = Info.plist;
INSTALL_PATH = "$(HOME)/Applications";
PRODUCT_NAME = MessageSender;
@@ -264,8 +330,7 @@
buildSettings = {
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
PREBINDING = NO;
SDKROOT = /Developer/SDKs/MacOSX10.5.sdk;
SDKROOT = macosx;
};
name = Debug;
};
@@ -274,8 +339,7 @@
buildSettings = {
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
PREBINDING = NO;
SDKROOT = /Developer/SDKs/MacOSX10.5.sdk;
SDKROOT = macosx;
};
name = Release;
};
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "self:MessageSender.xcodeproj">
</FileRef>
</Workspace>
@@ -9,10 +9,10 @@
IBOutlet id port;
IBOutlet id server;
IBOutlet id username;
IBOutlet id useAuth;
IBOutlet id useTLS;
IBOutlet id useAuth;
IBOutlet id useTLS;
CTCoreMessage *myMessage;
CTCoreMessage *myMessage;
}
- (IBAction)sendMessage:(id)sender;
- (NSString *)to;
+79
View File
@@ -0,0 +1,79 @@
#import "MyController.h"
@implementation MyController
- (id)init
{
self = [super init];
if(self)
{
myMessage = [[CTCoreMessage alloc] init];
}
return self;
}
- (void)dealloc
{
[myMessage release];
[super dealloc];
}
- (IBAction)sendMessage:(id)sender
{
CTCoreMessage *msg = [[CTCoreMessage alloc] init];
[msg setTo:[myMessage to]];
[msg setFrom:[myMessage from]];
[msg setBody:[myMessage body]];
[msg setSubject:[myMessage subject]];
BOOL auth = ([useAuth state] == NSOnState);
BOOL tls = ([useTLS state] == NSOnState);
[CTSMTPConnection sendMessage:msg server:[server stringValue] username:[username stringValue]
password:[password stringValue] port:[port intValue] useTLS:tls useAuth:auth];
[msg release];
}
- (NSString *)to
{
return [[[myMessage to] anyObject] email];
}
- (void)setTo:(NSString *)aValue
{
CTCoreAddress *addr = [CTCoreAddress address];
[addr setEmail:aValue];
[myMessage setTo:[NSSet setWithObject:addr]];
}
- (NSString *)from
{
return [[[myMessage from] anyObject] email];
}
- (void)setFrom:(NSString *)aValue
{
CTCoreAddress *addr = [CTCoreAddress address];
[addr setEmail:aValue];
[addr setName:@""];
[myMessage setFrom:[NSSet setWithObject:addr]];
}
- (NSString *)subject
{
return [myMessage subject];
}
- (void)setSubject:(NSString *)aValue
{
[myMessage setSubject:aValue];
}
- (NSString *)body
{
return [myMessage body];
}
- (void)setBody:(NSString *)aValue
{
[myMessage setBody:aValue];
}
@end
@@ -0,0 +1,531 @@
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 46;
objects = {
/* Begin PBXBuildFile section */
F81524F5144FA4A5007ABA9C /* libssl.a in Frameworks */ = {isa = PBXBuildFile; fileRef = F851FBC3144D13A5003F58D4 /* libssl.a */; };
F851FBB3144D134C003F58D4 /* libetpan_ios.a in Frameworks */ = {isa = PBXBuildFile; fileRef = F851FBB2144D133D003F58D4 /* libetpan_ios.a */; };
F851FBBB144D1391003F58D4 /* libsasl2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = F851FBBA144D1382003F58D4 /* libsasl2.a */; };
F851FBC6144D13B8003F58D4 /* libcrypto.a in Frameworks */ = {isa = PBXBuildFile; fileRef = F851FBC5144D13A5003F58D4 /* libcrypto.a */; };
F8919583144D0BF000EADD16 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F8919582144D0BF000EADD16 /* UIKit.framework */; };
F8919585144D0BF000EADD16 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F8919584144D0BF000EADD16 /* Foundation.framework */; };
F8919587144D0BF000EADD16 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F8919586144D0BF000EADD16 /* CoreGraphics.framework */; };
F891958D144D0BF000EADD16 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = F891958B144D0BF000EADD16 /* InfoPlist.strings */; };
F891958F144D0BF000EADD16 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = F891958E144D0BF000EADD16 /* main.m */; };
F8919593144D0BF000EADD16 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = F8919592144D0BF000EADD16 /* AppDelegate.m */; };
F8919596144D0BF000EADD16 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = F8919595144D0BF000EADD16 /* ViewController.m */; };
F8919599144D0BF000EADD16 /* ViewController_iPhone.xib in Resources */ = {isa = PBXBuildFile; fileRef = F8919597144D0BF000EADD16 /* ViewController_iPhone.xib */; };
F891959C144D0BF000EADD16 /* ViewController_iPad.xib in Resources */ = {isa = PBXBuildFile; fileRef = F891959A144D0BF000EADD16 /* ViewController_iPad.xib */; };
F89195D0144D0CAB00EADD16 /* libmailcore.a in Frameworks */ = {isa = PBXBuildFile; fileRef = F89195CC144D0C8900EADD16 /* libmailcore.a */; };
F89195D7144D0EFA00EADD16 /* libiconv.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = F89195D6144D0EF900EADD16 /* libiconv.dylib */; };
F8B6D589156EE4BB008DE9EB /* CFNetwork.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F8B6D588156EE4BB008DE9EB /* CFNetwork.framework */; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
F851FBAD144D133D003F58D4 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = F851FBA7144D133D003F58D4 /* libetpan.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = 8DC2EF5B0486A6940098B216;
remoteInfo = libetpan;
};
F851FBB1144D133D003F58D4 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = F851FBA7144D133D003F58D4 /* libetpan.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = F8B2455E144B8C48002B56DA;
remoteInfo = "static libetpan iOS";
};
F851FBB9144D1382003F58D4 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = F851FBB4144D1381003F58D4 /* Cyrus SASL.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = D2AAC07E0554694100DB518D;
remoteInfo = sasl2;
};
F851FBC2144D13A5003F58D4 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = F851FBBC144D13A4003F58D4 /* openssl.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = D2AAC07E0554694100DB518D;
remoteInfo = ssl;
};
F851FBC4144D13A5003F58D4 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = F851FBBC144D13A4003F58D4 /* openssl.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = A0511C5A127770FD00DE46C4;
remoteInfo = crypto;
};
F89195C7144D0C8900EADD16 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = F89195B2144D0C8800EADD16 /* MailCore.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = 8DC2EF5B0486A6940098B216;
remoteInfo = MailCore;
};
F89195C9144D0C8900EADD16 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = F89195B2144D0C8800EADD16 /* MailCore.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = F82D7C810F48AC8500ADA65C;
remoteInfo = Tests;
};
F89195CB144D0C8900EADD16 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = F89195B2144D0C8800EADD16 /* MailCore.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = F8618B5710DADB5C00C41188;
remoteInfo = "MailCore iOS";
};
F8B6D57F156EE463008DE9EB /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = F851FBA7144D133D003F58D4 /* libetpan.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = F8B6D4CC156EE0B6008DE9EB;
remoteInfo = "static libetpan Mac";
};
/* End PBXContainerItemProxy section */
/* Begin PBXFileReference section */
F851FBA7144D133D003F58D4 /* libetpan.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = libetpan.xcodeproj; path = "../../../libetpan/build-mac/libetpan.xcodeproj"; sourceTree = "<group>"; };
F851FBB4144D1381003F58D4 /* Cyrus SASL.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = "Cyrus SASL.xcodeproj"; path = "../../../iOSPorts/ports/security/cyrus-sasl/Cyrus SASL.xcodeproj"; sourceTree = "<group>"; };
F851FBBC144D13A4003F58D4 /* openssl.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = openssl.xcodeproj; path = ../../../iOSPorts/ports/security/openssl/openssl.xcodeproj; sourceTree = "<group>"; };
F891957E144D0BF000EADD16 /* MessageSender.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = MessageSender.app; sourceTree = BUILT_PRODUCTS_DIR; };
F8919582144D0BF000EADD16 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
F8919584144D0BF000EADD16 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
F8919586144D0BF000EADD16 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; };
F891958A144D0BF000EADD16 /* MessageSender-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "MessageSender-Info.plist"; sourceTree = "<group>"; };
F891958C144D0BF000EADD16 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; };
F891958E144D0BF000EADD16 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
F8919590144D0BF000EADD16 /* MessageSender-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "MessageSender-Prefix.pch"; sourceTree = "<group>"; };
F8919591144D0BF000EADD16 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
F8919592144D0BF000EADD16 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; };
F8919594144D0BF000EADD16 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = "<group>"; };
F8919595144D0BF000EADD16 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = "<group>"; };
F8919598144D0BF000EADD16 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = en.lproj/ViewController_iPhone.xib; sourceTree = "<group>"; };
F891959B144D0BF000EADD16 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = en.lproj/ViewController_iPad.xib; sourceTree = "<group>"; };
F89195B2144D0C8800EADD16 /* MailCore.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = MailCore.xcodeproj; path = ../../../MailCore.xcodeproj; sourceTree = "<group>"; };
F89195D6144D0EF900EADD16 /* libiconv.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libiconv.dylib; path = usr/lib/libiconv.dylib; sourceTree = SDKROOT; };
F89195D8144D0F0200EADD16 /* libsasl2.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libsasl2.a; path = "../../../iOSPorts/ports/security/cyrus-sasl/build/Debug-iphoneos/libsasl2.a"; sourceTree = "<group>"; };
F89195DA144D0F1000EADD16 /* libcrypto.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libcrypto.a; path = "../../../iOSPorts/ports/security/openssl/build/Debug-iphoneos/libcrypto.a"; sourceTree = "<group>"; };
F8B6D588156EE4BB008DE9EB /* CFNetwork.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CFNetwork.framework; path = System/Library/Frameworks/CFNetwork.framework; sourceTree = SDKROOT; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
F891957B144D0BF000EADD16 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
F8B6D589156EE4BB008DE9EB /* CFNetwork.framework in Frameworks */,
F81524F5144FA4A5007ABA9C /* libssl.a in Frameworks */,
F851FBC6144D13B8003F58D4 /* libcrypto.a in Frameworks */,
F851FBBB144D1391003F58D4 /* libsasl2.a in Frameworks */,
F851FBB3144D134C003F58D4 /* libetpan_ios.a in Frameworks */,
F89195D7144D0EFA00EADD16 /* libiconv.dylib in Frameworks */,
F89195D0144D0CAB00EADD16 /* libmailcore.a in Frameworks */,
F8919583144D0BF000EADD16 /* UIKit.framework in Frameworks */,
F8919585144D0BF000EADD16 /* Foundation.framework in Frameworks */,
F8919587144D0BF000EADD16 /* CoreGraphics.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
F851FBA8144D133D003F58D4 /* Products */ = {
isa = PBXGroup;
children = (
F851FBAE144D133D003F58D4 /* libetpan.framework */,
F851FBB2144D133D003F58D4 /* libetpan_ios.a */,
F8B6D580156EE463008DE9EB /* libetpan_mac.a */,
);
name = Products;
sourceTree = "<group>";
};
F851FBB5144D1381003F58D4 /* Products */ = {
isa = PBXGroup;
children = (
F851FBBA144D1382003F58D4 /* libsasl2.a */,
);
name = Products;
sourceTree = "<group>";
};
F851FBBD144D13A4003F58D4 /* Products */ = {
isa = PBXGroup;
children = (
F851FBC3144D13A5003F58D4 /* libssl.a */,
F851FBC5144D13A5003F58D4 /* libcrypto.a */,
);
name = Products;
sourceTree = "<group>";
};
F8919573144D0BEF00EADD16 = {
isa = PBXGroup;
children = (
F8B6D588156EE4BB008DE9EB /* CFNetwork.framework */,
F851FBBC144D13A4003F58D4 /* openssl.xcodeproj */,
F851FBB4144D1381003F58D4 /* Cyrus SASL.xcodeproj */,
F851FBA7144D133D003F58D4 /* libetpan.xcodeproj */,
F89195B2144D0C8800EADD16 /* MailCore.xcodeproj */,
F8919588144D0BF000EADD16 /* MessageSender */,
F8919581144D0BF000EADD16 /* Frameworks */,
F891957F144D0BF000EADD16 /* Products */,
);
sourceTree = "<group>";
};
F891957F144D0BF000EADD16 /* Products */ = {
isa = PBXGroup;
children = (
F891957E144D0BF000EADD16 /* MessageSender.app */,
);
name = Products;
sourceTree = "<group>";
};
F8919581144D0BF000EADD16 /* Frameworks */ = {
isa = PBXGroup;
children = (
F89195DA144D0F1000EADD16 /* libcrypto.a */,
F89195D8144D0F0200EADD16 /* libsasl2.a */,
F89195D6144D0EF900EADD16 /* libiconv.dylib */,
F8919582144D0BF000EADD16 /* UIKit.framework */,
F8919584144D0BF000EADD16 /* Foundation.framework */,
F8919586144D0BF000EADD16 /* CoreGraphics.framework */,
);
name = Frameworks;
sourceTree = "<group>";
};
F8919588144D0BF000EADD16 /* MessageSender */ = {
isa = PBXGroup;
children = (
F8919591144D0BF000EADD16 /* AppDelegate.h */,
F8919592144D0BF000EADD16 /* AppDelegate.m */,
F8919594144D0BF000EADD16 /* ViewController.h */,
F8919595144D0BF000EADD16 /* ViewController.m */,
F8919597144D0BF000EADD16 /* ViewController_iPhone.xib */,
F891959A144D0BF000EADD16 /* ViewController_iPad.xib */,
F8919589144D0BF000EADD16 /* Supporting Files */,
);
path = MessageSender;
sourceTree = "<group>";
};
F8919589144D0BF000EADD16 /* Supporting Files */ = {
isa = PBXGroup;
children = (
F891958A144D0BF000EADD16 /* MessageSender-Info.plist */,
F891958B144D0BF000EADD16 /* InfoPlist.strings */,
F891958E144D0BF000EADD16 /* main.m */,
F8919590144D0BF000EADD16 /* MessageSender-Prefix.pch */,
);
name = "Supporting Files";
sourceTree = "<group>";
};
F89195B3144D0C8800EADD16 /* Products */ = {
isa = PBXGroup;
children = (
F89195C8144D0C8900EADD16 /* MailCore.framework */,
F89195CA144D0C8900EADD16 /* Tests.octest */,
F89195CC144D0C8900EADD16 /* libmailcore.a */,
);
name = Products;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
F891957D144D0BF000EADD16 /* MessageSender */ = {
isa = PBXNativeTarget;
buildConfigurationList = F891959F144D0BF000EADD16 /* Build configuration list for PBXNativeTarget "MessageSender" */;
buildPhases = (
F891957A144D0BF000EADD16 /* Sources */,
F891957B144D0BF000EADD16 /* Frameworks */,
F891957C144D0BF000EADD16 /* Resources */,
);
buildRules = (
);
dependencies = (
);
name = MessageSender;
productName = MessageSender;
productReference = F891957E144D0BF000EADD16 /* MessageSender.app */;
productType = "com.apple.product-type.application";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
F8919575144D0BEF00EADD16 /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0420;
};
buildConfigurationList = F8919578144D0BEF00EADD16 /* Build configuration list for PBXProject "MessageSender" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
hasScannedForEncodings = 0;
knownRegions = (
en,
);
mainGroup = F8919573144D0BEF00EADD16;
productRefGroup = F891957F144D0BF000EADD16 /* Products */;
projectDirPath = "";
projectReferences = (
{
ProductGroup = F851FBB5144D1381003F58D4 /* Products */;
ProjectRef = F851FBB4144D1381003F58D4 /* Cyrus SASL.xcodeproj */;
},
{
ProductGroup = F851FBA8144D133D003F58D4 /* Products */;
ProjectRef = F851FBA7144D133D003F58D4 /* libetpan.xcodeproj */;
},
{
ProductGroup = F89195B3144D0C8800EADD16 /* Products */;
ProjectRef = F89195B2144D0C8800EADD16 /* MailCore.xcodeproj */;
},
{
ProductGroup = F851FBBD144D13A4003F58D4 /* Products */;
ProjectRef = F851FBBC144D13A4003F58D4 /* openssl.xcodeproj */;
},
);
projectRoot = "";
targets = (
F891957D144D0BF000EADD16 /* MessageSender */,
);
};
/* End PBXProject section */
/* Begin PBXReferenceProxy section */
F851FBAE144D133D003F58D4 /* libetpan.framework */ = {
isa = PBXReferenceProxy;
fileType = wrapper.framework;
path = libetpan.framework;
remoteRef = F851FBAD144D133D003F58D4 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
F851FBB2144D133D003F58D4 /* libetpan_ios.a */ = {
isa = PBXReferenceProxy;
fileType = archive.ar;
path = libetpan_ios.a;
remoteRef = F851FBB1144D133D003F58D4 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
F851FBBA144D1382003F58D4 /* libsasl2.a */ = {
isa = PBXReferenceProxy;
fileType = archive.ar;
path = libsasl2.a;
remoteRef = F851FBB9144D1382003F58D4 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
F851FBC3144D13A5003F58D4 /* libssl.a */ = {
isa = PBXReferenceProxy;
fileType = archive.ar;
path = libssl.a;
remoteRef = F851FBC2144D13A5003F58D4 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
F851FBC5144D13A5003F58D4 /* libcrypto.a */ = {
isa = PBXReferenceProxy;
fileType = archive.ar;
path = libcrypto.a;
remoteRef = F851FBC4144D13A5003F58D4 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
F89195C8144D0C8900EADD16 /* MailCore.framework */ = {
isa = PBXReferenceProxy;
fileType = wrapper.framework;
path = MailCore.framework;
remoteRef = F89195C7144D0C8900EADD16 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
F89195CA144D0C8900EADD16 /* Tests.octest */ = {
isa = PBXReferenceProxy;
fileType = wrapper.cfbundle;
path = Tests.octest;
remoteRef = F89195C9144D0C8900EADD16 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
F89195CC144D0C8900EADD16 /* libmailcore.a */ = {
isa = PBXReferenceProxy;
fileType = archive.ar;
path = libmailcore.a;
remoteRef = F89195CB144D0C8900EADD16 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
F8B6D580156EE463008DE9EB /* libetpan_mac.a */ = {
isa = PBXReferenceProxy;
fileType = archive.ar;
path = libetpan_mac.a;
remoteRef = F8B6D57F156EE463008DE9EB /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
/* End PBXReferenceProxy section */
/* Begin PBXResourcesBuildPhase section */
F891957C144D0BF000EADD16 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
F891958D144D0BF000EADD16 /* InfoPlist.strings in Resources */,
F8919599144D0BF000EADD16 /* ViewController_iPhone.xib in Resources */,
F891959C144D0BF000EADD16 /* ViewController_iPad.xib in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
F891957A144D0BF000EADD16 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
F891958F144D0BF000EADD16 /* main.m in Sources */,
F8919593144D0BF000EADD16 /* AppDelegate.m in Sources */,
F8919596144D0BF000EADD16 /* ViewController.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin PBXVariantGroup section */
F891958B144D0BF000EADD16 /* InfoPlist.strings */ = {
isa = PBXVariantGroup;
children = (
F891958C144D0BF000EADD16 /* en */,
);
name = InfoPlist.strings;
sourceTree = "<group>";
};
F8919597144D0BF000EADD16 /* ViewController_iPhone.xib */ = {
isa = PBXVariantGroup;
children = (
F8919598144D0BF000EADD16 /* en */,
);
name = ViewController_iPhone.xib;
sourceTree = "<group>";
};
F891959A144D0BF000EADD16 /* ViewController_iPad.xib */ = {
isa = PBXVariantGroup;
children = (
F891959B144D0BF000EADD16 /* en */,
);
name = ViewController_iPad.xib;
sourceTree = "<group>";
};
/* End PBXVariantGroup section */
/* Begin XCBuildConfiguration section */
F891959D144D0BF000EADD16 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ARCHS = "$(ARCHS_STANDARD_32_BIT)";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 5.0;
SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
};
F891959E144D0BF000EADD16 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ARCHS = "$(ARCHS_STANDARD_32_BIT)";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 5.0;
OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1";
SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2";
VALIDATE_PRODUCT = YES;
};
name = Release;
};
F89195A0144D0BF000EADD16 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
FRAMEWORK_SEARCH_PATHS = "";
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "MessageSender/MessageSender-Prefix.pch";
HEADER_SEARCH_PATHS = (
"$(SRCROOT)/../../../libetpan/build-mac/include",
"$(SRCROOT)/../../../include",
);
INFOPLIST_FILE = "MessageSender/MessageSender-Info.plist";
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"\"$(SRCROOT)/../../../iOSPorts/ports/security/cyrus-sasl/build/Debug-iphoneos\"",
"\"$(SRCROOT)/../../../iOSPorts/ports/security/openssl/build/Debug-iphoneos\"",
);
PRODUCT_NAME = "$(TARGET_NAME)";
WRAPPER_EXTENSION = app;
};
name = Debug;
};
F89195A1144D0BF000EADD16 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
FRAMEWORK_SEARCH_PATHS = "";
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "MessageSender/MessageSender-Prefix.pch";
HEADER_SEARCH_PATHS = (
"$(SRCROOT)/../../../libetpan/build-mac/include",
"$(SRCROOT)/../../../include",
);
INFOPLIST_FILE = "MessageSender/MessageSender-Info.plist";
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"\"$(SRCROOT)/../../../iOSPorts/ports/security/cyrus-sasl/build/Debug-iphoneos\"",
"\"$(SRCROOT)/../../../iOSPorts/ports/security/openssl/build/Debug-iphoneos\"",
);
PRODUCT_NAME = "$(TARGET_NAME)";
WRAPPER_EXTENSION = app;
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
F8919578144D0BEF00EADD16 /* Build configuration list for PBXProject "MessageSender" */ = {
isa = XCConfigurationList;
buildConfigurations = (
F891959D144D0BF000EADD16 /* Debug */,
F891959E144D0BF000EADD16 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
F891959F144D0BF000EADD16 /* Build configuration list for PBXNativeTarget "MessageSender" */ = {
isa = XCConfigurationList;
buildConfigurations = (
F89195A0144D0BF000EADD16 /* Debug */,
F89195A1144D0BF000EADD16 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = F8919575144D0BEF00EADD16 /* Project object */;
}
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "self:MessageSender.xcodeproj">
</FileRef>
</Workspace>
@@ -0,0 +1,19 @@
//
// AppDelegate.h
// MessageSender
//
// Created by Matthew Ronge on 10/17/11.
// Copyright (c) 2011 __MyCompanyName__. All rights reserved.
//
#import <UIKit/UIKit.h>
@class ViewController;
@interface AppDelegate : UIResponder <UIApplicationDelegate>
@property (strong, nonatomic) UIWindow *window;
@property (strong, nonatomic) ViewController *viewController;
@end
@@ -0,0 +1,78 @@
//
// AppDelegate.m
// MessageSender
//
// Created by Matthew Ronge on 10/17/11.
// Copyright (c) 2011 __MyCompanyName__. All rights reserved.
//
#import "AppDelegate.h"
#import "ViewController.h"
@implementation AppDelegate
@synthesize window = _window;
@synthesize viewController = _viewController;
- (void)dealloc
{
[_window release];
[_viewController release];
[super dealloc];
}
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease];
// Override point for customization after application launch.
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) {
self.viewController = [[[ViewController alloc] initWithNibName:@"ViewController_iPhone" bundle:nil] autorelease];
} else {
self.viewController = [[[ViewController alloc] initWithNibName:@"ViewController_iPad" bundle:nil] autorelease];
}
self.window.rootViewController = self.viewController;
[self.window makeKeyAndVisible];
return YES;
}
- (void)applicationWillResignActive:(UIApplication *)application
{
/*
Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
*/
}
- (void)applicationDidEnterBackground:(UIApplication *)application
{
/*
Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
*/
}
- (void)applicationWillEnterForeground:(UIApplication *)application
{
/*
Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
*/
}
- (void)applicationDidBecomeActive:(UIApplication *)application
{
/*
Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
*/
}
- (void)applicationWillTerminate:(UIApplication *)application
{
/*
Called when the application is about to terminate.
Save data if appropriate.
See also applicationDidEnterBackground:.
*/
}
@end
@@ -0,0 +1,47 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleDisplayName</key>
<string>${PRODUCT_NAME}</string>
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIconFiles</key>
<array/>
<key>CFBundleIdentifier</key>
<string>com.example.${PRODUCT_NAME:rfc1034identifier}</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>${PRODUCT_NAME}</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.0</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
</array>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
</dict>
</plist>
@@ -0,0 +1,14 @@
//
// Prefix header for all source files of the 'MessageSender' target in the 'MessageSender' project
//
#import <Availability.h>
#ifndef __IPHONE_4_0
#warning "This project uses features only available in iOS SDK 4.0 and later."
#endif
#ifdef __OBJC__
#import <UIKit/UIKit.h>
#import <Foundation/Foundation.h>
#endif
@@ -0,0 +1,14 @@
//
// ViewController.h
// MessageSender
//
// Created by Matthew Ronge on 10/17/11.
// Copyright (c) 2011 __MyCompanyName__. All rights reserved.
//
#import <UIKit/UIKit.h>
#import <MailCore/MailCore.h>
@interface ViewController : UIViewController
@end
@@ -0,0 +1,70 @@
//
// ViewController.m
// MessageSender
//
// Created by Matthew Ronge on 10/17/11.
// Copyright (c) 2011 __MyCompanyName__. All rights reserved.
//
#import "ViewController.h"
@implementation ViewController
- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
// Release any cached data, images, etc that aren't in use.
}
#pragma mark - View lifecycle
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
CTCoreMessage *msg = [[CTCoreMessage alloc] init];
// [CTSMTPConnection sendMessage:msg server:[server stringValue] username:[username stringValue]
// password:[password stringValue] port:[port intValue] useTLS:tls useAuth:auth];
[msg release];
}
- (void)viewDidUnload
{
[super viewDidUnload];
// Release any retained subviews of the main view.
// e.g. self.myOutlet = nil;
}
- (void)viewWillAppear:(BOOL)animated
{
[super viewWillAppear:animated];
}
- (void)viewDidAppear:(BOOL)animated
{
[super viewDidAppear:animated];
}
- (void)viewWillDisappear:(BOOL)animated
{
[super viewWillDisappear:animated];
}
- (void)viewDidDisappear:(BOOL)animated
{
[super viewDidDisappear:animated];
}
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
// Return YES for supported orientations
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) {
return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown);
} else {
return YES;
}
}
@end
@@ -0,0 +1,2 @@
/* Localized versions of Info.plist keys */
@@ -0,0 +1,162 @@
<?xml version="1.0" encoding="UTF-8"?>
<archive type="com.apple.InterfaceBuilder3.CocoaTouch.iPad.XIB" version="8.00">
<data>
<int key="IBDocument.SystemTarget">1280</int>
<string key="IBDocument.SystemVersion">11B26</string>
<string key="IBDocument.InterfaceBuilderVersion">1938</string>
<string key="IBDocument.AppKitVersion">1138</string>
<string key="IBDocument.HIToolboxVersion">566.00</string>
<object class="NSMutableDictionary" key="IBDocument.PluginVersions">
<string key="NS.key.0">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="NS.object.0">933</string>
</object>
<array key="IBDocument.IntegratedClassDependencies">
<string>IBProxyObject</string>
<string>IBUIView</string>
<string>IBUILabel</string>
</array>
<array key="IBDocument.PluginDependencies">
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
</array>
<object class="NSMutableDictionary" key="IBDocument.Metadata">
<string key="NS.key.0">PluginDependencyRecalculationVersion</string>
<integer value="1" key="NS.object.0"/>
</object>
<array class="NSMutableArray" key="IBDocument.RootObjects" id="1000">
<object class="IBProxyObject" id="841351856">
<string key="IBProxiedObjectIdentifier">IBFilesOwner</string>
<string key="targetRuntimeIdentifier">IBIPadFramework</string>
</object>
<object class="IBProxyObject" id="606714003">
<string key="IBProxiedObjectIdentifier">IBFirstResponder</string>
<string key="targetRuntimeIdentifier">IBIPadFramework</string>
</object>
<object class="IBUIView" id="766721923">
<reference key="NSNextResponder"/>
<int key="NSvFlags">274</int>
<array class="NSMutableArray" key="NSSubviews">
<object class="IBUILabel" id="943291862">
<reference key="NSNextResponder" ref="766721923"/>
<int key="NSvFlags">292</int>
<string key="NSFrame">{{281, 342}, {150, 21}}</string>
<reference key="NSSuperview" ref="766721923"/>
<reference key="NSWindow"/>
<string key="NSReuseIdentifierKey">_NS:345</string>
<bool key="IBUIOpaque">NO</bool>
<bool key="IBUIClipsSubviews">YES</bool>
<int key="IBUIContentMode">7</int>
<bool key="IBUIUserInteractionEnabled">NO</bool>
<string key="targetRuntimeIdentifier">IBIPadFramework</string>
<string key="IBUIText">Nothing to see here</string>
<object class="NSColor" key="IBUITextColor">
<int key="NSColorSpace">1</int>
<bytes key="NSRGB">MCAwIDAAA</bytes>
</object>
<nil key="IBUIHighlightedColor"/>
<int key="IBUIBaselineAdjustment">1</int>
<float key="IBUIMinimumFontSize">10</float>
<object class="IBUIFontDescription" key="IBUIFontDescription">
<int key="type">1</int>
<double key="pointSize">17</double>
</object>
<object class="NSFont" key="IBUIFont">
<string key="NSName">Helvetica</string>
<double key="NSSize">17</double>
<int key="NSfFlags">16</int>
</object>
</object>
</array>
<string key="NSFrame">{{0, 20}, {768, 1004}}</string>
<reference key="NSSuperview"/>
<reference key="NSWindow"/>
<object class="NSColor" key="IBUIBackgroundColor">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MQA</bytes>
<object class="NSColorSpace" key="NSCustomColorSpace">
<int key="NSID">2</int>
</object>
</object>
<object class="IBUISimulatedStatusBarMetrics" key="IBUISimulatedStatusBarMetrics">
<int key="IBUIStatusBarStyle">2</int>
</object>
<string key="targetRuntimeIdentifier">IBIPadFramework</string>
</object>
</array>
<object class="IBObjectContainer" key="IBDocument.Objects">
<array class="NSMutableArray" key="connectionRecords">
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">view</string>
<reference key="source" ref="841351856"/>
<reference key="destination" ref="766721923"/>
</object>
<int key="connectionID">3</int>
</object>
</array>
<object class="IBMutableOrderedSet" key="objectRecords">
<array key="orderedObjects">
<object class="IBObjectRecord">
<int key="objectID">0</int>
<array key="object" id="0"/>
<reference key="children" ref="1000"/>
<nil key="parent"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">-1</int>
<reference key="object" ref="841351856"/>
<reference key="parent" ref="0"/>
<string key="objectName">File's Owner</string>
</object>
<object class="IBObjectRecord">
<int key="objectID">-2</int>
<reference key="object" ref="606714003"/>
<reference key="parent" ref="0"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">2</int>
<reference key="object" ref="766721923"/>
<array class="NSMutableArray" key="children">
<reference ref="943291862"/>
</array>
<reference key="parent" ref="0"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">4</int>
<reference key="object" ref="943291862"/>
<reference key="parent" ref="766721923"/>
</object>
</array>
</object>
<dictionary class="NSMutableDictionary" key="flattenedProperties">
<string key="-1.CustomClassName">ViewController</string>
<string key="-1.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="-2.CustomClassName">UIResponder</string>
<string key="-2.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="2.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="4.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
</dictionary>
<dictionary class="NSMutableDictionary" key="unlocalizedProperties"/>
<nil key="activeLocalization"/>
<dictionary class="NSMutableDictionary" key="localizations"/>
<nil key="sourceID"/>
<int key="maxID">4</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<array class="NSMutableArray" key="referencedPartialClassDescriptions">
<object class="IBPartialClassDescription">
<string key="className">ViewController</string>
<string key="superclassName">UIViewController</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">./Classes/ViewController.h</string>
</object>
</object>
</array>
</object>
<int key="IBDocument.localizationMode">0</int>
<string key="IBDocument.TargetRuntimeIdentifier">IBIPadFramework</string>
<bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
<int key="IBDocument.defaultPropertyAccessControl">3</int>
<string key="IBCocoaTouchPluginVersion">933</string>
</data>
</archive>
@@ -0,0 +1,163 @@
<?xml version="1.0" encoding="UTF-8"?>
<archive type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="8.00">
<data>
<int key="IBDocument.SystemTarget">1280</int>
<string key="IBDocument.SystemVersion">11B26</string>
<string key="IBDocument.InterfaceBuilderVersion">1938</string>
<string key="IBDocument.AppKitVersion">1138</string>
<string key="IBDocument.HIToolboxVersion">566.00</string>
<object class="NSMutableDictionary" key="IBDocument.PluginVersions">
<string key="NS.key.0">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="NS.object.0">933</string>
</object>
<array key="IBDocument.IntegratedClassDependencies">
<string>IBProxyObject</string>
<string>IBUIView</string>
<string>IBUILabel</string>
</array>
<array key="IBDocument.PluginDependencies">
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
</array>
<object class="NSMutableDictionary" key="IBDocument.Metadata">
<string key="NS.key.0">PluginDependencyRecalculationVersion</string>
<integer value="1" key="NS.object.0"/>
</object>
<array class="NSMutableArray" key="IBDocument.RootObjects" id="1000">
<object class="IBProxyObject" id="372490531">
<string key="IBProxiedObjectIdentifier">IBFilesOwner</string>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
</object>
<object class="IBProxyObject" id="843779117">
<string key="IBProxiedObjectIdentifier">IBFirstResponder</string>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
</object>
<object class="IBUIView" id="774585933">
<reference key="NSNextResponder"/>
<int key="NSvFlags">274</int>
<array class="NSMutableArray" key="NSSubviews">
<object class="IBUILabel" id="281304688">
<reference key="NSNextResponder" ref="774585933"/>
<int key="NSvFlags">292</int>
<string key="NSFrame">{{85, 219}, {150, 21}}</string>
<reference key="NSSuperview" ref="774585933"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView"/>
<string key="NSReuseIdentifierKey">_NS:328</string>
<bool key="IBUIOpaque">NO</bool>
<bool key="IBUIClipsSubviews">YES</bool>
<int key="IBUIContentMode">7</int>
<bool key="IBUIUserInteractionEnabled">NO</bool>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<string key="IBUIText">Nothing to see here</string>
<object class="NSColor" key="IBUITextColor">
<int key="NSColorSpace">1</int>
<bytes key="NSRGB">MCAwIDAAA</bytes>
</object>
<nil key="IBUIHighlightedColor"/>
<int key="IBUIBaselineAdjustment">1</int>
<float key="IBUIMinimumFontSize">10</float>
<object class="IBUIFontDescription" key="IBUIFontDescription">
<int key="type">1</int>
<double key="pointSize">17</double>
</object>
<object class="NSFont" key="IBUIFont">
<string key="NSName">Helvetica</string>
<double key="NSSize">17</double>
<int key="NSfFlags">16</int>
</object>
</object>
</array>
<string key="NSFrame">{{0, 20}, {320, 460}}</string>
<reference key="NSSuperview"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="281304688"/>
<object class="NSColor" key="IBUIBackgroundColor">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MC43NQA</bytes>
<object class="NSColorSpace" key="NSCustomColorSpace">
<int key="NSID">2</int>
</object>
</object>
<bool key="IBUIClearsContextBeforeDrawing">NO</bool>
<object class="IBUISimulatedStatusBarMetrics" key="IBUISimulatedStatusBarMetrics"/>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
</object>
</array>
<object class="IBObjectContainer" key="IBDocument.Objects">
<array class="NSMutableArray" key="connectionRecords">
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">view</string>
<reference key="source" ref="372490531"/>
<reference key="destination" ref="774585933"/>
</object>
<int key="connectionID">7</int>
</object>
</array>
<object class="IBMutableOrderedSet" key="objectRecords">
<array key="orderedObjects">
<object class="IBObjectRecord">
<int key="objectID">0</int>
<array key="object" id="0"/>
<reference key="children" ref="1000"/>
<nil key="parent"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">-1</int>
<reference key="object" ref="372490531"/>
<reference key="parent" ref="0"/>
<string key="objectName">File's Owner</string>
</object>
<object class="IBObjectRecord">
<int key="objectID">-2</int>
<reference key="object" ref="843779117"/>
<reference key="parent" ref="0"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">6</int>
<reference key="object" ref="774585933"/>
<array class="NSMutableArray" key="children">
<reference ref="281304688"/>
</array>
<reference key="parent" ref="0"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">8</int>
<reference key="object" ref="281304688"/>
<reference key="parent" ref="774585933"/>
</object>
</array>
</object>
<dictionary class="NSMutableDictionary" key="flattenedProperties">
<string key="-1.CustomClassName">ViewController</string>
<string key="-1.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="-2.CustomClassName">UIResponder</string>
<string key="-2.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="6.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="8.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
</dictionary>
<dictionary class="NSMutableDictionary" key="unlocalizedProperties"/>
<nil key="activeLocalization"/>
<dictionary class="NSMutableDictionary" key="localizations"/>
<nil key="sourceID"/>
<int key="maxID">9</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<array class="NSMutableArray" key="referencedPartialClassDescriptions">
<object class="IBPartialClassDescription">
<string key="className">ViewController</string>
<string key="superclassName">UIViewController</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">./Classes/ViewController.h</string>
</object>
</object>
</array>
</object>
<int key="IBDocument.localizationMode">0</int>
<string key="IBDocument.TargetRuntimeIdentifier">IBCocoaTouchFramework</string>
<bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
<int key="IBDocument.defaultPropertyAccessControl">3</int>
<string key="IBCocoaTouchPluginVersion">933</string>
</data>
</archive>
@@ -0,0 +1,18 @@
//
// main.m
// MessageSender
//
// Created by Matthew Ronge on 10/17/11.
// Copyright (c) 2011 __MyCompanyName__. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "AppDelegate.h"
int main(int argc, char *argv[])
{
@autoreleasepool {
return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
}
}
+29
View File
@@ -0,0 +1,29 @@
MailCore
Copyright (C) 2007-2012 Matt Ronge
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. Neither the name of the MailCore project nor the names of its
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
File diff suppressed because it is too large Load Diff
-931
View File
@@ -1,931 +0,0 @@
// !$*UTF8*$!
{
0867D690FE84028FC02AAC07 /* Project object */ = {
activeBuildConfigurationName = Release;
activeTarget = 8DC2EF4F0486A6940098B216 /* MailCore */;
addToTargets = (
8DC2EF4F0486A6940098B216 /* MailCore */,
);
breakpoints = (
);
codeSenseManager = F8A70F000C4069C300D1D694 /* Code sense */;
perUserDictionary = {
"PBXConfiguration.PBXBreakpointsDataSource.v1:1CA1AED706398EBD00589147" = {
PBXFileTableDataSourceColumnSortingDirectionKey = "-1";
PBXFileTableDataSourceColumnSortingKey = PBXBreakpointsDataSource_BreakpointID;
PBXFileTableDataSourceColumnWidthsKey = (
20,
20,
198,
20,
99,
99,
29,
20,
);
PBXFileTableDataSourceColumnsKey = (
PBXBreakpointsDataSource_ActionID,
PBXBreakpointsDataSource_TypeID,
PBXBreakpointsDataSource_BreakpointID,
PBXBreakpointsDataSource_UseID,
PBXBreakpointsDataSource_LocationID,
PBXBreakpointsDataSource_ConditionID,
PBXBreakpointsDataSource_IgnoreCountID,
PBXBreakpointsDataSource_ContinueID,
);
};
PBXConfiguration.PBXFileTableDataSource3.PBXExecutablesDataSource = {
PBXFileTableDataSourceColumnSortingDirectionKey = "-1";
PBXFileTableDataSourceColumnSortingKey = PBXExecutablesDataSource_NameID;
PBXFileTableDataSourceColumnWidthsKey = (
22,
300,
229,
);
PBXFileTableDataSourceColumnsKey = (
PBXExecutablesDataSource_ActiveFlagID,
PBXExecutablesDataSource_NameID,
PBXExecutablesDataSource_CommentsID,
);
};
PBXConfiguration.PBXFileTableDataSource3.PBXFileTableDataSource = {
PBXFileTableDataSourceColumnSortingDirectionKey = "-1";
PBXFileTableDataSourceColumnSortingKey = PBXFileDataSource_FiletypeID;
PBXFileTableDataSourceColumnWidthsKey = (
20,
601,
20,
48,
43,
43,
20,
);
PBXFileTableDataSourceColumnsKey = (
PBXFileDataSource_FiletypeID,
PBXFileDataSource_Filename_ColumnID,
PBXFileDataSource_Built_ColumnID,
PBXFileDataSource_ObjectSize_ColumnID,
PBXFileDataSource_Errors_ColumnID,
PBXFileDataSource_Warnings_ColumnID,
PBXFileDataSource_Target_ColumnID,
);
};
PBXConfiguration.PBXTargetDataSource.PBXTargetDataSource = {
PBXFileTableDataSourceColumnSortingDirectionKey = "-1";
PBXFileTableDataSourceColumnSortingKey = PBXFileDataSource_Filename_ColumnID;
PBXFileTableDataSourceColumnWidthsKey = (
20,
561,
60,
20,
48,
43,
43,
);
PBXFileTableDataSourceColumnsKey = (
PBXFileDataSource_FiletypeID,
PBXFileDataSource_Filename_ColumnID,
PBXTargetDataSource_PrimaryAttribute,
PBXFileDataSource_Built_ColumnID,
PBXFileDataSource_ObjectSize_ColumnID,
PBXFileDataSource_Errors_ColumnID,
PBXFileDataSource_Warnings_ColumnID,
);
};
PBXPerProjectTemplateStateSaveDate = 271638751;
PBXWorkspaceStateSaveDate = 271638751;
};
perUserProjectItems = {
F82D7D360F48AD5200ADA65C = F82D7D360F48AD5200ADA65C /* PBXTextBookmark */;
F82D7D370F48AD5200ADA65C = F82D7D370F48AD5200ADA65C /* PBXTextBookmark */;
F82D7D380F48AD5200ADA65C = F82D7D380F48AD5200ADA65C /* PBXTextBookmark */;
F82D7D390F48AD5200ADA65C = F82D7D390F48AD5200ADA65C /* PBXTextBookmark */;
F82D7D4A0F4A0D2500ADA65C = F82D7D4A0F4A0D2500ADA65C /* PBXTextBookmark */;
F82D7D4C0F4A0D2500ADA65C = F82D7D4C0F4A0D2500ADA65C /* PBXTextBookmark */;
F82D7D4E0F4A0D2500ADA65C = F82D7D4E0F4A0D2500ADA65C /* PBXTextBookmark */;
F82D7D4F0F4A0D2500ADA65C = F82D7D4F0F4A0D2500ADA65C /* PBXTextBookmark */;
F82D7D500F4A0D2500ADA65C = F82D7D500F4A0D2500ADA65C /* PBXTextBookmark */;
F82D7D6F0F4A662300ADA65C = F82D7D6F0F4A662300ADA65C /* PBXTextBookmark */;
F82D7D800F4A675300ADA65C = F82D7D800F4A675300ADA65C /* PBXTextBookmark */;
F82D7D8E0F4A67E300ADA65C = F82D7D8E0F4A67E300ADA65C /* PBXTextBookmark */;
F82D7D8F0F4A67E300ADA65C = F82D7D8F0F4A67E300ADA65C /* PBXTextBookmark */;
F846D211102F7D7500E0277B = F846D211102F7D7500E0277B /* PBXTextBookmark */;
F846D212102F7D7500E0277B = F846D212102F7D7500E0277B /* PBXTextBookmark */;
F8EB05EA102FAC0E0073B4B2 = F8EB05EA102FAC0E0073B4B2 /* PBXTextBookmark */;
F8EB05EE102FAC0E0073B4B2 = F8EB05EE102FAC0E0073B4B2 /* PBXTextBookmark */;
F8EB05F8102FAC460073B4B2 = F8EB05F8102FAC460073B4B2 /* PBXTextBookmark */;
F8EB062D102FB4F20073B4B2 = F8EB062D102FB4F20073B4B2 /* PBXTextBookmark */;
F8EB0644102FB7670073B4B2 = F8EB0644102FB7670073B4B2 /* PBXTextBookmark */;
F8EB064E1030E0E30073B4B2 /* PBXTextBookmark */ = F8EB064E1030E0E30073B4B2 /* PBXTextBookmark */;
F8EB065C1030E1760073B4B2 /* PBXTextBookmark */ = F8EB065C1030E1760073B4B2 /* PBXTextBookmark */;
F8EB065D1030E1760073B4B2 /* PBXTextBookmark */ = F8EB065D1030E1760073B4B2 /* PBXTextBookmark */;
F8EB065F1030E1770073B4B2 /* PBXTextBookmark */ = F8EB065F1030E1770073B4B2 /* PBXTextBookmark */;
F8EB06601030E1770073B4B2 /* PBXTextBookmark */ = F8EB06601030E1770073B4B2 /* PBXTextBookmark */;
F8EB06611030E1770073B4B2 /* PBXTextBookmark */ = F8EB06611030E1770073B4B2 /* PBXTextBookmark */;
F8EB06761030F4960073B4B2 /* PBXTextBookmark */ = F8EB06761030F4960073B4B2 /* PBXTextBookmark */;
F8EB06771030F4960073B4B2 /* PBXTextBookmark */ = F8EB06771030F4960073B4B2 /* PBXTextBookmark */;
F8EB06781030F4960073B4B2 /* PBXBookmark */ = F8EB06781030F4960073B4B2 /* PBXBookmark */;
F8EB06791030F4960073B4B2 /* PBXTextBookmark */ = F8EB06791030F4960073B4B2 /* PBXTextBookmark */;
F8EB067A1030F4960073B4B2 /* PBXTextBookmark */ = F8EB067A1030F4960073B4B2 /* PBXTextBookmark */;
F8EB067B1030F4960073B4B2 /* PBXTextBookmark */ = F8EB067B1030F4960073B4B2 /* PBXTextBookmark */;
F8EB07931030F5040073B4B2 /* PBXTextBookmark */ = F8EB07931030F5040073B4B2 /* PBXTextBookmark */;
F8EB07941030F5040073B4B2 /* PBXBookmark */ = F8EB07941030F5040073B4B2 /* PBXBookmark */;
F8EB07951030F5040073B4B2 /* PBXTextBookmark */ = F8EB07951030F5040073B4B2 /* PBXTextBookmark */;
F8EB07961030F5040073B4B2 /* PBXTextBookmark */ = F8EB07961030F5040073B4B2 /* PBXTextBookmark */;
};
sourceControlManager = F8A70EFF0C4069C300D1D694 /* Source Control */;
userBuildSettings = {
};
};
72D117D00C5C181700FE2CB5 /* CTBareMessageTests.h */ = {
uiCtxt = {
sepNavIntBoundsRect = "{{0, 0}, {996, 681}}";
sepNavSelRange = "{628, 0}";
sepNavVisRange = "{0, 1699}";
};
};
72D117D10C5C181700FE2CB5 /* CTBareMessageTests.m */ = {
uiCtxt = {
sepNavIntBoundsRect = "{{0, 0}, {1063, 1050}}";
sepNavSelRange = "{628, 0}";
sepNavVisRange = "{77, 2706}";
};
};
8DC2EF4F0486A6940098B216 /* MailCore */ = {
activeExec = 0;
};
F80BDF620A774369003B344E /* maildir.h */ = {
isa = PBXFileReference;
fileEncoding = 30;
lastKnownFileType = sourcecode.c.h;
name = maildir.h;
path = /Users/mronge/Projects/mailcore/OpenSourceProjects/include/libetpan/maildir.h;
sourceTree = "<absolute>";
uiCtxt = {
sepNavIntBoundsRect = "{{0, 0}, {779, 798}}";
sepNavSelRange = "{0, 0}";
sepNavVisRange = "{0, 1607}";
};
};
F81A8AD20C03FC3B002F780A /* CTMIME_MessagePart.h */ = {
uiCtxt = {
sepNavIntBoundsRect = "{{0, 0}, {958, 989}}";
sepNavSelRange = "{1726, 48}";
sepNavVisRange = "{0, 1924}";
};
};
F81A8AD30C03FC3B002F780A /* CTMIME_MessagePart.m */ = {
uiCtxt = {
sepNavIntBoundsRect = "{{0, 0}, {958, 1204}}";
sepNavSelRange = "{2318, 0}";
sepNavVisRange = "{53, 2569}";
};
};
F81A8AD40C03FC3B002F780A /* CTMIME_MultiPart.h */ = {
uiCtxt = {
sepNavIntBoundsRect = "{{0, 0}, {726, 943}}";
sepNavSelRange = "{1694, 0}";
sepNavVisRange = "{0, 1756}";
};
};
F81A8AD50C03FC3B002F780A /* CTMIME_MultiPart.m */ = {
uiCtxt = {
sepNavIntBoundsRect = "{{0, 0}, {958, 1302}}";
sepNavSelRange = "{3035, 5}";
sepNavVisRange = "{1025, 2015}";
};
};
F81A8AD60C03FC3B002F780A /* CTMIME_SinglePart.h */ = {
uiCtxt = {
sepNavIntBoundsRect = "{{0, 0}, {958, 989}}";
sepNavSelRange = "{1991, 0}";
sepNavVisRange = "{0, 2016}";
};
};
F81A8AD70C03FC3B002F780A /* CTMIME_SinglePart.m */ = {
uiCtxt = {
sepNavIntBoundsRect = "{{0, 0}, {958, 2086}}";
sepNavSelRange = "{4214, 0}";
sepNavVisRange = "{2862, 2111}";
};
};
F81A8AD80C03FC3B002F780A /* CTMIME_TextPart.h */ = {
uiCtxt = {
sepNavIntBoundsRect = "{{0, 0}, {726, 943}}";
sepNavSelRange = "{1805, 0}";
sepNavVisRange = "{0, 1810}";
};
};
F81A8AD90C03FC3B002F780A /* CTMIME_TextPart.m */ = {
uiCtxt = {
sepNavIntBoundsRect = "{{0, 0}, {726, 1274}}";
sepNavSelRange = "{3027, 0}";
sepNavVisRange = "{1101, 2095}";
};
};
F81A8ADA0C03FC3B002F780A /* CTMIME.h */ = {
uiCtxt = {
sepNavIntBoundsRect = "{{0, 0}, {726, 943}}";
sepNavSelRange = "{1781, 0}";
sepNavVisRange = "{0, 1980}";
};
};
F81A8ADB0C03FC3B002F780A /* CTMIME.m */ = {
uiCtxt = {
sepNavIntBoundsRect = "{{0, 0}, {958, 1806}}";
sepNavSelRange = "{1721, 0}";
sepNavVisRange = "{2553, 1596}";
};
};
F81A8AEB0C03FC58002F780A /* CTMIMETests.h */ = {
uiCtxt = {
sepNavIntBoundsRect = "{{0, 0}, {1019, 574}}";
sepNavSelRange = "{620, 9}";
sepNavVisRange = "{0, 1696}";
sepNavWindowFrame = "{{61, 434}, {1078, 697}}";
};
};
F81A8AEC0C03FC58002F780A /* CTMIMETests.m */ = {
uiCtxt = {
sepNavIntBoundsRect = "{{0, 0}, {1046, 2590}}";
sepNavSelRange = "{9152, 0}";
sepNavVisRange = "{220, 4047}";
};
};
F81B88500A74AA7100143DF6 /* CTCoreAccount.h */ = {
uiCtxt = {
sepNavIntBoundsRect = "{{0, 0}, {1041, 1386}}";
sepNavSelRange = "{628, 0}";
sepNavVisRange = "{2208, 1654}";
sepNavWindowFrame = "{{63, 87}, {1100, 785}}";
};
};
F81B88510A74AA7100143DF6 /* CTCoreAccount.m */ = {
uiCtxt = {
sepNavIntBoundsRect = "{{0, 0}, {779, 2842}}";
sepNavSelRange = "{628, 0}";
sepNavVisRange = "{0, 1572}";
};
};
F81B88520A74AA7100143DF6 /* CTCoreAddress.h */ = {
uiCtxt = {
sepNavIntBoundsRect = "{{0, 0}, {779, 1036}}";
sepNavSelRange = "{628, 0}";
sepNavVisRange = "{0, 1572}";
sepNavWindowFrame = "{{130, 371}, {1078, 697}}";
};
};
F81B88530A74AA7100143DF6 /* CTCoreAddress.m */ = {
uiCtxt = {
sepNavIntBoundsRect = "{{0, 0}, {996, 1316}}";
sepNavSelRange = "{628, 0}";
sepNavVisRange = "{0, 2017}";
};
};
F81B88540A74AA7100143DF6 /* CTCoreFolder.h */ = {
uiCtxt = {
sepNavIntBoundsRect = "{{0, 0}, {779, 2562}}";
sepNavSelRange = "{3233, 0}";
sepNavVisRange = "{2736, 1096}";
};
};
F81B88550A74AA7100143DF6 /* CTCoreFolder.m */ = {
uiCtxt = {
sepNavIntBoundsRect = "{{0, 0}, {779, 8638}}";
sepNavSelRange = "{6999, 0}";
sepNavVisRange = "{6755, 760}";
sepNavWindowFrame = "{{221, 92}, {1100, 785}}";
};
};
F81B88560A74AA7100143DF6 /* CTCoreMessage.h */ = {
uiCtxt = {
sepNavIntBoundsRect = "{{0, 0}, {726, 2618}}";
sepNavSelRange = "{2272, 0}";
sepNavVisRange = "{590, 2634}";
};
};
F81B88570A74AA7100143DF6 /* CTCoreMessage.m */ = {
uiCtxt = {
sepNavIntBoundsRect = "{{0, 0}, {958, 6636}}";
sepNavSelRange = "{5296, 252}";
sepNavVisRange = "{5137, 2378}";
sepNavWindowFrame = "{{109, 45}, {1100, 785}}";
};
};
F81B885A0A74AA7100143DF6 /* CTSMTPConnection.h */ = {
uiCtxt = {
sepNavIntBoundsRect = "{{0, 0}, {958, 966}}";
sepNavSelRange = "{628, 0}";
sepNavVisRange = "{0, 2813}";
};
};
F81B885B0A74AA7100143DF6 /* CTSMTPConnection.m */ = {
uiCtxt = {
sepNavIntBoundsRect = "{{0, 0}, {996, 1036}}";
sepNavSelRange = "{628, 0}";
sepNavVisRange = "{0, 2185}";
};
};
F81B885C0A74AA7100143DF6 /* MailCore.h */ = {
uiCtxt = {
sepNavIntBoundsRect = "{{0, 0}, {1019, 569}}";
sepNavSelRange = "{628, 0}";
sepNavVisRange = "{0, 1811}";
sepNavWindowFrame = "{{107, 392}, {1078, 697}}";
};
};
F81B885D0A74AA7100143DF6 /* MailCoreTypes.h */ = {
uiCtxt = {
sepNavIntBoundsRect = "{{0, 0}, {782, 1456}}";
sepNavSelRange = "{1641, 69}";
sepNavVisRange = "{1576, 2558}";
};
};
F81B88710A74AAD800143DF6 /* MailCore_Prefix.pch */ = {
uiCtxt = {
sepNavIntBoundsRect = "{{0, 0}, {996, 681}}";
sepNavSelRange = "{0, 0}";
sepNavVisRange = "{0, 148}";
};
};
F81E26680C6ED35C00B3FBAC /* CTBareAttachment.h */ = {
uiCtxt = {
sepNavIntBoundsRect = "{{0, 0}, {580, 950}}";
sepNavSelRange = "{1978, 0}";
sepNavVisRange = "{0, 1978}";
};
};
F81E26690C6ED35C00B3FBAC /* CTBareAttachment.m */ = {
uiCtxt = {
sepNavIntBoundsRect = "{{0, 0}, {596, 952}}";
sepNavSelRange = "{1999, 0}";
sepNavVisRange = "{1663, 563}";
};
};
F81E266C0C6ED4E100B3FBAC /* CTCoreAttachment.h */ = {
uiCtxt = {
sepNavIntBoundsRect = "{{0, 0}, {1063, 967}}";
sepNavSelRange = "{1925, 0}";
sepNavVisRange = "{0, 1925}";
};
};
F81E266D0C6ED4E100B3FBAC /* CTCoreAttachment.m */ = {
uiCtxt = {
sepNavIntBoundsRect = "{{0, 0}, {726, 1204}}";
sepNavSelRange = "{2237, 139}";
sepNavVisRange = "{796, 2106}";
};
};
F81E272D0C6EDC6A00B3FBAC /* CTCoreAttachmentTests.h */ = {
uiCtxt = {
sepNavIntBoundsRect = "{{0, 0}, {996, 681}}";
sepNavSelRange = "{628, 0}";
sepNavVisRange = "{0, 1730}";
};
};
F81E272E0C6EDC6A00B3FBAC /* CTCoreAttachmentTests.m */ = {
uiCtxt = {
sepNavIntBoundsRect = "{{0, 0}, {726, 966}}";
sepNavSelRange = "{2064, 0}";
sepNavVisRange = "{3, 3263}";
};
};
F8245A2F0C04089D005E08A8 /* CTMIMEFactory.h */ = {
uiCtxt = {
sepNavIntBoundsRect = "{{0, 0}, {726, 966}}";
sepNavSelRange = "{0, 1575}";
sepNavVisRange = "{0, 1921}";
};
};
F8245A300C04089D005E08A8 /* CTMIMEFactory.m */ = {
uiCtxt = {
sepNavIntBoundsRect = "{{0, 0}, {777, 1372}}";
sepNavSelRange = "{3113, 0}";
sepNavVisRange = "{2435, 716}";
};
};
F82D7C800F48AC8500ADA65C /* Tests */ = {
activeExec = 0;
};
F82D7D360F48AD5200ADA65C /* PBXTextBookmark */ = {
isa = PBXTextBookmark;
fRef = F81A8AEB0C03FC58002F780A /* CTMIMETests.h */;
name = "CTMIMETests.h: 15";
rLen = 9;
rLoc = 620;
rType = 0;
vrLen = 1573;
vrLoc = 0;
};
F82D7D370F48AD5200ADA65C /* PBXTextBookmark */ = {
isa = PBXTextBookmark;
fRef = F8EADFB30B3BB178000C8371 /* CTCoreMessageTests.h */;
name = "CTCoreMessageTests.h: 6";
rLen = 0;
rLoc = 79;
rType = 0;
vrLen = 1572;
vrLoc = 0;
};
F82D7D380F48AD5200ADA65C /* PBXTextBookmark */ = {
isa = PBXTextBookmark;
fRef = F81A8AEB0C03FC58002F780A /* CTMIMETests.h */;
name = "CTMIMETests.h: 15";
rLen = 9;
rLoc = 620;
rType = 0;
vrLen = 1573;
vrLoc = 0;
};
F82D7D390F48AD5200ADA65C /* PBXTextBookmark */ = {
isa = PBXTextBookmark;
fRef = F8EADFB30B3BB178000C8371 /* CTCoreMessageTests.h */;
name = "CTCoreMessageTests.h: 6";
rLen = 0;
rLoc = 79;
rType = 0;
vrLen = 1572;
vrLoc = 0;
};
F82D7D420F49279400ADA65C /* CTCoreAccountTests.h */ = {
uiCtxt = {
sepNavIntBoundsRect = "{{0, 0}, {779, 602}}";
sepNavSelRange = "{1725, 0}";
sepNavVisRange = "{0, 1572}";
};
};
F82D7D430F49279400ADA65C /* CTCoreAccountTests.m */ = {
uiCtxt = {
sepNavIntBoundsRect = "{{0, 0}, {779, 1316}}";
sepNavSelRange = "{3578, 0}";
sepNavVisRange = "{2066, 1221}";
};
};
F82D7D4A0F4A0D2500ADA65C /* PBXTextBookmark */ = {
isa = PBXTextBookmark;
fRef = F8EADFB40B3BB178000C8371 /* CTCoreMessageTests.m */;
name = "CTCoreMessageTests.m: 173";
rLen = 0;
rLoc = 8647;
rType = 0;
vrLen = 1352;
vrLoc = 7295;
};
F82D7D4C0F4A0D2500ADA65C /* PBXTextBookmark */ = {
isa = PBXTextBookmark;
fRef = F81B88520A74AA7100143DF6 /* CTCoreAddress.h */;
name = "CTCoreAddress.h: 15";
rLen = 0;
rLoc = 628;
rType = 0;
vrLen = 1572;
vrLoc = 0;
};
F82D7D4E0F4A0D2500ADA65C /* PBXTextBookmark */ = {
isa = PBXTextBookmark;
fRef = F8EADFB40B3BB178000C8371 /* CTCoreMessageTests.m */;
name = "CTCoreMessageTests.m: 173";
rLen = 0;
rLoc = 8647;
rType = 0;
vrLen = 1352;
vrLoc = 7295;
};
F82D7D4F0F4A0D2500ADA65C /* PBXTextBookmark */ = {
isa = PBXTextBookmark;
fRef = F81B88510A74AA7100143DF6 /* CTCoreAccount.m */;
name = "CTCoreAccount.m: 15";
rLen = 0;
rLoc = 628;
rType = 0;
vrLen = 1572;
vrLoc = 0;
};
F82D7D500F4A0D2500ADA65C /* PBXTextBookmark */ = {
isa = PBXTextBookmark;
fRef = F81B88520A74AA7100143DF6 /* CTCoreAddress.h */;
name = "CTCoreAddress.h: 15";
rLen = 0;
rLoc = 628;
rType = 0;
vrLen = 1572;
vrLoc = 0;
};
F82D7D6F0F4A662300ADA65C /* PBXTextBookmark */ = {
isa = PBXTextBookmark;
fRef = F82D7D420F49279400ADA65C /* CTCoreAccountTests.h */;
name = "CTCoreAccountTests.h: 39";
rLen = 0;
rLoc = 1725;
rType = 0;
vrLen = 1572;
vrLoc = 0;
};
F82D7D7F0F4A675300ADA65C /* RunPlatformUnitTests.include */ = {
isa = PBXFileReference;
lastKnownFileType = text.script.sh;
name = RunPlatformUnitTests.include;
path = /Developer/Tools/RunPlatformUnitTests.include;
sourceTree = "<absolute>";
};
F82D7D800F4A675300ADA65C /* PBXTextBookmark */ = {
isa = PBXTextBookmark;
fRef = F82D7D430F49279400ADA65C /* CTCoreAccountTests.m */;
name = "CTCoreAccountTests.m: 58";
rLen = 0;
rLoc = 2454;
rType = 0;
vrLen = 1379;
vrLoc = 590;
};
F82D7D8E0F4A67E300ADA65C /* PBXTextBookmark */ = {
isa = PBXTextBookmark;
fRef = F82D7D7F0F4A675300ADA65C /* RunPlatformUnitTests.include */;
name = "RunPlatformUnitTests.include: 387";
rLen = 135;
rLoc = 13188;
rType = 0;
vrLen = 951;
vrLoc = 12689;
};
F82D7D8F0F4A67E300ADA65C /* PBXTextBookmark */ = {
isa = PBXTextBookmark;
fRef = F82D7D7F0F4A675300ADA65C /* RunPlatformUnitTests.include */;
name = "RunPlatformUnitTests.include: 387";
rLen = 135;
rLoc = 13188;
rType = 0;
vrLen = 951;
vrLoc = 12689;
};
F8430BAF0C72B16000753941 /* CTMIME_Enumerator.h */ = {
uiCtxt = {
sepNavIntBoundsRect = "{{0, 0}, {726, 966}}";
sepNavSelRange = "{1501, 0}";
sepNavVisRange = "{0, 1813}";
};
};
F8430BB00C72B16000753941 /* CTMIME_Enumerator.m */ = {
uiCtxt = {
sepNavIntBoundsRect = "{{0, 0}, {726, 1106}}";
sepNavSelRange = "{1723, 33}";
sepNavVisRange = "{0, 2362}";
};
};
F846D211102F7D7500E0277B /* PBXTextBookmark */ = {
isa = PBXTextBookmark;
fRef = F81B88540A74AA7100143DF6 /* CTCoreFolder.h */;
name = "CTCoreFolder.h: 15";
rLen = 0;
rLoc = 628;
rType = 0;
vrLen = 965;
vrLoc = 2700;
};
F846D212102F7D7500E0277B /* PBXTextBookmark */ = {
isa = PBXTextBookmark;
fRef = F81B88550A74AA7100143DF6 /* CTCoreFolder.m */;
name = "CTCoreFolder.m: 328";
rLen = 0;
rLoc = 9377;
rType = 0;
vrLen = 680;
vrLoc = 1556;
};
F858CC470C51DE6B00EF1B3D /* CTBareMessage.h */ = {
uiCtxt = {
sepNavIntBoundsRect = "{{0, 0}, {1019, 672}}";
sepNavSelRange = "{628, 0}";
sepNavVisRange = "{150, 1741}";
};
};
F858CC480C51DE6B00EF1B3D /* CTBareMessage.m */ = {
uiCtxt = {
sepNavIntBoundsRect = "{{0, 0}, {1019, 826}}";
sepNavSelRange = "{628, 0}";
sepNavVisRange = "{799, 1298}";
sepNavWindowFrame = "{{84, 413}, {1078, 697}}";
};
};
F88804D50B4243C000D400E7 /* MailCoreUtilities.h */ = {
uiCtxt = {
sepNavIntBoundsRect = "{{0, 0}, {996, 681}}";
sepNavSelRange = "{628, 0}";
sepNavVisRange = "{0, 1963}";
};
};
F88804D60B4243C000D400E7 /* MailCoreUtilities.m */ = {
uiCtxt = {
sepNavIntBoundsRect = "{{0, 0}, {779, 1078}}";
sepNavSelRange = "{2121, 0}";
sepNavVisRange = "{1906, 591}";
};
};
F88CA0CC0BF7A7B00055AC29 /* CTSMTP.h */ = {
uiCtxt = {
sepNavIntBoundsRect = "{{0, 0}, {996, 756}}";
sepNavSelRange = "{628, 0}";
sepNavVisRange = "{0, 2164}";
};
};
F88CA0CD0BF7A7B00055AC29 /* CTSMTP.m */ = {
uiCtxt = {
sepNavIntBoundsRect = "{{0, 0}, {996, 1414}}";
sepNavSelRange = "{628, 0}";
sepNavVisRange = "{0, 2023}";
};
};
F88CA0D20BF7AC0B0055AC29 /* CTESMTP.h */ = {
uiCtxt = {
sepNavIntBoundsRect = "{{0, 0}, {996, 714}}";
sepNavSelRange = "{628, 0}";
sepNavVisRange = "{0, 2028}";
};
};
F88CA0D30BF7AC0B0055AC29 /* CTESMTP.m */ = {
uiCtxt = {
sepNavIntBoundsRect = "{{0, 0}, {996, 2338}}";
sepNavSelRange = "{628, 0}";
sepNavVisRange = "{0, 2020}";
};
};
F8A70EED0C4059E100D1D694 /* JRLog.h */ = {
uiCtxt = {
sepNavIntBoundsRect = "{{0, 0}, {996, 1050}}";
sepNavSelRange = "{0, 0}";
sepNavVisRange = "{0, 1661}";
};
};
F8A70EEE0C4059E100D1D694 /* JRLog.m */ = {
uiCtxt = {
sepNavIntBoundsRect = "{{0, 0}, {779, 3918}}";
sepNavSelRange = "{6285, 92}";
sepNavVisRange = "{5899, 740}";
};
};
F8A70EFF0C4069C300D1D694 /* Source Control */ = {
isa = PBXSourceControlManager;
fallbackIsa = XCSourceControlManager;
isSCMEnabled = 0;
scmConfiguration = {
};
};
F8A70F000C4069C300D1D694 /* Code sense */ = {
isa = PBXCodeSenseManager;
indexTemplatePath = "";
};
F8D31A3109C524EA00468234 /* main.m */ = {
uiCtxt = {
sepNavIntBoundsRect = "{{0, 0}, {958, 2478}}";
sepNavSelRange = "{6343, 0}";
sepNavVisRange = "{0, 2923}";
sepNavWindowFrame = "{{237, 16}, {1100, 785}}";
};
};
F8DCD39F0C13E1BE00B10F94 /* uidplus_types.h */ = {
isa = PBXFileReference;
fileEncoding = 30;
lastKnownFileType = sourcecode.c.h;
name = uidplus_types.h;
path = /Users/mronge/Projects/mailcore/OpenSourceProjects/include/libetpan/uidplus_types.h;
sourceTree = "<absolute>";
uiCtxt = {
sepNavIntBoundsRect = "{{0, 0}, {779, 714}}";
sepNavSelRange = "{124, 0}";
sepNavVisRange = "{0, 540}";
};
};
F8EA76110C1141C1004F85D8 /* CTCoreAddressTests.h */ = {
uiCtxt = {
sepNavIntBoundsRect = "{{0, 0}, {996, 681}}";
sepNavSelRange = "{628, 0}";
sepNavVisRange = "{0, 1699}";
};
};
F8EA76120C1141C1004F85D8 /* CTCoreAddressTests.m */ = {
uiCtxt = {
sepNavIntBoundsRect = "{{0, 0}, {996, 681}}";
sepNavSelRange = "{628, 0}";
sepNavVisRange = "{0, 2227}";
};
};
F8EADFB30B3BB178000C8371 /* CTCoreMessageTests.h */ = {
uiCtxt = {
sepNavIntBoundsRect = "{{0, 0}, {1019, 574}}";
sepNavSelRange = "{79, 0}";
sepNavVisRange = "{0, 1749}";
sepNavWindowFrame = "{{38, 455}, {1078, 697}}";
};
};
F8EADFB40B3BB178000C8371 /* CTCoreMessageTests.m */ = {
uiCtxt = {
sepNavIntBoundsRect = "{{0, 0}, {1024, 2436}}";
sepNavSelRange = "{8647, 0}";
sepNavVisRange = "{6730, 1361}";
sepNavWindowFrame = "{{15, 476}, {1078, 697}}";
};
};
F8EB05EA102FAC0E0073B4B2 /* PBXTextBookmark */ = {
isa = PBXTextBookmark;
fRef = F88804D60B4243C000D400E7 /* MailCoreUtilities.m */;
name = "MailCoreUtilities.m: 54";
rLen = 0;
rLoc = 2121;
rType = 0;
vrLen = 591;
vrLoc = 1906;
};
F8EB05EE102FAC0E0073B4B2 /* PBXTextBookmark */ = {
isa = PBXTextBookmark;
fRef = F88804D60B4243C000D400E7 /* MailCoreUtilities.m */;
name = "MailCoreUtilities.m: 54";
rLen = 0;
rLoc = 2121;
rType = 0;
vrLen = 591;
vrLoc = 1906;
};
F8EB05F8102FAC460073B4B2 /* PBXTextBookmark */ = {
isa = PBXTextBookmark;
fRef = F81B88540A74AA7100143DF6 /* CTCoreFolder.h */;
name = "CTCoreFolder.h: 84";
rLen = 0;
rLoc = 3233;
rType = 0;
vrLen = 1096;
vrLoc = 2736;
};
F8EB062D102FB4F20073B4B2 /* PBXTextBookmark */ = {
isa = PBXTextBookmark;
fRef = F81B88550A74AA7100143DF6 /* CTCoreFolder.m */;
name = "CTCoreFolder.m: 240";
rLen = 0;
rLoc = 6960;
rType = 0;
vrLen = 760;
vrLoc = 6755;
};
F8EB0644102FB7670073B4B2 /* PBXTextBookmark */ = {
isa = PBXTextBookmark;
fRef = F81B88550A74AA7100143DF6 /* CTCoreFolder.m */;
name = "CTCoreFolder.m: 241";
rLen = 0;
rLoc = 6999;
rType = 0;
vrLen = 760;
vrLoc = 6755;
};
F8EB064E1030E0E30073B4B2 /* PBXTextBookmark */ = {
isa = PBXTextBookmark;
fRef = F81B88550A74AA7100143DF6 /* CTCoreFolder.m */;
name = "CTCoreFolder.m: 241";
rLen = 0;
rLoc = 6999;
rType = 0;
vrLen = 760;
vrLoc = 6755;
};
F8EB065C1030E1760073B4B2 /* PBXTextBookmark */ = {
isa = PBXTextBookmark;
comments = "warning: 'NSIntMapKeyCallBacks' is deprecated (declared at /Developer/SDKs/MacOSX10.5.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSMapTable.h:121)";
fRef = F8A70EEE0C4059E100D1D694 /* JRLog.m */;
rLen = 1;
rLoc = 227;
rType = 1;
};
F8EB065D1030E1760073B4B2 /* PBXTextBookmark */ = {
isa = PBXTextBookmark;
fRef = F8A70EEE0C4059E100D1D694 /* JRLog.m */;
name = "JRLog.m: 228";
rLen = 92;
rLoc = 6285;
rType = 0;
vrLen = 226;
vrLoc = 6157;
};
F8EB065F1030E1770073B4B2 /* PBXTextBookmark */ = {
isa = PBXTextBookmark;
fRef = F81B88550A74AA7100143DF6 /* CTCoreFolder.m */;
name = "CTCoreFolder.m: 241";
rLen = 0;
rLoc = 6999;
rType = 0;
vrLen = 760;
vrLoc = 6755;
};
F8EB06601030E1770073B4B2 /* PBXTextBookmark */ = {
isa = PBXTextBookmark;
fRef = F81B88550A74AA7100143DF6 /* CTCoreFolder.m */;
name = "CTCoreFolder.m: 241";
rLen = 0;
rLoc = 6999;
rType = 0;
vrLen = 760;
vrLoc = 6755;
};
F8EB06611030E1770073B4B2 /* PBXTextBookmark */ = {
isa = PBXTextBookmark;
fRef = F8A70EEE0C4059E100D1D694 /* JRLog.m */;
name = "JRLog.m: 228";
rLen = 92;
rLoc = 6285;
rType = 0;
vrLen = 740;
vrLoc = 5899;
};
F8EB06761030F4960073B4B2 /* PBXTextBookmark */ = {
isa = PBXTextBookmark;
fRef = F8A70EEE0C4059E100D1D694 /* JRLog.m */;
name = "JRLog.m: 228";
rLen = 92;
rLoc = 6285;
rType = 0;
vrLen = 740;
vrLoc = 5899;
};
F8EB06771030F4960073B4B2 /* PBXTextBookmark */ = {
isa = PBXTextBookmark;
fRef = F8DCD39F0C13E1BE00B10F94 /* uidplus_types.h */;
name = "uidplus_types.h: 10";
rLen = 0;
rLoc = 124;
rType = 0;
vrLen = 540;
vrLoc = 0;
};
F8EB06781030F4960073B4B2 /* PBXBookmark */ = {
isa = PBXBookmark;
fRef = F80BDF620A774369003B344E /* maildir.h */;
};
F8EB06791030F4960073B4B2 /* PBXTextBookmark */ = {
isa = PBXTextBookmark;
fRef = F8A70EEE0C4059E100D1D694 /* JRLog.m */;
name = "JRLog.m: 228";
rLen = 92;
rLoc = 6285;
rType = 0;
vrLen = 740;
vrLoc = 5899;
};
F8EB067A1030F4960073B4B2 /* PBXTextBookmark */ = {
isa = PBXTextBookmark;
fRef = F8DCD39F0C13E1BE00B10F94 /* uidplus_types.h */;
name = "uidplus_types.h: 10";
rLen = 0;
rLoc = 124;
rType = 0;
vrLen = 540;
vrLoc = 0;
};
F8EB067B1030F4960073B4B2 /* PBXTextBookmark */ = {
isa = PBXTextBookmark;
fRef = F80BDF620A774369003B344E /* maildir.h */;
name = "maildir.h: 1";
rLen = 0;
rLoc = 0;
rType = 0;
vrLen = 1607;
vrLoc = 0;
};
F8EB06811030F4FA0073B4B2 /* acl_types.h */ = {
uiCtxt = {
sepNavIntBoundsRect = "{{0, 0}, {779, 2114}}";
sepNavSelRange = "{863, 0}";
sepNavVisRange = "{0, 1607}";
};
};
F8EB07931030F5040073B4B2 /* PBXTextBookmark */ = {
isa = PBXTextBookmark;
fRef = F8A70EEE0C4059E100D1D694 /* JRLog.m */;
name = "JRLog.m: 228";
rLen = 92;
rLoc = 6285;
rType = 0;
vrLen = 740;
vrLoc = 5899;
};
F8EB07941030F5040073B4B2 /* PBXBookmark */ = {
isa = PBXBookmark;
fRef = F8EB06811030F4FA0073B4B2 /* acl_types.h */;
};
F8EB07951030F5040073B4B2 /* PBXTextBookmark */ = {
isa = PBXTextBookmark;
fRef = F8A70EEE0C4059E100D1D694 /* JRLog.m */;
name = "JRLog.m: 228";
rLen = 92;
rLoc = 6285;
rType = 0;
vrLen = 740;
vrLoc = 5899;
};
F8EB07961030F5040073B4B2 /* PBXTextBookmark */ = {
isa = PBXTextBookmark;
fRef = F8EB06811030F4FA0073B4B2 /* acl_types.h */;
name = "acl_types.h: 19";
rLen = 0;
rLoc = 863;
rType = 0;
vrLen = 1607;
vrLoc = 0;
};
}
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "self:MailCore.xcodeproj">
</FileRef>
</Workspace>
+1 -1
View File
@@ -3,5 +3,5 @@
//
#ifdef __OBJC__
#import <Cocoa/Cocoa.h>
#import <Foundation/Foundation.h>
#endif
Binary file not shown.
+41
View File
@@ -0,0 +1,41 @@
__ __ ______ __ __ ______ ______ ______ ______
/\ "-./ \ /\ __ \ /\ \ /\ \ /\ ___\ /\ __ \ /\ == \ /\ ___\
\ \ \-./\ \ \ \ __ \ \ \ \ \ \ \____ \ \ \____ \ \ \/\ \ \ \ __< \ \ __\
\ \_\ \ \_\ \ \_\ \_\ \ \_\ \ \_____\ \ \_____\ \ \_____\ \ \_\ \_\ \ \_____\
\/_/ \/_/ \/_/\/_/ \/_/ \/_____/ \/_____/ \/_____/ \/_/ /_/ \/_____/
Getting Started
---------------
First checkout the code and pulldown the required dependencies as submodules:
git clone https://github.com/mronge/MailCore.git
cd MailCore/
git submodule init
git submodule update
Now open up MailCore.xcodeproj and build either the iOS static library or the Mac OS X framework depending on your needs.
Upgrading from previous version
-------
TODO:Fill this out, right now these are just notes
- Not backwards compatible
- fetchBody -> fetchBodyStructure
- New methods for fetching message lists
- Both - (NSSet *)messageObjectsFromIndex:(unsigned int)start toIndex:(unsigned int)end and - (NSSet *)messageListWithFetchAttributes:(NSArray *)attributes are gone.
- Moved to NSError
- Message to, from, sender, bcc, cc, subject are nil when not downloaded or message doesn't have them
- Changed how UID is stored, now just an integer, UID validity is separate
- isUIDValid is gone
Contact
-------
If you have any questions contact me:
Matt Ronge
mronge@mronge.com
+7
View File
@@ -12,6 +12,13 @@ projects. To run the example projects:
The documentation isn't as detailed as I'd like. Sorry about that! If
something isn't clear try reading the source included or contact me.
IPHONE USE
reMail has ported MailCore over to the iPhone. Check out their open
source project that includes MailCore:
http://code.google.com/p/remail-iphone/
CONTACT INFO
MailCore by Matt Ronge
-30
View File
@@ -1,30 +0,0 @@
import os, fnmatch, glob, projectutils
# Must be run from the root of the MailCore project
if __name__ == "__main__":
os.system('mkdir OpenSourceProjects/build')
# Build universal libetpan
print "Expanding libetpan..."
projectpath = projectutils.expandArchive(os.path.abspath("OpenSourceProjects/"),"libetpan")
os.chdir(projectpath)
print "Building libetpan i386"
os.system('env CPPFLAGS="-isysroot /Developer/SDKs/MacOSX10.5.sdk -arch i386" ./configure --disable-dependency-tracking --host i386')
os.system('make')
os.system('mkdir i386')
os.system('mv src/.libs/*.a i386')
print "Building libetpan PPC"
os.system('make clean')
os.system('env CPPFLAGS="-isysroot /Developer/SDKs/MacOSX10.5.sdk -arch ppc" ./configure --disable-dependency-tracking --host ppc')
os.system('make')
os.system('mkdir ppc')
os.system('mv src/.libs/*.a ppc')
print "Using lipo to create libetpan universal binary"
os.system('lipo i386/libetpan.a ppc/libetpan.a -output ../build/libetpan.a -create')
print "Creating headers"
projectutils.searchAndReplaceInDirectory('include', r'include <libetpan/(.*?)>', r'include "\1"')
os.system('cp -r include ../')
-10
View File
@@ -1,10 +0,0 @@
import os, fnmatch, glob, projectutils
# Must be run from the root of the project
if __name__ == "__main__":
if(os.path.exists("OpenSourceProjects/build") == False):
os.system('python Scripts/BuildScripts/buildlibetpan.py')
-23
View File
@@ -1,23 +0,0 @@
#! /usr/bin/sh
# Run this from the root of the MailCore project
# Pass in as an arg the tag name for the release
mkdir -p build/MailCore
xcodebuild -configuration Release
cp -R build/Release/MailCore.framework build/MailCore
cp -R Documentation/ build/MailCore/Documentation
cd Examples/InboxLister
xcodebuild clean
cd ../MessageSender
xcodebuild clean
cd ../..
cp -R Examples build/MailCore
cp Resources/GETTING_STARTED.txt build/MailCore
cp Resources/LICENSE.txt build/MailCore
cp Resources/RELEASE_NOTES.txt build/MailCore
cd build/MailCore
ln -s Documentation/index.html index.html
hg clone -r $1 https://bitbucket.org/mronge/mailcore/ src
cd ..
tar czf MailCore.tar.gz MailCore
-29
View File
@@ -1,29 +0,0 @@
import os, fnmatch, glob, re
def expandArchive(directory, archiveName):
""" Given a directory, it will try and find an archive that
has name that begins with archiveName and will then expand it """
for path, subdirs, files in os.walk(directory):
for filename in files:
pattern = archiveName+"*.tar.gz"
if(fnmatch.fnmatch(filename,pattern)):
archivePath = os.path.join(path, filename)
os.chdir(directory)
os.system("tar xzf \""+archivePath+"\"");
return os.path.join(path, filename[:-7])
def searchAndReplaceInDirectory(directory, regex, replacement):
""" Given a directory this will go through and do a search and a replace
with the regex and will replace with replacement """
for path, subdirs, files in os.walk(directory):
for name in files:
fullPath = os.path.join(path,name)
thefile = open(fullPath,'r+')
lines = thefile.readlines()
thefile.close()
newfile = open(fullPath, 'w')
newlines = []
for line in lines:
newlines.append(re.sub(regex, replacement, line))
newfile.writelines(newlines)
newfile.close()
-8
View File
@@ -1,8 +0,0 @@
#! /usr/bin/sh
# Run this from the root of the MailCore project
# Arg 1 is the tag name
cp -r Documentation API
scp -r API mronge.com:/var/www/mronge/m/MailCore/API
scp build/MailCore.tar.gz mronge.com:/var/www/mronge/m/MailCore/MailCore-$1.tar.gz
+8 -5
View File
@@ -29,20 +29,23 @@
* SUCH DAMAGE.
*/
#import <Cocoa/Cocoa.h>
#import <Foundation/Foundation.h>
#import "CTMIME_SinglePart.h"
@class CTMIME_SinglePart;
@class CTCoreAttachment;
//TODO Document me
@interface CTBareAttachment : NSObject {
CTMIME_SinglePart *mMIMEPart;
NSString *mFilename;
NSString *mContentType;
CTMIME_SinglePart *mMIMEPart;
NSString *mFilename;
NSString *mContentType;
}
@property(retain) NSString *filename;
@property(retain) NSString *contentType;
@property(readonly) CTMIME_SinglePart *part;
-(NSString*)decodedFilename;
- (id)initWithMIMESinglePart:(CTMIME_SinglePart *)part;
- (CTCoreAttachment *)fetchFullAttachment;
- (CTCoreAttachment *)fetchFullAttachmentWithProgress:(CTProgressBlock)block;
@end
+31 -17
View File
@@ -29,8 +29,10 @@
* SUCH DAMAGE.
*/
#import <MailCore/MailCore.h>
#import "CTBareAttachment.h"
#import "MailCoreUtilities.h"
#import "MailCoreTypes.h"
#import "CTMIME_SinglePart.h"
#import "CTCoreAttachment.h"
@@ -40,31 +42,43 @@
@synthesize filename=mFilename;
- (id)initWithMIMESinglePart:(CTMIME_SinglePart *)part {
self = [super init];
if (self) {
mMIMEPart = [part retain];
self.filename = mMIMEPart.filename;
self.contentType = mMIMEPart.contentType;
}
return self;
self = [super init];
if (self) {
mMIMEPart = [part retain];
self.filename = mMIMEPart.filename;
self.contentType = mMIMEPart.contentType;
}
return self;
}
-(NSString*)decodedFilename {
return MailCoreDecodeMIMEPhrase((char *)[self.filename UTF8String]);
}
- (NSString *)description {
return [NSString stringWithFormat:@"ContentType: %@\tFilename: %@",
self.contentType, self.filename];
return [NSString stringWithFormat:@"ContentType: %@\tFilename: %@",
self.contentType, self.filename];
}
- (CTCoreAttachment *)fetchFullAttachment {
[mMIMEPart fetchPart];
CTCoreAttachment *attach = [[CTCoreAttachment alloc] initWithData:mMIMEPart.data
contentType:self.contentType filename:self.filename];
return [attach autorelease];
return [self fetchFullAttachmentWithProgress:^(size_t curr, size_t max) {}];
}
- (CTCoreAttachment *)fetchFullAttachmentWithProgress:(CTProgressBlock)block {
[mMIMEPart fetchPartWithProgress:block];
CTCoreAttachment *attach = [[CTCoreAttachment alloc] initWithData:mMIMEPart.data
contentType:self.contentType filename:self.filename];
return [attach autorelease];
}
- (CTMIME_SinglePart *)part {
return mMIMEPart;
}
- (void)dealloc {
[mMIMEPart release];
[mFilename release];
[mContentType release];
[super dealloc];
[mMIMEPart release];
[mFilename release];
[mContentType release];
[super dealloc];
}
@end
+59 -34
View File
@@ -29,69 +29,94 @@
* SUCH DAMAGE.
*/
#import <Cocoa/Cocoa.h>
#import "libetpan.h"
#import <Foundation/Foundation.h>
#import <libetpan/libetpan.h>
/*!
@class CTCoreAccount
CTCoreAccount is the base class with which you establish a connection to the
IMAP server. After establishing a connection with CTCoreAccount you can access
all of the folders (I use the term folder instead of mailbox) on the server.
All methods throw an exception on failure.
@class CTCoreAccount
CTCoreAccount is the base class with which you establish a connection to the
IMAP server. After establishing a connection with CTCoreAccount you can access
all of the folders (I use the term folder instead of mailbox) on the server.
All methods throw an exception on failure.
*/
@class CTCoreFolder;
@interface CTCoreAccount : NSObject {
struct mailstorage *myStorage;
BOOL connected;
@interface CTCoreAccount : NSObject {
struct mailstorage *myStorage;
BOOL connected;
NSError *lastError;
}
/*!
@abstract If an error occurred (nil or return of NO) call this method to get the error
*/
@property(nonatomic, retain) NSError *lastError;
/*!
@abstract Retrieves the list of all the available folders from the server.
@result Returns a NSSet which contains NSStrings of the folders pathnames.
@abstract Retrieves the list of all the available folders from the server.
@result Returns a NSSet which contains NSStrings of the folders pathnames, nil on error
*/
- (NSSet *)allFolders;
/*!
@abstract Retrieves a list of only the subscribed folders from the server.
@result Returns a NSSet which contains NSStrings of the folders pathnames.
@abstract Retrieves a list of only the subscribed folders from the server.
@result Returns a NSSet which contains NSStrings of the folders pathnames, nil on error
*/
- (NSSet *)subscribedFolders;
/*!
@abstract If you have the path of a folder on the server use this method to retrieve just the one folder.
@param path A NSString specifying the path of the folder to retrieve from the server.
@result Returns a CTCoreFolder.
@abstract If you have the path of a folder on the server use this method to retrieve just the one folder.
@param path A NSString specifying the path of the folder to retrieve from the server.
@result Returns a CTCoreFolder.
*/
- (CTCoreFolder *)folderWithPath:(NSString *)path;
/*!
@abstract This method initiates the connection to the server.
@param server The address of the server.
@param port The port to connect to.
@param connnectionType What kind of connection to use, it can be one of these three values:
CTConnectionTypePlain, CTConnectionTypeStartTLS, CTConnectionTypeTryStartTLS, CTConnectionTypeTLS.
See MailCoreTypes.h for more information
@param authType The authentication type, only CTImapAuthTypePlain is currently supported
@param login The username to connect with.
@param password The password to use to connect.
@return Return YES on success, NO on error. Call method lastError to get error if one occurred
*/
- (BOOL)connectToServer:(NSString *)server port:(int)port connectionType:(int)conType authType:(int)authType
login:(NSString *)login password:(NSString *)password;
/*!
@abstract This method initiates the connection to the server.
@param server The address of the server.
@param port The port to connect to.
@param connnectionType What kind of connection to use, it can be one of these three values:
CONNECTION_TYPE_PLAIN, CONNECTION_TYPE_STARTTLS, CONNECTION_TYPE_TRY_STARTTLS, CONNECTION_TYPE_TLS
@param authType The authentication type, only IMAP_AUTH_TYPE_PLAIN is currently supported
@param login The username to connect with.
@param password The password to use to connect.
*/
- (void)connectToServer:(NSString *)server port:(int)port connectionType:(int)conType authType:(int)authType
login:(NSString *)login password:(NSString *)password;
/*!
@abstract This method returns the current connection status.
@result Returns YES or NO as the status of the connection.
@abstract This method returns the current connection status.
@result Returns YES or NO as the status of the connection.
*/
- (BOOL)isConnected;
/*!
@abstract Terminates the connection. If you terminate this connection it will also affect the
connectivity of CTCoreFolders and CTMessages that rely on this account.
@abstract Terminates the connection. If you terminate this connection it will also affect the
connectivity of CTCoreFolders and CTMessages that rely on this account.
*/
- (void)disconnect;
/*!
@abstract Sends the idle command to the server.
@return Return YES on success, NO on error. Call method lastError to get error if one occurred
*/
- (BOOL)idle;
/*!
@abstract Blocks the connection until data arrives.
@return Returns nil on error
*/
- (NSString *)read;
/*!
@abstract Sends the done command to the server.
@return Return YES on success, NO on error. Call method lastError to get error if one occurred
*/
- (BOOL)done;
/* Intended for advanced use only */
- (mailimap *)session;
- (struct mailstorage *)storageStruct;
+153 -138
View File
@@ -32,185 +32,200 @@
#import "CTCoreAccount.h"
#import "CTCoreFolder.h"
#import "MailCoreTypes.h"
#import "MailCoreUtilities.h"
@interface CTCoreAccount (Private)
@interface CTCoreAccount ()
@end
@implementation CTCoreAccount
@synthesize lastError;
- (id)init {
self = [super init];
if (self) {
connected = NO;
myStorage = mailstorage_new(NULL);
assert(myStorage != NULL);
}
return self;
self = [super init];
if (self) {
connected = NO;
myStorage = mailstorage_new(NULL);
assert(myStorage != NULL);
}
return self;
}
- (void)dealloc {
mailstorage_disconnect(myStorage);
mailstorage_free(myStorage);
[super dealloc];
mailstorage_disconnect(myStorage);
mailstorage_free(myStorage);
self.lastError = nil;
[super dealloc];
}
- (NSError *)lastError {
return lastError;
}
- (BOOL)isConnected {
return connected;
return connected;
}
- (BOOL)connectToServer:(NSString *)server port:(int)port
connectionType:(int)conType authType:(int)authType
login:(NSString *)login password:(NSString *)password {
int err = 0;
int imap_cached = 0;
//TODO, should I use the cache?
- (void)connectToServer:(NSString *)server port:(int)port
connectionType:(int)conType authType:(int)authType
login:(NSString *)login password:(NSString *)password {
int err = 0;
int imap_cached = 0;
const char* auth_type_to_pass = NULL;
if(authType == IMAP_AUTH_TYPE_SASL_CRAM_MD5) {
auth_type_to_pass = "CRAM-MD5";
}
err = imap_mailstorage_init(myStorage,
(char *)[server cStringUsingEncoding:NSASCIIStringEncoding],
(uint16_t)port, NULL, conType, authType,
(char *)[login cStringUsingEncoding:NSASCIIStringEncoding],
(char *)[password cStringUsingEncoding:NSASCIIStringEncoding],
imap_cached, NULL);
if (err != MAIL_NO_ERROR) {
NSException *exception = [NSException
exceptionWithName:CTMemoryError
reason:CTMemoryErrorDesc
userInfo:nil];
[exception raise];
}
err = mailstorage_connect(myStorage);
if (err == MAIL_ERROR_LOGIN) {
NSException *exception = [NSException
exceptionWithName:CTLoginError
reason:CTLoginErrorDesc
userInfo:nil];
[exception raise];
}
else if (err != MAIL_NO_ERROR) {
NSException *exception = [NSException
exceptionWithName:CTUnknownError
reason:[NSString stringWithFormat:@"Error number: %d",err]
userInfo:nil];
[exception raise];
}
else
connected = YES;
err = imap_mailstorage_init_sasl(myStorage,
(char *)[server cStringUsingEncoding:NSUTF8StringEncoding],
(uint16_t)port, NULL,
conType,
auth_type_to_pass,
NULL,
NULL, NULL,
(char *)[login cStringUsingEncoding:NSUTF8StringEncoding], (char *)[login cStringUsingEncoding:NSUTF8StringEncoding],
(char *)[password cStringUsingEncoding:NSUTF8StringEncoding], NULL,
imap_cached, NULL);
if (err != MAILIMAP_NO_ERROR) {
self.lastError = MailCoreCreateErrorFromCode(err);
return NO;
}
err = mailstorage_connect(myStorage);
if (err == MAIL_ERROR_LOGIN) {
self.lastError = MailCoreCreateError(err, @"Invalid username or password");
return NO;
} else if (err != MAILIMAP_NO_ERROR) {
self.lastError = MailCoreCreateErrorFromCode(err);
return NO;
}
connected = YES;
return YES;
}
- (BOOL)idle {
int err = mailimap_idle([self session]);
if (err != MAILIMAP_NO_ERROR) {
self.lastError = MailCoreCreateErrorFromCode(err);
return NO;
}
return YES;
}
- (NSString*)read {
char * buf = mailimap_read_line([self session]);
if (buf == NULL) {
return nil;
}
return [NSString stringWithCString:buf encoding:NSUTF8StringEncoding];
}
- (BOOL)done {
int err = mailimap_idle_done([self session]);
if (err != MAILIMAP_NO_ERROR) {
self.lastError = MailCoreCreateErrorFromCode(err);
return NO;
}
return YES;
}
- (void)disconnect {
connected = NO;
mailstorage_disconnect(myStorage);
if (connected) {
connected = NO;
mailstorage_disconnect(myStorage);
}
}
- (CTCoreFolder *)folderWithPath:(NSString *)path {
CTCoreFolder *folder = [[CTCoreFolder alloc] initWithPath:path inAccount:self];
return [folder autorelease];
CTCoreFolder *folder = [[CTCoreFolder alloc] initWithPath:path inAccount:self];
return [folder autorelease];
}
- (mailimap *)session {
struct imap_cached_session_state_data * cached_data;
struct imap_session_state_data * data;
mailsession *session;
session = myStorage->sto_session;
if (strcasecmp(session->sess_driver->sess_name, "imap-cached") == 0)
{
cached_data = session->sess_data;
session = cached_data->imap_ancestor;
}
struct imap_cached_session_state_data * cached_data;
struct imap_session_state_data * data;
mailsession *session;
data = session->sess_data;
return data->imap_session;
session = myStorage->sto_session;
if(session == nil) {
return nil;
}
if (strcasecmp(session->sess_driver->sess_name, "imap-cached") == 0) {
cached_data = session->sess_data;
session = cached_data->imap_ancestor;
}
data = session->sess_data;
return data->imap_session;
}
- (struct mailstorage *)storageStruct {
return myStorage;
return myStorage;
}
- (NSSet *)subscribedFolders {
struct mailimap_mailbox_list * mailboxStruct;
clist *subscribedList;
clistiter *cur;
NSString *mailboxNameObject;
char *mailboxName;
int err;
NSMutableSet *subscribedFolders = [NSMutableSet set];
//Fill the subscribed folder array
err = mailimap_lsub([self session], "", "*", &subscribedList);
if (err != MAIL_NO_ERROR) {
NSException *exception = [NSException
exceptionWithName:CTUnknownError
reason:[NSString stringWithFormat:@"Error number: %d",err]
userInfo:nil];
[exception raise];
}
else if (clist_isempty(subscribedList)) {
NSException *exception = [NSException
exceptionWithName:CTNoSubscribedFolders
reason:CTNoSubscribedFoldersDesc
userInfo:nil];
[exception raise];
}
for(cur = clist_begin(subscribedList); cur != NULL; cur = cur->next) {
mailboxStruct = cur->data;
mailboxName = mailboxStruct->mb_name;
mailboxNameObject = [NSString stringWithCString:mailboxName encoding:NSASCIIStringEncoding];
[subscribedFolders addObject:mailboxNameObject];
}
mailimap_list_result_free(subscribedList);
return subscribedFolders;
struct mailimap_mailbox_list * mailboxStruct;
clist *subscribedList;
clistiter *cur;
NSString *mailboxNameObject;
char *mailboxName;
int err;
NSMutableSet *subscribedFolders = [NSMutableSet set];
//Fill the subscribed folder array
err = mailimap_lsub([self session], "", "*", &subscribedList);
if (err != MAILIMAP_NO_ERROR) {
self.lastError = MailCoreCreateErrorFromCode(err);
return nil;
}
for(cur = clist_begin(subscribedList); cur != NULL; cur = cur->next) {
mailboxStruct = cur->data;
mailboxName = mailboxStruct->mb_name;
mailboxNameObject = [NSString stringWithCString:mailboxName encoding:NSUTF8StringEncoding];
[subscribedFolders addObject:mailboxNameObject];
}
mailimap_list_result_free(subscribedList);
return subscribedFolders;
}
- (NSSet *)allFolders {
struct mailimap_mailbox_list * mailboxStruct;
clist *allList;
clistiter *cur;
NSString *mailboxNameObject;
char *mailboxName;
int err;
NSMutableSet *allFolders = [NSMutableSet set];
struct mailimap_mailbox_list * mailboxStruct;
clist *allList;
clistiter *cur;
//Now, fill the all folders array
//TODO Fix this so it doesn't use *
err = mailimap_list([self session], "", "*", &allList);
if (err != MAIL_NO_ERROR)
{
NSException *exception = [NSException
exceptionWithName:CTUnknownError
reason:[NSString stringWithFormat:@"Error number: %d",err]
userInfo:nil];
[exception raise];
}
else if (clist_isempty(allList))
{
NSException *exception = [NSException
exceptionWithName:CTNoFolders
reason:CTNoFoldersDesc
userInfo:nil];
[exception raise];
}
for(cur = clist_begin(allList); cur != NULL; cur = cur->next)
{
mailboxStruct = cur->data;
mailboxName = mailboxStruct->mb_name;
mailboxNameObject = [NSString stringWithCString:mailboxName encoding:NSASCIIStringEncoding];
[allFolders addObject:mailboxNameObject];
}
mailimap_list_result_free(allList);
return allFolders;
NSString *mailboxNameObject;
char *mailboxName;
int err;
NSMutableSet *allFolders = [NSMutableSet set];
//Now, fill the all folders array
//TODO Fix this so it doesn't use *
err = mailimap_list([self session], "", "*", &allList);
if (err != MAILIMAP_NO_ERROR) {
self.lastError = MailCoreCreateErrorFromCode(err);
return nil;
}
for(cur = clist_begin(allList); cur != NULL; cur = cur->next)
{
mailboxStruct = cur->data;
mailboxName = mailboxStruct->mb_name;
mailboxNameObject = [NSString stringWithCString:mailboxName encoding:NSUTF8StringEncoding];
[allFolders addObject:mailboxNameObject];
}
mailimap_list_result_free(allList);
return allFolders;
}
@end
+17 -16
View File
@@ -29,61 +29,62 @@
* SUCH DAMAGE.
*/
#import <Cocoa/Cocoa.h>
#import <Foundation/Foundation.h>
/*!
@class @CTCoreAddress
This is a very simple class designed to make it easier to work with email addresses since many times
the e-mail address and name are both encoded in the MIME e-mail fields. This class should be very straight
forward, you can get and set a name and an e-mail address.
@class @CTCoreAddress
This is a very simple class designed to make it easier to work with email addresses since many times
the e-mail address and name are both encoded in the MIME e-mail fields. This class should be very straight
forward, you can get and set a name and an e-mail address.
*/
@interface CTCoreAddress : NSObject {
NSString *email;
NSString *name;
NSString *email;
NSString *name;
}
/*!
@abstract Returns a CTCoreAddress with the name and e-mail address set as an empty string.
@abstract Returns a CTCoreAddress with the name and e-mail address set as an empty string.
*/
+ (id)address;
/*!
@abstract Returns a CTCoreAddress set with the specified name and email.
@abstract Returns a CTCoreAddress set with the specified name and email.
*/
+ (id)addressWithName:(NSString *)aName email:(NSString *)aEmail;
/*!
@abstract Returns a CTCoreAddress set with the specified name and email.
@abstract Returns a CTCoreAddress set with the specified name and email.
*/
- (id)initWithName:(NSString *)aName email:(NSString *)aEmail;
/*!
@abstract Returns the name as a NSString
@abstract Returns the name as a NSString
*/
- (NSString *)name;
-(NSString*)decodedName; // added by Gabor
/*!
@abstract Sets the name.
@abstract Sets the name.
*/
- (void)setName:(NSString *)aValue;
/*!
@abstract Returns the e-mail as a NSString
@abstract Returns the e-mail as a NSString
*/
- (NSString *)email;
/*!
@abstract Sets the e-mail.
@abstract Sets the e-mail.
*/
- (void)setEmail:(NSString *)aValue;
/*!
@abstract Works like the typical isEqual: method
@abstract Works like the typical isEqual: method
*/
- (BOOL)isEqual:(id)object;
/*!
@abstract Standard description method
@abstract Standard description method
*/
- (NSString *)description;
@end
+36 -31
View File
@@ -31,78 +31,83 @@
#import "CTCoreAddress.h"
#import "MailCoreUtilities.h"
@implementation CTCoreAddress
+ (id)address {
CTCoreAddress *aAddress = [[CTCoreAddress alloc] init];
return [aAddress autorelease];
CTCoreAddress *aAddress = [[CTCoreAddress alloc] init];
return [aAddress autorelease];
}
+ (id)addressWithName:(NSString *)aName email:(NSString *)aEmail {
CTCoreAddress *aAddress = [[CTCoreAddress alloc] initWithName:aName email:aEmail];
return [aAddress autorelease];
CTCoreAddress *aAddress = [[CTCoreAddress alloc] initWithName:aName email:aEmail];
return [aAddress autorelease];
}
- (id)initWithName:(NSString *)aName email:(NSString *)aEmail {
self = [super init];
if (self) {
[self setName:aName];
[self setEmail:aEmail];
}
return self;
self = [super init];
if (self) {
[self setName:aName];
[self setEmail:aEmail];
}
return self;
}
- (id)init {
self = [super init];
if (self) {
[self setName:@""];
[self setEmail:@""];
}
return self;
self = [super init];
if (self) {
[self setName:@""];
[self setEmail:@""];
}
return self;
}
-(NSString*)decodedName {
return MailCoreDecodeMIMEPhrase((char *)[self.name UTF8String]);
}
- (NSString *)name {
return name;
return name;
}
- (void)setName:(NSString *)aValue {
NSString *oldName = name;
name = [aValue retain];
[oldName release];
NSString *oldName = name;
name = [aValue retain];
[oldName release];
}
- (NSString *)email {
return email;
return email;
}
- (void)setEmail:(NSString *)aValue {
NSString *oldEmail = email;
email = [aValue retain];
[oldEmail release];
NSString *oldEmail = email;
email = [aValue retain];
[oldEmail release];
}
- (NSString *)description {
return [NSString stringWithFormat:@"<%@,%@>", [self name],[self email]];
return [NSString stringWithFormat:@"<%@,%@>", [self name],[self email]];
}
- (BOOL)isEqual:(id)object {
if (![object isKindOfClass:[CTCoreAddress class]])
return NO;
return [[object name] isEqualToString:[self name]] && [[object email] isEqualToString:[self email]];
if (![object isKindOfClass:[CTCoreAddress class]])
return NO;
return [[object name] isEqualToString:[self name]] && [[object email] isEqualToString:[self email]];
}
- (void)dealloc {
[email release];
[name release];
[super dealloc];
[email release];
[name release];
[super dealloc];
}
@end
+3 -3
View File
@@ -29,16 +29,16 @@
* SUCH DAMAGE.
*/
#import <Cocoa/Cocoa.h>
#import <Foundation/Foundation.h>
#import "CTBareAttachment.h"
@interface CTCoreAttachment : CTBareAttachment {
NSData *mData;
NSData *mData;
}
@property(retain) NSData *data;
- (id)initWithContentsOfFile:(NSString *)path;
- (id)initWithData:(NSData *)data contentType:(NSString *)contentType
filename:(NSString *)filename;
filename:(NSString *)filename;
- (BOOL)writeToFile:(NSString *)path;
@end
+36 -35
View File
@@ -37,49 +37,50 @@
@synthesize data=mData;
- (id)initWithContentsOfFile:(NSString *)path {
NSData *data = [NSData dataWithContentsOfFile:path];
NSString *filePathExt = [path pathExtension];
NSString *contentType = nil;
NSDictionary *contentTypes = [NSDictionary dictionaryWithContentsOfFile:CTContentTypesPath];
for (NSString *key in [contentTypes allKeys]) {
NSArray *fileExtensions = [contentTypes objectForKey:key];
for (NSString *ext in fileExtensions) {
if ([filePathExt isEqual:ext]) {
contentType = key;
break;
}
}
if (contentType != nil)
break;
}
// We couldn't find a content-type, set it to something generic
if (contentType == nil) {
contentType = @"application/octet-stream";
}
NSString *filename = [path lastPathComponent];
return [self initWithData:data contentType:contentType filename:filename];
NSData *data = [NSData dataWithContentsOfFile:path];
NSString *filePathExt = [path pathExtension];
NSString *contentType = nil;
//TODO: This won't work on iOS
NSDictionary *contentTypes = [NSDictionary dictionaryWithContentsOfFile:CTContentTypesPath];
for (NSString *key in [contentTypes allKeys]) {
NSArray *fileExtensions = [contentTypes objectForKey:key];
for (NSString *ext in fileExtensions) {
if ([filePathExt isEqual:ext]) {
contentType = key;
break;
}
}
if (contentType != nil)
break;
}
// We couldn't find a content-type, set it to something generic
if (contentType == nil) {
contentType = @"application/octet-stream";
}
NSString *filename = [path lastPathComponent];
return [self initWithData:data contentType:contentType filename:filename];
}
- (id)initWithData:(NSData *)data contentType:(NSString *)contentType
filename:(NSString *)filename {
self = [super init];
if (self) {
self.data = data;
self.contentType = contentType;
self.filename = filename;
}
return self;
filename:(NSString *)filename {
self = [super init];
if (self) {
self.data = data;
self.contentType = contentType;
self.filename = filename;
}
return self;
}
- (BOOL)writeToFile:(NSString *)path {
return [mData writeToFile:path atomically:YES];
return [mData writeToFile:path atomically:YES];
}
- (void)dealloc {
[mData release];
[super dealloc];
[mData release];
[super dealloc];
}
@end
+141 -91
View File
@@ -29,169 +29,219 @@
* SUCH DAMAGE.
*/
#import <Cocoa/Cocoa.h>
#import "libetpan.h"
#import <Foundation/Foundation.h>
#import <libetpan/libetpan.h>
#import "MailCoreTypes.h"
/*!
@class CTCoreFolder
CTCoreFolder is the class used to get and set attributes for a server side folder. It is also the
class used to get a list of messages from the server. You need to make sure and establish a connection
first by calling connect. All methods throw an exceptions on failure.
@class CTCoreFolder
CTCoreFolder is the class used to get and set attributes for a server side folder. It is also the
class used to get a list of messages from the server. You need to make sure and establish a connection
first by calling connect. All methods throw an exceptions on failure.
*/
@class CTCoreMessage, CTCoreAccount;
@interface CTCoreFolder : NSObject {
struct mailfolder *myFolder;
CTCoreAccount *myAccount;
NSString *myPath;
BOOL connected;
struct mailfolder *myFolder;
CTCoreAccount *myAccount;
NSString *myPath;
BOOL connected;
NSError *lastError;
}
/*!
@abstract If an error occurred (nil or return of NO) call this method to get the error
*/
@property(nonatomic, retain) NSError *lastError;
/*!
@abstract This method is used to initialize a folder. This method or the
method in CTCoreAccount folderWithPath can be used to setup a folder.
@param inAccount This parameter must be passed in so the folder can initiate it's connection.
@abstract This method is used to initialize a folder. This method or the
method in CTCoreAccount folderWithPath can be used to setup a folder.
@param inAccount This parameter must be passed in so the folder can initiate it's connection.
*/
- (id)initWithPath:(NSString *)path inAccount:(CTCoreAccount *)account;
/*!
@abstract This initiates the connection after the folder has been initalized.
@abstract This initiates the connection after the folder has been initalized.
@return Return YES on success, NO on error. Call method lastError to get error if one occurred
*/
- (void)connect;
- (BOOL)connect;
/*!
@abstract This method terminates the connection, make sure you don't have any message
connections open from this folder before disconnecting.
@abstract This method terminates the connection, make sure you don't have any message
connections open from this folder before disconnecting.
*/
- (void)disconnect;
/*
Implementation is in alpha.
/*!
@abstract This will return the message from this folder with the UID that was passed in. If the message
can't be found, nil is returned
@result A CTMessage object is returned which can be used to get further information and perform operations
on the message.
*/
//TODO Document Me!
- (NSSet *)messageObjectsFromIndex:(unsigned int)start toIndex:(unsigned int)end;
- (CTCoreMessage *)messageWithUID:(NSUInteger)uid;
/*!
@abstract This will return the message from this folder with the UID that was passed in. If the message
can't be found, nil is returned
@param uid The uid as an NSString for the message to retrieve.
@result A CTMessage object is returned which can be used to get further information and perform operations
on the message.
@abstract Use this method to download message lists from the server. This method take fetch attributes
which configure what is fetched. Fetch attributes can be combined so you fetch all the message data at
once, or select which pieces you want for your app. You can also fetch just the default attributes which
will be as fast as possible.
@param start The message sequence number to start from, starts with 1 and NOT 0 (IMAP starts with 1 that way, sorry)
@param end The ending message sequence number, or if you'd like to fetch to the end of the message list pass in 0
@param attrs This controls what is fetched. Pass in CTFetchAttrDefaultsOnly to fetch the minimum possible, this
includes the UID, RFC822.size, and flags. The defaults are always fetched, even when you don't pass in this flag.
Use CTFetchAttrBodyStructure to also fetch the body structure of the message. This prevents a future round trip
done by [CTCoreMessage fetchBodyStructure], if it sees you already have the body structure it won't re-fetch it.
Use CTFetchAttrEnvelope if you'd like to fetch the subject, to, from, cc, bcc, sender, date etc. You can
also fetch both the envelope and body structure by passing in CTFetchAttrEnvelope | CTFetchAttrBodyStructure
@return Returns a NSArray of CTCoreMessage's. Returns nil on error
*/
- (CTCoreMessage *)messageWithUID:(NSString *)uid;
//TODO Document me!
//TODO Attributes is ignore, fix me!
- (NSSet *)messageListWithFetchAttributes:(NSArray *)attributes;
- (NSArray *)messagesFromSequenceNumber:(NSUInteger)startNum to:(NSUInteger)endNum withFetchAttributes:(CTFetchAttributes)attrs;
/*!
@abstract This validates the passed in UID. The server can at times change the set of UID's for a folder. So
you should verify that the server is still using the same set when connecting.
@param uid The UID to verify.
@return YES if the UID is valid.
@abstract Use this method to download message lists from the server. This method uses UID ranges to determine
which messages to download, while messagesFromSequenceNumber:to:withFetchAttributes: uses sequence numbers.
This method take fetch attributes which configure what is fetched. Fetch attributes can be combined so
you fetch all the message data at once, or select which pieces you want.
@param start The message sequence number to start from, starts with 1 and NOT 0 (IMAP starts with 1 that way, sorry)
@param end The ending message sequence number, or if you'd like to fetch to the end of the message list pass in 0
@param attrs This controls what is fetched. Pass in CTFetchAttrDefaultsOnly to fetch the minimum possible, this
includes the UID, RFC822.size, and flags. The defaults are always fetched, even when you don't pass in this flag.
Use CTFetchAttrBodyStructure to also fetch the body structure of the message. This prevents a future round trip
done by [CTCoreMessage fetchBodyStructure], if it sees you already have the body structure it won't re-fetch it.
Use CTFetchAttrEnvelope if you'd like to fetch the subject, to, from, cc, bcc, sender, date etc. You can
also fetch both the envelope and body structure by passing in CTFetchAttrEnvelope | CTFetchAttrBodyStructure
@return Returns a NSArray of CTCoreMessage's. Returns nil on error
*/
- (BOOL)isUIDValid:(NSString *)uid;
- (NSArray *)messagesFromUID:(NSUInteger)startUID to:(NSUInteger)endUID withFetchAttributes:(CTFetchAttributes)attrs;
/*!
@abstract Pulls the sequence number for the messag with the specified uid.
It does not perform UID validation, and the sequence ID is only
valid per session.
@param The uid for the message
@return > 1 if successful, 0 on err
@abstract Pulls the sequence number for the message with the specified uid.
It does not perform UID validation, and the sequence ID is only
valid per session.
@param The uid for the message
@return Return YES on success, NO on error. Call method lastError to get error if one occurred
*/
- (NSUInteger)sequenceNumberForUID:(NSString *)uid;
//FIXME What is this?
- (void)check;
- (BOOL)sequenceNumberForUID:(NSUInteger)uid sequenceNumber:(NSUInteger *)sequenceNumber;
/*!
@abstract The folder name.
@abstract From IMAP RFC: "The CHECK command requests a checkpoint of the currently selected mailbox.
A checkpoint refers to any implementation-dependent housekeeping associated
with the mailbox (e.g., resolving the server's in-memory state of the mailbox
with the state on its disk) that is not normally executed as part of each command."
@return Return YES on success, NO on error. Call method lastError to get error if one occurred
*/
- (BOOL)check;
/*!
@abstract The folder name.
*/
- (NSString *)name;
/*!
@abstract The entire path of folder.
@abstract The entire path of folder.
*/
- (NSString *)path;
/*!
@abstract This will change the path of the folder. Use this method to rename the folder on the server
or to move the folder on the server.
@param path The new path for the folder as an NSString.
@abstract This will change the path of the folder. Use this method to rename the folder on the server
or to move the folder on the server.
@param path The new path for the folder as an NSString.
@return Return YES on success, NO on error. Call method lastError to get error if one occurred
*/
- (void)setPath:(NSString *)path;
- (BOOL)setPath:(NSString *)path;
/*!
@abstract If the folder doesn't exist on the server this method will create it. Make sure the pathname
has been set first.
@abstract If the folder doesn't exist on the server this method will create it. Make sure the pathname
has been set first.
@return Return YES on success, NO on error. Call method lastError to get error if one occurred
*/
- (void)create;
- (BOOL)create;
/*!
@abstract This method will remove the folder and any messages contained within from the server.
Be careful when using this method because there is no way to undo.
@abstract This method will remove the folder and any messages contained within from the server.
Be careful when using this method because there is no way to undo.
@return Return YES on success, NO on error. Call method lastError to get error if one occurred
*/
- (void)delete;
- (BOOL)delete;
/*!
@abstract The folder will be listed as subscribed on the server.
@abstract The folder will be listed as subscribed on the server.
@return Return YES on success, NO on error. Call method lastError to get error if one occurred
*/
- (void)subscribe;
- (BOOL)subscribe;
/*!
@abstract The folder will be listed as unsubscribed.
@abstract The folder will be listed as unsubscribed.
@return Return YES on success, NO on error. Call method lastError to get error if one occurred
*/
- (void)unsubscribe;
- (BOOL)unsubscribe;
/*!
@abstract Returns the message flags. You must AND/OR using the defines constants.
Here is a list of message flags:
CTFlagNew, CTFlagSeen, CTFlagFlagged, CTFlagDeleted,
CTFlagAnswered, CTFlagForwarded.
@abstract Retrieves the message flags. You must AND/OR using the defines constants.
Here is a list of message flags:
CTFlagNew, CTFlagSeen, CTFlagFlagged, CTFlagDeleted,
CTFlagAnswered, CTFlagForwarded.
@return Return YES on success, NO on error. Call method lastError to get error if one occurred
*/
- (unsigned int)flagsForMessage:(CTCoreMessage *)msg;
- (BOOL)flagsForMessage:(CTCoreMessage *)msg flags:(NSUInteger *)flags;
/*!
@abstract Sets the message's flags on the server, take a look at the
documentation for flagsForMessage:
@abstract Sets the message's flags on the server, take a look at the
documentation for flagsForMessage:
@return Return YES on success, NO on error. Call method lastError to get error if one occurred
*/
- (void)setFlags:(unsigned int)flags forMessage:(CTCoreMessage *)msg;
- (BOOL)setFlags:(NSUInteger)flags forMessage:(CTCoreMessage *)msg;
/*!
@astract Deletes all messages contained in the folder that are marked for
deletion. Deleting messages in IMAP is a little strange, first
you need to set the message flag CTFlagDeleted to CTFlagSet, and
then when you call expunge on the folder the message is contained
in, it will be deleted.
@astract Deletes all messages contained in the folder that are marked for
deletion. Deleting messages in IMAP is a little strange, first
you need to set the message flag CTFlagDeleted to CTFlagSet, and
then when you call expunge on the folder the message is contained
in, it will be deleted.
@return Return YES on success, NO on error. Call method lastError to get error if one occurred
*/
- (void)expunge;
//TODO document me
//Should this be by message instead of by UID?
- (void)copyMessageWithUID:(NSString *)uid toFolderWithPath:(NSString *)path;
- (BOOL)expunge;
/*!
@abstract Returns the number of unread messages.
@result A NSUInteger containing the number of unread messages.
*/
- (NSUInteger)unreadMessageCount;
@abstract Copies a message to a folder
@return Return YES on success, NO on error. Call method lastError to get error if one occurred
*/
- (BOOL)copyMessage:(CTCoreMessage *)msg toPath:(NSString *)path;
/*!
@abstract Returns the number of messages in the folder.
@result A NSUInteger containing the number of messages.
*/
- (NSUInteger)totalMessageCount;
@abstract Moves a message to a folder
@return Return YES on success, NO on error. Call method lastError to get error if one occurred
*/
- (BOOL)moveMessage:(CTCoreMessage *)msg toPath:(NSString *)path;
/*!
@abstract Returns the uid validity value for the folder
@result An integer containing the uid validity
@abstract Returns the number of unread messages. This causes a round trip to the server, as it fetches
the count for each call.
@return Return YES on success, NO on error. Call method lastError to get error if one occurred
*/
- (BOOL)unreadMessageCount:(NSUInteger *)unseenCount;
/*!
@abstract Returns the number of messages in the folder. The count was retrieved when the folder connection was
established, so to refresh the count you must disconnect and reconnect.
@return Return YES on success, NO on error. Call method lastError to get error if one occurred
*/
- (BOOL)totalMessageCount:(NSUInteger *)totalCount;
/*!
@abstract Returns the uid validity value for the folder, which can be used to determine if the
local cached UID's are still valid, or if the server has changed UID's
*/
- (NSUInteger)uidValidity;
/*!
@abstract Returns the uid next value for the folder. The next message added to the mailbox
will be assigned a UID greater than or equal to uidNext
*/
- (NSUInteger)uidNext;
/* Intended for advanced use only */
- (struct mailfolder *)folderStruct;
- (mailsession *)folderSession;
+609 -495
View File
File diff suppressed because it is too large Load Diff
+140 -66
View File
@@ -29,190 +29,264 @@
* SUCH DAMAGE.
*/
#import <Cocoa/Cocoa.h>
#import "libetpan.h"
#import <Foundation/Foundation.h>
#import <libetpan/libetpan.h>
/*!
@class CTCoreMessage
CTCoreMessage is how you work with messages. The easiest way to instantiate a CTCoreMessage
is to first setup a CTCoreAccount object and then get a CTCoreFolder object and then use it's
convience method messageWithUID: to get a message object you can work with.
Anything that begins with "fetch", requires that an active network connection is present.
@class CTCoreMessage
CTCoreMessage is how you work with messages. The easiest way to instantiate a CTCoreMessage
is to first setup a CTCoreAccount object and then get a CTCoreFolder object and then use it's
convenience method messageWithUID: to get a message object you can work with.
Anything that begins with "fetch", requires that an active network connection is present.
*/
@class CTCoreFolder, CTCoreAddress, CTCoreAttachment, CTMIME;
@interface CTCoreMessage : NSObject {
struct mailmessage *myMessage;
struct mailimf_single_fields *myFields;
CTMIME *myParsedMIME;
NSUInteger mySequenceNumber;
struct mailmessage *myMessage;
struct mailimf_single_fields *myFields;
CTMIME *myParsedMIME;
NSUInteger mySequenceNumber;
NSError *lastError;
}
@property(retain) CTMIME *mime;
//TODO Parse this stuff: message_id, inReplyTo, references, comments, keywords, headers
/*!
@abstract If an error occurred (nil or return of NO) call this method to get the error
*/
@property(nonatomic, retain) NSError *lastError;
/*!
@abstract Used to instantiate an empty message object.
@abstract If the body structure has been fetched, this will contain the MIME structure
*/
@property(retain) CTMIME *mime;
/*!
@abstract Used to instantiate an empty message object.
*/
- (id)init;
/*!
@abstract Used to instantiate a message object with the contents of a mailmessage struct
(a LibEtPan type). The mailmessage struct does not include any body information,
so after calling this method the message will have a body which is NULL.
@abstract Used to instantiate a message object with the contents of a mailmessage struct
(a LibEtPan type). The mailmessage struct does not include any body information,
so after calling this method the message will have a body which is NULL.
*/
- (id)initWithMessageStruct:(struct mailmessage *)message;
/*!
@abstract Used to instantiate a message object based off the contents of a file on disk.
The file on disk must be a valid MIME message.
@abstract Used to instantiate a message object based off the contents of a file on disk.
The file on disk must be a valid MIME message.
*/
- (id)initWithFileAtPath:(NSString *)path;
/*!
@abstract Used to instantiate a message object based off a string
that contains a valid MIME message
@abstract Used to instantiate a message object based off a string
that contains a valid MIME message
*/
- (id)initWithString:(NSString *)msgData;
/*
@abstract Creates an empty message
@abstract Creates an empty message
*/
- (id)init;
/*!
@abstract This method fetches the message body off of the server, and places
it in a local data structure which can later be returned by the
method body. This method require that an active MailCore network
connection is present.
*/
- (void)fetchBody;
@abstract If a method returns nil or in the case of a BOOL returns NO, call this to get the error that occured
*/
- (NSError *)lastError;
/*!
@abstract This method returns the parsed message body as an NSString.
@abstract If the messages body structure hasn't been downloaded already it will be fetched from the server.
The body structure is needed to get attachments or the message body
@return Return YES on success, NO on error. Call method lastError to get error if one occurred
*/
- (BOOL)fetchBodyStructure;
/*!
@abstract This method returns the parsed message body as an NSString.
This attempts to return a plain text body and skips HTML. If
a plaintext body isn't found the HTML body is returned.
*/
- (NSString *)body;
/*!
@abstract This method sets the message body. Plaintext only please!
@abstract This method returns the html body as an NSString.
*/
- (NSString *)htmlBody;
/*! @abstract Returns a message body as an NSString. First attempts
to retrieve a plain text body, if that fails then
tries for an HTML body.
*/
- (NSString *)bodyPreferringPlainText;
/*!
@abstract This method sets the message body. Plaintext only please!
*/
- (void)setBody:(NSString *)body;
/*!
@abstract Use this method to set the body if you have HTML content.
*/
- (void)setHTMLBody:(NSString *)body;
- (NSArray *)attachments;
- (void)addAttachment:(CTCoreAttachment *)attachment;
/*!
@abstract Returns the subject of the message.
@abstract Returns the subject of the message.
*/
- (NSString *)subject;
/*!
@abstract Will set the subject of the message, use this when composing e-mail.
@abstract Will set the subject of the message, use this when composing e-mail.
*/
- (void)setSubject:(NSString *)subject;
/*!
@abstract Return the date the message was sent. If a date wasn't included then
a date from the distant past is used instead.
*/
- (NSCalendarDate *)sentDate;
/*! @abstract Returns the timezone of the sender of the message (got from the Date field timezone attribute) */
- (NSTimeZone*)senderTimeZone;
/*! @abstract Returns the date as given in the Date mail field (no timezone is applied) */
- (NSDate *)senderDate;
/*! @abstract Returns the date in the Date field converted to GMT */
- (NSDate *)sentDateGMT;
/*!
@abstract Returns YES if the method is unread.
@abstract Returns the date in the Date field converted to the local timezone
the local timezone is the one set in the device running this code
*/
- (NSDate *)sentDateLocalTimeZone;
/*!
@abstract Returns YES if the message is unread.
*/
- (BOOL)isUnread;
/*!
@abstract Returns YES if the message is recent and unread.
*/
- (BOOL)isNew;
/*!
@abstract A machine readable ID that is guaranteed unique by the
host that generated the messaeg
@abstract Returns YES if the message is starred (flagged in IMAP terms).
*/
- (BOOL)isStarred;
/*!
@abstract A machine readable ID that is guaranteed unique by the
host that generated the message
*/
- (NSString *)messageId;
/*!
@abstract Returns an NSString containing the messages UID.
@abstract Returns an NSUInteger containing the messages UID. This number is unique across sessions
*/
- (NSString *)uid;
- (NSUInteger)uid;
/*!
@abstract Returns the message sequence number, this number cannot be used across sessions
@abstract Returns the message sequence number, this number cannot be used across sessions
*/
- (NSUInteger)sequenceNumber;
/*!
@abstract Set the message sequence number, this will NOT set any thing on the server.
This is used to assign sequence numbers after retrieving the message list.
@abstract Returns the message size in bytes
*/
- (NSUInteger)messageSize;
/*!
@abstract Returns the message flags. The flags contain if there user has replied, forwarded, read, delete etc.
See MailCoreTypes.h for a list of constants
*/
- (NSUInteger)flags;
/*!
@abstract Set the message sequence number, this will NOT set any thing on the server.
This is used to assign sequence numbers after retrieving the message list.
*/
- (void)setSequenceNumber:(NSUInteger)sequenceNumber;
/*!
@abstract Parses the from list, the result is an NSSet containing CTCoreAddress's
@abstract Parses the from list, the result is an NSSet containing CTCoreAddress's
*/
- (NSSet *)from;
/*!
@abstract Sets the message's from addresses
@param addresses A NSSet containing CTCoreAddress's
@abstract Sets the message's from addresses
@param addresses A NSSet containing CTCoreAddress's
*/
- (void)setFrom:(NSSet *)addresses;
/*!
@abstract Returns the sender, which isn't always the actual person who sent the message, it's usually the
address of the machine that sent the message. In reality, this method isn't very useful, use from: instead.
@abstract Returns the sender, which isn't always the actual person who sent the message, it's usually the
address of the machine that sent the message. In reality, this method isn't very useful, use from: instead.
*/
- (CTCoreAddress *)sender;
/*!
@abstract Returns the list of people the message was sent to, returns an NSSet containing CTAddress's.
@abstract Returns the list of people the message was sent to, returns an NSSet containing CTAddress's.
*/
- (NSSet *)to;
/*!
@abstract Sets the message's to addresses
@param addresses A NSSet containing CTCoreAddress's
@abstract Sets the message's to addresses
@param addresses A NSSet containing CTCoreAddress's
*/
- (void)setTo:(NSSet *)addresses;
/*!
@abstract Returns the list of people the message was cced to, returns an NSSet containing CTAddress's.
@abstract Returns the list of people the message was cced to, returns an NSSet containing CTAddress's.
*/
- (NSSet *)cc;
/*!
@abstract Sets the message's cc addresses
@param addresses A NSSet containing CTCoreAddress's
@abstract Sets the message's cc addresses
@param addresses A NSSet containing CTCoreAddress's
*/
- (void)setCc:(NSSet *)addresses;
/*!
@abstract Returns the list of people the message was bcced to, returns an NSSet containing CTAddress's.
@abstract Returns the list of people the message was bcced to, returns an NSSet containing CTAddress's.
*/
- (NSSet *)bcc;
/*!
@abstract Sets the message's bcc addresses
@param addresses A NSSet containing CTCoreAddress's
@abstract Sets the message's bcc addresses
@param addresses A NSSet containing CTCoreAddress's
*/
- (void)setBcc:(NSSet *)addresses;
/*!
@abstract Returns the list of people the message was in reply-to, returns an NSSet containing CTAddress's.
@abstract Returns the list of people the message was in reply-to, returns an NSSet containing CTAddress's.
*/
- (NSSet *)replyTo;
/*!
@abstract Sets the message's reply to addresses
@param addresses A NSSet containing CTCoreAddress's
@abstract Sets the message's reply to addresses
@param addresses A NSSet containing CTCoreAddress's
*/
- (void)setReplyTo:(NSSet *)addresses;
/*!
@abstract Returns the message rendered as the appropriate MIME and IMF content. Use this only if you
want the raw encoding of the message.
@abstract Returns the message rendered as the appropriate MIME and IMF content. Use this only if you
want the raw encoding of the message.
*/
- (NSString *)render;
/*!
@abstract Returns the message in the format Mail.app uses, Emlx. This format stores the message
headers, body, and flags.
*/
- (NSData *)messageAsEmlx;
/*!
@abstract Fetches from the server the rfc822 content of the message, which is the headers and the message body.
@return Return nil on error. Call method lastError to get error if one occurred
*/
- (NSString *)rfc822;
/* Intended for advanced use only */
- (struct mailmessage *)messageStruct;
- (mailimap *)imapSession;
- (void)setBodyStructure:(struct mailmime *)mime;
- (void)setFields:(struct mailimf_fields *)fields;
@end
+560 -318
View File
File diff suppressed because it is too large Load Diff
+9 -9
View File
@@ -29,22 +29,22 @@
* SUCH DAMAGE.
*/
#import <Cocoa/Cocoa.h>
#import <Foundation/Foundation.h>
#import "CTSMTP.h"
/*!
@class CTESMTP
This class is used internally by CTSMTPConnection for ESMTP connections, clients
should not use this directly.
@class CTESMTP
This class is used internally by CTSMTPConnection for ESMTP connections, clients
should not use this directly.
*/
@interface CTESMTP : CTSMTP {
}
- (bool)helo;
- (void)startTLS;
- (void)authenticateWithUsername:(NSString *)username password:(NSString *)password server:(NSString *)server;
- (void)setFrom:(NSString *)fromAddress;
- (void)setRecipientAddress:(NSString *)recAddress;
- (BOOL)helo;
- (BOOL)startTLS;
- (BOOL)authenticateWithUsername:(NSString *)username password:(NSString *)password server:(NSString *)server;
- (BOOL)setFrom:(NSString *)fromAddress;
- (BOOL)setRecipientAddress:(NSString *)recAddress;
@end
+88 -67
View File
@@ -34,6 +34,7 @@
#import "CTCoreAddress.h"
#import "CTCoreMessage.h"
#import "MailCoreTypes.h"
#import "MailCoreUtilities.h"
#include <sys/types.h>
#include <sys/socket.h>
@@ -48,22 +49,22 @@ static int fill_remote_ip_port(mailstream * stream, char * remote_ip_port, size_
socklen_t namelen;
char remote_ip_port_buf[128];
int r;
low = mailstream_get_low(stream);
fd = mailstream_low_get_fd(low);
namelen = sizeof(name);
r = getpeername(fd, (struct sockaddr *) &name, &namelen);
if (r < 0)
return -1;
if (inet_ntop(AF_INET, &name.sin_addr, remote_ip_port_buf,
sizeof(remote_ip_port_buf)))
return -1;
snprintf(remote_ip_port, remote_ip_port_len, "%s;%i",
remote_ip_port_buf, ntohs(name.sin_port));
return 0;
}
@@ -75,101 +76,121 @@ static int fill_local_ip_port(mailstream * stream, char * local_ip_port, size_t
socklen_t namelen;
char local_ip_port_buf[128];
int r;
low = mailstream_get_low(stream);
fd = mailstream_low_get_fd(low);
namelen = sizeof(name);
r = getpeername(fd, (struct sockaddr *) &name, &namelen);
if (r < 0)
return -1;
if (inet_ntop(AF_INET, &name.sin_addr, local_ip_port_buf, sizeof(local_ip_port_buf)))
return -1;
snprintf(local_ip_port, local_ip_port_len, "%s;%i", local_ip_port_buf, ntohs(name.sin_port));
return 0;
}
@implementation CTESMTP
- (bool)helo {
int ret = mailesmtp_ehlo([self resource]);
/* Return false if the server doesn't implement ehlo */
return (ret != MAILSMTP_ERROR_NOT_IMPLEMENTED);
- (BOOL)helo {
int ret = mailesmtp_ehlo([self resource]);
/* Return false if the server doesn't implement ehlo */
return (ret != MAILSMTP_ERROR_NOT_IMPLEMENTED);
}
- (void)startTLS {
mailstream_low * low;
int fd;
mailstream_low * new_low;
int ret = mailesmtp_starttls([self resource]);
IfTrue_RaiseException(ret != MAILSMTP_NO_ERROR, CTSMTPTLS, CTSMTPTLSDesc);
- (BOOL)startTLS {
mailstream_low * low;
int fd;
mailstream_low * new_low;
low = mailstream_get_low([self resource]->stream);
fd = mailstream_low_get_fd(low);
new_low = mailstream_low_tls_open(fd);
mailstream_low_free(low);
mailstream_set_low([self resource]->stream, new_low);
int ret = mailesmtp_starttls([self resource]);
if (ret != MAIL_NO_ERROR) {
self.lastError = MailCoreCreateErrorFromCode(ret);
return NO;
}
ret = mailesmtp_ehlo([self resource]);
IfTrue_RaiseException(ret != MAILSMTP_NO_ERROR, CTSMTPHello, CTSMTPHelloDesc);
low = mailstream_get_low([self resource]->stream);
fd = mailstream_low_get_fd(low);
new_low = mailstream_low_tls_open(fd);
mailstream_low_free(low);
mailstream_set_low([self resource]->stream, new_low);
ret = mailesmtp_ehlo([self resource]);
if (ret != MAIL_NO_ERROR) {
self.lastError = MailCoreCreateErrorFromCode(ret);
return NO;
}
return YES;
}
- (void)authenticateWithUsername:(NSString *)username password:(NSString *)password server:(NSString *)server {
char *cUsername = (char *)[username cStringUsingEncoding:NSASCIIStringEncoding];
char *cPassword = (char *)[password cStringUsingEncoding:NSASCIIStringEncoding];
char *cServer = (char *)[server cStringUsingEncoding:NSASCIIStringEncoding];
char local_ip_port_buf[128];
char remote_ip_port_buf[128];
char * local_ip_port;
char * remote_ip_port;
if (cPassword == NULL)
cPassword = "";
if (cUsername == NULL)
cUsername = "";
int ret = fill_local_ip_port([self resource]->stream, local_ip_port_buf, sizeof(local_ip_port_buf));
if (ret < 0)
local_ip_port = NULL;
else
local_ip_port = local_ip_port_buf;
- (BOOL)authenticateWithUsername:(NSString *)username password:(NSString *)password server:(NSString *)server {
char *cUsername = (char *)[username cStringUsingEncoding:NSUTF8StringEncoding];
char *cPassword = (char *)[password cStringUsingEncoding:NSUTF8StringEncoding];
char *cServer = (char *)[server cStringUsingEncoding:NSUTF8StringEncoding];
ret = fill_remote_ip_port([self resource]->stream, remote_ip_port_buf, sizeof(remote_ip_port_buf));
if (ret < 0)
remote_ip_port = NULL;
else
remote_ip_port = remote_ip_port_buf;
char local_ip_port_buf[128];
char remote_ip_port_buf[128];
char * local_ip_port;
char * remote_ip_port;
if (cPassword == NULL)
cPassword = "";
if (cUsername == NULL)
cUsername = "";
int ret = fill_local_ip_port([self resource]->stream, local_ip_port_buf, sizeof(local_ip_port_buf));
if (ret < 0)
local_ip_port = NULL;
else
local_ip_port = local_ip_port_buf;
ret = fill_remote_ip_port([self resource]->stream, remote_ip_port_buf, sizeof(remote_ip_port_buf));
if (ret < 0)
remote_ip_port = NULL;
else
remote_ip_port = remote_ip_port_buf;
/*
in most case, login = auth_name = user@domain
and realm = server hostname full qualified domain name
int mailesmtp_auth_sasl(mailsmtp * session, const char * auth_type,
const char * server_fqdn,
const char * local_ip_port,
const char * remote_ip_port,
const char * login, const char * auth_name,
const char * password, const char * realm);
int mailesmtp_auth_sasl(mailsmtp * session, const char * auth_type,
const char * server_fqdn,
const char * local_ip_port,
const char * remote_ip_port,
const char * login, const char * auth_name,
const char * password, const char * realm);
*/
ret = mailesmtp_auth_sasl([self resource], "PLAIN", cServer, local_ip_port, remote_ip_port,
cUsername, cUsername, cPassword, cServer);
IfTrue_RaiseException(ret != MAILSMTP_NO_ERROR, CTSMTPLogin, CTSMTPLoginDesc);
ret = mailesmtp_auth_sasl([self resource], "PLAIN", cServer, local_ip_port, remote_ip_port,
cUsername, cUsername, cPassword, cServer);
if (ret != MAIL_NO_ERROR) {
self.lastError = MailCoreCreateErrorFromCode(ret);
return NO;
}
return YES;
}
- (void)setFrom:(NSString *)fromAddress {
int ret = mailesmtp_mail([self resource], [fromAddress cStringUsingEncoding:NSASCIIStringEncoding], 1, "MailCoreSMTP");
IfTrue_RaiseException(ret != MAILSMTP_NO_ERROR, CTSMTPFrom, CTSMTPFromDesc);
- (BOOL)setFrom:(NSString *)fromAddress {
int ret = mailesmtp_mail([self resource], [fromAddress cStringUsingEncoding:NSUTF8StringEncoding], 1, "MailCoreSMTP");
if (ret != MAIL_NO_ERROR) {
self.lastError = MailCoreCreateErrorFromCode(ret);
return NO;
}
return YES;
}
- (void)setRecipientAddress:(NSString *)recAddress {
int ret = mailesmtp_rcpt([self resource], [recAddress cStringUsingEncoding:NSASCIIStringEncoding],
MAILSMTP_DSN_NOTIFY_FAILURE|MAILSMTP_DSN_NOTIFY_DELAY,NULL);
IfTrue_RaiseException(ret != MAILSMTP_NO_ERROR, CTSMTPRecipients, CTSMTPRecipientsDesc);
- (BOOL)setRecipientAddress:(NSString *)recAddress {
int ret = mailesmtp_rcpt([self resource], [recAddress cStringUsingEncoding:NSUTF8StringEncoding],
MAILSMTP_DSN_NOTIFY_FAILURE|MAILSMTP_DSN_NOTIFY_DELAY,NULL);
if (ret != MAIL_NO_ERROR) {
self.lastError = MailCoreCreateErrorFromCode(ret);
return NO;
}
return YES;
}
@end
+6 -6
View File
@@ -29,19 +29,19 @@
* SUCH DAMAGE.
*/
#import <Cocoa/Cocoa.h>
#import "libetpan.h"
#import <Foundation/Foundation.h>
#import <libetpan/libetpan.h>
@class CTMIME_Enumerator;
@interface CTMIME : NSObject {
NSString *mContentType;
NSString *mContentType;
}
@property(retain) NSString *contentType;
@property(readonly) id content;
@property(nonatomic, retain) NSString *contentType;
@property(nonatomic, readonly) id content;
- (id)initWithMIMEStruct:(struct mailmime *)mime
forMessage:(struct mailmessage *)message;
forMessage:(struct mailmessage *)message;
- (struct mailmime *)buildMIMEStruct;
- (NSString *)render;
- (CTMIME_Enumerator *)mimeEnumerator;
+68 -69
View File
@@ -37,92 +37,91 @@
@synthesize contentType=mContentType;
- (id)initWithMIMEStruct:(struct mailmime *)mime
forMessage:(struct mailmessage *)message {
self = [super init];
if (self) {
// We couldn't find a content-type, set it to something generic
NSString *mainType = @"application";
NSString *subType = @"octet-stream";
if (mime != NULL && mime->mm_content_type != NULL) {
struct mailmime_content *content = mime->mm_content_type;
if (content->ct_type != NULL) {
subType = [NSString stringWithCString:content->ct_subtype
encoding:NSASCIIStringEncoding];
subType = [subType lowercaseString];
struct mailmime_type *type = content->ct_type;
if (type->tp_type == MAILMIME_TYPE_DISCRETE_TYPE &&
type->tp_data.tp_discrete_type != NULL) {
switch (type->tp_data.tp_discrete_type->dt_type) {
case MAILMIME_DISCRETE_TYPE_TEXT:
mainType = @"text";
break;
case MAILMIME_DISCRETE_TYPE_IMAGE:
mainType = @"image";
break;
case MAILMIME_DISCRETE_TYPE_AUDIO:
mainType = @"audio";
break;
case MAILMIME_DISCRETE_TYPE_VIDEO:
mainType = @"video";
break;
case MAILMIME_DISCRETE_TYPE_APPLICATION:
mainType = @"application";
break;
}
}
else if (type->tp_type == MAILMIME_TYPE_COMPOSITE_TYPE &&
type->tp_data.tp_composite_type != NULL) {
switch (type->tp_data.tp_discrete_type->dt_type) {
case MAILMIME_COMPOSITE_TYPE_MESSAGE:
mainType = @"message";
break;
case MAILMIME_COMPOSITE_TYPE_MULTIPART:
mainType = @"multipart";
break;
}
}
}
}
mContentType = [[NSString alloc] initWithFormat:@"%@/%@", mainType, subType];
}
return self;
forMessage:(struct mailmessage *)message {
self = [super init];
if (self) {
// We couldn't find a content-type, set it to something generic
NSString *mainType = @"application";
NSString *subType = @"octet-stream";
if (mime != NULL && mime->mm_content_type != NULL) {
struct mailmime_content *content = mime->mm_content_type;
if (content->ct_type != NULL) {
subType = [NSString stringWithCString:content->ct_subtype
encoding:NSUTF8StringEncoding];
subType = [subType lowercaseString];
struct mailmime_type *type = content->ct_type;
if (type->tp_type == MAILMIME_TYPE_DISCRETE_TYPE &&
type->tp_data.tp_discrete_type != NULL) {
switch (type->tp_data.tp_discrete_type->dt_type) {
case MAILMIME_DISCRETE_TYPE_TEXT:
mainType = @"text";
break;
case MAILMIME_DISCRETE_TYPE_IMAGE:
mainType = @"image";
break;
case MAILMIME_DISCRETE_TYPE_AUDIO:
mainType = @"audio";
break;
case MAILMIME_DISCRETE_TYPE_VIDEO:
mainType = @"video";
break;
case MAILMIME_DISCRETE_TYPE_APPLICATION:
mainType = @"application";
break;
}
}
else if (type->tp_type == MAILMIME_TYPE_COMPOSITE_TYPE &&
type->tp_data.tp_composite_type != NULL) {
switch (type->tp_data.tp_discrete_type->dt_type) {
case MAILMIME_COMPOSITE_TYPE_MESSAGE:
mainType = @"message";
break;
case MAILMIME_COMPOSITE_TYPE_MULTIPART:
mainType = @"multipart";
break;
}
}
}
}
mContentType = [[NSString alloc] initWithFormat:@"%@/%@", mainType, subType];
}
return self;
}
- (id)content {
return nil;
return nil;
}
- (NSString *)contentType {
return mContentType;
return mContentType;
}
- (struct mailmime *)buildMIMEStruct {
return NULL;
return NULL;
}
- (NSString *)render {
MMAPString * str = mmap_string_new("");
int col = 0;
int err = 0;
NSString *resultStr;
mailmime_write_mem(str, &col, [self buildMIMEStruct]);
err = mmap_string_ref(str);
assert(err == 0);
resultStr = [[NSString alloc] initWithBytes:str->str length:str->len
encoding:NSASCIIStringEncoding];
mmap_string_free(str);
return [resultStr autorelease];
MMAPString * str = mmap_string_new("");
int col = 0;
int err = 0;
NSString *resultStr;
mailmime_write_mem(str, &col, [self buildMIMEStruct]);
err = mmap_string_ref(str);
resultStr = [[NSString alloc] initWithBytes:str->str length:str->len
encoding:NSUTF8StringEncoding];
mmap_string_free(str);
return [resultStr autorelease];
}
- (CTMIME_Enumerator *)mimeEnumerator {
CTMIME_Enumerator *enumerator;
enumerator = [[CTMIME_Enumerator alloc] initWithMIME:self];
return [enumerator autorelease];
CTMIME_Enumerator *enumerator;
enumerator = [[CTMIME_Enumerator alloc] initWithMIME:self];
return [enumerator autorelease];
}
- (void)dealloc {
[mContentType release];
[super dealloc];
[mContentType release];
[super dealloc];
}
@end
+5 -3
View File
@@ -29,7 +29,9 @@
* SUCH DAMAGE.
*/
#import <Cocoa/Cocoa.h>
#import <Foundation/Foundation.h>
#import <libetpan/libetpan.h>
@class CTMIME, CTMIME_SinglePart;
@@ -37,7 +39,7 @@
}
+ (CTMIME *)createMIMEWithMIMEStruct:(struct mailmime *)mime
forMessage:(struct mailmessage *)message;
forMessage:(struct mailmessage *)message;
+ (CTMIME_SinglePart *)createMIMESinglePartWithMIMEStruct:(struct mailmime *)mime
forMessage:(struct mailmessage *)message;
forMessage:(struct mailmessage *)message;
@end
+39 -39
View File
@@ -32,7 +32,7 @@
#import "CTMIMEFactory.h"
#import "MailCoreTypes.h"
#import "libetpan.h"
#import "MailCoreUtilities.h"
#import "CTMIME_SinglePart.h"
#import "CTMIME_MessagePart.h"
#import "CTMIME_MultiPart.h"
@@ -42,46 +42,46 @@
@implementation CTMIMEFactory
+ (CTMIME *)createMIMEWithMIMEStruct:(struct mailmime *)mime
forMessage:(struct mailmessage *)message {
if (mime == NULL) {
RaiseException(CTMIMEParseError, CTMIMEParseErrorDesc);
}
switch (mime->mm_type) {
case MAILMIME_SINGLE:
return [CTMIMEFactory createMIMESinglePartWithMIMEStruct:mime
forMessage:message];
break;
case MAILMIME_MULTIPLE:
return [[[CTMIME_MultiPart alloc] initWithMIMEStruct:mime
forMessage:message] autorelease];
break;
case MAILMIME_MESSAGE:
return [[[CTMIME_MessagePart alloc] initWithMIMEStruct:mime
forMessage:message] autorelease];
break;
}
return NULL;
forMessage:(struct mailmessage *)message {
if (mime == nil) {
return nil;
}
switch (mime->mm_type) {
case MAILMIME_SINGLE:
return [CTMIMEFactory createMIMESinglePartWithMIMEStruct:mime
forMessage:message];
break;
case MAILMIME_MULTIPLE:
return [[[CTMIME_MultiPart alloc] initWithMIMEStruct:mime
forMessage:message] autorelease];
break;
case MAILMIME_MESSAGE:
return [[[CTMIME_MessagePart alloc] initWithMIMEStruct:mime
forMessage:message] autorelease];
break;
}
return NULL;
}
+ (CTMIME_SinglePart *)createMIMESinglePartWithMIMEStruct:(struct mailmime *)mime
forMessage:(struct mailmessage *)message {
struct mailmime_type *aType = mime->mm_content_type->ct_type;
if (aType->tp_type != MAILMIME_TYPE_DISCRETE_TYPE) {
/* What do you do with a composite single part? */
return nil;
}
CTMIME_SinglePart *content = nil;
switch (aType->tp_data.tp_discrete_type->dt_type) {
case MAILMIME_DISCRETE_TYPE_TEXT:
content = [[CTMIME_TextPart alloc] initWithMIMEStruct:mime
forMessage:message];
break;
default:
content = [[CTMIME_SinglePart alloc] initWithMIMEStruct:mime
forMessage:message];
break;
}
return [content autorelease];
forMessage:(struct mailmessage *)message {
struct mailmime_type *aType = mime->mm_content_type->ct_type;
if (aType->tp_type != MAILMIME_TYPE_DISCRETE_TYPE) {
/* What do you do with a composite single part? */
return nil;
}
CTMIME_SinglePart *content = nil;
switch (aType->tp_data.tp_discrete_type->dt_type) {
case MAILMIME_DISCRETE_TYPE_TEXT:
content = [[CTMIME_TextPart alloc] initWithMIMEStruct:mime
forMessage:message];
break;
default:
content = [[CTMIME_SinglePart alloc] initWithMIMEStruct:mime
forMessage:message];
break;
}
return [content autorelease];
}
@end
+2 -2
View File
@@ -29,14 +29,14 @@
* SUCH DAMAGE.
*/
#import <Cocoa/Cocoa.h>
#import <Foundation/Foundation.h>
@class CTMIME;
//TODO Document me
// Breadth first
@interface CTMIME_Enumerator : NSEnumerator {
NSMutableArray *mToVisit;
NSMutableArray *mToVisit;
}
- (id)initWithMIME:(CTMIME *)mime;
+35 -35
View File
@@ -28,7 +28,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#import "CTMIME_Enumerator.h"
#import "CTMIME.h"
@@ -37,48 +37,48 @@
@implementation CTMIME_Enumerator
- (id)initWithMIME:(CTMIME *)mime {
self = [super init];
if (self) {
mToVisit = [[NSMutableArray alloc] init];
[mToVisit addObject:mime];
}
return self;
self = [super init];
if (self) {
mToVisit = [[NSMutableArray alloc] init];
[mToVisit addObject:mime];
}
return self;
}
- (NSArray *)allObjects {
NSMutableArray *objects = [NSMutableArray array];
id obj;
while ((obj = [self nextObject])) {
[objects addObject:obj];
}
return objects;
NSMutableArray *objects = [NSMutableArray array];
id obj;
while ((obj = [self nextObject])) {
[objects addObject:obj];
}
return objects;
}
- (id)nextObject {
if ([mToVisit count] == 0) {
return nil;
}
id mime = [mToVisit objectAtIndex:0];
if ([mime isKindOfClass:[CTMIME_MessagePart class]]) {
if ([mime content] != nil) {
[mToVisit addObject:[mime content]];
}
}
else if ([mime isKindOfClass:[CTMIME_MultiPart class]]) {
NSEnumerator *enumer = [[mime content] objectEnumerator];
CTMIME *subpart;
while ((subpart = [enumer nextObject])) {
[mToVisit addObject:subpart];
}
}
[mToVisit removeObjectAtIndex:0];
return mime;
if ([mToVisit count] == 0) {
return nil;
}
id mime = [mToVisit objectAtIndex:0];
if ([mime isKindOfClass:[CTMIME_MessagePart class]]) {
if ([mime content] != nil) {
[mToVisit addObject:[mime content]];
}
}
else if ([mime isKindOfClass:[CTMIME_MultiPart class]]) {
NSEnumerator *enumer = [[mime content] objectEnumerator];
CTMIME *subpart;
while ((subpart = [enumer nextObject])) {
[mToVisit addObject:subpart];
}
}
[mToVisit removeObjectAtIndex:0];
return mime;
}
- (void)dealloc {
[mToVisit release];
[super dealloc];
[mToVisit release];
[super dealloc];
}
@end
@@ -1,7 +1,7 @@
/*
* MailCore
*
* Copyright (C) 2007 - Matt Ronge
* Copyright (C) 2012 - Matt Ronge
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -29,19 +29,12 @@
* SUCH DAMAGE.
*/
#import <Foundation/Foundation.h>
#import "CTMIME_SinglePart.h"
#import <Cocoa/Cocoa.h>
//TODO Document me
//TODO Eventually CTCoreMessage should inherit from this
@interface CTBareMessage : NSObject {
NSString *mUid;
unsigned int mFlags;
@interface CTMIME_HtmlPart : CTMIME_SinglePart {
}
@property(retain) NSString *uid;
@property unsigned int flags;
- (id)init;
- (unsigned int)hash;
- (BOOL)isEqual:(id)anObject;
+ (id)mimeTextPartWithString:(NSString *)str;
- (id)initWithString:(NSString *)string;
- (void)setString:(NSString *)str;
@end
+108
View File
@@ -0,0 +1,108 @@
/*
* MailCore
*
* Copyright (C) 2012 - Matt Ronge
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the MailCore project nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#import "CTMIME_HtmlPart.h"
#import <libetpan/libetpan.h>
#import "MailCoreTypes.h"
@implementation CTMIME_HtmlPart
+ (id)mimeTextPartWithString:(NSString *)str {
return [[[CTMIME_HtmlPart alloc] initWithString:str] autorelease];
}
- (id)initWithString:(NSString *)string {
self = [super init];
if (self) {
[self setString:string];
}
return self;
}
- (id)content {
if (mMimeFields != NULL) {
// We are decoding from an existing msg so read
// the charset and convert from that to UTF-8
char *converted;
size_t converted_len;
char *source_charset = mMimeFields->fld_content_charset;
if (source_charset == NULL) {
source_charset = DEST_CHARSET;
}
int r = charconv_buffer(DEST_CHARSET, source_charset,
self.data.bytes, self.data.length,
&converted, &converted_len);
NSString *str = @"";
if (r == MAIL_CHARCONV_NO_ERROR) {
NSData *newData = [NSData dataWithBytes:converted length:converted_len];
str = [[[NSString alloc] initWithData:newData encoding:NSUTF8StringEncoding] autorelease];
}
charconv_buffer_free(converted);
return str;
} else {
// Don't have a charset available so treat data as UTF-8
// This will happen when we are creating a msg and not decoding
// an existing one
return [[[NSString alloc] initWithData:self.data encoding:NSUTF8StringEncoding] autorelease];
}
}
- (void)setString:(NSString *)str {
self.data = [str dataUsingEncoding:NSUTF8StringEncoding];
// The data is all local, so we don't want it to do any fetching
self.fetched = YES;
}
- (struct mailmime *)buildMIMEStruct {
struct mailmime_fields *mime_fields;
struct mailmime *mime_sub;
struct mailmime_content *content;
struct mailmime_parameter *param;
int r;
/* text/html part */
//TODO this needs to be changed, something other than 8BIT should be used
mime_fields = mailmime_fields_new_encoding(MAILMIME_MECHANISM_8BIT);
content = mailmime_content_new_with_str("text/html");
param = mailmime_parameter_new(strdup("charset"), strdup(DEST_CHARSET));
r = clist_append(content->ct_parameters, param);
mime_sub = mailmime_new_empty(content, mime_fields);
assert(mime_sub != NULL);
NSString *str = [self content];
//TODO is strdup necessary?
r = mailmime_set_body_text(mime_sub, strdup([str cStringUsingEncoding:NSUTF8StringEncoding]), [str length]);
return mime_sub;
}
@end
+4 -3
View File
@@ -29,16 +29,17 @@
* SUCH DAMAGE.
*/
#import <Cocoa/Cocoa.h>
#import <Foundation/Foundation.h>
#import "CTMIME.h"
@interface CTMIME_MessagePart : CTMIME {
CTMIME *myMessageContent;
struct mailimf_fields *myFields;
CTMIME *myMessageContent;
struct mailimf_fields *myFields;
}
+ (id)mimeMessagePartWithContent:(CTMIME *)mime;
- (id)initWithContent:(CTMIME *)messageContent;
- (void)setContent:(CTMIME *)aContent;
- (CTMIME *)content;
- (void)setIMFFields:(struct mailimf_fields *)imfFields;
@end
+28 -26
View File
@@ -31,57 +31,59 @@
#import "CTMIME_MessagePart.h"
#import "libetpan.h"
#import <libetpan/libetpan.h>
#import "MailCoreTypes.h"
#import "CTMIMEFactory.h"
@implementation CTMIME_MessagePart
+ (id)mimeMessagePartWithContent:(CTMIME *)mime {
return [[[CTMIME_MessagePart alloc] initWithContent:mime] autorelease];
return [[[CTMIME_MessagePart alloc] initWithContent:mime] autorelease];
}
- (id)initWithMIMEStruct:(struct mailmime *)mime
forMessage:(struct mailmessage *)message {
self = [super initWithMIMEStruct:mime forMessage:message];
if (self) {
struct mailmime *content = mime->mm_data.mm_message.mm_msg_mime;
myMessageContent = [[CTMIMEFactory createMIMEWithMIMEStruct:content
forMessage:message] retain];
myFields = mime->mm_data.mm_message.mm_fields;
}
return self;
forMessage:(struct mailmessage *)message {
self = [super initWithMIMEStruct:mime forMessage:message];
if (self) {
struct mailmime *content = mime->mm_data.mm_message.mm_msg_mime;
myMessageContent = [[CTMIMEFactory createMIMEWithMIMEStruct:content
forMessage:message] retain];
myFields = mime->mm_data.mm_message.mm_fields;
}
return self;
}
- (id)initWithContent:(CTMIME *)messageContent {
self = [super init];
if (self) {
[self setContent:messageContent];
}
return self;
self = [super init];
if (self) {
[self setContent:messageContent];
}
return self;
}
- (void)dealloc {
[myMessageContent release];
[super dealloc];
[myMessageContent release];
[super dealloc];
}
- (void)setContent:(CTMIME *)aContent {
[aContent retain];
[myMessageContent release];
myMessageContent = aContent;
[aContent retain];
[myMessageContent release];
myMessageContent = aContent;
}
- (id)content {
return myMessageContent;
return myMessageContent;
}
- (struct mailmime *)buildMIMEStruct {
struct mailmime *mime = mailmime_new_message_data([myMessageContent buildMIMEStruct]);
mailmime_set_imf_fields(mime, myFields);
return mime;
struct mailmime *mime = mailmime_new_message_data([myMessageContent buildMIMEStruct]);
if (myFields != NULL) {
mailmime_set_imf_fields(mime, myFields);
}
return mime;
}
- (void)setIMFFields:(struct mailimf_fields *)imfFields {
myFields = imfFields;
myFields = imfFields;
}
@end
+2 -2
View File
@@ -29,11 +29,11 @@
* SUCH DAMAGE.
*/
#import <Cocoa/Cocoa.h>
#import <Foundation/Foundation.h>
#import "CTMIME.h"
@interface CTMIME_MultiPart : CTMIME {
NSMutableArray *myContentList;
NSMutableArray *myContentList;
}
+ (id)mimeMultiPart;
- (void)addMIMEPart:(CTMIME *)mime;
+33 -33
View File
@@ -30,63 +30,63 @@
*/
#import "CTMIME_MultiPart.h"
#import "libetpan.h"
#import "CTMIME_MessagePart.h"
#import <libetpan/libetpan.h>
#import "MailCoreTypes.h"
#import "CTMIMEFactory.h"
@implementation CTMIME_MultiPart
+ (id)mimeMultiPart {
return [[[CTMIME_MultiPart alloc] init] autorelease];
return [[[CTMIME_MultiPart alloc] init] autorelease];
}
- (id)initWithMIMEStruct:(struct mailmime *)mime forMessage:(struct mailmessage *)message {
self = [super initWithMIMEStruct:mime forMessage:message];
if (self) {
myContentList = [[NSMutableArray alloc] init];
clistiter *cur = clist_begin(mime->mm_data.mm_multipart.mm_mp_list);
for (; cur != NULL; cur=clist_next(cur)) {
CTMIME *content = [CTMIMEFactory createMIMEWithMIMEStruct:clist_content(cur) forMessage:message];
if (content != nil) {
[myContentList addObject:content];
}
}
}
return self;
self = [super initWithMIMEStruct:mime forMessage:message];
if (self) {
myContentList = [[NSMutableArray alloc] init];
clistiter *cur = clist_begin(mime->mm_data.mm_multipart.mm_mp_list);
for (; cur != NULL; cur=clist_next(cur)) {
CTMIME *content = [CTMIMEFactory createMIMEWithMIMEStruct:clist_content(cur) forMessage:message];
if (content != nil) {
[myContentList addObject:content];
}
}
}
return self;
}
- (id)init {
self = [super init];
if (self) {
myContentList = [[NSMutableArray alloc] init];
}
return self;
self = [super init];
if (self) {
myContentList = [[NSMutableArray alloc] init];
}
return self;
}
- (void)dealloc {
[myContentList release];
[super dealloc];
[myContentList release];
[super dealloc];
}
- (void)addMIMEPart:(CTMIME *)mime {
[myContentList addObject:mime];
[myContentList addObject:mime];
}
- (id)content {
return myContentList;
return myContentList;
}
- (struct mailmime *)buildMIMEStruct {
//TODO make this smarter so it builds different types other than multipart/mixed
struct mailmime *mime = mailmime_multiple_new("multipart/mixed");
//TODO make this smarter so it builds different types other than multipart/mixed
struct mailmime *mime = mailmime_multiple_new("multipart/mixed");
NSEnumerator *enumer = [myContentList objectEnumerator];
CTMIME *part;
int r;
while ((part = [enumer nextObject])) {
r = mailmime_add_part(mime, [part buildMIMEStruct]);
assert(r == 0);
}
return mime;
NSEnumerator *enumer = [myContentList objectEnumerator];
CTMIME *part;
while ((part = [enumer nextObject])) {
mailmime_smart_add_part(mime, [part buildMIMEStruct]);
}
return mime;
}
@end
+25 -13
View File
@@ -29,24 +29,36 @@
* SUCH DAMAGE.
*/
#import <Cocoa/Cocoa.h>
#import <Foundation/Foundation.h>
#import "CTMIME.h"
@interface CTMIME_SinglePart : CTMIME {
struct mailmime *mMime;
struct mailmessage *mMessage;
typedef void (^CTProgressBlock)(size_t curr, size_t max);
NSData *mData;
BOOL mAttached;
BOOL mFetched;
NSString *mFilename;
@interface CTMIME_SinglePart : CTMIME {
struct mailmime *mMime;
struct mailmessage *mMessage;
struct mailmime_single_fields *mMimeFields;
NSData *mData;
BOOL mAttached;
BOOL mFetched;
NSString *mFilename;
NSString *mContentId;
}
@property BOOL attached;
@property BOOL fetched;
@property(retain) NSString *filename;
@property(retain) NSData *data;
@property(nonatomic) BOOL attached;
@property(nonatomic) BOOL fetched;
@property(nonatomic, retain) NSString *filename;
@property(nonatomic, retain) NSString *contentId;
@property(nonatomic, retain) NSData *data;
@property(nonatomic, readonly) size_t size;
/*!
@abstract If an error occurred (nil or return of NO) call this method to get the error
*/
@property(nonatomic, retain) NSError *lastError;
+ (id)mimeSinglePartWithData:(NSData *)data;
- (id)initWithData:(NSData *)data;
- (void)fetchPart;
- (BOOL)fetchPart;
- (BOOL)fetchPartWithProgress:(CTProgressBlock)block;
@end
+173 -86
View File
@@ -31,118 +31,205 @@
#import "CTMIME_SinglePart.h"
#import "libetpan.h"
#import <libetpan/libetpan.h>
#import "MailCoreTypes.h"
#import "MailCoreUtilities.h"
static inline struct imap_session_state_data *
get_session_data(mailmessage * msg)
{
return msg->msg_session->sess_data;
}
static inline mailimap * get_imap_session(mailmessage * msg)
{
return get_session_data(msg)->imap_session;
}
static void download_progress_callback(size_t current, size_t maximum, void * context) {
CTProgressBlock block = context;
block(current, maximum);
}
@interface CTMIME_SinglePart ()
@end
@implementation CTMIME_SinglePart
@synthesize attached=mAttached;
@synthesize filename=mFilename;
@synthesize contentId=mContentId;
@synthesize data=mData;
@synthesize fetched=mFetched;
@synthesize lastError;
+ (id)mimeSinglePartWithData:(NSData *)data {
return [[[CTMIME_SinglePart alloc] initWithData:data] autorelease];
return [[[CTMIME_SinglePart alloc] initWithData:data] autorelease];
}
- (id)initWithData:(NSData *)data {
self = [super init];
if (self) {
self.data = data;
self.fetched = YES;
}
return self;
self = [super init];
if (self) {
self.data = data;
self.fetched = YES;
}
return self;
}
- (id)initWithMIMEStruct:(struct mailmime *)mime
forMessage:(struct mailmessage *)message {
self = [super initWithMIMEStruct:mime forMessage:message];
if (self) {
self.data = nil;
mMime = mime;
mMessage = message;
self.fetched = NO;
struct mailmime_single_fields *mimeFields = NULL;
mimeFields = mailmime_single_fields_new(mMime->mm_mime_fields, mMime->mm_content_type);
if (mimeFields != NULL) {
struct mailmime_disposition *disp = mimeFields->fld_disposition;
if (disp != NULL) {
if (disp->dsp_type != NULL) {
self.attached = (disp->dsp_type->dsp_type ==
MAILMIME_DISPOSITION_TYPE_ATTACHMENT);
}
}
if (mimeFields->fld_disposition_filename != NULL) {
self.filename = [NSString stringWithCString:mimeFields->fld_disposition_filename
encoding:NSASCIIStringEncoding];
}
mailmime_single_fields_free(mimeFields);
}
}
return self;
forMessage:(struct mailmessage *)message {
self = [super initWithMIMEStruct:mime forMessage:message];
if (self) {
self.data = nil;
mMime = mime;
mMessage = message;
self.fetched = NO;
mMimeFields = mailmime_single_fields_new(mMime->mm_mime_fields, mMime->mm_content_type);
if (mMimeFields != NULL) {
struct mailmime_disposition *disp = mMimeFields->fld_disposition;
if (disp != NULL) {
if (disp->dsp_type != NULL) {
self.attached = (disp->dsp_type->dsp_type ==
MAILMIME_DISPOSITION_TYPE_ATTACHMENT);
if (self.attached)
{
// MWA workaround for bug where specific emails look like this:
// Content-Type: application/vnd.ms-excel; name="=?UTF-8?B?TVhBVC0zMTFfcGFja2xpc3QxMTA0MDAueGxz?="
// Content-Disposition: attachment
// - usually they look like -
// Content-Type: image/jpeg; name="photo.JPG"
// Content-Disposition: attachment; filename="photo.JPG"
if (mMimeFields->fld_disposition_filename == NULL && mMimeFields->fld_content_name != NULL)
mMimeFields->fld_disposition_filename = mMimeFields->fld_content_name;
}
}
}
if (mMimeFields->fld_disposition_filename != NULL) {
self.filename = [NSString stringWithCString:mMimeFields->fld_disposition_filename encoding:NSUTF8StringEncoding];
if (mMimeFields->fld_id != NULL)
self.contentId = [NSString stringWithCString:mMimeFields->fld_id encoding:NSUTF8StringEncoding];
NSString* lowercaseName = [self.filename lowercaseString];
if([lowercaseName hasSuffix:@".xls"] ||
[lowercaseName hasSuffix:@".xlsx"] ||
[lowercaseName hasSuffix:@".key.zip"] ||
[lowercaseName hasSuffix:@".numbers.zip"] ||
[lowercaseName hasSuffix:@".pages.zip"] ||
[lowercaseName hasSuffix:@".pdf"] ||
[lowercaseName hasSuffix:@".ppt"] ||
[lowercaseName hasSuffix:@".doc"] ||
[lowercaseName hasSuffix:@".docx"] ||
[lowercaseName hasSuffix:@".rtf"] ||
[lowercaseName hasSuffix:@".rtfd.zip"] ||
[lowercaseName hasSuffix:@".key"] ||
[lowercaseName hasSuffix:@".numbers"] ||
[lowercaseName hasSuffix:@".pages"] ||
[lowercaseName hasSuffix:@".png"] ||
[lowercaseName hasSuffix:@".gif"] ||
[lowercaseName hasSuffix:@".png"] ||
[lowercaseName hasSuffix:@".jpg"] ||
[lowercaseName hasSuffix:@".jpeg"] ||
[lowercaseName hasSuffix:@".tiff"]) { // hack by gabor, improved by waseem, based on http://developer.apple.com/iphone/library/qa/qa2008/qa1630.html
self.attached = YES;
}
}
}
}
return self;
}
- (void)fetchPart {
if (self.fetched == NO) {
struct mailmime_single_fields *mimeFields = NULL;
int encoding = MAILMIME_MECHANISM_8BIT;
mimeFields = mailmime_single_fields_new(mMime->mm_mime_fields, mMime->mm_content_type);
if (mimeFields != NULL && mimeFields->fld_encoding != NULL)
encoding = mimeFields->fld_encoding->enc_type;
char *fetchedData;
size_t fetchedDataLen;
int r;
r = mailmessage_fetch_section(mMessage, mMime, &fetchedData, &fetchedDataLen);
if (r != MAIL_NO_ERROR) {
mailmessage_fetch_result_free(mMessage, fetchedData);
RaiseException(CTMIMEParseError, CTMIMEParseErrorDesc);
}
- (BOOL)fetchPartWithProgress:(CTProgressBlock)block {
if (self.fetched == NO) {
struct mailmime_single_fields *mimeFields = NULL;
size_t current_index = 0;
char * result;
size_t result_len;
r = mailmime_part_parse(fetchedData, fetchedDataLen, &current_index,
encoding, &result, &result_len);
if (r != MAILIMF_NO_ERROR) {
mailmime_decoded_part_free(result);
RaiseException(CTMIMEParseError, CTMIMEParseErrorDesc);
}
NSData *data = [NSData dataWithBytes:result length:result_len];
mailmessage_fetch_result_free(mMessage, fetchedData);
mailmime_decoded_part_free(result);
mailmime_single_fields_free(mimeFields);
self.data = data;
self.fetched = YES;
}
int encoding = MAILMIME_MECHANISM_8BIT;
mimeFields = mailmime_single_fields_new(mMime->mm_mime_fields, mMime->mm_content_type);
if (mimeFields != NULL && mimeFields->fld_encoding != NULL)
encoding = mimeFields->fld_encoding->enc_type;
char *fetchedData;
size_t fetchedDataLen;
int r;
if (mMessage->msg_session != NULL) {
mailimap_set_progress_callback(get_imap_session(mMessage), &download_progress_callback, NULL, block);
}
r = mailmessage_fetch_section(mMessage, mMime, &fetchedData, &fetchedDataLen);
if (mMessage->msg_session != NULL) {
mailimap_set_progress_callback(get_imap_session(mMessage), NULL, NULL, NULL);
}
if (r != MAIL_NO_ERROR) {
mailmessage_fetch_result_free(mMessage, fetchedData);
self.lastError = MailCoreCreateErrorFromCode(r);
return NO;
}
size_t current_index = 0;
char * result;
size_t result_len;
r = mailmime_part_parse(fetchedData, fetchedDataLen, &current_index,
encoding, &result, &result_len);
if (r != MAILIMF_NO_ERROR) {
mailmime_decoded_part_free(result);
self.lastError = MailCoreCreateErrorFromCode(r);
return NO;
}
NSData *data = [NSData dataWithBytes:result length:result_len];
mailmessage_fetch_result_free(mMessage, fetchedData);
mailmime_decoded_part_free(result);
mailmime_single_fields_free(mimeFields);
self.data = data;
self.fetched = YES;
}
return YES;
}
- (BOOL)fetchPart {
return [self fetchPartWithProgress:^(size_t curr, size_t max){}];
}
//TODO need to do content disposition
- (struct mailmime *)buildMIMEStruct {
struct mailmime_fields *mime_fields;
struct mailmime *mime_sub;
struct mailmime_content *content;
int r;
struct mailmime_fields *mime_fields;
struct mailmime *mime_sub;
struct mailmime_content *content;
int r;
mime_fields = mailmime_fields_new_encoding(MAILMIME_MECHANISM_BASE64);
assert(mime_fields != NULL);
if (mFilename) {
mime_fields = mailmime_fields_new_filename( MAILMIME_DISPOSITION_TYPE_ATTACHMENT,
(char *)[mFilename cStringUsingEncoding:NSUTF8StringEncoding],
MAILMIME_MECHANISM_BASE64 );
} else {
mime_fields = mailmime_fields_new_encoding(MAILMIME_MECHANISM_BASE64);
}
content = mailmime_content_new_with_str([self.contentType cStringUsingEncoding:NSUTF8StringEncoding]);
mime_sub = mailmime_new_empty(content, mime_fields);
content = mailmime_content_new_with_str([self.contentType cStringUsingEncoding:NSASCIIStringEncoding]);
assert(content != NULL);
mime_sub = mailmime_new_empty(content, mime_fields);
assert(mime_sub != NULL);
r = mailmime_set_body_text(mime_sub, (char *)[self.data bytes], [self.data length]);
assert(r == MAILIMF_NO_ERROR);
return mime_sub;
// Add Data
r = mailmime_set_body_text(mime_sub, (char *)[self.data bytes], [self.data length]);
return mime_sub;
}
- (size_t)size {
if (mMime) {
return mMime->mm_length;
}
return 0;
}
- (void)dealloc {
[mData release];
[mFilename release];
//The structs are held by CTCoreMessage so we don't have to free them
[super dealloc];
mailmime_single_fields_free(mMimeFields);
[mData release];
[mFilename release];
[mContentId release];
self.lastError = nil;
//The structs are held by CTCoreMessage so we don't have to free them
[super dealloc];
}
@end
+1 -1
View File
@@ -29,7 +29,7 @@
* SUCH DAMAGE.
*/
#import <Cocoa/Cocoa.h>
#import <Foundation/Foundation.h>
#import "CTMIME_SinglePart.h"
@interface CTMIME_TextPart : CTMIME_SinglePart {
+53 -38
View File
@@ -31,60 +31,75 @@
#import "CTMIME_TextPart.h"
#import "libetpan.h"
#import <libetpan/libetpan.h>
#import "MailCoreTypes.h"
@implementation CTMIME_TextPart
+ (id)mimeTextPartWithString:(NSString *)str {
return [[[CTMIME_TextPart alloc] initWithString:str] autorelease];
return [[[CTMIME_TextPart alloc] initWithString:str] autorelease];
}
- (id)initWithString:(NSString *)string {
self = [super init];
if (self) {
[self setString:string];
}
return self;
self = [super init];
if (self) {
[self setString:string];
}
return self;
}
- (id)content {
NSString *str = [[NSString alloc] initWithData:self.data encoding:NSASCIIStringEncoding];
return [str autorelease];
if (mMimeFields != NULL) {
// We are decoding from an existing msg so read
// the charset and convert from that to UTF-8
char *converted;
size_t converted_len;
char *source_charset = mMimeFields->fld_content_charset;
if (source_charset == NULL) {
source_charset = DEST_CHARSET;
}
int r = charconv_buffer(DEST_CHARSET, source_charset,
self.data.bytes, self.data.length,
&converted, &converted_len);
NSString *str = @"";
if (r == MAIL_CHARCONV_NO_ERROR) {
NSData *newData = [NSData dataWithBytes:converted length:converted_len];
str = [[[NSString alloc] initWithData:newData encoding:NSUTF8StringEncoding] autorelease];
}
charconv_buffer_free(converted);
return str;
} else {
// Don't have a charset available so treat data as UTF-8
// This will happen when we are creating a msg and not decoding
// an existing one
return [[[NSString alloc] initWithData:self.data encoding:NSUTF8StringEncoding] autorelease];
}
}
- (void)setString:(NSString *)str {
self.data = [str dataUsingEncoding:NSASCIIStringEncoding];
// The data is all local, so we don't want it to do any fetching
self.fetched = YES;
self.data = [str dataUsingEncoding:NSUTF8StringEncoding];
// The data is all local, so we don't want it to do any fetching
self.fetched = YES;
}
- (struct mailmime *)buildMIMEStruct {
struct mailmime_fields *mime_fields;
struct mailmime *mime_sub;
struct mailmime_content *content;
struct mailmime_parameter *param;
int r;
struct mailmime_fields *mime_fields;
struct mailmime *mime_sub;
struct mailmime_content *content;
struct mailmime_parameter *param;
int r;
/* text/plain part */
//TODO this needs to be changed, something other than 8BIT should be used
mime_fields = mailmime_fields_new_encoding(MAILMIME_MECHANISM_8BIT);
assert(mime_fields != NULL);
content = mailmime_content_new_with_str("text/plain");
assert(content != NULL);
param = mailmime_parameter_new(strdup("charset"), strdup(DEST_CHARSET));
assert(param != NULL);
r = clist_append(content->ct_parameters, param);
assert(r >= 0);
mime_sub = mailmime_new_empty(content, mime_fields);
assert(mime_sub != NULL);
NSString *str = [self content];
//TODO is strdup necessary?
r = mailmime_set_body_text(mime_sub, strdup([str cStringUsingEncoding:NSASCIIStringEncoding]), [str length]);
assert(r == MAILIMF_NO_ERROR);
return mime_sub;
/* text/plain part */
//TODO this needs to be changed, something other than 8BIT should be used
mime_fields = mailmime_fields_new_encoding(MAILMIME_MECHANISM_8BIT);
content = mailmime_content_new_with_str("text/plain");
param = mailmime_parameter_new(strdup("charset"), strdup(DEST_CHARSET));
r = clist_append(content->ct_parameters, param);
mime_sub = mailmime_new_empty(content, mime_fields);
NSString *str = [self content];
//TODO is strdup necessary?
r = mailmime_set_body_text(mime_sub, strdup([str cStringUsingEncoding:NSUTF8StringEncoding]), [str length]);
return mime_sub;
}
@end
+20 -14
View File
@@ -29,26 +29,32 @@
* SUCH DAMAGE.
*/
#import <Cocoa/Cocoa.h>
#import "libetpan.h"
#import <Foundation/Foundation.h>
#import <libetpan/libetpan.h>
/*!
@class CTSMTP
This class is used internally by CTSMTPConnection for SMTP connections, clients
should not use this directly.
@class CTSMTP
This class is used internally by CTSMTPConnection for SMTP connections, clients
should not use this directly.
*/
@interface CTSMTP : NSObject {
mailsmtp *mySMTP; /* This resource is created and freed by CTSMTPConnection */
mailsmtp *mySMTP; /* This resource is created and freed by CTSMTPConnection */
NSError *lastError;
}
/*!
@abstract If an error occurred (nil or return of NO) call this method to get the error
*/
@property(nonatomic, retain) NSError *lastError;
- (id)initWithResource:(mailsmtp *)smtp;
- (void)connectToServer:(NSString *)server port:(unsigned int)port;
- (bool)helo;
- (void)startTLS;
- (void)authenticateWithUsername:(NSString *)username password:(NSString *)password server:(NSString *)server;
- (void)setFrom:(NSString *)fromAddress;
- (void)setRecipients:(id)recipients;
- (void)setRecipientAddress:(NSString *)recAddress;
- (void)setData:(NSString *)data;
- (BOOL)connectToServer:(NSString *)server port:(unsigned int)port;
- (BOOL)helo;
- (BOOL)startTLS;
- (BOOL)authenticateWithUsername:(NSString *)username password:(NSString *)password server:(NSString *)server;
- (BOOL)setFrom:(NSString *)fromAddress;
- (BOOL)setRecipients:(id)recipients;
- (BOOL)setRecipientAddress:(NSString *)recAddress;
- (BOOL)setData:(NSString *)data;
- (mailsmtp *)resource;
@end
+81 -54
View File
@@ -33,73 +33,100 @@
#import "CTCoreAddress.h"
#import "CTCoreMessage.h"
#import "MailCoreTypes.h"
#import "MailCoreUtilities.h"
@implementation CTSMTP
@synthesize lastError;
- (id)initWithResource:(mailsmtp *)smtp {
self = [super init];
if (self) {
mySMTP = smtp;
}
return self;
self = [super init];
if (self) {
mySMTP = smtp;
}
return self;
}
- (void)dealloc {
self.lastError = nil;
[super dealloc];
}
- (BOOL)connectToServer:(NSString *)server port:(unsigned int)port {
/* first open the stream */
int ret = mailsmtp_socket_connect([self resource], [server cStringUsingEncoding:NSUTF8StringEncoding], port);
if (ret != MAIL_NO_ERROR) {
self.lastError = MailCoreCreateErrorFromCode(ret);
return NO;
}
return YES;
}
- (BOOL)helo {
/* The server doesn't support esmtp, so try regular smtp */
int ret = mailsmtp_helo([self resource]);
if (ret != MAIL_NO_ERROR) {
self.lastError = MailCoreCreateErrorFromCode(ret);
return NO;
}
return YES; /* The server supports helo so return YES */
}
- (BOOL)startTLS {
return YES;
}
- (BOOL)authenticateWithUsername:(NSString *)username password:(NSString *)password server:(NSString *)server {
return YES;
}
- (BOOL)setFrom:(NSString *)fromAddress {
int ret = mailsmtp_mail([self resource], [fromAddress cStringUsingEncoding:NSUTF8StringEncoding]);
if (ret != MAIL_NO_ERROR) {
self.lastError = MailCoreCreateErrorFromCode(ret);
return NO;
}
return YES;
}
- (void)connectToServer:(NSString *)server port:(unsigned int)port {
/* first open the stream */
int ret = mailsmtp_socket_connect([self resource], [server cStringUsingEncoding:NSASCIIStringEncoding], port);
IfTrue_RaiseException(ret != MAILSMTP_NO_ERROR, CTSMTPSocket, CTSMTPSocketDesc);
- (BOOL)setRecipients:(id)recipients {
NSEnumerator *objEnum = [recipients objectEnumerator];
CTCoreAddress *rcpt;
while ((rcpt = [objEnum nextObject])) {
BOOL success = [self setRecipientAddress:[rcpt email]];
if (!success) {
return NO;
}
}
return YES;
}
- (bool)helo {
/* The server doesn't support esmtp, so try regular smtp */
int ret = mailsmtp_helo([self resource]);
IfTrue_RaiseException(ret != MAILSMTP_NO_ERROR, CTSMTPHello, CTSMTPHelloDesc);
return YES; /* The server supports helo so return YES */
- (BOOL)setRecipientAddress:(NSString *)recAddress {
int ret = mailsmtp_rcpt([self resource], [recAddress cStringUsingEncoding:NSUTF8StringEncoding]);
if (ret != MAIL_NO_ERROR) {
self.lastError = MailCoreCreateErrorFromCode(ret);
return NO;
}
return YES;
}
- (void)startTLS {
//TODO Raise exception
- (BOOL)setData:(NSString *)data {
NSData *dataObj = [data dataUsingEncoding:NSUTF8StringEncoding];
int ret = mailsmtp_data([self resource]);
if (ret != MAIL_NO_ERROR) {
self.lastError = MailCoreCreateErrorFromCode(ret);
return NO;
}
ret = mailsmtp_data_message([self resource], [dataObj bytes], [dataObj length]);
if (ret != MAIL_NO_ERROR) {
self.lastError = MailCoreCreateErrorFromCode(ret);
return NO;
}
return YES;
}
- (void)authenticateWithUsername:(NSString *)username password:(NSString *)password server:(NSString *)server {
//TODO Raise exception
}
- (void)setFrom:(NSString *)fromAddress {
int ret = mailsmtp_mail([self resource], [fromAddress cStringUsingEncoding:NSASCIIStringEncoding]);
IfTrue_RaiseException(ret != MAILSMTP_NO_ERROR, CTSMTPFrom, CTSMTPFromDesc);
}
- (void)setRecipients:(id)recipients {
NSEnumerator *objEnum = [recipients objectEnumerator];
CTCoreAddress *rcpt;
while(rcpt = [objEnum nextObject]) {
[self setRecipientAddress:[rcpt email]];
}
}
- (void)setRecipientAddress:(NSString *)recAddress {
int ret = mailsmtp_rcpt([self resource], [recAddress cStringUsingEncoding:NSASCIIStringEncoding]);
IfTrue_RaiseException(ret != MAILSMTP_NO_ERROR, CTSMTPRecipients, CTSMTPRecipientsDesc);
}
- (void)setData:(NSString *)data {
NSData *dataObj = [data dataUsingEncoding:NSASCIIStringEncoding];
int ret = mailsmtp_data([self resource]);
IfTrue_RaiseException(ret != MAILSMTP_NO_ERROR, CTSMTPData, CTSMTPDataDesc);
ret = mailsmtp_data_message([self resource], [dataObj bytes], [dataObj length]);
IfTrue_RaiseException(ret != MAILSMTP_NO_ERROR, CTSMTPData, CTSMTPDataDesc);
}
- (mailsmtp *)resource {
return mySMTP;
return mySMTP;
}
@end
@@ -1,7 +1,7 @@
/*
* MailCore
*
* Copyright (C) 2007 - Matt Ronge
* Copyright (C) 2010 - Matt Ronge
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -29,46 +29,51 @@
* SUCH DAMAGE.
*/
#import "CTBareMessageTests.h"
#import <Foundation/Foundation.h>
#import <libetpan/libetpan.h>
#import "MailCoreTypes.h"
@implementation CTBareMessageTests
- (void)testEquals {
CTBareMessage *msg1 = [[CTBareMessage alloc] init];
msg1.uid = @"11111-11111";
msg1.flags = 2;
CTBareMessage *msg2 = [[CTBareMessage alloc] init];
msg2.uid = @"11111-11111";
msg2.flags = 2;
STAssertTrue([msg1 isEqual:msg2], @"CTBareMessage should have been equal!");
[msg1 release];
[msg2 release];
}
@protocol CTSMTPConnectionDelegate
- (void)testNotEqual {
CTBareMessage *msg1 = [[CTBareMessage alloc] init];
msg1.uid = @"11111-11111";
msg1.flags = 3;
CTBareMessage *msg2 = [[CTBareMessage alloc] init];
msg2.uid = @"11111-11111";
msg2.flags = 2;
STAssertFalse([msg1 isEqual:msg2], @"CTBareMessage should have been not equal!");
msg1.flags = 2;
msg2.uid = @"";
STAssertFalse([msg1 isEqual:msg2], @"CTBareMessage should have been not equal!");
[msg1 release];
[msg2 release];
}
//This is called with values between 0-100 (inclusive)
-(void)smtpProgress:(unsigned int)aProgress;
- (void)testHash {
CTBareMessage *msg1 = [[CTBareMessage alloc] init];
msg1.uid = @"11111-11111";
msg1.flags = 2;
CTBareMessage *msg2 = [[CTBareMessage alloc] init];
msg2.uid = @"11111-11111";
msg2.flags = 2;
STAssertTrue([msg1 hash] == [msg2 hash], @"CTBareMessage hashes should have been equal!");
[msg1 release];
[msg2 release];
}
-(void)smtpDidFinishSendingMessage:(CTSMTPAsyncStatus)aStatus;
@end
@class CTCoreMessage;
@class CTCoreAddress;
@class CTSMTP;
@interface CTSMTPAsyncConnection : NSObject
{
CTSMTP* mSMTPObj;
mailsmtp* mSMTP;
CTCoreMessage* mMessage;
NSDictionary* mServerSettings;
NSThread* mMailThread;
id <CTSMTPConnectionDelegate> mDelegate;
unsigned int mLastProgress;
CTSMTPAsyncStatus mStatus;
}
@property (readonly) NSDictionary* serverSettings;
@property (retain) CTCoreMessage* message;
@property (readonly) CTSMTPAsyncStatus status;
- (id)initWithServer:(NSString *)aServer
username:(NSString *)aUsername
password:(NSString *)aPassword
port:(unsigned int)aPort
useTLS:(BOOL)aTls
useAuth:(BOOL)aAuth
delegate:(id<CTSMTPConnectionDelegate>)aDelegate;
- (void)sendMessageInBackgroundAndNotify:(CTCoreMessage*)aMessage;
- (void)cancel;
- (BOOL)isBusy;
@end
+284
View File
@@ -0,0 +1,284 @@
/*
* MailCore
*
* Copyright (C) 2010 - Matt Ronge
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the MailCore project nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#import <libetpan/libetpan.h>
#import "CTCoreAddress.h"
#import "CTCoreMessage.h"
#import "CTESMTP.h"
#import "CTSMTP.h"
#import "CTSMTPAsyncConnection.h"
//setup to allow c callback fxn:
CTSMTPAsyncConnection *ptrToSelf;
void
smtpProgress(size_t aCurrent, size_t aTotal) {
if (ptrToSelf != nil) {
float theProgress = (float) aCurrent / (float) aTotal * 100;
[ptrToSelf performSelector:@selector(handleSmtpProgress:)
withObject:[NSNumber numberWithFloat:theProgress]];
}
}
@interface CTSMTPAsyncConnection (PrivateMethods)
- (void)sendMailThread;
- (void)handleSmtpProgress:(NSNumber *)aProgress;
- (void)threadWillExitHandler:(NSNotification *)aNote;
- (void)cleanupAfterThread;
@end
@implementation CTSMTPAsyncConnection
@synthesize message = mMessage;
@synthesize serverSettings = mServerSettings;
@synthesize status = mStatus;
- (id)initWithServer:(NSString *)aServer
username:(NSString *)aUsername
password:(NSString *)aPassword
port:(unsigned int)aPort
useTLS:(BOOL)aTls
useAuth:(BOOL)aAuth
delegate:(id <CTSMTPConnectionDelegate>)aDelegate {
self = [super init];
if (self) {
mStatus = CTSMTPAsyncSuccess;
ptrToSelf = self;
mSMTPObj = nil;
mSMTP = NULL;
mMailThread = nil;
mDelegate = aDelegate;
mServerSettings =
[[NSDictionary dictionaryWithObjectsAndKeys:aServer, @"server",
aUsername, @"username",
aPassword, @"password",
[NSNumber numberWithInt:aPort], @"port",
[NSNumber numberWithBool:aTls], @"tls",
[NSNumber numberWithBool:aAuth], @"auth", nil] retain];
//save clients from themselves (they could be leaking us - no dealloc)
[[NSNotificationCenter defaultCenter] removeObserver:self];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(threadWillExitHandler:)
name:NSThreadWillExitNotification
object:nil];
}
return self;
}
- (void)dealloc {
[[NSNotificationCenter defaultCenter] removeObserver:self];
[self cleanupAfterThread];
[super dealloc];
}
- (void)finalize {
[[NSNotificationCenter defaultCenter] removeObserver:self];
[self cleanupAfterThread];
[super finalize];
}
- (void)sendMessageInBackgroundAndNotify:(CTCoreMessage *)aMessage {
if (aMessage == nil) {
NSLog(@"CTCoreMessage param cannot be nil");
return;
}
if (mMailThread != nil && [mMailThread isExecuting]) {
NSLog(@"Can only send one message at a time, we're busy, sheesh.");
return;
}
NSAssert( mMailThread == nil, @"Invalid smtp thread state" );
self.message = aMessage;
//start thread:
mMailThread = [NSThread alloc];
[mMailThread initWithTarget:self selector:@selector(sendMailThread) object:nil];
[mMailThread start];
}
- (void)cancel {
if (![mMailThread isExecuting] || [mMailThread isCancelled]) {
return;
}
//mark thread as cancelled
[mMailThread cancel];
//cancel libetpan smtp stream
mailstream_cancel(mSMTP->stream);
mailstream_close(mSMTP->stream);
mSMTP->stream = NULL;
mailsmtp_free(mSMTP);
mSMTP = NULL;
}
- (BOOL)isBusy {
return (mMailThread != nil && [mMailThread isExecuting]);
}
@end
@implementation CTSMTPAsyncConnection (PrivateMethods)
- (void)sendMailThread {
NSAutoreleasePool *thePool = [[NSAutoreleasePool alloc] init];
BOOL success;
void (*progFxn)(size_t, size_t) = &smtpProgress;
mSMTP = NULL;
mSMTP = mailsmtp_new(30, progFxn);
mSMTPObj = [[CTESMTP alloc] initWithResource:mSMTP];
NSDictionary *theSettings = self.serverSettings;
success = [mSMTPObj connectToServer:[theSettings objectForKey:@"server"]
port:[[theSettings objectForKey:@"port"] unsignedIntValue]];
if (!success) {
goto error;
}
if ([mSMTPObj helo] == NO) {
/* The server didn't support ESMTP, so switching to STMP */
[mSMTPObj release];
mSMTPObj = [[CTSMTP alloc] initWithResource:mSMTP];
success = [mSMTPObj helo];
if (!success) {
goto error;
}
}
if ([(NSNumber *) [theSettings objectForKey:@"tls"] boolValue]) {
success = [mSMTPObj startTLS];
if (!success) {
goto error;
}
}
if ([(NSNumber *) [theSettings objectForKey:@"auth"] boolValue]) {
success = [mSMTPObj authenticateWithUsername:[theSettings objectForKey:@"username"]
password:[theSettings objectForKey:@"password"]
server:[theSettings objectForKey:@"server"]];
if (!success) {
goto error;
}
}
CTCoreMessage *theMessage = self.message;
success = [mSMTPObj setFrom:[[[theMessage from] anyObject] email]];
if (!success) {
goto error;
}
NSMutableSet *rcpts = [NSMutableSet set];
[rcpts unionSet:[theMessage to]];
[rcpts unionSet:[theMessage bcc]];
[rcpts unionSet:[theMessage cc]];
success = [mSMTPObj setRecipients:rcpts];
if (!success) {
goto error;
}
//send
success = [mSMTPObj setData:[theMessage render]];
if (success) {
mStatus = CTSMTPAsyncSuccess;
} else if (success && [mMailThread isCancelled]) {
//libetpan was cancelled from another thread
mStatus = CTSMTPAsyncCanceled;
} else {
mStatus = CTSMTPAsyncError;
}
[thePool drain];
return;
error:
mStatus = CTSMTPAsyncError;
[thePool drain];
}
- (void)handleSmtpProgress:(NSNumber *)aProgress {
//check if cancelled before sending an update
if ([mMailThread isCancelled] && [NSThread currentThread] == mMailThread) {
return;
}
unsigned int theProgress = [aProgress unsignedIntValue];
if (theProgress > mLastProgress) {
mLastProgress = theProgress;
//call delegate
if (mDelegate) {
[mDelegate smtpProgress:mLastProgress];
}
}
}
- (void)threadWillExitHandler:(NSNotification *)aNote {
if ([aNote object] != mMailThread) {
return;
}
if (mDelegate) {
[mDelegate smtpDidFinishSendingMessage:mStatus];
}
[self cleanupAfterThread];
}
- (void)cleanupAfterThread {
[mSMTPObj release];
mSMTPObj = nil;
if (mSMTP) {
if (mSMTP->stream) {
mailstream_cancel(mSMTP->stream);
mailstream_close(mSMTP->stream);
mSMTP->stream = NULL;
}
mailsmtp_free(mSMTP);
mSMTP = NULL;
}
[mServerSettings release];
mServerSettings = nil;
[mMessage release];
mMessage = nil;
[mMailThread release];
mMailThread = nil;
}
@end
+18 -16
View File
@@ -29,13 +29,13 @@
* SUCH DAMAGE.
*/
#import <Cocoa/Cocoa.h>
#import <Foundation/Foundation.h>
/*!
@class CTSMTPConnection
This is not a class you instantiate! It has only one class method, and that is all you need to send e-mail.
First use CTCoreMessage to compose an e-mail and then pass the e-mail to the method sendMessage: with
the necessary server settings and CTSMTPConnection will send the message.
@class CTSMTPConnection
This is not a class you instantiate! It has only one class method, and that is all you need to send e-mail.
First use CTCoreMessage to compose an e-mail and then pass the e-mail to the method sendMessage: with
the necessary server settings and CTSMTPConnection will send the message.
*/
@class CTCoreMessage, CTCoreAddress;
@@ -44,16 +44,18 @@
}
/*!
@abstract This method...it sends e-mail.
@param message Just pass in a CTCoreMessage which has the body, subject, from, to etc. that you want
@param server The server address
@param username The username, if there is none then pass in an empty string. For some servers you may
have to specify the username as username@domain
@param password The password, if there is none then pass in an empty string.
@param port The port to use, the standard port is 25
@param useTLS Pass in YES, if you want to use SSL/TLS
@param useAuth Pass in YES if you would like to use SASL authentication
@abstract This method...it sends e-mail.
@param message Just pass in a CTCoreMessage which has the body, subject, from, to etc. that you want
@param server The server address
@param username The username, if there is none then pass in an empty string. For some servers you may
have to specify the username as username@domain
@param password The password, if there is none then pass in an empty string.
@param port The port to use, the standard port is 25
@param useTLS Pass in YES, if you want to use SSL/TLS
@param useAuth Pass in YES if you would like to use SASL authentication
@param error Will contain an error when the method returns NO
@result Returns YES on success, NO on error
*/
+ (void)sendMessage:(CTCoreMessage *)message server:(NSString *)server username:(NSString *)username
password:(NSString *)password port:(unsigned int)port useTLS:(BOOL)tls useAuth:(BOOL)auth;
+ (BOOL)sendMessage:(CTCoreMessage *)message server:(NSString *)server username:(NSString *)username
password:(NSString *)password port:(unsigned int)port useTLS:(BOOL)tls useAuth:(BOOL)auth error:(NSError **)error;
@end
+59 -35
View File
@@ -30,7 +30,7 @@
*/
#import "CTSMTPConnection.h"
#import "libetpan.h"
#import <libetpan/libetpan.h>
#import "CTCoreAddress.h"
#import "CTCoreMessage.h"
#import "MailCoreTypes.h"
@@ -40,41 +40,65 @@
//TODO Add more descriptive error messages using mailsmtp_strerror
@implementation CTSMTPConnection
+ (void)sendMessage:(CTCoreMessage *)message server:(NSString *)server username:(NSString *)username
password:(NSString *)password port:(unsigned int)port useTLS:(BOOL)tls useAuth:(BOOL)auth {
mailsmtp *smtp = NULL;
smtp = mailsmtp_new(0, NULL);
assert(smtp != NULL);
+ (BOOL)sendMessage:(CTCoreMessage *)message server:(NSString *)server username:(NSString *)username
password:(NSString *)password port:(unsigned int)port useTLS:(BOOL)tls useAuth:(BOOL)auth error:(NSError **)error {
BOOL success;
mailsmtp *smtp = NULL;
smtp = mailsmtp_new(0, NULL);
CTSMTP *smtpObj = [[CTESMTP alloc] initWithResource:smtp];
@try {
[smtpObj connectToServer:server port:port];
if ([smtpObj helo] == false) {
/* The server didn't support ESMTP, so switching to STMP */
[smtpObj release];
smtpObj = [[CTSMTP alloc] initWithResource:smtp];
[smtpObj helo];
}
if (tls)
[smtpObj startTLS];
if (auth)
[smtpObj authenticateWithUsername:username password:password server:server];
CTSMTP *smtpObj = [[CTESMTP alloc] initWithResource:smtp];
success = [smtpObj connectToServer:server port:port];
if (!success) {
goto error;
}
if ([smtpObj helo] == NO) {
/* The server didn't support ESMTP, so switching to STMP */
[smtpObj release];
smtpObj = [[CTSMTP alloc] initWithResource:smtp];
success = [smtpObj helo];
if (!success) {
goto error;
}
}
if (tls) {
success = [smtpObj startTLS];
if (!success) {
goto error;
}
}
if (auth) {
[smtpObj authenticateWithUsername:username password:password server:server];
if (!success) {
goto error;
}
}
[smtpObj setFrom:[[[message from] anyObject] email]];
success = [smtpObj setFrom:[[[message from] anyObject] email]];
if (!success) {
goto error;
}
/* recipients */
NSMutableSet *rcpts = [NSMutableSet set];
[rcpts unionSet:[message to]];
[rcpts unionSet:[message bcc]];
[rcpts unionSet:[message cc]];
[smtpObj setRecipients:rcpts];
/* data */
[smtpObj setData:[message render]];
}
@finally {
[smtpObj release];
mailsmtp_free(smtp);
}
/* recipients */
NSMutableSet *rcpts = [NSMutableSet set];
[rcpts unionSet:[message to]];
[rcpts unionSet:[message bcc]];
[rcpts unionSet:[message cc]];
success = [smtpObj setRecipients:rcpts];
if (!success) {
goto error;
}
/* data */
success = [smtpObj setData:[message render]];
if (!success) {
goto error;
}
[smtpObj release];
return YES;
error:
*error = smtpObj.lastError;
[smtpObj release];
mailsmtp_free(smtp);
return NO;
}
@end
@end
+48 -1
View File
@@ -48,18 +48,23 @@ JRLogLevel gDefaultJRLogLevel = JRLogLevel_Debug;
self = [super init];
if (self) {
sessionUUID = (id)CFUUIDCreateString(kCFAllocatorDefault, CFUUIDCreate(kCFAllocatorDefault));
#if 0
[[NSDistributedNotificationCenter defaultCenter] addObserver:self
selector:@selector(destinationDOAvailable:)
name:@"JRLogDestinationDOAvailable"
object:nil];
tryDO = YES;
#endif
}
return self;
}
#if 0
- (void)destinationDOAvailable:(NSNotification*)notification_ {
tryDO = YES;
}
#endif
- (void)logWithLevel:(JRLogLevel)callerLevel_
instance:(NSString*)instance_
@@ -68,6 +73,7 @@ JRLogLevel gDefaultJRLogLevel = JRLogLevel_Debug;
function:(const char*)function_
message:(NSString*)message_
{
#if 0
if (tryDO) {
tryDO = NO;
destination = [[NSConnection rootProxyForConnectionWithRegisteredName:@"JRLogDestinationDO" host:nil] retain];
@@ -101,6 +107,12 @@ JRLogLevel gDefaultJRLogLevel = JRLogLevel_Debug;
line_,
message_);
}
#endif
NSLog(@"%@:%u: %@",
[[NSString stringWithUTF8String:file_] lastPathComponent],
line_,
message_);
}
@end
@@ -161,6 +173,17 @@ static void LoadJRLogSettings() {
[pool release];
}
BOOL IsJRLogLevelActive(id self_, JRLogLevel callerLevel_) {
assert(callerLevel_ >= JRLogLevel_Debug && callerLevel_ <= JRLogLevel_Fatal);
// Setting the default level to OFF disables all logging, regardless of everything else.
if (JRLogLevel_Off == gDefaultJRLogLevel)
return NO;
return YES;
}
#if 0
BOOL IsJRLogLevelActive(id self_, JRLogLevel callerLevel_) {
assert(callerLevel_ >= JRLogLevel_Debug && callerLevel_ <= JRLogLevel_Fatal);
@@ -186,6 +209,7 @@ BOOL IsJRLogLevelActive(id self_, JRLogLevel callerLevel_) {
return callerLevel_ >= currentLevel;
}
#endif
void
JRLog(
@@ -209,7 +233,7 @@ JRLog(
va_end(args);
[[JRLogOutput sharedOutput] logWithLevel:callerLevel_
instance:self_ ? [NSString stringWithFormat:@"<%@: %p>", [self_ className], self_] : @"nil"
instance:self_ ? [NSString stringWithFormat:@"<%@: %p>", [self_ class], self_] : @"nil"
file:file_
line:line_
function:function_
@@ -222,6 +246,7 @@ JRLog(
@implementation NSObject (JRLogAdditions)
#if 0
NSMapTable *gClassLoggingLevels = NULL;
+ (void)load {
if (!gClassLoggingLevels) {
@@ -251,6 +276,28 @@ NSMapTable *gClassLoggingLevels = NULL;
return gDefaultJRLogLevel;
}
+ (void)setDefaultJRLogLevel:(JRLogLevel)level_ {
assert(level_ >= JRLogLevel_Debug && level_ <= JRLogLevel_Off);
gDefaultJRLogLevel = level_;
}
#endif
+ (void)load {
}
+ (JRLogLevel)classJRLogLevel {
return gDefaultJRLogLevel;
}
+ (void)setClassJRLogLevel:(JRLogLevel)level_ {
}
+ (JRLogLevel)defaultJRLogLevel {
return gDefaultJRLogLevel;
}
+ (void)setDefaultJRLogLevel:(JRLogLevel)level_ {
assert(level_ >= JRLogLevel_Debug && level_ <= JRLogLevel_Off);
gDefaultJRLogLevel = level_;
+3 -3
View File
@@ -34,7 +34,7 @@
#import "CTCoreFolder.h"
#import "CTCoreMessage.h"
#import "CTSMTPConnection.h"
#import "CTBareMessage.h"
#import "libetpan.h"
#import "CTBareAttachment.h"
#import <libetpan/libetpan.h>
#import "MailCoreTypes.h"
#import "MailCoreUtilities.h"
#import "MailCoreUtilities.h"
+32 -59
View File
@@ -28,16 +28,35 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#define DEST_CHARSET "iso-8859-1"
#import <libetpan/libetpan.h>
#define DEST_CHARSET "UTF-8"
#define CTContentTypesPath @"/System/Library/Frameworks/Foundation.framework/Resources/types.plist"
/** Constants for fetching messages **/
/* ========================= */
/* = List of Message Flags = */
/* ========================= */
typedef enum
{
CTFetchAttrDefaultsOnly = 0,
CTFetchAttrBodyStructure = 1 << 0,
CTFetchAttrEnvelope = 1 << 1,
} CTFetchAttributes;
//TODO Turn these into extern's, not defines
/** Connection Constants **/
/* when the connection is plain text */
#define CTConnectionTypePlain CONNECTION_TYPE_PLAIN
/* when the connection is first plain, then, we want to switch to TLS (secure connection) */
#define CTConnectionTypeStartTLS CONNECTION_TYPE_STARTTLS
/* the connection is first plain, then, we will try to switch to TLS */
#define CTConnectionTypeTryStartTLS CONNECTION_TYPE_TRY_STARTTLS
/* the connection is over TLS */
#define CTConnectionTypeTLS CONNECTION_TYPE_TLS
#define CTImapAuthTypePlain IMAP_AUTH_TYPE_PLAIN
/** List of Message Flags **/
#define CTFlagNew MAIL_FLAG_NEW
#define CTFlagSeen MAIL_FLAG_SEEN
@@ -47,57 +66,11 @@
#define CTFlagForwarded MAIL_FLAG_FORWARDED
#define CTFlagCancelled MAIL_FLAG_CANCELLED
/** Async SMTP Status **/
/* =========================== */
/* = List of Exception Types = */
/* =========================== */
#define CTMIMEParseError @"MIMEParserError"
#define CTMIMEParseErrorDesc @"An error occured during MIME parsing."
#define CTMIMEUnknownError @"MIMEUnknownError"
#define CTMIMEUnknownErrorDesc @"I don't know how to parse this MIME structure."
#define CTMemoryError @"MemoryError"
#define CTMemoryErrorDesc @"Memory could not be allocated."
#define CTLoginError @"LoginError"
#define CTLoginErrorDesc @"The username or password you entered is invalid."
#define CTUnknownError @"UnknownError"
#define CTMessageNotFound @"MessageNotFound"
#define CTMessageNotFoundDesc @"The message could not be found."
#define CTNoSubscribedFolders @"NoSubcribedFolders"
#define CTNoSubscribedFoldersDesc @"There are not any subscribed folders."
#define CTNoFolders @"NoFolders"
#define CTNoFoldersDesc @"There are not any folders on the server."
#define CTFetchError @"FetchError"
#define CTFetchErrorDesc @"An error has occurred while fetching from the server."
#define CTSMTPError @"SMTPError"
#define CTSMTPErrorDesc @"An error has occurred while attempting to send via SMTP."
#define CTSMTPSocket @"SMTPSocket"
#define CTSMTPSocketDesc @"An error has occurred while attempting to open an SMTP socket connection."
#define CTSMTPHello @"SMTPHello"
#define CTSMTPHelloDesc @"An error occured while introducing ourselves to the server with the ehlo, or helo command."
#define CTSMTPTLS @"SMTPTLS"
#define CTSMTPTLSDesc @"An error occured while attempting to setup a TLS connection with the server."
#define CTSMTPLogin @"SMTPLogin"
#define CTSMTPLoginDesc @"The password or username is invalid."
#define CTSMTPFrom @"SMTPFrom"
#define CTSMTPFromDesc @"An error occured while sending the from address."
#define CTSMTPRecipients @"SMTPRecipients"
#define CTSMTPRecipientsDesc @"An error occured while sending the recipient addresses."
#define CTSMTPData @"SMTPData"
#define CTSMTPDataDesc @"An error occured while sending message data."
typedef enum
{
CTSMTPAsyncSuccess = 0,
CTSMTPAsyncCanceled = 1,
CTSMTPAsyncError = 2
} CTSMTPAsyncStatus;
+12 -5
View File
@@ -29,13 +29,20 @@
* SUCH DAMAGE.
*/
#import "libetpan.h"
#import <Foundation/Foundation.h>
#import <libetpan/libetpan.h>
/*!
@abstract Enables logging of all streams, data is output to standard out.
@abstract Enables logging of all streams, data is output to standard out.
*/
void MailCoreEnableLogging();
void MailCoreDisableLogging();
void IfFalse_RaiseException(bool value, NSString *exceptionName, NSString *exceptionDesc);
void IfTrue_RaiseException(bool value, NSString *exceptionName, NSString *exceptionDesc);
void RaiseException(NSString *exceptionName, NSString *exceptionDesc);
NSError* MailCoreCreateError(int errcode, NSString *description);
/*!
@abstract Translates the LibEtPan error code into NSError with error description
*/
NSError* MailCoreCreateErrorFromCode(int errcode);
NSString *MailCoreDecodeMIMEPhrase(char *data);
+221 -31
View File
@@ -31,48 +31,238 @@
#import "MailCoreUtilities.h"
#import "JRLog.h"
#import "MailCoreTypes.h"
/* direction is 1 for send, 0 for receive, -1 when it does not apply */
void mailcore_logger(int direction, const char * str, size_t size) {
char *str2 = malloc(size+1);
strncpy(str2,str,size);
str2[size] = 0;
id self = nil; // Work around for using JRLogInfo in a C function
if (direction == 1) {
JRLogInfo(@"Client: %s\n", str2);
}
else if (direction == 0) {
JRLogInfo(@"Server: %s\n", str2);
}
else {
JRLogInfo(@"%s\n", str2);
}
free(str2);
char *str2 = malloc(size+1);
strncpy(str2,str,size);
str2[size] = 0;
if (direction == 1) {
printf("%s\n", str2);
}
else if (direction == 0) {
printf("%s\n", str2);
}
else {
printf("%s\n", str2);
}
free(str2);
}
void MailCoreEnableLogging() {
mailstream_debug = 1;
mailstream_logger = mailcore_logger;
mailstream_debug = 1;
mailstream_logger = mailcore_logger;
}
void IfFalse_RaiseException(bool value, NSString *exceptionName, NSString *exceptionDesc) {
if (!value)
RaiseException(exceptionName, exceptionDesc);
void MailCoreDisableLogging() {
mailstream_debug = 0;
mailstream_logger = nil;
}
void IfTrue_RaiseException(bool value, NSString *exceptionName, NSString *exceptionDesc) {
if (value)
RaiseException(exceptionName, exceptionDesc);
NSError* MailCoreCreateError(int errcode, NSString *description) {
NSMutableDictionary *errorDetail = [NSMutableDictionary dictionary];
[errorDetail setValue:description forKey:NSLocalizedDescriptionKey];
return [NSError errorWithDomain:@"mailcore" code:errcode userInfo:errorDetail];
}
NSError* MailCoreCreateErrorFromCode(int errcode) {
NSString *description = @"";
switch (errcode) {
case MAILIMAP_ERROR_BAD_STATE:
description = @"Bad state";
break;
case MAILIMAP_ERROR_STREAM:
description = @"Stream error"; // Used to be @"Lost connection"
break;
case MAILIMAP_ERROR_PARSE:
description = @"Parse error";
break;
case MAILIMAP_ERROR_CONNECTION_REFUSED:
description = @"Connection refused";
break;
case MAILIMAP_ERROR_MEMORY:
description = @"Memory Error";
break;
case MAILIMAP_ERROR_FATAL:
description = @"IMAP connection lost"; // I renamed this to calm users
break;
case MAILIMAP_ERROR_PROTOCOL:
description = @"Protocol Error";
break;
case MAILIMAP_ERROR_DONT_ACCEPT_CONNECTION:
description = @"Connection not accepted";
break;
case MAILIMAP_ERROR_APPEND:
description = @"Append error";
break;
case MAILIMAP_ERROR_NOOP:
description = @"NOOP error";
break;
case MAILIMAP_ERROR_LOGOUT:
description = @"Logout error";
break;
case MAILIMAP_ERROR_CAPABILITY:
description = @"Capability error";
break;
case MAILIMAP_ERROR_CHECK:
description = @"Check command error";
break;
case MAILIMAP_ERROR_CLOSE:
description = @"Close command error";
break;
case MAILIMAP_ERROR_EXPUNGE:
description = @"Expunge command error";
break;
case MAILIMAP_ERROR_COPY:
description = @"Copy command error";
break;
case MAILIMAP_ERROR_UID_COPY:
description = @"UID copy command error";
break;
case MAILIMAP_ERROR_CREATE:
description = @"Create command error";
break;
case MAILIMAP_ERROR_DELETE:
description = @"Delete error";
break;
case MAILIMAP_ERROR_EXAMINE:
description = @"Examine command error";
break;
case MAILIMAP_ERROR_FETCH:
description = @"Fetch command error";
break;
case MAILIMAP_ERROR_UID_FETCH:
description = @"UID fetch command error";
break;
case MAILIMAP_ERROR_LIST:
description = @"List command error";
break;
case MAILIMAP_ERROR_LOGIN:
description = @"Login error";
break;
case MAILIMAP_ERROR_LSUB:
description = @"Lsub error";
break;
case MAILIMAP_ERROR_RENAME:
description = @"Rename error";
break;
case MAILIMAP_ERROR_SEARCH:
description = @"Search error";
break;
case MAILIMAP_ERROR_UID_SEARCH:
description = @"Uid search error";
break;
case MAILIMAP_ERROR_SELECT:
description = @"Select cmnd error";
break;
case MAILIMAP_ERROR_STATUS:
description = @"Status cmnd error";
break;
case MAILIMAP_ERROR_STORE:
description = @"Store cmnd error";
break;
case MAILIMAP_ERROR_UID_STORE:
description = @"Uid store cmd error";
break;
case MAILIMAP_ERROR_SUBSCRIBE:
description = @"Subscribe error";
break;
case MAILIMAP_ERROR_UNSUBSCRIBE:
description = @"Unsubscribe error";
break;
case MAILIMAP_ERROR_STARTTLS:
description = @"StartTLS error";
break;
case MAILIMAP_ERROR_INVAL:
description = @"Inval cmd error";
break;
case MAILIMAP_ERROR_EXTENSION:
description = @"Extension error";
break;
case MAILIMAP_ERROR_SASL:
description = @"SASL error";
break;
case MAILIMAP_ERROR_SSL:
description = @"SSL error";
break;
// the following are from maildriver_errors.h
case MAIL_ERROR_PROTOCOL:
description = @"Protocol error";
break;
case MAIL_ERROR_CAPABILITY:
description = @"Capability error";
break;
case MAIL_ERROR_CLOSE:
description = @"Close error";
break;
case MAIL_ERROR_FATAL:
description = @"Fatal error";
break;
case MAIL_ERROR_READONLY:
description = @"Readonly error";
break;
case MAIL_ERROR_NO_APOP:
description = @"No APOP error";
break;
case MAIL_ERROR_COMMAND_NOT_SUPPORTED:
description = @"Cmd not supported";
break;
case MAIL_ERROR_NO_PERMISSION:
description = @"No permission";
break;
case MAIL_ERROR_PROGRAM_ERROR:
description = @"Program error";
break;
case MAIL_ERROR_SUBJECT_NOT_FOUND:
description = @"Subject not found";
break;
case MAIL_ERROR_CHAR_ENCODING_FAILED:
description = @"Encoding failed";
break;
case MAIL_ERROR_SEND:
description = @"Send error";
break;
case MAIL_ERROR_COMMAND:
description = @"Command error";
break;
case MAIL_ERROR_SYSTEM:
description = @"System error";
break;
case MAIL_ERROR_UNABLE:
description = @"Unable error";
break;
case MAIL_ERROR_FOLDER:
description = @"Folder errror";
break;
default:
description = [NSString stringWithFormat:@"Error: %@", exp];
break;
}
return MailCoreCreateError(errcode, description);
}
void RaiseException(NSString *exceptionName, NSString *exceptionDesc) {
NSException *exception = [NSException
exceptionWithName:exceptionName
reason:exceptionDesc
userInfo:nil];
[exception raise];
}
NSString *MailCoreDecodeMIMEPhrase(char *data) {
int err;
size_t currToken = 0;
char *decodedSubject;
NSString *result;
if (*data != '\0') {
err = mailmime_encoded_phrase_parse(DEST_CHARSET, data, strlen(data),
&currToken, DEST_CHARSET, &decodedSubject);
if (err != MAILIMF_NO_ERROR) {
if (decodedSubject == NULL)
free(decodedSubject);
return nil;
}
} else {
return @"";
}
result = [NSString stringWithCString:decodedSubject encoding:NSUTF8StringEncoding];
free(decodedSubject);
return result;
}
@@ -1,7 +1,7 @@
/*
* MailCore
* Mailcore
*
* Copyright (C) 2007 - Matt Ronge
* Copyright (C) 2012 - Matt Ronge
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -29,30 +29,13 @@
* SUCH DAMAGE.
*/
#import "CTBareMessage.h"
#import <Foundation/Foundation.h>
#import <SenTestingKit/SenTestingKit.h>
@implementation CTBareMessage
@synthesize uid=mUid, flags=mFlags;
@class CTCoreAccount;
@class CTCoreFolder;
- (id)init {
self = [super init];
if (self != nil) {
self.uid = @"";
self.flags = 0;
}
return self;
}
- (NSString *)description {
return [NSString stringWithFormat:@"UID: %@\n Flags: %d\n", self.uid, self.flags];
}
- (NSUInteger)hash {
NSString *str = [NSString stringWithFormat:@"%@%d", self.uid, self.flags];
return [str hash];
}
- (BOOL)isEqual:(id)anObject {
return ([self hash] == [anObject hash]);
}
@end
@interface CTConnectedTest : SenTestCase
@property (nonatomic, strong) CTCoreAccount *account;
@property (nonatomic, strong) CTCoreFolder *folder;
@end
+71
View File
@@ -0,0 +1,71 @@
/*
* Mailcore
*
* Copyright (C) 2012 - Matt Ronge
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the MailCore project nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#import <MailCore/MailCore.h>
#import "CTConnectedTest.h"
#import "CTCoreAccount.h"
@implementation CTConnectedTest {
}
@synthesize account, folder;
NSString *SERVER = @"imap.gmail.com";
NSString *USERNAME = @"mailcoretests@gmail.com";
NSString *PASSWORD = @"MailCoreRockz";
- (void)setUp {
self.account = [[CTCoreAccount alloc] init];
[self connect];
self.folder = [self.account folderWithPath:@"Test"];
[self.folder connect];
}
- (void)tearDown {
[self disconnect];
self.folder = nil;
self.account = nil;
}
- (void)dealloc {
self.folder = nil;
self.account = nil;
[super dealloc];
}
- (void)connect {
[self.account connectToServer:SERVER port:993 connectionType:CTConnectionTypeTLS authType:CTImapAuthTypePlain
login:USERNAME password:PASSWORD];
}
- (void)disconnect {
[self.folder disconnect];
[self.account disconnect];
}
@end
+54 -62
View File
@@ -31,67 +31,59 @@
#import "CTCoreAccountTests.h"
NSString *SERVER = @"192.168.1.106";
NSString *USERNAME = @"test";
NSString *PASSWORD = @"password";
@interface CTCoreAccountTests (CTCoreAccountTestsPrivate)
- (void)disconnect;
- (void)connect;
@end
//TODO: Turn these tests back on
@implementation CTCoreAccountTests
- (void)setUp {
account = [[CTCoreAccount alloc] init];
[self connect];
}
- (void)tearDown {
[self disconnect];
[account release];
}
- (void)testAllFolders {
NSSet *folders = [account allFolders];
NSSet *expectedFolders = [NSSet setWithObjects:@"ACM", @"Drafts", @"JDEE", @"Lucene",
@"Lucene-Dev", @"MacWarriors", @"Sent", @"Templates",
@"TestMailbox", @"TestMailbox.SubMailbox", @"Trash",
@"INBOX", nil];
STAssertEqualObjects(folders, expectedFolders, nil);
}
/*!
Make sure every folder can be opened
*/
- (void)testOpenAllFolders {
for (NSString *folderPath in [account allFolders]) {
STAssertNotNil([account folderWithPath:folderPath], nil);
}
}
- (void)testSubscribedFolders {
NSSet *folders = [account subscribedFolders];
NSSet *expectedFolders = [NSSet setWithObjects:@"Drafts", @"JDEE", @"Lucene",
@"Lucene-Dev", @"MacWarriors", @"Sent", @"Templates",
@"TestMailbox", @"TestMailbox.SubMailbox", @"Trash",
@"INBOX", nil];
STAssertEqualObjects(folders, expectedFolders, nil);
}
- (void)testIsConnected {
STAssertEquals(YES, [account isConnected], nil);
[self disconnect];
STAssertEquals(NO, [account isConnected], nil);
[self connect];
STAssertEquals(YES, [account isConnected], nil);
}
- (void)connect {
[account connectToServer:SERVER port:143 connectionType:CONNECTION_TYPE_PLAIN authType:IMAP_AUTH_TYPE_PLAIN
login:USERNAME password:PASSWORD];
}
- (void)disconnect {
[account disconnect];
}
//- (void)setUp {
// account = [[CTCoreAccount alloc] init];
// [self connect];
//}
//
//- (void)tearDown {
// [self disconnect];
// [account release];
//}
//
//- (void)testAllFolders {
// NSSet *folders = [account allFolders];
// NSSet *expectedFolders = [NSSet setWithObjects:@"ACM", @"Drafts", @"JDEE", @"Lucene",
// @"Lucene-Dev", @"MacWarriors", @"Sent", @"Templates",
// @"TestMailbox", @"TestMailbox.SubMailbox", @"Trash",
// @"INBOX", nil];
// STAssertEqualObjects(folders, expectedFolders, nil);
//}
//
///*!
// Make sure every folder can be opened
//*/
//- (void)testOpenAllFolders {
// for (NSString *folderPath in [account allFolders]) {
// STAssertNotNil([account folderWithPath:folderPath], nil);
// }
//}
//
//- (void)testSubscribedFolders {
// NSSet *folders = [account subscribedFolders];
// NSSet *expectedFolders = [NSSet setWithObjects:@"Drafts", @"JDEE", @"Lucene",
// @"Lucene-Dev", @"MacWarriors", @"Sent", @"Templates",
// @"TestMailbox", @"TestMailbox.SubMailbox", @"Trash",
// @"INBOX", nil];
// STAssertEqualObjects(folders, expectedFolders, nil);
//}
//
//- (void)testIsConnected {
// STAssertEquals(YES, [account isConnected], nil);
// [self disconnect];
// STAssertEquals(NO, [account isConnected], nil);
// [self connect];
// STAssertEquals(YES, [account isConnected], nil);
//}
//
//- (void)connect {
// [account connectToServer:SERVER port:143 connectionType:CONNECTION_TYPE_PLAIN authType:IMAP_AUTH_TYPE_PLAIN
// login:USERNAME password:PASSWORD];
//}
//
//- (void)disconnect {
// [account disconnect];
//}
@end

Some files were not shown because too many files have changed in this diff Show More