Compare commits
83 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 2ac9928971 | |||
| 1766cf21d2 | |||
| bb29c7911f | |||
| 899bf653ce | |||
| e44d7169a6 | |||
| 053ab837fb | |||
| 5d97ad5220 | |||
| 8a89fd2fc8 | |||
| a857dd00af | |||
| 1ce5f390c7 | |||
| 9aec18fe31 | |||
| e0396cbf50 | |||
| e67020cc10 | |||
| 4dd4759fb5 | |||
| b3a1e0689f | |||
| 81e574398c | |||
| 483a932dd5 | |||
| 784d4e4bae | |||
| 3dfe73d8df | |||
| 016aca79d9 | |||
| d2fd023d68 | |||
| 5a033e98ec | |||
| 175b398c5c | |||
| 48e04c6471 | |||
| b0180fbfcd | |||
| c6eab3fff5 | |||
| 829a820342 | |||
| 92cc79a5c6 | |||
| a182d018ae | |||
| 182298db69 | |||
| d05b8bbeb3 | |||
| 4012917c5c | |||
| d8034d4c83 | |||
| 859c5b794f | |||
| 406bd77197 | |||
| c4098c1f06 | |||
| 7daedee7aa | |||
| abb0520f0b | |||
| fef9c331f3 | |||
| f9581ee615 | |||
| 44d69c9b03 | |||
| 9037bf3350 | |||
| 6e5e72d502 | |||
| d39296426a | |||
| 163cb86770 | |||
| fbd1774f0c | |||
| 4a7a6f817c | |||
| 1840b6ee95 | |||
| bd9e3296d7 | |||
| 358e58e029 | |||
| 1f64ed5b56 | |||
| e10dc48ea1 | |||
| ba2b0ea12a | |||
| 28594aff21 | |||
| 4511d3b133 | |||
| 538f405a1b | |||
| 5537a637a1 | |||
| 8230b1e8e4 | |||
| a89ce29177 | |||
| 99a87a418f | |||
| 25c22d15f4 | |||
| 057a96d531 | |||
| 69e90c1bda | |||
| 8419f444e9 | |||
| 2bfd413f8a | |||
| d76fd2946a | |||
| b350ef36d3 | |||
| 704741e85b | |||
| 99a3147be4 | |||
| c570d2d85b | |||
| ad39f14b2d | |||
| a656b30632 | |||
| 7e08f69d88 | |||
| b4ba0f6ab3 | |||
| 7a496655f2 | |||
| 6f823c7804 | |||
| 33070d46a8 | |||
| fe1049ec3b | |||
| 1d833fb599 | |||
| c95e8fc483 | |||
| a19d761806 | |||
| ee03eb476b | |||
| 7cfa165d1c |
+1
-1
@@ -3,4 +3,4 @@
|
||||
url = https://github.com/mronge/libetpan.git
|
||||
[submodule "iOSPorts"]
|
||||
path = iOSPorts
|
||||
url = https://github.com/bindle/iOSPorts.git
|
||||
url = https://github.com/mronge/iOSPorts.git
|
||||
|
||||
@@ -1,18 +1,19 @@
|
||||
Primary Authors:
|
||||
|
||||
* Matt Ronge
|
||||
|
||||
* Matt Ronge
|
||||
|
||||
Contributors:
|
||||
|
||||
* Stefano Barbato - For a patch that fixes a memory leak
|
||||
|
||||
* 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
|
||||
* 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
|
||||
|
||||
* Kaustubh Kabra - For HTML mail support
|
||||
* Dirk Holtwick - For updating the examples
|
||||
|
||||
Thanks to:
|
||||
|
||||
* Dinh Viet Hoa - For writing libetpan, which made MailCore possible
|
||||
* Dinh Viet Hoa - For writing libetpan, which made MailCore possible
|
||||
@@ -1,45 +0,0 @@
|
||||
<?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>IBClasses</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>CLASS</key>
|
||||
<string>FirstResponder</string>
|
||||
<key>LANGUAGE</key>
|
||||
<string>ObjC</string>
|
||||
<key>SUPERCLASS</key>
|
||||
<string>NSObject</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>ACTIONS</key>
|
||||
<dict>
|
||||
<key>connect</key>
|
||||
<string>id</string>
|
||||
</dict>
|
||||
<key>CLASS</key>
|
||||
<string>MyController</string>
|
||||
<key>LANGUAGE</key>
|
||||
<string>ObjC</string>
|
||||
<key>OUTLETS</key>
|
||||
<dict>
|
||||
<key>password</key>
|
||||
<string>id</string>
|
||||
<key>port</key>
|
||||
<string>id</string>
|
||||
<key>server</key>
|
||||
<string>id</string>
|
||||
<key>useTLS</key>
|
||||
<string>id</string>
|
||||
<key>username</key>
|
||||
<string>id</string>
|
||||
</dict>
|
||||
<key>SUPERCLASS</key>
|
||||
<string>NSObject</string>
|
||||
</dict>
|
||||
</array>
|
||||
<key>IBVersion</key>
|
||||
<string>1</string>
|
||||
</dict>
|
||||
</plist>
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,21 +0,0 @@
|
||||
<?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>IBFramework Version</key>
|
||||
<string>677</string>
|
||||
<key>IBLastKnownRelativeProjectPath</key>
|
||||
<string>../InboxLister.xcodeproj</string>
|
||||
<key>IBOldestOS</key>
|
||||
<integer>5</integer>
|
||||
<key>IBOpenObjects</key>
|
||||
<array>
|
||||
<integer>29</integer>
|
||||
<integer>2</integer>
|
||||
</array>
|
||||
<key>IBSystem Version</key>
|
||||
<string>9J61</string>
|
||||
<key>targetFramework</key>
|
||||
<string>IBCocoaFramework</string>
|
||||
</dict>
|
||||
</plist>
|
||||
Binary file not shown.
@@ -165,8 +165,8 @@
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
F8A2FAE4144FAA8E00C03DB4 /* MailCore.framework */,
|
||||
F8A2FAE6144FAA8E00C03DB4 /* Tests.octest */,
|
||||
F8A2FAE8144FAA8E00C03DB4 /* libmailcore.a */,
|
||||
F8A2FAE6144FAA8E00C03DB4 /* Tests.octest */,
|
||||
);
|
||||
name = Products;
|
||||
sourceTree = "<group>";
|
||||
@@ -294,6 +294,7 @@
|
||||
C01FCF4B08A954540054247B /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ARCHS = "$(NATIVE_ARCH_ACTUAL)";
|
||||
COPY_PHASE_STRIP = NO;
|
||||
GCC_DYNAMIC_NO_PIC = NO;
|
||||
GCC_MODEL_TUNING = G5;
|
||||
@@ -304,6 +305,7 @@
|
||||
);
|
||||
INFOPLIST_FILE = Info.plist;
|
||||
INSTALL_PATH = "$(HOME)/Applications";
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.7;
|
||||
PRODUCT_NAME = InboxLister;
|
||||
WRAPPER_EXTENSION = app;
|
||||
ZERO_LINK = YES;
|
||||
@@ -313,6 +315,7 @@
|
||||
C01FCF4C08A954540054247B /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ARCHS = "$(NATIVE_ARCH_ACTUAL)";
|
||||
GCC_GENERATE_DEBUGGING_SYMBOLS = NO;
|
||||
GCC_MODEL_TUNING = G5;
|
||||
HEADER_SEARCH_PATHS = (
|
||||
@@ -321,6 +324,7 @@
|
||||
);
|
||||
INFOPLIST_FILE = Info.plist;
|
||||
INSTALL_PATH = "$(HOME)/Applications";
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.7;
|
||||
PRODUCT_NAME = InboxLister;
|
||||
WRAPPER_EXTENSION = app;
|
||||
};
|
||||
|
||||
@@ -24,27 +24,34 @@
|
||||
- (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]];
|
||||
|
||||
int portNumber = [port intValue];
|
||||
BOOL ssl = [useTLS state] == NSOnState;
|
||||
|
||||
[myAccount connectToServer:[server stringValue]
|
||||
port:portNumber > 0 ? portNumber : 993
|
||||
connectionType:ssl ? CONNECTION_TYPE_TLS : CONNECTION_TYPE_PLAIN
|
||||
authType:IMAP_AUTH_TYPE_PLAIN
|
||||
login:[username stringValue]
|
||||
password:[password stringValue]];
|
||||
|
||||
if(![myAccount isConnected]) {
|
||||
NSRunCriticalAlertPanel(@"Connection Error", @"Please check your connection details and try again.", @"OK", nil, nil);
|
||||
return;
|
||||
}
|
||||
|
||||
// NSLog(@"Folders %@", [myAccount allFolders]);
|
||||
|
||||
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...");
|
||||
|
||||
NSArray *messageSet = [inbox messagesFromSequenceNumber:1 to:0 withFetchAttributes:CTFetchAttrEnvelope];
|
||||
NSLog(@"Done getting list of messages... %@", messageSet);
|
||||
|
||||
NSMutableSet *messagesProxy = [self mutableSetValueForKey:@"messages"];
|
||||
NSEnumerator *objEnum = [messageSet objectEnumerator];
|
||||
id msg;
|
||||
|
||||
|
||||
while(msg = [objEnum nextObject]) {
|
||||
[msg fetchBodyStructure];
|
||||
[messagesProxy addObject:msg];
|
||||
|
||||
Binary file not shown.
@@ -1,20 +0,0 @@
|
||||
{
|
||||
IBClasses = (
|
||||
{CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; },
|
||||
{
|
||||
ACTIONS = {sendMessage = id; };
|
||||
CLASS = MyController;
|
||||
LANGUAGE = ObjC;
|
||||
OUTLETS = {
|
||||
password = id;
|
||||
port = id;
|
||||
server = id;
|
||||
useAuth = id;
|
||||
useTLS = id;
|
||||
username = id;
|
||||
};
|
||||
SUPERCLASS = NSObject;
|
||||
}
|
||||
);
|
||||
IBVersion = 1;
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>IBDocumentLocation</key>
|
||||
<string>393 113 356 240 0 0 1440 878 </string>
|
||||
<key>IBEditorPositions</key>
|
||||
<dict>
|
||||
<key>29</key>
|
||||
<string>109 298 338 44 0 0 1440 878 </string>
|
||||
</dict>
|
||||
<key>IBFramework Version</key>
|
||||
<string>446.1</string>
|
||||
<key>IBOpenObjects</key>
|
||||
<array>
|
||||
<integer>29</integer>
|
||||
<integer>21</integer>
|
||||
</array>
|
||||
<key>IBSystem Version</key>
|
||||
<string>8P2137</string>
|
||||
</dict>
|
||||
</plist>
|
||||
Binary file not shown.
@@ -7,165 +7,154 @@
|
||||
objects = {
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
8D11072A0486CEB800E47090 /* MainMenu.nib in Resources */ = {isa = PBXBuildFile; fileRef = 29B97318FDCFA39411CA2CEA /* MainMenu.nib */; };
|
||||
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 */; };
|
||||
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 */; };
|
||||
F8FF34BD15A34C98000C5541 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F8FF34BC15A34C98000C5541 /* Cocoa.framework */; };
|
||||
F8FF34C715A34C98000C5541 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = F8FF34C515A34C98000C5541 /* InfoPlist.strings */; };
|
||||
F8FF34C915A34C98000C5541 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = F8FF34C815A34C98000C5541 /* main.m */; };
|
||||
F8FF34CD15A34C98000C5541 /* Credits.rtf in Resources */ = {isa = PBXBuildFile; fileRef = F8FF34CB15A34C98000C5541 /* Credits.rtf */; };
|
||||
F8FF34D015A34C98000C5541 /* CTAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = F8FF34CF15A34C98000C5541 /* CTAppDelegate.m */; };
|
||||
F8FF34D315A34C98000C5541 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = F8FF34D115A34C98000C5541 /* MainMenu.xib */; };
|
||||
F8FF34FF15A34D08000C5541 /* MailCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F8FF34F515A34CDC000C5541 /* MailCore.framework */; };
|
||||
F8FF350115A34D4C000C5541 /* MailCore.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = F8FF34F515A34CDC000C5541 /* MailCore.framework */; };
|
||||
F8FF350415A34DC0000C5541 /* CTMyController.m in Sources */ = {isa = PBXBuildFile; fileRef = F8FF350315A34DB0000C5541 /* CTMyController.m */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXContainerItemProxy section */
|
||||
F8A2FB09144FB0AD00C03DB4 /* PBXContainerItemProxy */ = {
|
||||
F8FF34F415A34CDC000C5541 /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = F8A2FAF4144FB0AC00C03DB4 /* MailCore.xcodeproj */;
|
||||
containerPortal = F8FF34DD15A34CDC000C5541 /* MailCore.xcodeproj */;
|
||||
proxyType = 2;
|
||||
remoteGlobalIDString = 8DC2EF5B0486A6940098B216;
|
||||
remoteInfo = MailCore;
|
||||
};
|
||||
F8A2FB0B144FB0AD00C03DB4 /* PBXContainerItemProxy */ = {
|
||||
F8FF34F615A34CDC000C5541 /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = F8A2FAF4144FB0AC00C03DB4 /* MailCore.xcodeproj */;
|
||||
proxyType = 2;
|
||||
remoteGlobalIDString = F82D7C810F48AC8500ADA65C;
|
||||
remoteInfo = Tests;
|
||||
};
|
||||
F8A2FB0D144FB0AD00C03DB4 /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = F8A2FAF4144FB0AC00C03DB4 /* MailCore.xcodeproj */;
|
||||
containerPortal = F8FF34DD15A34CDC000C5541 /* MailCore.xcodeproj */;
|
||||
proxyType = 2;
|
||||
remoteGlobalIDString = F8618B5710DADB5C00C41188;
|
||||
remoteInfo = "MailCore iOS";
|
||||
};
|
||||
F8FF34F815A34CDC000C5541 /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = F8FF34DD15A34CDC000C5541 /* MailCore.xcodeproj */;
|
||||
proxyType = 2;
|
||||
remoteGlobalIDString = F8DFCF4915801A5000C01975;
|
||||
remoteInfo = Tests;
|
||||
};
|
||||
/* End PBXContainerItemProxy section */
|
||||
|
||||
/* Begin PBXCopyFilesBuildPhase section */
|
||||
F805A83009D7CDB80055EFC3 /* CopyFiles */ = {
|
||||
F8FF350015A34D40000C5541 /* CopyFiles */ = {
|
||||
isa = PBXCopyFilesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
dstPath = "";
|
||||
dstSubfolderSpec = 10;
|
||||
files = (
|
||||
F8A2FB12144FB19300C03DB4 /* MailCore.framework in CopyFiles */,
|
||||
F8FF350115A34D4C000C5541 /* MailCore.framework in CopyFiles */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXCopyFilesBuildPhase section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
089C165DFE840E0CC02AAC07 /* English */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/InfoPlist.strings; sourceTree = "<group>"; };
|
||||
1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = "<absolute>"; };
|
||||
13E42FB307B3F0F600E4EEF1 /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = /System/Library/Frameworks/CoreData.framework; sourceTree = "<absolute>"; };
|
||||
29B97316FDCFA39411CA2CEA /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
|
||||
29B97319FDCFA39411CA2CEA /* English */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = English; path = English.lproj/MainMenu.nib; sourceTree = "<group>"; };
|
||||
29B97324FDCFA39411CA2CEA /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = "<absolute>"; };
|
||||
29B97325FDCFA39411CA2CEA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = "<absolute>"; };
|
||||
32CA4F630368D1EE00C91783 /* MessageSender_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MessageSender_Prefix.pch; sourceTree = "<group>"; };
|
||||
8D1107310486CEB800E47090 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist; path = Info.plist; sourceTree = "<group>"; };
|
||||
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>"; };
|
||||
F8FF34B815A34C98000C5541 /* MessageSender.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = MessageSender.app; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
F8FF34BC15A34C98000C5541 /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; };
|
||||
F8FF34BF15A34C98000C5541 /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = System/Library/Frameworks/AppKit.framework; sourceTree = SDKROOT; };
|
||||
F8FF34C015A34C98000C5541 /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = System/Library/Frameworks/CoreData.framework; sourceTree = SDKROOT; };
|
||||
F8FF34C115A34C98000C5541 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
|
||||
F8FF34C415A34C98000C5541 /* MessageSender-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "MessageSender-Info.plist"; sourceTree = "<group>"; };
|
||||
F8FF34C615A34C98000C5541 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; };
|
||||
F8FF34C815A34C98000C5541 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
|
||||
F8FF34CA15A34C98000C5541 /* MessageSender-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "MessageSender-Prefix.pch"; sourceTree = "<group>"; };
|
||||
F8FF34CC15A34C98000C5541 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; name = en; path = en.lproj/Credits.rtf; sourceTree = "<group>"; };
|
||||
F8FF34CE15A34C98000C5541 /* CTAppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CTAppDelegate.h; sourceTree = "<group>"; };
|
||||
F8FF34CF15A34C98000C5541 /* CTAppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CTAppDelegate.m; sourceTree = "<group>"; };
|
||||
F8FF34D215A34C98000C5541 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = en.lproj/MainMenu.xib; sourceTree = "<group>"; };
|
||||
F8FF34DD15A34CDC000C5541 /* MailCore.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = MailCore.xcodeproj; path = ../../../MailCore.xcodeproj; sourceTree = "<group>"; };
|
||||
F8FF350215A34DB0000C5541 /* CTMyController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CTMyController.h; sourceTree = "<group>"; };
|
||||
F8FF350315A34DB0000C5541 /* CTMyController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CTMyController.m; sourceTree = "<group>"; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
8D11072E0486CEB800E47090 /* Frameworks */ = {
|
||||
F8FF34B515A34C97000C5541 /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
F8A2FB11144FB18A00C03DB4 /* MailCore.framework in Frameworks */,
|
||||
8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */,
|
||||
F8FF34FF15A34D08000C5541 /* MailCore.framework in Frameworks */,
|
||||
F8FF34BD15A34C98000C5541 /* Cocoa.framework in Frameworks */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXFrameworksBuildPhase section */
|
||||
|
||||
/* Begin PBXGroup section */
|
||||
080E96DDFE201D6D7F000001 /* Classes */ = {
|
||||
F8FF34AD15A34C97000C5541 = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
F805A71E09D7CD7D0055EFC3 /* MyController.h */,
|
||||
F805A71F09D7CD7D0055EFC3 /* MyController.m */,
|
||||
F8FF34DD15A34CDC000C5541 /* MailCore.xcodeproj */,
|
||||
F8FF34C215A34C98000C5541 /* MessageSender */,
|
||||
F8FF34BB15A34C98000C5541 /* Frameworks */,
|
||||
F8FF34B915A34C98000C5541 /* Products */,
|
||||
);
|
||||
name = Classes;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */ = {
|
||||
F8FF34B915A34C98000C5541 /* Products */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */,
|
||||
);
|
||||
name = "Linked Frameworks";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
1058C7A2FEA54F0111CA2CBB /* Other Frameworks */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
F856BE2313779C2000D9C2ED /* MailCore.framework */,
|
||||
29B97324FDCFA39411CA2CEA /* AppKit.framework */,
|
||||
13E42FB307B3F0F600E4EEF1 /* CoreData.framework */,
|
||||
29B97325FDCFA39411CA2CEA /* Foundation.framework */,
|
||||
);
|
||||
name = "Other Frameworks";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
19C28FACFE9D520D11CA2CBB /* Products */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
8D1107320486CEB800E47090 /* MessageSender.app */,
|
||||
F8FF34B815A34C98000C5541 /* MessageSender.app */,
|
||||
);
|
||||
name = Products;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
29B97314FDCFA39411CA2CEA /* MessageSender */ = {
|
||||
F8FF34BB15A34C98000C5541 /* Frameworks */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
F8A2FAF4144FB0AC00C03DB4 /* MailCore.xcodeproj */,
|
||||
080E96DDFE201D6D7F000001 /* Classes */,
|
||||
29B97315FDCFA39411CA2CEA /* Other Sources */,
|
||||
29B97317FDCFA39411CA2CEA /* Resources */,
|
||||
29B97323FDCFA39411CA2CEA /* Frameworks */,
|
||||
19C28FACFE9D520D11CA2CBB /* Products */,
|
||||
);
|
||||
name = MessageSender;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
29B97315FDCFA39411CA2CEA /* Other Sources */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
32CA4F630368D1EE00C91783 /* MessageSender_Prefix.pch */,
|
||||
29B97316FDCFA39411CA2CEA /* main.m */,
|
||||
);
|
||||
name = "Other Sources";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
29B97317FDCFA39411CA2CEA /* Resources */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
8D1107310486CEB800E47090 /* Info.plist */,
|
||||
089C165CFE840E0CC02AAC07 /* InfoPlist.strings */,
|
||||
29B97318FDCFA39411CA2CEA /* MainMenu.nib */,
|
||||
);
|
||||
name = Resources;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
29B97323FDCFA39411CA2CEA /* Frameworks */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */,
|
||||
1058C7A2FEA54F0111CA2CBB /* Other Frameworks */,
|
||||
F8FF34BC15A34C98000C5541 /* Cocoa.framework */,
|
||||
F8FF34BE15A34C98000C5541 /* Other Frameworks */,
|
||||
);
|
||||
name = Frameworks;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
F8A2FAF5144FB0AC00C03DB4 /* Products */ = {
|
||||
F8FF34BE15A34C98000C5541 /* Other Frameworks */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
F8A2FB0A144FB0AD00C03DB4 /* MailCore.framework */,
|
||||
F8A2FB0C144FB0AD00C03DB4 /* Tests.octest */,
|
||||
F8A2FB0E144FB0AD00C03DB4 /* libmailcore.a */,
|
||||
F8FF34BF15A34C98000C5541 /* AppKit.framework */,
|
||||
F8FF34C015A34C98000C5541 /* CoreData.framework */,
|
||||
F8FF34C115A34C98000C5541 /* Foundation.framework */,
|
||||
);
|
||||
name = "Other Frameworks";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
F8FF34C215A34C98000C5541 /* MessageSender */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
F8FF350215A34DB0000C5541 /* CTMyController.h */,
|
||||
F8FF350315A34DB0000C5541 /* CTMyController.m */,
|
||||
F8FF34CE15A34C98000C5541 /* CTAppDelegate.h */,
|
||||
F8FF34CF15A34C98000C5541 /* CTAppDelegate.m */,
|
||||
F8FF34D115A34C98000C5541 /* MainMenu.xib */,
|
||||
F8FF34C315A34C98000C5541 /* Supporting Files */,
|
||||
);
|
||||
path = MessageSender;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
F8FF34C315A34C98000C5541 /* Supporting Files */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
F8FF34C415A34C98000C5541 /* MessageSender-Info.plist */,
|
||||
F8FF34C515A34C98000C5541 /* InfoPlist.strings */,
|
||||
F8FF34C815A34C98000C5541 /* main.m */,
|
||||
F8FF34CA15A34C98000C5541 /* MessageSender-Prefix.pch */,
|
||||
F8FF34CB15A34C98000C5541 /* Credits.rtf */,
|
||||
);
|
||||
name = "Supporting Files";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
F8FF34DE15A34CDC000C5541 /* Products */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
F8FF34F515A34CDC000C5541 /* MailCore.framework */,
|
||||
F8FF34F715A34CDC000C5541 /* libmailcore.a */,
|
||||
F8FF34F915A34CDC000C5541 /* Tests.octest */,
|
||||
);
|
||||
name = Products;
|
||||
sourceTree = "<group>";
|
||||
@@ -173,198 +162,227 @@
|
||||
/* End PBXGroup section */
|
||||
|
||||
/* Begin PBXNativeTarget section */
|
||||
8D1107260486CEB800E47090 /* MessageSender */ = {
|
||||
F8FF34B715A34C97000C5541 /* MessageSender */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = C01FCF4A08A954540054247B /* Build configuration list for PBXNativeTarget "MessageSender" */;
|
||||
buildConfigurationList = F8FF34D615A34C98000C5541 /* Build configuration list for PBXNativeTarget "MessageSender" */;
|
||||
buildPhases = (
|
||||
8D1107290486CEB800E47090 /* Resources */,
|
||||
8D11072C0486CEB800E47090 /* Sources */,
|
||||
8D11072E0486CEB800E47090 /* Frameworks */,
|
||||
F805A83009D7CDB80055EFC3 /* CopyFiles */,
|
||||
F8FF34B415A34C97000C5541 /* Sources */,
|
||||
F8FF34B515A34C97000C5541 /* Frameworks */,
|
||||
F8FF34B615A34C97000C5541 /* Resources */,
|
||||
F8FF350015A34D40000C5541 /* CopyFiles */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
dependencies = (
|
||||
);
|
||||
name = MessageSender;
|
||||
productInstallPath = "$(HOME)/Applications";
|
||||
productName = MessageSender;
|
||||
productReference = 8D1107320486CEB800E47090 /* MessageSender.app */;
|
||||
productReference = F8FF34B815A34C98000C5541 /* MessageSender.app */;
|
||||
productType = "com.apple.product-type.application";
|
||||
};
|
||||
/* End PBXNativeTarget section */
|
||||
|
||||
/* Begin PBXProject section */
|
||||
29B97313FDCFA39411CA2CEA /* Project object */ = {
|
||||
F8FF34AF15A34C97000C5541 /* Project object */ = {
|
||||
isa = PBXProject;
|
||||
attributes = {
|
||||
CLASSPREFIX = CT;
|
||||
LastUpgradeCheck = 0430;
|
||||
};
|
||||
buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "MessageSender" */;
|
||||
buildConfigurationList = F8FF34B215A34C97000C5541 /* Build configuration list for PBXProject "MessageSender" */;
|
||||
compatibilityVersion = "Xcode 3.2";
|
||||
developmentRegion = English;
|
||||
hasScannedForEncodings = 1;
|
||||
hasScannedForEncodings = 0;
|
||||
knownRegions = (
|
||||
en,
|
||||
);
|
||||
mainGroup = 29B97314FDCFA39411CA2CEA /* MessageSender */;
|
||||
mainGroup = F8FF34AD15A34C97000C5541;
|
||||
productRefGroup = F8FF34B915A34C98000C5541 /* Products */;
|
||||
projectDirPath = "";
|
||||
projectReferences = (
|
||||
{
|
||||
ProductGroup = F8A2FAF5144FB0AC00C03DB4 /* Products */;
|
||||
ProjectRef = F8A2FAF4144FB0AC00C03DB4 /* MailCore.xcodeproj */;
|
||||
ProductGroup = F8FF34DE15A34CDC000C5541 /* Products */;
|
||||
ProjectRef = F8FF34DD15A34CDC000C5541 /* MailCore.xcodeproj */;
|
||||
},
|
||||
);
|
||||
projectRoot = "";
|
||||
targets = (
|
||||
8D1107260486CEB800E47090 /* MessageSender */,
|
||||
F8FF34B715A34C97000C5541 /* MessageSender */,
|
||||
);
|
||||
};
|
||||
/* End PBXProject section */
|
||||
|
||||
/* Begin PBXReferenceProxy section */
|
||||
F8A2FB0A144FB0AD00C03DB4 /* MailCore.framework */ = {
|
||||
F8FF34F515A34CDC000C5541 /* MailCore.framework */ = {
|
||||
isa = PBXReferenceProxy;
|
||||
fileType = wrapper.framework;
|
||||
path = MailCore.framework;
|
||||
remoteRef = F8A2FB09144FB0AD00C03DB4 /* PBXContainerItemProxy */;
|
||||
remoteRef = F8FF34F415A34CDC000C5541 /* 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 */ = {
|
||||
F8FF34F715A34CDC000C5541 /* libmailcore.a */ = {
|
||||
isa = PBXReferenceProxy;
|
||||
fileType = archive.ar;
|
||||
path = libmailcore.a;
|
||||
remoteRef = F8A2FB0D144FB0AD00C03DB4 /* PBXContainerItemProxy */;
|
||||
remoteRef = F8FF34F615A34CDC000C5541 /* PBXContainerItemProxy */;
|
||||
sourceTree = BUILT_PRODUCTS_DIR;
|
||||
};
|
||||
F8FF34F915A34CDC000C5541 /* Tests.octest */ = {
|
||||
isa = PBXReferenceProxy;
|
||||
fileType = wrapper.cfbundle;
|
||||
path = Tests.octest;
|
||||
remoteRef = F8FF34F815A34CDC000C5541 /* PBXContainerItemProxy */;
|
||||
sourceTree = BUILT_PRODUCTS_DIR;
|
||||
};
|
||||
/* End PBXReferenceProxy section */
|
||||
|
||||
/* Begin PBXResourcesBuildPhase section */
|
||||
8D1107290486CEB800E47090 /* Resources */ = {
|
||||
F8FF34B615A34C97000C5541 /* Resources */ = {
|
||||
isa = PBXResourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
8D11072A0486CEB800E47090 /* MainMenu.nib in Resources */,
|
||||
8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */,
|
||||
F8FF34C715A34C98000C5541 /* InfoPlist.strings in Resources */,
|
||||
F8FF34CD15A34C98000C5541 /* Credits.rtf in Resources */,
|
||||
F8FF34D315A34C98000C5541 /* MainMenu.xib in Resources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXResourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXSourcesBuildPhase section */
|
||||
8D11072C0486CEB800E47090 /* Sources */ = {
|
||||
F8FF34B415A34C97000C5541 /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
8D11072D0486CEB800E47090 /* main.m in Sources */,
|
||||
F805A72009D7CD7D0055EFC3 /* MyController.m in Sources */,
|
||||
F8FF34C915A34C98000C5541 /* main.m in Sources */,
|
||||
F8FF34D015A34C98000C5541 /* CTAppDelegate.m in Sources */,
|
||||
F8FF350415A34DC0000C5541 /* CTMyController.m in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXSourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXVariantGroup section */
|
||||
089C165CFE840E0CC02AAC07 /* InfoPlist.strings */ = {
|
||||
F8FF34C515A34C98000C5541 /* InfoPlist.strings */ = {
|
||||
isa = PBXVariantGroup;
|
||||
children = (
|
||||
089C165DFE840E0CC02AAC07 /* English */,
|
||||
F8FF34C615A34C98000C5541 /* en */,
|
||||
);
|
||||
name = InfoPlist.strings;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
29B97318FDCFA39411CA2CEA /* MainMenu.nib */ = {
|
||||
F8FF34CB15A34C98000C5541 /* Credits.rtf */ = {
|
||||
isa = PBXVariantGroup;
|
||||
children = (
|
||||
29B97319FDCFA39411CA2CEA /* English */,
|
||||
F8FF34CC15A34C98000C5541 /* en */,
|
||||
);
|
||||
name = MainMenu.nib;
|
||||
name = Credits.rtf;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
F8FF34D115A34C98000C5541 /* MainMenu.xib */ = {
|
||||
isa = PBXVariantGroup;
|
||||
children = (
|
||||
F8FF34D215A34C98000C5541 /* en */,
|
||||
);
|
||||
name = MainMenu.xib;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
/* End PBXVariantGroup section */
|
||||
|
||||
/* Begin XCBuildConfiguration section */
|
||||
C01FCF4B08A954540054247B /* Debug */ = {
|
||||
F8FF34D415A34C98000C5541 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
ARCHS = "$(ARCHS_STANDARD_64_BIT)";
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
COPY_PHASE_STRIP = NO;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu99;
|
||||
GCC_DYNAMIC_NO_PIC = NO;
|
||||
GCC_MODEL_TUNING = G5;
|
||||
GCC_ENABLE_OBJC_EXCEPTIONS = YES;
|
||||
GCC_OPTIMIZATION_LEVEL = 0;
|
||||
HEADER_SEARCH_PATHS = (
|
||||
"$(SRCROOT)/../../../libetpan/build-mac/include",
|
||||
"$(SRCROOT)/../../../include",
|
||||
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||
"DEBUG=1",
|
||||
"$(inherited)",
|
||||
);
|
||||
INFOPLIST_FILE = Info.plist;
|
||||
INSTALL_PATH = "$(HOME)/Applications";
|
||||
PRODUCT_NAME = MessageSender;
|
||||
WRAPPER_EXTENSION = app;
|
||||
ZERO_LINK = YES;
|
||||
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
|
||||
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
|
||||
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES;
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.7;
|
||||
ONLY_ACTIVE_ARCH = YES;
|
||||
SDKROOT = macosx;
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
C01FCF4C08A954540054247B /* Release */ = {
|
||||
F8FF34D515A34C98000C5541 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
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;
|
||||
WRAPPER_EXTENSION = app;
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
ARCHS = "$(ARCHS_STANDARD_64_BIT)";
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
COPY_PHASE_STRIP = YES;
|
||||
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||
GCC_C_LANGUAGE_STANDARD = gnu99;
|
||||
GCC_ENABLE_OBJC_EXCEPTIONS = YES;
|
||||
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
|
||||
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES;
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.7;
|
||||
SDKROOT = macosx;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
C01FCF4F08A954540054247B /* Debug */ = {
|
||||
F8FF34D715A34C98000C5541 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
SDKROOT = macosx;
|
||||
GCC_PRECOMPILE_PREFIX_HEADER = YES;
|
||||
GCC_PREFIX_HEADER = "MessageSender/MessageSender-Prefix.pch";
|
||||
HEADER_SEARCH_PATHS = "";
|
||||
INFOPLIST_FILE = "MessageSender/MessageSender-Info.plist";
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
WRAPPER_EXTENSION = app;
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
C01FCF5008A954540054247B /* Release */ = {
|
||||
F8FF34D815A34C98000C5541 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
SDKROOT = macosx;
|
||||
GCC_PRECOMPILE_PREFIX_HEADER = YES;
|
||||
GCC_PREFIX_HEADER = "MessageSender/MessageSender-Prefix.pch";
|
||||
HEADER_SEARCH_PATHS = "";
|
||||
INFOPLIST_FILE = "MessageSender/MessageSender-Info.plist";
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
WRAPPER_EXTENSION = app;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
/* End XCBuildConfiguration section */
|
||||
|
||||
/* Begin XCConfigurationList section */
|
||||
C01FCF4A08A954540054247B /* Build configuration list for PBXNativeTarget "MessageSender" */ = {
|
||||
F8FF34B215A34C97000C5541 /* Build configuration list for PBXProject "MessageSender" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
C01FCF4B08A954540054247B /* Debug */,
|
||||
C01FCF4C08A954540054247B /* Release */,
|
||||
F8FF34D415A34C98000C5541 /* Debug */,
|
||||
F8FF34D515A34C98000C5541 /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
C01FCF4E08A954540054247B /* Build configuration list for PBXProject "MessageSender" */ = {
|
||||
F8FF34D615A34C98000C5541 /* Build configuration list for PBXNativeTarget "MessageSender" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
C01FCF4F08A954540054247B /* Debug */,
|
||||
C01FCF5008A954540054247B /* Release */,
|
||||
F8FF34D715A34C98000C5541 /* Debug */,
|
||||
F8FF34D815A34C98000C5541 /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
/* End XCConfigurationList section */
|
||||
};
|
||||
rootObject = 29B97313FDCFA39411CA2CEA /* Project object */;
|
||||
rootObject = F8FF34AF15A34C97000C5541 /* Project object */;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
//
|
||||
// CTAppDelegate.h
|
||||
// MessageSender
|
||||
//
|
||||
// Created by Matt Ronge on 7/3/12.
|
||||
// Copyright (c) 2012 __MyCompanyName__. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
|
||||
@interface CTAppDelegate : NSObject <NSApplicationDelegate>
|
||||
|
||||
@property (assign) IBOutlet NSWindow *window;
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,20 @@
|
||||
//
|
||||
// CTAppDelegate.m
|
||||
// MessageSender
|
||||
//
|
||||
// Created by Matt Ronge on 7/3/12.
|
||||
// Copyright (c) 2012 __MyCompanyName__. All rights reserved.
|
||||
//
|
||||
|
||||
#import "CTAppDelegate.h"
|
||||
|
||||
@implementation CTAppDelegate
|
||||
|
||||
@synthesize window = _window;
|
||||
|
||||
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification
|
||||
{
|
||||
// Insert code here to initialize your application
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,22 @@
|
||||
/* MyController */
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
#import <MailCore/MailCore.h>
|
||||
|
||||
@interface CTMyController : NSObject
|
||||
{
|
||||
IBOutlet NSTextField *password;
|
||||
IBOutlet NSTextField *port;
|
||||
IBOutlet NSTextField *server;
|
||||
IBOutlet NSTextField *username;
|
||||
IBOutlet NSButton *useAuth;
|
||||
IBOutlet NSButton *useTLS;
|
||||
|
||||
IBOutlet NSTextField *to;
|
||||
IBOutlet NSTextField *from;
|
||||
IBOutlet NSTextField *subject;
|
||||
IBOutlet NSTextField *body;
|
||||
}
|
||||
- (IBAction)sendMessage:(id)sender;
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,39 @@
|
||||
#import "CTMyController.h"
|
||||
|
||||
@implementation CTMyController
|
||||
|
||||
- (IBAction)sendMessage:(id)sender {
|
||||
CTCoreMessage *msg = [[CTCoreMessage alloc] init];
|
||||
|
||||
CTCoreAddress *toAddr = [CTCoreAddress address];
|
||||
[toAddr setEmail:to.stringValue];
|
||||
[msg setTo:[NSSet setWithObject:toAddr]];
|
||||
|
||||
CTCoreAddress *fromAddr = [CTCoreAddress address];
|
||||
[fromAddr setEmail:from.stringValue];
|
||||
[fromAddr setName:@""];
|
||||
[msg setFrom:[NSSet setWithObject:fromAddr]];
|
||||
|
||||
[msg setSubject:subject.stringValue];
|
||||
[msg setBody:body.stringValue];
|
||||
|
||||
BOOL auth = ([useAuth state] == NSOnState);
|
||||
BOOL tls = ([useTLS state] == NSOnState);
|
||||
|
||||
NSString *serverValue = server.stringValue;
|
||||
NSString *usernameValue = username.stringValue;
|
||||
NSString *passwordValue = password.stringValue;
|
||||
int portValue = port.intValue;
|
||||
|
||||
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
|
||||
NSError *error;
|
||||
BOOL success = [CTSMTPConnection sendMessage:msg server:serverValue username:usernameValue
|
||||
password:passwordValue port:portValue useTLS:tls useAuth:auth error:&error];
|
||||
if (!success) {
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
[NSApp presentError:error];
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
@end
|
||||
+10
-4
@@ -1,25 +1,31 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<!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>English</string>
|
||||
<string>en</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>${EXECUTABLE_NAME}</string>
|
||||
<key>CFBundleIconFile</key>
|
||||
<string></string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>com.yourcompany.MessageSender</string>
|
||||
<string>centralatomics.${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>
|
||||
<string>1</string>
|
||||
<key>LSMinimumSystemVersion</key>
|
||||
<string>${MACOSX_DEPLOYMENT_TARGET}</string>
|
||||
<key>NSHumanReadableCopyright</key>
|
||||
<string>Copyright © 2012 __MyCompanyName__. All rights reserved.</string>
|
||||
<key>NSMainNibFile</key>
|
||||
<string>MainMenu</string>
|
||||
<key>NSPrincipalClass</key>
|
||||
@@ -0,0 +1,29 @@
|
||||
{\rtf0\ansi{\fonttbl\f0\fswiss Helvetica;}
|
||||
{\colortbl;\red255\green255\blue255;}
|
||||
\paperw9840\paperh8400
|
||||
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural
|
||||
|
||||
\f0\b\fs24 \cf0 Engineering:
|
||||
\b0 \
|
||||
Some people\
|
||||
\
|
||||
|
||||
\b Human Interface Design:
|
||||
\b0 \
|
||||
Some other people\
|
||||
\
|
||||
|
||||
\b Testing:
|
||||
\b0 \
|
||||
Hopefully not nobody\
|
||||
\
|
||||
|
||||
\b Documentation:
|
||||
\b0 \
|
||||
Whoever\
|
||||
\
|
||||
|
||||
\b With special thanks to:
|
||||
\b0 \
|
||||
Mom\
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
/* Localized versions of Info.plist keys */
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,14 @@
|
||||
//
|
||||
// main.m
|
||||
// MessageSender
|
||||
//
|
||||
// Created by Matt Ronge on 7/3/12.
|
||||
// Copyright (c) 2012 __MyCompanyName__. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
return NSApplicationMain(argc, (const char **)argv);
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
/* MyController */
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
#import <MailCore/MailCore.h>
|
||||
|
||||
@interface MyController : NSObject
|
||||
{
|
||||
IBOutlet id password;
|
||||
IBOutlet id port;
|
||||
IBOutlet id server;
|
||||
IBOutlet id username;
|
||||
IBOutlet id useAuth;
|
||||
IBOutlet id useTLS;
|
||||
|
||||
CTCoreMessage *myMessage;
|
||||
}
|
||||
- (IBAction)sendMessage:(id)sender;
|
||||
- (NSString *)to;
|
||||
- (void)setTo:(NSString *)aValue;
|
||||
- (NSString *)from;
|
||||
- (void)setFrom:(NSString *)aValue;
|
||||
- (NSString *)subject;
|
||||
- (void)setSubject:(NSString *)aValue;
|
||||
- (NSString *)body;
|
||||
- (void)setBody:(NSString *)aValue;
|
||||
|
||||
@end
|
||||
@@ -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
|
||||
@@ -1,14 +0,0 @@
|
||||
//
|
||||
// main.m
|
||||
// MessageSender
|
||||
//
|
||||
// Created by Matt Ronge on 3/26/06.
|
||||
// Copyright Cotingent 2006. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
return NSApplicationMain(argc, (const char **) argv);
|
||||
}
|
||||
@@ -228,8 +228,8 @@
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
F89195C8144D0C8900EADD16 /* MailCore.framework */,
|
||||
F89195CA144D0C8900EADD16 /* Tests.octest */,
|
||||
F89195CC144D0C8900EADD16 /* libmailcore.a */,
|
||||
F89195CA144D0C8900EADD16 /* Tests.octest */,
|
||||
);
|
||||
name = Products;
|
||||
sourceTree = "<group>";
|
||||
@@ -468,16 +468,8 @@
|
||||
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",
|
||||
);
|
||||
HEADER_SEARCH_PATHS = "\"$(BUILT_PRODUCTS_DIR)/../../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;
|
||||
};
|
||||
@@ -489,16 +481,8 @@
|
||||
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",
|
||||
);
|
||||
HEADER_SEARCH_PATHS = "\"$(BUILT_PRODUCTS_DIR)/../../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;
|
||||
};
|
||||
|
||||
@@ -7,6 +7,10 @@
|
||||
objects = {
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
0F134A871656D718000D1E83 /* types.plist in Resources */ = {isa = PBXBuildFile; fileRef = 0F134A861656D718000D1E83 /* types.plist */; };
|
||||
0F369D03162DF5030043A3ED /* CTXlistResult.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F369D01162DF5030043A3ED /* CTXlistResult.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
0F369D04162DF5030043A3ED /* CTXlistResult.m in Sources */ = {isa = PBXBuildFile; fileRef = 0F369D02162DF5030043A3ED /* CTXlistResult.m */; };
|
||||
0FFA954C16559D4F00A89EA0 /* CTXlistResult.m in Sources */ = {isa = PBXBuildFile; fileRef = 0F369D02162DF5030043A3ED /* CTXlistResult.m */; };
|
||||
2D538B45119803A6000AB4A2 /* CTSMTPAsyncConnection.h in Headers */ = {isa = PBXBuildFile; fileRef = 2D538B42119803A6000AB4A2 /* CTSMTPAsyncConnection.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
2D538B46119803A6000AB4A2 /* CTSMTPAsyncConnection.m in Sources */ = {isa = PBXBuildFile; fileRef = 2D538B43119803A6000AB4A2 /* CTSMTPAsyncConnection.m */; };
|
||||
2D538B48119803E2000AB4A2 /* CTSMTPAsyncConnection.m in Sources */ = {isa = PBXBuildFile; fileRef = 2D538B43119803A6000AB4A2 /* CTSMTPAsyncConnection.m */; };
|
||||
@@ -45,7 +49,6 @@
|
||||
F8483E4109CE7B9000B80440 /* libssl.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = F8483E4009CE7B9000B80440 /* libssl.dylib */; };
|
||||
F8483E4309CE7B9C00B80440 /* libiconv.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = F8483E4209CE7B9C00B80440 /* libiconv.dylib */; };
|
||||
F8483E4C09CE7C2800B80440 /* libcrypto.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = F8483E4B09CE7C2800B80440 /* libcrypto.dylib */; };
|
||||
F858CC4A0C51DE6B00EF1B3D /* (null) in Sources */ = {isa = PBXBuildFile; };
|
||||
F8618D0D10DAE1E600C41188 /* CTSMTPConnection.m in Sources */ = {isa = PBXBuildFile; fileRef = F81B885B0A74AA7100143DF6 /* CTSMTPConnection.m */; };
|
||||
F8618D0E10DAE1E600C41188 /* CTSMTP.m in Sources */ = {isa = PBXBuildFile; fileRef = F88CA0CD0BF7A7B00055AC29 /* CTSMTP.m */; };
|
||||
F8618D0F10DAE1E600C41188 /* CTESMTP.m in Sources */ = {isa = PBXBuildFile; fileRef = F88CA0D30BF7AC0B0055AC29 /* CTESMTP.m */; };
|
||||
@@ -61,38 +64,34 @@
|
||||
F8618D1910DAE1E600C41188 /* CTCoreAddress.m in Sources */ = {isa = PBXBuildFile; fileRef = F81B88530A74AA7100143DF6 /* CTCoreAddress.m */; };
|
||||
F8618D1A10DAE1E600C41188 /* CTCoreFolder.m in Sources */ = {isa = PBXBuildFile; fileRef = F81B88550A74AA7100143DF6 /* CTCoreFolder.m */; };
|
||||
F8618D1B10DAE1E600C41188 /* CTCoreMessage.m in Sources */ = {isa = PBXBuildFile; fileRef = F81B88570A74AA7100143DF6 /* CTCoreMessage.m */; };
|
||||
F8618D1C10DAE1E600C41188 /* (null) in Sources */ = {isa = PBXBuildFile; };
|
||||
F8618D1D10DAE1E600C41188 /* CTBareAttachment.m in Sources */ = {isa = PBXBuildFile; fileRef = F81E26690C6ED35C00B3FBAC /* CTBareAttachment.m */; };
|
||||
F8618D1E10DAE1E600C41188 /* MailCoreUtilities.m in Sources */ = {isa = PBXBuildFile; fileRef = F88804D60B4243C000D400E7 /* MailCoreUtilities.m */; };
|
||||
F8618D1F10DAE1EB00C41188 /* JRLog.m in Sources */ = {isa = PBXBuildFile; fileRef = F8A70EEE0C4059E100D1D694 /* JRLog.m */; };
|
||||
F86B542314F476170080FB8F /* CTSMTPConnection.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = F81B885A0A74AA7100143DF6 /* CTSMTPConnection.h */; };
|
||||
F86B542414F4761C0080FB8F /* CTSMTPAsyncConnection.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 2D538B42119803A6000AB4A2 /* CTSMTPAsyncConnection.h */; };
|
||||
F86B542514F4761E0080FB8F /* CTSMTP.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = F88CA0CC0BF7A7B00055AC29 /* CTSMTP.h */; };
|
||||
F86B542614F476200080FB8F /* CTESMTP.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = F88CA0D20BF7AC0B0055AC29 /* CTESMTP.h */; };
|
||||
F86B542714F476250080FB8F /* CTMIME_HtmlPart.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = F8EC5B0114C37F60006AF4D3 /* CTMIME_HtmlPart.h */; };
|
||||
F86B542814F476280080FB8F /* CTMIMEFactory.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = F8245A2F0C04089D005E08A8 /* CTMIMEFactory.h */; };
|
||||
F86B542914F4762A0080FB8F /* CTMIME_MessagePart.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = F81A8AD20C03FC3B002F780A /* CTMIME_MessagePart.h */; };
|
||||
F86B542A14F4762C0080FB8F /* CTMIME_MultiPart.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = F81A8AD40C03FC3B002F780A /* CTMIME_MultiPart.h */; };
|
||||
F86B542B14F4762E0080FB8F /* CTMIME_SinglePart.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = F81A8AD60C03FC3B002F780A /* CTMIME_SinglePart.h */; };
|
||||
F86B542C14F4762F0080FB8F /* CTMIME_TextPart.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = F81A8AD80C03FC3B002F780A /* CTMIME_TextPart.h */; };
|
||||
F86B542D14F476320080FB8F /* CTMIME.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = F81A8ADA0C03FC3B002F780A /* CTMIME.h */; };
|
||||
F86B542E14F476330080FB8F /* CTMIME_Enumerator.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = F8430BAF0C72B16000753941 /* CTMIME_Enumerator.h */; };
|
||||
F86B542F14F476350080FB8F /* CTCoreAttachment.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = F81E266C0C6ED4E100B3FBAC /* CTCoreAttachment.h */; };
|
||||
F86B543014F476390080FB8F /* CTCoreAddress.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = F81B88520A74AA7100143DF6 /* CTCoreAddress.h */; };
|
||||
F86B543114F4763F0080FB8F /* CTCoreAccount.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = F81B88500A74AA7100143DF6 /* CTCoreAccount.h */; };
|
||||
F86B543214F476420080FB8F /* CTCoreFolder.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = F81B88540A74AA7100143DF6 /* CTCoreFolder.h */; };
|
||||
F86B543314F476480080FB8F /* CTCoreMessage.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = F81B88560A74AA7100143DF6 /* CTCoreMessage.h */; };
|
||||
F86B543514F4764E0080FB8F /* CTBareAttachment.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = F81E26680C6ED35C00B3FBAC /* CTBareAttachment.h */; };
|
||||
F86B543614F476500080FB8F /* MailCoreUtilities.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = F88804D50B4243C000D400E7 /* MailCoreUtilities.h */; };
|
||||
F86B543714F476530080FB8F /* MailCore.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = F81B885C0A74AA7100143DF6 /* MailCore.h */; };
|
||||
F86B543814F476540080FB8F /* MailCoreTypes.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = F81B885D0A74AA7100143DF6 /* MailCoreTypes.h */; };
|
||||
F86B543914F476560080FB8F /* JRLog.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = F8A70EED0C4059E100D1D694 /* JRLog.h */; };
|
||||
F86B542314F476170080FB8F /* CTSMTPConnection.h in Headers */ = {isa = PBXBuildFile; fileRef = F81B885A0A74AA7100143DF6 /* CTSMTPConnection.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
F86B542414F4761C0080FB8F /* CTSMTPAsyncConnection.h in Headers */ = {isa = PBXBuildFile; fileRef = 2D538B42119803A6000AB4A2 /* CTSMTPAsyncConnection.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
F86B542514F4761E0080FB8F /* CTSMTP.h in Headers */ = {isa = PBXBuildFile; fileRef = F88CA0CC0BF7A7B00055AC29 /* CTSMTP.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
F86B542614F476200080FB8F /* CTESMTP.h in Headers */ = {isa = PBXBuildFile; fileRef = F88CA0D20BF7AC0B0055AC29 /* CTESMTP.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
F86B542714F476250080FB8F /* CTMIME_HtmlPart.h in Headers */ = {isa = PBXBuildFile; fileRef = F8EC5B0114C37F60006AF4D3 /* CTMIME_HtmlPart.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
F86B542814F476280080FB8F /* CTMIMEFactory.h in Headers */ = {isa = PBXBuildFile; fileRef = F8245A2F0C04089D005E08A8 /* CTMIMEFactory.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
F86B542914F4762A0080FB8F /* CTMIME_MessagePart.h in Headers */ = {isa = PBXBuildFile; fileRef = F81A8AD20C03FC3B002F780A /* CTMIME_MessagePart.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
F86B542A14F4762C0080FB8F /* CTMIME_MultiPart.h in Headers */ = {isa = PBXBuildFile; fileRef = F81A8AD40C03FC3B002F780A /* CTMIME_MultiPart.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
F86B542B14F4762E0080FB8F /* CTMIME_SinglePart.h in Headers */ = {isa = PBXBuildFile; fileRef = F81A8AD60C03FC3B002F780A /* CTMIME_SinglePart.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
F86B542C14F4762F0080FB8F /* CTMIME_TextPart.h in Headers */ = {isa = PBXBuildFile; fileRef = F81A8AD80C03FC3B002F780A /* CTMIME_TextPart.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
F86B542D14F476320080FB8F /* CTMIME.h in Headers */ = {isa = PBXBuildFile; fileRef = F81A8ADA0C03FC3B002F780A /* CTMIME.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
F86B542E14F476330080FB8F /* CTMIME_Enumerator.h in Headers */ = {isa = PBXBuildFile; fileRef = F8430BAF0C72B16000753941 /* CTMIME_Enumerator.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
F86B542F14F476350080FB8F /* CTCoreAttachment.h in Headers */ = {isa = PBXBuildFile; fileRef = F81E266C0C6ED4E100B3FBAC /* CTCoreAttachment.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
F86B543014F476390080FB8F /* CTCoreAddress.h in Headers */ = {isa = PBXBuildFile; fileRef = F81B88520A74AA7100143DF6 /* CTCoreAddress.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
F86B543114F4763F0080FB8F /* CTCoreAccount.h in Headers */ = {isa = PBXBuildFile; fileRef = F81B88500A74AA7100143DF6 /* CTCoreAccount.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
F86B543214F476420080FB8F /* CTCoreFolder.h in Headers */ = {isa = PBXBuildFile; fileRef = F81B88540A74AA7100143DF6 /* CTCoreFolder.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
F86B543314F476480080FB8F /* CTCoreMessage.h in Headers */ = {isa = PBXBuildFile; fileRef = F81B88560A74AA7100143DF6 /* CTCoreMessage.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
F86B543514F4764E0080FB8F /* CTBareAttachment.h in Headers */ = {isa = PBXBuildFile; fileRef = F81E26680C6ED35C00B3FBAC /* CTBareAttachment.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
F86B543614F476500080FB8F /* MailCoreUtilities.h in Headers */ = {isa = PBXBuildFile; fileRef = F88804D50B4243C000D400E7 /* MailCoreUtilities.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
F86B543714F476530080FB8F /* MailCore.h in Headers */ = {isa = PBXBuildFile; fileRef = F81B885C0A74AA7100143DF6 /* MailCore.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
F86B543814F476540080FB8F /* MailCoreTypes.h in Headers */ = {isa = PBXBuildFile; fileRef = F81B885D0A74AA7100143DF6 /* MailCoreTypes.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
F88804620B42018500D400E7 /* libsasl2.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = F88804610B42018500D400E7 /* libsasl2.dylib */; };
|
||||
F88804D70B4243C000D400E7 /* MailCoreUtilities.h in Headers */ = {isa = PBXBuildFile; fileRef = F88804D50B4243C000D400E7 /* MailCoreUtilities.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
F88804D80B4243C000D400E7 /* MailCoreUtilities.m in Sources */ = {isa = PBXBuildFile; fileRef = F88804D60B4243C000D400E7 /* MailCoreUtilities.m */; };
|
||||
F8886306158101A50088CF38 /* libmailcore.a in Frameworks */ = {isa = PBXBuildFile; fileRef = F8618B5710DADB5C00C41188 /* libmailcore.a */; };
|
||||
F88863071581021F0088CF38 /* CTCoreAttachmentTests.m in Sources */ = {isa = PBXBuildFile; fileRef = F81E272E0C6EDC6A00B3FBAC /* CTCoreAttachmentTests.m */; };
|
||||
F8886308158102220088CF38 /* (null) in Sources */ = {isa = PBXBuildFile; };
|
||||
F888630A1581023C0088CF38 /* libiconv.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = F88863091581023C0088CF38 /* libiconv.dylib */; };
|
||||
F888630B158102550088CF38 /* CTCoreAccountTests.m in Sources */ = {isa = PBXBuildFile; fileRef = F82D7D430F49279400ADA65C /* CTCoreAccountTests.m */; };
|
||||
F888630C158102660088CF38 /* CTCoreAddressTests.m in Sources */ = {isa = PBXBuildFile; fileRef = F8EA76120C1141C1004F85D8 /* CTCoreAddressTests.m */; };
|
||||
@@ -106,29 +105,6 @@
|
||||
F88CA0CF0BF7A7B00055AC29 /* CTSMTP.m in Sources */ = {isa = PBXBuildFile; fileRef = F88CA0CD0BF7A7B00055AC29 /* CTSMTP.m */; };
|
||||
F88CA0D40BF7AC0B0055AC29 /* CTESMTP.h in Headers */ = {isa = PBXBuildFile; fileRef = F88CA0D20BF7AC0B0055AC29 /* CTESMTP.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
F88CA0D50BF7AC0B0055AC29 /* CTESMTP.m in Sources */ = {isa = PBXBuildFile; fileRef = F88CA0D30BF7AC0B0055AC29 /* CTESMTP.m */; };
|
||||
F8A2FAB2144FA83700C03DB4 /* MailCore.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = F81B885C0A74AA7100143DF6 /* MailCore.h */; };
|
||||
F8A2FAB3144FA84C00C03DB4 /* CTCoreAttachment.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = F81E266C0C6ED4E100B3FBAC /* CTCoreAttachment.h */; };
|
||||
F8A2FAB4144FA85100C03DB4 /* CTCoreAccount.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = F81B88500A74AA7100143DF6 /* CTCoreAccount.h */; };
|
||||
F8A2FAB5144FA85300C03DB4 /* CTCoreAddress.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = F81B88520A74AA7100143DF6 /* CTCoreAddress.h */; };
|
||||
F8A2FAB6144FA85600C03DB4 /* CTCoreFolder.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = F81B88540A74AA7100143DF6 /* CTCoreFolder.h */; };
|
||||
F8A2FAB7144FA85900C03DB4 /* CTCoreMessage.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = F81B88560A74AA7100143DF6 /* CTCoreMessage.h */; };
|
||||
F8A2FAB9144FA85E00C03DB4 /* CTBareAttachment.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = F81E26680C6ED35C00B3FBAC /* CTBareAttachment.h */; };
|
||||
F8A2FABA144FA86300C03DB4 /* MailCoreUtilities.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = F88804D50B4243C000D400E7 /* MailCoreUtilities.h */; };
|
||||
F8A2FABB144FA86600C03DB4 /* MailCoreTypes.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = F81B885D0A74AA7100143DF6 /* MailCoreTypes.h */; };
|
||||
F8A2FABC144FA86900C03DB4 /* CTMIMEFactory.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = F8245A2F0C04089D005E08A8 /* CTMIMEFactory.h */; };
|
||||
F8A2FABD144FA86B00C03DB4 /* CTMIME_MessagePart.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = F81A8AD20C03FC3B002F780A /* CTMIME_MessagePart.h */; };
|
||||
F8A2FABE144FA86D00C03DB4 /* CTMIME_MultiPart.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = F81A8AD40C03FC3B002F780A /* CTMIME_MultiPart.h */; };
|
||||
F8A2FABF144FA86F00C03DB4 /* CTMIME_SinglePart.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = F81A8AD60C03FC3B002F780A /* CTMIME_SinglePart.h */; };
|
||||
F8A2FAC0144FA87100C03DB4 /* CTMIME_TextPart.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = F81A8AD80C03FC3B002F780A /* CTMIME_TextPart.h */; };
|
||||
F8A2FAC1144FA87300C03DB4 /* CTMIME.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = F81A8ADA0C03FC3B002F780A /* CTMIME.h */; };
|
||||
F8A2FAC2144FA87400C03DB4 /* CTMIME_Enumerator.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = F8430BAF0C72B16000753941 /* CTMIME_Enumerator.h */; };
|
||||
F8A2FAC3144FA87800C03DB4 /* CTSMTPConnection.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = F81B885A0A74AA7100143DF6 /* CTSMTPConnection.h */; };
|
||||
F8A2FAC4144FA87B00C03DB4 /* CTSMTPAsyncConnection.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 2D538B42119803A6000AB4A2 /* CTSMTPAsyncConnection.h */; };
|
||||
F8A2FAC5144FA87D00C03DB4 /* CTSMTP.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = F88CA0CC0BF7A7B00055AC29 /* CTSMTP.h */; };
|
||||
F8A2FAC6144FA88100C03DB4 /* CTESMTP.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = F88CA0D20BF7AC0B0055AC29 /* CTESMTP.h */; };
|
||||
F8A2FAC7144FA88F00C03DB4 /* JRLog.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = F8A70EED0C4059E100D1D694 /* JRLog.h */; };
|
||||
F8A70EEF0C4059E100D1D694 /* JRLog.h in Headers */ = {isa = PBXBuildFile; fileRef = F8A70EED0C4059E100D1D694 /* JRLog.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
F8A70EF00C4059E100D1D694 /* JRLog.m in Sources */ = {isa = PBXBuildFile; fileRef = F8A70EEE0C4059E100D1D694 /* JRLog.m */; };
|
||||
F8B245CE144BAC15002B56DA /* libetpan_ios.a in Frameworks */ = {isa = PBXBuildFile; fileRef = F8B245CA144BABA4002B56DA /* libetpan_ios.a */; };
|
||||
F8B6D4F0156EE189008DE9EB /* libetpan_mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = F8B6D4EC156EE173008DE9EB /* libetpan_mac.a */; };
|
||||
F8DFCF4C15801A5000C01975 /* SenTestingKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F8DFCF4B15801A5000C01975 /* SenTestingKit.framework */; };
|
||||
@@ -136,7 +112,7 @@
|
||||
F8DFCF5015801A5000C01975 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F8DFCF4F15801A5000C01975 /* Foundation.framework */; };
|
||||
F8DFCF5615801A5000C01975 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = F8DFCF5415801A5000C01975 /* InfoPlist.strings */; };
|
||||
F8DFCF7415801B3500C01975 /* libetpan_ios.a in Frameworks */ = {isa = PBXBuildFile; fileRef = F8B245CA144BABA4002B56DA /* libetpan_ios.a */; };
|
||||
F8EC5B0314C37F60006AF4D3 /* CTMIME_HtmlPart.h in Headers */ = {isa = PBXBuildFile; fileRef = F8EC5B0114C37F60006AF4D3 /* CTMIME_HtmlPart.h */; };
|
||||
F8EC5B0314C37F60006AF4D3 /* CTMIME_HtmlPart.h in Headers */ = {isa = PBXBuildFile; fileRef = F8EC5B0114C37F60006AF4D3 /* CTMIME_HtmlPart.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
F8EC5B0414C37F60006AF4D3 /* CTMIME_HtmlPart.m in Sources */ = {isa = PBXBuildFile; fileRef = F8EC5B0214C37F60006AF4D3 /* CTMIME_HtmlPart.m */; };
|
||||
F8EC5B0514C37F60006AF4D3 /* CTMIME_HtmlPart.m in Sources */ = {isa = PBXBuildFile; fileRef = F8EC5B0214C37F60006AF4D3 /* CTMIME_HtmlPart.m */; };
|
||||
F8EC5B0514C37F60006AF4D5 /* CTConnectedTest.m in Sources */ = {isa = PBXBuildFile; fileRef = F8EC5B0514C37F60006AF4D4 /* CTConnectedTest.m */; };
|
||||
@@ -237,73 +213,12 @@
|
||||
};
|
||||
/* End PBXContainerItemProxy section */
|
||||
|
||||
/* Begin PBXCopyFilesBuildPhase section */
|
||||
F86B542214F475DE0080FB8F /* CopyFiles */ = {
|
||||
isa = PBXCopyFilesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
dstPath = "$(SRCROOT)/include/MailCore";
|
||||
dstSubfolderSpec = 0;
|
||||
files = (
|
||||
F86B543914F476560080FB8F /* JRLog.h in CopyFiles */,
|
||||
F86B543814F476540080FB8F /* MailCoreTypes.h in CopyFiles */,
|
||||
F86B543714F476530080FB8F /* MailCore.h in CopyFiles */,
|
||||
F86B543614F476500080FB8F /* MailCoreUtilities.h in CopyFiles */,
|
||||
F86B543514F4764E0080FB8F /* CTBareAttachment.h in CopyFiles */,
|
||||
F86B543314F476480080FB8F /* CTCoreMessage.h in CopyFiles */,
|
||||
F86B543214F476420080FB8F /* CTCoreFolder.h in CopyFiles */,
|
||||
F86B543114F4763F0080FB8F /* CTCoreAccount.h in CopyFiles */,
|
||||
F86B543014F476390080FB8F /* CTCoreAddress.h in CopyFiles */,
|
||||
F86B542F14F476350080FB8F /* CTCoreAttachment.h in CopyFiles */,
|
||||
F86B542E14F476330080FB8F /* CTMIME_Enumerator.h in CopyFiles */,
|
||||
F86B542D14F476320080FB8F /* CTMIME.h in CopyFiles */,
|
||||
F86B542C14F4762F0080FB8F /* CTMIME_TextPart.h in CopyFiles */,
|
||||
F86B542B14F4762E0080FB8F /* CTMIME_SinglePart.h in CopyFiles */,
|
||||
F86B542A14F4762C0080FB8F /* CTMIME_MultiPart.h in CopyFiles */,
|
||||
F86B542914F4762A0080FB8F /* CTMIME_MessagePart.h in CopyFiles */,
|
||||
F86B542814F476280080FB8F /* CTMIMEFactory.h in CopyFiles */,
|
||||
F86B542714F476250080FB8F /* CTMIME_HtmlPart.h in CopyFiles */,
|
||||
F86B542314F476170080FB8F /* CTSMTPConnection.h in CopyFiles */,
|
||||
F86B542414F4761C0080FB8F /* CTSMTPAsyncConnection.h in CopyFiles */,
|
||||
F86B542514F4761E0080FB8F /* CTSMTP.h in CopyFiles */,
|
||||
F86B542614F476200080FB8F /* CTESMTP.h in CopyFiles */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
F8A2FAA9144FA7BA00C03DB4 /* CopyFiles */ = {
|
||||
isa = PBXCopyFilesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
dstPath = "$(SRCROOT)/include/MailCore";
|
||||
dstSubfolderSpec = 0;
|
||||
files = (
|
||||
F8A2FAC3144FA87800C03DB4 /* CTSMTPConnection.h in CopyFiles */,
|
||||
F8A2FAC7144FA88F00C03DB4 /* JRLog.h in CopyFiles */,
|
||||
F8A2FAC1144FA87300C03DB4 /* CTMIME.h in CopyFiles */,
|
||||
F8A2FAC2144FA87400C03DB4 /* CTMIME_Enumerator.h in CopyFiles */,
|
||||
F8A2FAC0144FA87100C03DB4 /* CTMIME_TextPart.h in CopyFiles */,
|
||||
F8A2FABF144FA86F00C03DB4 /* CTMIME_SinglePart.h in CopyFiles */,
|
||||
F8A2FABE144FA86D00C03DB4 /* CTMIME_MultiPart.h in CopyFiles */,
|
||||
F8A2FABC144FA86900C03DB4 /* CTMIMEFactory.h in CopyFiles */,
|
||||
F8A2FAB2144FA83700C03DB4 /* MailCore.h in CopyFiles */,
|
||||
F8A2FABD144FA86B00C03DB4 /* CTMIME_MessagePart.h in CopyFiles */,
|
||||
F8A2FABA144FA86300C03DB4 /* MailCoreUtilities.h in CopyFiles */,
|
||||
F8A2FAC6144FA88100C03DB4 /* CTESMTP.h in CopyFiles */,
|
||||
F8A2FABB144FA86600C03DB4 /* MailCoreTypes.h in CopyFiles */,
|
||||
F8A2FAB9144FA85E00C03DB4 /* CTBareAttachment.h in CopyFiles */,
|
||||
F8A2FAB7144FA85900C03DB4 /* CTCoreMessage.h in CopyFiles */,
|
||||
F8A2FAC5144FA87D00C03DB4 /* CTSMTP.h in CopyFiles */,
|
||||
F8A2FAB6144FA85600C03DB4 /* CTCoreFolder.h in CopyFiles */,
|
||||
F8A2FAB5144FA85300C03DB4 /* CTCoreAddress.h in CopyFiles */,
|
||||
F8A2FAC4144FA87B00C03DB4 /* CTSMTPAsyncConnection.h in CopyFiles */,
|
||||
F8A2FAB3144FA84C00C03DB4 /* CTCoreAttachment.h in CopyFiles */,
|
||||
F8A2FAB4144FA85100C03DB4 /* CTCoreAccount.h in CopyFiles */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXCopyFilesBuildPhase section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
0867D69BFE84028FC02AAC07 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = "<absolute>"; };
|
||||
0867D6A5FE840307C02AAC07 /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = "<absolute>"; };
|
||||
0F134A861656D718000D1E83 /* types.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = types.plist; path = Resources/types.plist; sourceTree = "<group>"; };
|
||||
0F369D01162DF5030043A3ED /* CTXlistResult.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CTXlistResult.h; path = Source/CTXlistResult.h; sourceTree = "<group>"; };
|
||||
0F369D02162DF5030043A3ED /* CTXlistResult.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CTXlistResult.m; path = Source/CTXlistResult.m; sourceTree = "<group>"; };
|
||||
1058C7B1FEA5585E11CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = "<absolute>"; };
|
||||
2D538B42119803A6000AB4A2 /* CTSMTPAsyncConnection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CTSMTPAsyncConnection.h; path = Source/CTSMTPAsyncConnection.h; sourceTree = SOURCE_ROOT; };
|
||||
2D538B43119803A6000AB4A2 /* CTSMTPAsyncConnection.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CTSMTPAsyncConnection.m; path = Source/CTSMTPAsyncConnection.m; sourceTree = SOURCE_ROOT; };
|
||||
@@ -327,7 +242,7 @@
|
||||
F81B88530A74AA7100143DF6 /* CTCoreAddress.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = CTCoreAddress.m; path = Source/CTCoreAddress.m; sourceTree = SOURCE_ROOT; };
|
||||
F81B88540A74AA7100143DF6 /* CTCoreFolder.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = CTCoreFolder.h; path = Source/CTCoreFolder.h; sourceTree = SOURCE_ROOT; };
|
||||
F81B88550A74AA7100143DF6 /* CTCoreFolder.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = CTCoreFolder.m; path = Source/CTCoreFolder.m; sourceTree = SOURCE_ROOT; };
|
||||
F81B88560A74AA7100143DF6 /* CTCoreMessage.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = CTCoreMessage.h; path = Source/CTCoreMessage.h; sourceTree = SOURCE_ROOT; };
|
||||
F81B88560A74AA7100143DF6 /* CTCoreMessage.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; lineEnding = 0; name = CTCoreMessage.h; path = Source/CTCoreMessage.h; sourceTree = SOURCE_ROOT; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; };
|
||||
F81B88570A74AA7100143DF6 /* CTCoreMessage.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = CTCoreMessage.m; path = Source/CTCoreMessage.m; sourceTree = SOURCE_ROOT; };
|
||||
F81B885A0A74AA7100143DF6 /* CTSMTPConnection.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = CTSMTPConnection.h; path = Source/CTSMTPConnection.h; sourceTree = "<group>"; };
|
||||
F81B885B0A74AA7100143DF6 /* CTSMTPConnection.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = CTSMTPConnection.m; path = Source/CTSMTPConnection.m; sourceTree = "<group>"; };
|
||||
@@ -363,8 +278,6 @@
|
||||
F88CA0D20BF7AC0B0055AC29 /* CTESMTP.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CTESMTP.h; path = Source/CTESMTP.h; sourceTree = "<group>"; };
|
||||
F88CA0D30BF7AC0B0055AC29 /* CTESMTP.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CTESMTP.m; path = Source/CTESMTP.m; sourceTree = "<group>"; };
|
||||
F890D38D10CEECD50039817C /* libetpan.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = libetpan.xcodeproj; path = "libetpan/build-mac/libetpan.xcodeproj"; sourceTree = SOURCE_ROOT; };
|
||||
F8A70EED0C4059E100D1D694 /* JRLog.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = JRLog.h; path = Source/JRLog.h; sourceTree = "<group>"; };
|
||||
F8A70EEE0C4059E100D1D694 /* JRLog.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = JRLog.m; path = Source/JRLog.m; sourceTree = "<group>"; };
|
||||
F8D31A3109C524EA00468234 /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
|
||||
F8DFAB0410541708003D3CC1 /* libetpan.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = libetpan.framework; path = "OpenSourceProjects/libetpan-0.58/build-mac/build/Release/libetpan.framework"; sourceTree = "<group>"; };
|
||||
F8DFCF4915801A5000C01975 /* Tests.octest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = Tests.octest; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
@@ -470,6 +383,7 @@
|
||||
089C1665FE841158C02AAC07 /* Resources */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
0F134A861656D718000D1E83 /* types.plist */,
|
||||
F81B88700A74AAD800143DF6 /* Info.plist */,
|
||||
);
|
||||
name = Resources;
|
||||
@@ -492,6 +406,8 @@
|
||||
F81B88570A74AA7100143DF6 /* CTCoreMessage.m */,
|
||||
F81E26680C6ED35C00B3FBAC /* CTBareAttachment.h */,
|
||||
F81E26690C6ED35C00B3FBAC /* CTBareAttachment.m */,
|
||||
0F369D01162DF5030043A3ED /* CTXlistResult.h */,
|
||||
0F369D02162DF5030043A3ED /* CTXlistResult.m */,
|
||||
F88804D50B4243C000D400E7 /* MailCoreUtilities.h */,
|
||||
F88804D60B4243C000D400E7 /* MailCoreUtilities.m */,
|
||||
F81B885C0A74AA7100143DF6 /* MailCore.h */,
|
||||
@@ -527,8 +443,6 @@
|
||||
32C88DFF0371C24200C91783 /* Other Sources */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
F8A70EED0C4059E100D1D694 /* JRLog.h */,
|
||||
F8A70EEE0C4059E100D1D694 /* JRLog.m */,
|
||||
F81B88710A74AAD800143DF6 /* MailCore_Prefix.pch */,
|
||||
F8D31A3109C524EA00468234 /* main.m */,
|
||||
);
|
||||
@@ -667,12 +581,40 @@
|
||||
F81A8AE20C03FC3B002F780A /* CTMIME_TextPart.h in Headers */,
|
||||
F81A8AE40C03FC3B002F780A /* CTMIME.h in Headers */,
|
||||
F8245A6D0C041C8C005E08A8 /* CTMIMEFactory.h in Headers */,
|
||||
F8A70EEF0C4059E100D1D694 /* JRLog.h in Headers */,
|
||||
F81E266A0C6ED35C00B3FBAC /* CTBareAttachment.h in Headers */,
|
||||
F81E266E0C6ED4E100B3FBAC /* CTCoreAttachment.h in Headers */,
|
||||
F8430BB10C72B16000753941 /* CTMIME_Enumerator.h in Headers */,
|
||||
2D538B45119803A6000AB4A2 /* CTSMTPAsyncConnection.h in Headers */,
|
||||
F8EC5B0314C37F60006AF4D3 /* CTMIME_HtmlPart.h in Headers */,
|
||||
0F369D03162DF5030043A3ED /* CTXlistResult.h in Headers */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
F831808C15AE74CE00448FC5 /* Headers */ = {
|
||||
isa = PBXHeadersBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
F86B543814F476540080FB8F /* MailCoreTypes.h in Headers */,
|
||||
F86B543714F476530080FB8F /* MailCore.h in Headers */,
|
||||
F86B543614F476500080FB8F /* MailCoreUtilities.h in Headers */,
|
||||
F86B543514F4764E0080FB8F /* CTBareAttachment.h in Headers */,
|
||||
F86B543314F476480080FB8F /* CTCoreMessage.h in Headers */,
|
||||
F86B543214F476420080FB8F /* CTCoreFolder.h in Headers */,
|
||||
F86B543114F4763F0080FB8F /* CTCoreAccount.h in Headers */,
|
||||
F86B543014F476390080FB8F /* CTCoreAddress.h in Headers */,
|
||||
F86B542F14F476350080FB8F /* CTCoreAttachment.h in Headers */,
|
||||
F86B542E14F476330080FB8F /* CTMIME_Enumerator.h in Headers */,
|
||||
F86B542D14F476320080FB8F /* CTMIME.h in Headers */,
|
||||
F86B542C14F4762F0080FB8F /* CTMIME_TextPart.h in Headers */,
|
||||
F86B542B14F4762E0080FB8F /* CTMIME_SinglePart.h in Headers */,
|
||||
F86B542A14F4762C0080FB8F /* CTMIME_MultiPart.h in Headers */,
|
||||
F86B542914F4762A0080FB8F /* CTMIME_MessagePart.h in Headers */,
|
||||
F86B542814F476280080FB8F /* CTMIMEFactory.h in Headers */,
|
||||
F86B542714F476250080FB8F /* CTMIME_HtmlPart.h in Headers */,
|
||||
F86B542314F476170080FB8F /* CTSMTPConnection.h in Headers */,
|
||||
F86B542414F4761C0080FB8F /* CTSMTPAsyncConnection.h in Headers */,
|
||||
F86B542514F4761E0080FB8F /* CTSMTP.h in Headers */,
|
||||
F86B542614F476200080FB8F /* CTESMTP.h in Headers */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
@@ -689,7 +631,6 @@
|
||||
8DC2EF540486A6940098B216 /* Sources */,
|
||||
8DC2EF560486A6940098B216 /* Frameworks */,
|
||||
F848422D09CFACA000B80440 /* ShellScript */,
|
||||
F8A2FAA9144FA7BA00C03DB4 /* CopyFiles */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
@@ -708,7 +649,7 @@
|
||||
buildPhases = (
|
||||
F8618B5410DADB5C00C41188 /* Sources */,
|
||||
F8618B5510DADB5C00C41188 /* Frameworks */,
|
||||
F86B542214F475DE0080FB8F /* CopyFiles */,
|
||||
F831808C15AE74CE00448FC5 /* Headers */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
@@ -749,7 +690,7 @@
|
||||
0867D690FE84028FC02AAC07 /* Project object */ = {
|
||||
isa = PBXProject;
|
||||
attributes = {
|
||||
LastUpgradeCheck = 0430;
|
||||
LastUpgradeCheck = 0450;
|
||||
};
|
||||
buildConfigurationList = 1DEB91B108733DA50010E9CD /* Build configuration list for PBXProject "MailCore" */;
|
||||
compatibilityVersion = "Xcode 3.2";
|
||||
@@ -834,6 +775,7 @@
|
||||
isa = PBXResourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
0F134A871656D718000D1E83 /* types.plist in Resources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
@@ -908,13 +850,12 @@
|
||||
F81A8AE30C03FC3B002F780A /* CTMIME_TextPart.m in Sources */,
|
||||
F81A8AE50C03FC3B002F780A /* CTMIME.m in Sources */,
|
||||
F8245A700C041C91005E08A8 /* CTMIMEFactory.m in Sources */,
|
||||
F8A70EF00C4059E100D1D694 /* JRLog.m in Sources */,
|
||||
F858CC4A0C51DE6B00EF1B3D /* (null) in Sources */,
|
||||
F81E266B0C6ED35C00B3FBAC /* CTBareAttachment.m in Sources */,
|
||||
F81E266F0C6ED4E100B3FBAC /* CTCoreAttachment.m in Sources */,
|
||||
F8430BB20C72B16000753941 /* CTMIME_Enumerator.m in Sources */,
|
||||
2D538B46119803A6000AB4A2 /* CTSMTPAsyncConnection.m in Sources */,
|
||||
F8EC5B0414C37F60006AF4D3 /* CTMIME_HtmlPart.m in Sources */,
|
||||
0F369D04162DF5030043A3ED /* CTXlistResult.m in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
@@ -922,7 +863,7 @@
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
F8618D1F10DAE1EB00C41188 /* JRLog.m in Sources */,
|
||||
0FFA954C16559D4F00A89EA0 /* CTXlistResult.m in Sources */,
|
||||
F8618D0D10DAE1E600C41188 /* CTSMTPConnection.m in Sources */,
|
||||
F8618D0E10DAE1E600C41188 /* CTSMTP.m in Sources */,
|
||||
F8618D0F10DAE1E600C41188 /* CTESMTP.m in Sources */,
|
||||
@@ -938,7 +879,6 @@
|
||||
F8618D1910DAE1E600C41188 /* CTCoreAddress.m in Sources */,
|
||||
F8618D1A10DAE1E600C41188 /* CTCoreFolder.m in Sources */,
|
||||
F8618D1B10DAE1E600C41188 /* CTCoreMessage.m in Sources */,
|
||||
F8618D1C10DAE1E600C41188 /* (null) in Sources */,
|
||||
F8618D1D10DAE1E600C41188 /* CTBareAttachment.m in Sources */,
|
||||
F8618D1E10DAE1E600C41188 /* MailCoreUtilities.m in Sources */,
|
||||
2D538B48119803E2000AB4A2 /* CTSMTPAsyncConnection.m in Sources */,
|
||||
@@ -954,7 +894,6 @@
|
||||
F888630D158102680088CF38 /* CTCoreMessageTests.m in Sources */,
|
||||
F888630C158102660088CF38 /* CTCoreAddressTests.m in Sources */,
|
||||
F88863071581021F0088CF38 /* CTCoreAttachmentTests.m in Sources */,
|
||||
F8886308158102220088CF38 /* (null) in Sources */,
|
||||
F888630B158102550088CF38 /* CTCoreAccountTests.m in Sources */,
|
||||
F8EC5B0514C37F60006AF4D5 /* CTConnectedTest.m in Sources */,
|
||||
F8EC5B0514C37F60006AF4D8 /* CTCoreFolderTests.m in Sources */,
|
||||
@@ -1016,7 +955,10 @@
|
||||
1DEB91AE08733DA50010E9CD /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
|
||||
COMBINE_HIDPI_IMAGES = YES;
|
||||
COPY_PHASE_STRIP = NO;
|
||||
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||
DYLIB_COMPATIBILITY_VERSION = 1;
|
||||
DYLIB_CURRENT_VERSION = 1;
|
||||
FRAMEWORK_SEARCH_PATHS = (
|
||||
@@ -1050,6 +992,9 @@
|
||||
1DEB91AF08733DA50010E9CD /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
|
||||
COMBINE_HIDPI_IMAGES = YES;
|
||||
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||
DYLIB_COMPATIBILITY_VERSION = 1;
|
||||
DYLIB_CURRENT_VERSION = 1;
|
||||
FRAMEWORK_SEARCH_PATHS = (
|
||||
@@ -1081,6 +1026,7 @@
|
||||
1DEB91B208733DA50010E9CD /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||
GCC_C_LANGUAGE_STANDARD = "compiler-default";
|
||||
GCC_ENABLE_OBJC_EXCEPTIONS = YES;
|
||||
GCC_TREAT_WARNINGS_AS_ERRORS = YES;
|
||||
@@ -1088,9 +1034,7 @@
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
HEADER_SEARCH_PATHS = "libetpan/build-mac/include/**";
|
||||
LIBRARY_SEARCH_PATHS = "";
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.6;
|
||||
SDKROOT = macosx;
|
||||
SYMROOT = build;
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
@@ -1098,6 +1042,7 @@
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
DEAD_CODE_STRIPPING = YES;
|
||||
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||
GCC_C_LANGUAGE_STANDARD = "compiler-default";
|
||||
GCC_ENABLE_OBJC_EXCEPTIONS = YES;
|
||||
GCC_TREAT_WARNINGS_AS_ERRORS = YES;
|
||||
@@ -1105,9 +1050,7 @@
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
HEADER_SEARCH_PATHS = "libetpan/build-mac/include/**";
|
||||
LIBRARY_SEARCH_PATHS = "";
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.6;
|
||||
SDKROOT = macosx;
|
||||
SYMROOT = build;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
@@ -1119,9 +1062,12 @@
|
||||
COPY_PHASE_STRIP = NO;
|
||||
GCC_DYNAMIC_NO_PIC = NO;
|
||||
GCC_OPTIMIZATION_LEVEL = 0;
|
||||
ONLY_ACTIVE_ARCH = YES;
|
||||
ONLY_ACTIVE_ARCH = NO;
|
||||
PRIVATE_HEADERS_FOLDER_PATH = ../../include/MailCore/Private;
|
||||
PRODUCT_NAME = mailcore;
|
||||
PUBLIC_HEADERS_FOLDER_PATH = ../../include/MailCore;
|
||||
SDKROOT = iphoneos;
|
||||
SKIP_INSTALL = YES;
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
@@ -1133,8 +1079,11 @@
|
||||
COPY_PHASE_STRIP = YES;
|
||||
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||
ONLY_ACTIVE_ARCH = NO;
|
||||
PRIVATE_HEADERS_FOLDER_PATH = ../../include/MailCore/Private;
|
||||
PRODUCT_NAME = mailcore;
|
||||
PUBLIC_HEADERS_FOLDER_PATH = ../../include/MailCore;
|
||||
SDKROOT = iphoneos;
|
||||
SKIP_INSTALL = YES;
|
||||
ZERO_LINK = NO;
|
||||
};
|
||||
name = Release;
|
||||
|
||||
@@ -5,37 +5,23 @@
|
||||
\/_/ \/_/ \/_/\/_/ \/_/ \/_____/ \/_____/ \/_____/ \/_/ /_/ \/_____/
|
||||
|
||||
|
||||
Getting Started
|
||||
---------------
|
||||
##Getting the code
|
||||
|
||||
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
|
||||
git submodule update --init
|
||||
|
||||
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
|
||||
##Website
|
||||
|
||||
- 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
|
||||
The official site contains documentation, FAQs, and step by step instructions on how to include MailCore
|
||||
|
||||
http://www.libmailcore.com
|
||||
|
||||
Contact
|
||||
-------
|
||||
Thanks,
|
||||
|
||||
If you have any questions contact me:
|
||||
|
||||
Matt Ronge
|
||||
|
||||
mronge@mronge.com
|
||||
Matt Ronge
|
||||
[@mronge](http://www.twitter.com/mronge)
|
||||
@@ -0,0 +1,568 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>application/andrew-inset</key>
|
||||
<array>
|
||||
<string>ez</string>
|
||||
</array>
|
||||
<key>application/java-archive</key>
|
||||
<array>
|
||||
<string>jar</string>
|
||||
</array>
|
||||
<key>application/mac-binhex40</key>
|
||||
<array>
|
||||
<string>hqx</string>
|
||||
</array>
|
||||
<key>application/mac-compactpro</key>
|
||||
<array>
|
||||
<string>cpt</string>
|
||||
</array>
|
||||
<key>application/msword</key>
|
||||
<array>
|
||||
<string>doc</string>
|
||||
</array>
|
||||
<key>application/octet-stream</key>
|
||||
<array>
|
||||
<string>dms</string>
|
||||
<string>lha</string>
|
||||
<string>lzh</string>
|
||||
<string>exe</string>
|
||||
<string>class</string>
|
||||
<string>so</string>
|
||||
<string>dll</string>
|
||||
<string>iso</string>
|
||||
<string>fla</string>
|
||||
</array>
|
||||
<key>application/oda</key>
|
||||
<array>
|
||||
<string>oda</string>
|
||||
</array>
|
||||
<key>application/pdf</key>
|
||||
<array>
|
||||
<string>pdf</string>
|
||||
</array>
|
||||
<key>application/postscript</key>
|
||||
<array>
|
||||
<string>eps</string>
|
||||
<string>ai</string>
|
||||
<string>ps</string>
|
||||
</array>
|
||||
<key>application/smil</key>
|
||||
<array>
|
||||
<string>smil</string>
|
||||
</array>
|
||||
<key>application/vnd.adobe.xdp+xml</key>
|
||||
<array>
|
||||
<string>xdp</string>
|
||||
</array>
|
||||
<key>application/vnd.adobe.xfd+xml</key>
|
||||
<array>
|
||||
<string>xfd</string>
|
||||
</array>
|
||||
<key>application/vnd.adobe.xfdf</key>
|
||||
<array>
|
||||
<string>xfdf</string>
|
||||
</array>
|
||||
<key>application/vnd.fdf</key>
|
||||
<array>
|
||||
<string>fdf</string>
|
||||
</array>
|
||||
<key>application/vnd.mif</key>
|
||||
<array>
|
||||
<string>mif</string>
|
||||
</array>
|
||||
<key>application/vnd.ms-excel</key>
|
||||
<array>
|
||||
<string>xls</string>
|
||||
</array>
|
||||
<key>application/vnd.ms-powerpoint</key>
|
||||
<array>
|
||||
<string>ppt</string>
|
||||
</array>
|
||||
<key>application/vnd.wap.wbxml</key>
|
||||
<array>
|
||||
<string>wbxml</string>
|
||||
</array>
|
||||
<key>application/vnd.wap.wmlc</key>
|
||||
<array>
|
||||
<string>wmlc</string>
|
||||
</array>
|
||||
<key>application/vnd.wap.wmlscriptc</key>
|
||||
<array>
|
||||
<string>wmlsc</string>
|
||||
</array>
|
||||
<key>application/x-bcpio</key>
|
||||
<array>
|
||||
<string>bcpio</string>
|
||||
</array>
|
||||
<key>application/x-cdlink</key>
|
||||
<array>
|
||||
<string>vcd</string>
|
||||
</array>
|
||||
<key>application/x-chess-pgn</key>
|
||||
<array>
|
||||
<string>pgn</string>
|
||||
</array>
|
||||
<key>application/x-compress</key>
|
||||
<array>
|
||||
<string>Z</string>
|
||||
</array>
|
||||
<key>application/x-cpio</key>
|
||||
<array>
|
||||
<string>cpio</string>
|
||||
</array>
|
||||
<key>application/x-csh</key>
|
||||
<array>
|
||||
<string>csh</string>
|
||||
</array>
|
||||
<key>application/x-director</key>
|
||||
<array>
|
||||
<string>dcr</string>
|
||||
<string>dir</string>
|
||||
<string>dxr</string>
|
||||
</array>
|
||||
<key>application/x-diskcopy</key>
|
||||
<array>
|
||||
<string>smi</string>
|
||||
<string>dmg</string>
|
||||
</array>
|
||||
<key>application/x-dvi</key>
|
||||
<array>
|
||||
<string>dvi</string>
|
||||
</array>
|
||||
<key>application/x-filemaker</key>
|
||||
<array>
|
||||
<string>fp6</string>
|
||||
<string>fp5</string>
|
||||
<string>fp4</string>
|
||||
<string>fp3</string>
|
||||
<string>fp2</string>
|
||||
<string>fp</string>
|
||||
</array>
|
||||
<key>application/x-futuresplash</key>
|
||||
<array>
|
||||
<string>spl</string>
|
||||
</array>
|
||||
<key>application/x-gtar</key>
|
||||
<array>
|
||||
<string>gtar</string>
|
||||
</array>
|
||||
<key>application/x-gzip</key>
|
||||
<array>
|
||||
<string>gz</string>
|
||||
<string>tgz</string>
|
||||
<string>cpgz</string>
|
||||
</array>
|
||||
<key>application/x-hdf</key>
|
||||
<array>
|
||||
<string>hdf</string>
|
||||
</array>
|
||||
<key>application/x-java-jnlp-file</key>
|
||||
<array>
|
||||
<string>jnlp</string>
|
||||
</array>
|
||||
<key>application/x-javascript</key>
|
||||
<array>
|
||||
<string>js</string>
|
||||
</array>
|
||||
<key>application/x-koan</key>
|
||||
<array>
|
||||
<string>skp</string>
|
||||
<string>skd</string>
|
||||
<string>skt</string>
|
||||
<string>skm</string>
|
||||
</array>
|
||||
<key>application/x-latex</key>
|
||||
<array>
|
||||
<string>latex</string>
|
||||
</array>
|
||||
<key>application/x-ms-wmd</key>
|
||||
<array>
|
||||
<string>wmd</string>
|
||||
</array>
|
||||
<key>application/x-netcdf</key>
|
||||
<array>
|
||||
<string>nc</string>
|
||||
<string>cdf</string>
|
||||
</array>
|
||||
<key>application/x-photoshop</key>
|
||||
<array>
|
||||
<string>psd</string>
|
||||
</array>
|
||||
<key>application/x-sh</key>
|
||||
<array>
|
||||
<string>sh</string>
|
||||
</array>
|
||||
<key>application/x-shar</key>
|
||||
<array>
|
||||
<string>shar</string>
|
||||
</array>
|
||||
<key>application/x-shockwave-flash</key>
|
||||
<array>
|
||||
<string>swf</string>
|
||||
</array>
|
||||
<key>application/x-stuffit</key>
|
||||
<array>
|
||||
<string>sit</string>
|
||||
</array>
|
||||
<key>application/x-sv4cpio</key>
|
||||
<array>
|
||||
<string>sv4cpio</string>
|
||||
</array>
|
||||
<key>application/x-sv4crc</key>
|
||||
<array>
|
||||
<string>sv4crc</string>
|
||||
</array>
|
||||
<key>application/x-tar</key>
|
||||
<array>
|
||||
<string>tar</string>
|
||||
</array>
|
||||
<key>application/x-tcl</key>
|
||||
<array>
|
||||
<string>tcl</string>
|
||||
</array>
|
||||
<key>application/x-tex</key>
|
||||
<array>
|
||||
<string>tex</string>
|
||||
</array>
|
||||
<key>application/x-texinfo</key>
|
||||
<array>
|
||||
<string>texinfo</string>
|
||||
<string>texi</string>
|
||||
</array>
|
||||
<key>application/x-troff</key>
|
||||
<array>
|
||||
<string>t</string>
|
||||
<string>tr</string>
|
||||
<string>roff</string>
|
||||
</array>
|
||||
<key>application/x-troff-man</key>
|
||||
<array>
|
||||
<string>man</string>
|
||||
</array>
|
||||
<key>application/x-troff-me</key>
|
||||
<array>
|
||||
<string>me</string>
|
||||
</array>
|
||||
<key>application/x-troff-ms</key>
|
||||
<array>
|
||||
<string>ms</string>
|
||||
</array>
|
||||
<key>application/x-ustar</key>
|
||||
<array>
|
||||
<string>ustar</string>
|
||||
</array>
|
||||
<key>application/x-wais-source</key>
|
||||
<array>
|
||||
<string>src</string>
|
||||
</array>
|
||||
<key>application/x-webarchive</key>
|
||||
<array>
|
||||
<string>webarchive</string>
|
||||
</array>
|
||||
<key>application/xhtml+xml</key>
|
||||
<array>
|
||||
<string>xhtml</string>
|
||||
<string>xhtm</string>
|
||||
</array>
|
||||
<key>application/xml</key>
|
||||
<array>
|
||||
<string>xml</string>
|
||||
</array>
|
||||
<key>application/zip</key>
|
||||
<array>
|
||||
<string>zip</string>
|
||||
</array>
|
||||
<key>audio/basic</key>
|
||||
<array>
|
||||
<string>au</string>
|
||||
<string>snd</string>
|
||||
</array>
|
||||
<key>audio/midi</key>
|
||||
<array>
|
||||
<string>mid</string>
|
||||
<string>midi</string>
|
||||
<string>kar</string>
|
||||
</array>
|
||||
<key>audio/mpeg</key>
|
||||
<array>
|
||||
<string>mp3</string>
|
||||
<string>mpga</string>
|
||||
<string>mp2</string>
|
||||
</array>
|
||||
<key>audio/scpls</key>
|
||||
<array>
|
||||
<string>pls</string>
|
||||
</array>
|
||||
<key>audio/x-aiff</key>
|
||||
<array>
|
||||
<string>aif</string>
|
||||
<string>aiff</string>
|
||||
<string>aifc</string>
|
||||
</array>
|
||||
<key>audio/x-m4p</key>
|
||||
<array>
|
||||
<string>m4p</string>
|
||||
</array>
|
||||
<key>audio/x-mpegurl</key>
|
||||
<array>
|
||||
<string>m3u</string>
|
||||
</array>
|
||||
<key>audio/x-ms-wma</key>
|
||||
<array>
|
||||
<string>wma</string>
|
||||
</array>
|
||||
<key>audio/x-pn-realaudio</key>
|
||||
<array>
|
||||
<string>ram</string>
|
||||
<string>rm</string>
|
||||
</array>
|
||||
<key>audio/x-pn-realaudio-plugin</key>
|
||||
<array>
|
||||
<string>rpm</string>
|
||||
</array>
|
||||
<key>audio/x-realaudio</key>
|
||||
<array>
|
||||
<string>ra</string>
|
||||
</array>
|
||||
<key>audio/x-wav</key>
|
||||
<array>
|
||||
<string>wav</string>
|
||||
</array>
|
||||
<key>chemical/x-pdb</key>
|
||||
<array>
|
||||
<string>pdb</string>
|
||||
</array>
|
||||
<key>chemical/x-xyz</key>
|
||||
<array>
|
||||
<string>xyz</string>
|
||||
</array>
|
||||
<key>image/bmp</key>
|
||||
<array>
|
||||
<string>bmp</string>
|
||||
</array>
|
||||
<key>image/gif</key>
|
||||
<array>
|
||||
<string>gif</string>
|
||||
</array>
|
||||
<key>image/ief</key>
|
||||
<array>
|
||||
<string>ief</string>
|
||||
</array>
|
||||
<key>image/jp2</key>
|
||||
<array>
|
||||
<string>jp2</string>
|
||||
</array>
|
||||
<key>image/jpeg</key>
|
||||
<array>
|
||||
<string>jpg</string>
|
||||
<string>jpeg</string>
|
||||
<string>jpe</string>
|
||||
</array>
|
||||
<key>image/pict</key>
|
||||
<array>
|
||||
<string>pict</string>
|
||||
<string>pic</string>
|
||||
</array>
|
||||
<key>image/png</key>
|
||||
<array>
|
||||
<string>png</string>
|
||||
</array>
|
||||
<key>image/quicktime</key>
|
||||
<array>
|
||||
<string>qti</string>
|
||||
<string>qtif</string>
|
||||
</array>
|
||||
<key>image/svg+xml</key>
|
||||
<array>
|
||||
<string>svg</string>
|
||||
<string>svgz</string>
|
||||
</array>
|
||||
<key>image/tiff</key>
|
||||
<array>
|
||||
<string>tiff</string>
|
||||
<string>tif</string>
|
||||
</array>
|
||||
<key>image/vnd.wap.wbmp</key>
|
||||
<array>
|
||||
<string>wbmp</string>
|
||||
</array>
|
||||
<key>image/x-cmu-raster</key>
|
||||
<array>
|
||||
<string>ras</string>
|
||||
</array>
|
||||
<key>image/x-icon</key>
|
||||
<array>
|
||||
<string>ico</string>
|
||||
</array>
|
||||
<key>image/x-macpaint</key>
|
||||
<array>
|
||||
<string>pnt</string>
|
||||
<string>pntg</string>
|
||||
<string>mac</string>
|
||||
</array>
|
||||
<key>image/x-pcx</key>
|
||||
<array>
|
||||
<string>pcx</string>
|
||||
</array>
|
||||
<key>image/x-portable-anymap</key>
|
||||
<array>
|
||||
<string>pnm</string>
|
||||
</array>
|
||||
<key>image/x-portable-bitmap</key>
|
||||
<array>
|
||||
<string>pbm</string>
|
||||
</array>
|
||||
<key>image/x-portable-graymap</key>
|
||||
<array>
|
||||
<string>pgm</string>
|
||||
</array>
|
||||
<key>image/x-portable-pixmap</key>
|
||||
<array>
|
||||
<string>ppm</string>
|
||||
</array>
|
||||
<key>image/x-rgb</key>
|
||||
<array>
|
||||
<string>rgb</string>
|
||||
</array>
|
||||
<key>image/x-targa</key>
|
||||
<array>
|
||||
<string>targa</string>
|
||||
</array>
|
||||
<key>image/x-xbitmap</key>
|
||||
<array>
|
||||
<string>xbm</string>
|
||||
</array>
|
||||
<key>image/x-xpixmap</key>
|
||||
<array>
|
||||
<string>xpm</string>
|
||||
</array>
|
||||
<key>image/x-xwindowdump</key>
|
||||
<array>
|
||||
<string>xwd</string>
|
||||
</array>
|
||||
<key>model/iges</key>
|
||||
<array>
|
||||
<string>igs</string>
|
||||
<string>iges</string>
|
||||
</array>
|
||||
<key>model/mesh</key>
|
||||
<array>
|
||||
<string>msh</string>
|
||||
<string>mesh</string>
|
||||
<string>silo</string>
|
||||
</array>
|
||||
<key>model/vrml</key>
|
||||
<array>
|
||||
<string>wrl</string>
|
||||
<string>vrml</string>
|
||||
</array>
|
||||
<key>text/calendar</key>
|
||||
<array>
|
||||
<string>ics</string>
|
||||
</array>
|
||||
<key>text/css</key>
|
||||
<array>
|
||||
<string>css</string>
|
||||
</array>
|
||||
<key>text/html</key>
|
||||
<array>
|
||||
<string>html</string>
|
||||
<string>htm</string>
|
||||
<string>shtml</string>
|
||||
<string>jhtml</string>
|
||||
</array>
|
||||
<key>text/plain</key>
|
||||
<array>
|
||||
<string>txt</string>
|
||||
<string>asc</string>
|
||||
<string>text</string>
|
||||
</array>
|
||||
<key>text/qif</key>
|
||||
<array>
|
||||
<string>qif</string>
|
||||
</array>
|
||||
<key>text/richtext</key>
|
||||
<array>
|
||||
<string>rtx</string>
|
||||
</array>
|
||||
<key>text/rtf</key>
|
||||
<array>
|
||||
<string>rtf</string>
|
||||
</array>
|
||||
<key>text/sgml</key>
|
||||
<array>
|
||||
<string>sgml</string>
|
||||
<string>sgm</string>
|
||||
</array>
|
||||
<key>text/tab-separated-values</key>
|
||||
<array>
|
||||
<string>tsv</string>
|
||||
</array>
|
||||
<key>text/vcard</key>
|
||||
<array>
|
||||
<string>vcf</string>
|
||||
</array>
|
||||
<key>text/vnd.wap.wml</key>
|
||||
<array>
|
||||
<string>wml</string>
|
||||
</array>
|
||||
<key>text/vnd.wap.wmlscript</key>
|
||||
<array>
|
||||
<string>wmls</string>
|
||||
</array>
|
||||
<key>text/x-setext</key>
|
||||
<array>
|
||||
<string>etx</string>
|
||||
</array>
|
||||
<key>text/xml</key>
|
||||
<array>
|
||||
<string>xml</string>
|
||||
<string>xsl</string>
|
||||
</array>
|
||||
<key>video/mpeg</key>
|
||||
<array>
|
||||
<string>mpeg</string>
|
||||
<string>mpg</string>
|
||||
<string>mpe</string>
|
||||
</array>
|
||||
<key>video/quicktime</key>
|
||||
<array>
|
||||
<string>qt</string>
|
||||
<string>mov</string>
|
||||
</array>
|
||||
<key>video/vnd.mpegurl</key>
|
||||
<array>
|
||||
<string>mxu</string>
|
||||
</array>
|
||||
<key>video/x-ms-asf</key>
|
||||
<array>
|
||||
<string>asf</string>
|
||||
</array>
|
||||
<key>video/x-ms-wmv</key>
|
||||
<array>
|
||||
<string>wmv</string>
|
||||
</array>
|
||||
<key>video/x-ms-wmx</key>
|
||||
<array>
|
||||
<string>wmx</string>
|
||||
</array>
|
||||
<key>video/x-ms.wmp</key>
|
||||
<array>
|
||||
<string>wmp</string>
|
||||
</array>
|
||||
<key>video/x-msvideo</key>
|
||||
<array>
|
||||
<string>avi</string>
|
||||
</array>
|
||||
<key>video/x-sgi-movie</key>
|
||||
<array>
|
||||
<string>movie</string>
|
||||
</array>
|
||||
<key>x-conference/x-cooltalk</key>
|
||||
<array>
|
||||
<string>ice</string>
|
||||
</array>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -34,7 +34,9 @@
|
||||
|
||||
@class CTCoreAttachment;
|
||||
|
||||
//TODO Document me
|
||||
/**
|
||||
Represents an attachment before it has been fully fetched.
|
||||
*/
|
||||
@interface CTBareAttachment : NSObject {
|
||||
CTMIME_SinglePart *mMIMEPart;
|
||||
NSString *mFilename;
|
||||
@@ -46,6 +48,14 @@
|
||||
|
||||
-(NSString*)decodedFilename;
|
||||
- (id)initWithMIMESinglePart:(CTMIME_SinglePart *)part;
|
||||
/**
|
||||
Fetches the full attachment
|
||||
*/
|
||||
- (CTCoreAttachment *)fetchFullAttachment;
|
||||
/**
|
||||
Fetches the full attachment
|
||||
|
||||
Also has a progress handler
|
||||
*/
|
||||
- (CTCoreAttachment *)fetchFullAttachmentWithProgress:(CTProgressBlock)block;
|
||||
@end
|
||||
|
||||
@@ -29,7 +29,6 @@
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#import <MailCore/MailCore.h>
|
||||
#import "CTBareAttachment.h"
|
||||
|
||||
#import "MailCoreUtilities.h"
|
||||
|
||||
+45
-54
@@ -31,13 +31,12 @@
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import <libetpan/libetpan.h>
|
||||
#import "MailCoreTypes.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.
|
||||
/**
|
||||
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.
|
||||
*/
|
||||
|
||||
@class CTCoreFolder;
|
||||
@@ -46,76 +45,68 @@
|
||||
struct mailstorage *myStorage;
|
||||
BOOL connected;
|
||||
NSError *lastError;
|
||||
NSString *pathDelimiter;
|
||||
}
|
||||
/*!
|
||||
@abstract If an error occurred (nil or return of NO) call this method to get the error
|
||||
*/
|
||||
/**
|
||||
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, nil on error
|
||||
@property(nonatomic, retain) NSString *pathDelimiter;
|
||||
|
||||
/**
|
||||
Retrieves the list of all the available folders from the server.
|
||||
@return 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, nil on error
|
||||
/**
|
||||
Retrieves the list of all the available folders from the server using the extended list command (XLIST).
|
||||
This is only supported by Gmail.
|
||||
@return Returns a NSSet which contains CTXlistResults, nil on error
|
||||
*/
|
||||
- (NSSet *)allFoldersExtended;
|
||||
|
||||
/**
|
||||
Retrieves a list of only the subscribed folders from the server.
|
||||
@return 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.
|
||||
/**
|
||||
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.
|
||||
@return 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
|
||||
/**
|
||||
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 returns the current connection status.
|
||||
@result Returns YES or NO as the status of the connection.
|
||||
/**
|
||||
This method returns the current connection status.
|
||||
@return 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.
|
||||
/**
|
||||
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;
|
||||
- (NSSet *)capabilities;
|
||||
|
||||
/* Intended for advanced use only */
|
||||
- (mailimap *)session;
|
||||
|
||||
+136
-35
@@ -31,6 +31,7 @@
|
||||
|
||||
#import "CTCoreAccount.h"
|
||||
#import "CTCoreFolder.h"
|
||||
#import "CTXlistResult.h"
|
||||
#import "MailCoreTypes.h"
|
||||
#import "MailCoreUtilities.h"
|
||||
|
||||
@@ -39,7 +40,7 @@
|
||||
|
||||
|
||||
@implementation CTCoreAccount
|
||||
@synthesize lastError;
|
||||
@synthesize lastError, pathDelimiter;
|
||||
|
||||
- (id)init {
|
||||
self = [super init];
|
||||
@@ -56,6 +57,7 @@
|
||||
mailstorage_disconnect(myStorage);
|
||||
mailstorage_free(myStorage);
|
||||
self.lastError = nil;
|
||||
self.pathDelimiter = nil;
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
@@ -90,7 +92,7 @@
|
||||
imap_cached, NULL);
|
||||
|
||||
if (err != MAILIMAP_NO_ERROR) {
|
||||
self.lastError = MailCoreCreateErrorFromCode(err);
|
||||
self.lastError = MailCoreCreateErrorFromIMAPCode(err);
|
||||
return NO;
|
||||
}
|
||||
|
||||
@@ -99,41 +101,46 @@
|
||||
self.lastError = MailCoreCreateError(err, @"Invalid username or password");
|
||||
return NO;
|
||||
} else if (err != MAILIMAP_NO_ERROR) {
|
||||
self.lastError = MailCoreCreateErrorFromCode(err);
|
||||
self.lastError = MailCoreCreateErrorFromIMAPCode(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) {
|
||||
- (NSSet *)capabilities {
|
||||
NSMutableSet *capabilitiesSet = [NSMutableSet set];
|
||||
|
||||
int r;
|
||||
struct mailimap_capability_data *capabilities;
|
||||
|
||||
r = mailimap_capability(self.session, &capabilities);
|
||||
if (r != MAILIMAP_NO_ERROR) {
|
||||
self.lastError = MailCoreCreateErrorFromIMAPCode(r);
|
||||
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;
|
||||
for(clistiter * cur = clist_begin(capabilities->cap_list); cur != NULL ; cur = cur->next) {
|
||||
struct mailimap_capability *capability;
|
||||
NSString *name;
|
||||
|
||||
capability = clist_content(cur);
|
||||
name = nil;
|
||||
switch (capability->cap_type) {
|
||||
case MAILIMAP_CAPABILITY_AUTH_TYPE:
|
||||
name = [@"AUTH=" stringByAppendingString:[NSString stringWithUTF8String:capability->cap_data.cap_auth_type]];
|
||||
break;
|
||||
case MAILIMAP_CAPABILITY_NAME:
|
||||
name = [NSString stringWithUTF8String:capability->cap_data.cap_name];
|
||||
break;
|
||||
}
|
||||
if (name != nil) {
|
||||
[capabilitiesSet addObject:name];
|
||||
}
|
||||
}
|
||||
return YES;
|
||||
mailimap_capability_data_free(capabilities);
|
||||
|
||||
return capabilitiesSet;
|
||||
}
|
||||
|
||||
- (void)disconnect {
|
||||
@@ -187,14 +194,30 @@
|
||||
//Fill the subscribed folder array
|
||||
err = mailimap_lsub([self session], "", "*", &subscribedList);
|
||||
if (err != MAILIMAP_NO_ERROR) {
|
||||
self.lastError = MailCoreCreateErrorFromCode(err);
|
||||
self.lastError = MailCoreCreateErrorFromIMAPCode(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];
|
||||
struct mailimap_mbx_list_flags *flags = mailboxStruct->mb_flag;
|
||||
BOOL selectable = YES;
|
||||
if (flags) {
|
||||
selectable = !(flags->mbf_type==MAILIMAP_MBX_LIST_FLAGS_SFLAG && flags->mbf_sflag==MAILIMAP_MBX_LIST_SFLAG_NOSELECT);
|
||||
}
|
||||
|
||||
if (selectable) {
|
||||
mailboxName = mailboxStruct->mb_name;
|
||||
// Per RFC 3501, mailbox names must use 7-bit enconding (UTF-7).
|
||||
mailboxNameObject = (NSString *)CFStringCreateWithCString(NULL, mailboxName, kCFStringEncodingUTF7_IMAP);
|
||||
|
||||
if (mailboxStruct->mb_delimiter) {
|
||||
self.pathDelimiter = [NSString stringWithFormat:@"%c", mailboxStruct->mb_delimiter];
|
||||
} else {
|
||||
self.pathDelimiter = @"/";
|
||||
}
|
||||
[subscribedFolders addObject:mailboxNameObject];
|
||||
[mailboxNameObject release];
|
||||
}
|
||||
}
|
||||
mailimap_list_result_free(subscribedList);
|
||||
return subscribedFolders;
|
||||
@@ -215,15 +238,93 @@
|
||||
//TODO Fix this so it doesn't use *
|
||||
err = mailimap_list([self session], "", "*", &allList);
|
||||
if (err != MAILIMAP_NO_ERROR) {
|
||||
self.lastError = MailCoreCreateErrorFromCode(err);
|
||||
self.lastError = MailCoreCreateErrorFromIMAPCode(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];
|
||||
struct mailimap_mbx_list_flags *flags = mailboxStruct->mb_flag;
|
||||
BOOL selectable = YES;
|
||||
if (flags) {
|
||||
selectable = !(flags->mbf_type==MAILIMAP_MBX_LIST_FLAGS_SFLAG && flags->mbf_sflag==MAILIMAP_MBX_LIST_SFLAG_NOSELECT);
|
||||
}
|
||||
if (selectable) {
|
||||
mailboxName = mailboxStruct->mb_name;
|
||||
// Per RFC 3501, mailbox names must use 7-bit enconding (UTF-7).
|
||||
mailboxNameObject = (NSString *)CFStringCreateWithCString(NULL, mailboxName, kCFStringEncodingUTF7_IMAP);
|
||||
|
||||
if (mailboxStruct->mb_delimiter) {
|
||||
self.pathDelimiter = [NSString stringWithFormat:@"%c", mailboxStruct->mb_delimiter];
|
||||
} else {
|
||||
self.pathDelimiter = @"/";
|
||||
}
|
||||
[allFolders addObject:mailboxNameObject];
|
||||
[mailboxNameObject release];
|
||||
}
|
||||
}
|
||||
mailimap_list_result_free(allList);
|
||||
return allFolders;
|
||||
}
|
||||
|
||||
- (NSSet *)allFoldersExtended {
|
||||
struct mailimap_mailbox_list * mailboxStruct;
|
||||
struct mailimap_mbx_list_oflag * oflagStruct;
|
||||
clist *allList;
|
||||
clistiter *cur, *flagIter;
|
||||
|
||||
NSString *mailboxNameObject;
|
||||
char *mailboxName;
|
||||
NSString *flagNameObject;
|
||||
char *flagName;
|
||||
int err;
|
||||
|
||||
NSMutableSet *allFolders = [NSMutableSet set];
|
||||
CTXlistResult *listResult;
|
||||
|
||||
//Now, fill the all folders array
|
||||
//TODO Fix this so it doesn't use *
|
||||
err = mailimap_xlist([self session], "", "*", &allList);
|
||||
if (err != MAILIMAP_NO_ERROR) {
|
||||
self.lastError = MailCoreCreateErrorFromIMAPCode(err);
|
||||
return nil;
|
||||
}
|
||||
for(cur = clist_begin(allList); cur != NULL; cur = cur->next)
|
||||
{
|
||||
mailboxStruct = cur->data;
|
||||
struct mailimap_mbx_list_flags *flags = mailboxStruct->mb_flag;
|
||||
BOOL selectable = YES;
|
||||
if (flags) {
|
||||
selectable = !(flags->mbf_type==MAILIMAP_MBX_LIST_FLAGS_SFLAG && flags->mbf_sflag==MAILIMAP_MBX_LIST_SFLAG_NOSELECT);
|
||||
}
|
||||
if (selectable) {
|
||||
mailboxName = mailboxStruct->mb_name;
|
||||
// Per RFC 3501, mailbox names must use 7-bit enconding (UTF-7).
|
||||
mailboxNameObject = (NSString *)CFStringCreateWithCString(NULL, mailboxName, kCFStringEncodingUTF7_IMAP);
|
||||
|
||||
if (mailboxStruct->mb_delimiter) {
|
||||
self.pathDelimiter = [NSString stringWithFormat:@"%c", mailboxStruct->mb_delimiter];
|
||||
} else {
|
||||
self.pathDelimiter = @"/";
|
||||
}
|
||||
|
||||
listResult = [[CTXlistResult alloc] init];
|
||||
[listResult setName:mailboxNameObject];
|
||||
[mailboxNameObject release];
|
||||
|
||||
if (flags) {
|
||||
for (flagIter = clist_begin(flags->mbf_oflags); flagIter != NULL; flagIter = flagIter->next) {
|
||||
oflagStruct = flagIter->data;
|
||||
flagName = oflagStruct->of_flag_ext;
|
||||
flagNameObject = (NSString *)CFStringCreateWithCString(NULL, flagName, kCFStringEncodingUTF7_IMAP);
|
||||
[listResult addFlag:flagNameObject];
|
||||
[flagNameObject release];
|
||||
}
|
||||
}
|
||||
|
||||
[allFolders addObject:listResult];
|
||||
[listResult release];
|
||||
}
|
||||
}
|
||||
mailimap_list_result_free(allList);
|
||||
return allFolders;
|
||||
|
||||
+22
-23
@@ -31,60 +31,59 @@
|
||||
|
||||
#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.
|
||||
/**
|
||||
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;
|
||||
}
|
||||
/*!
|
||||
@abstract Returns a CTCoreAddress with the name and e-mail address set as an empty string.
|
||||
/**
|
||||
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.
|
||||
/**
|
||||
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.
|
||||
/**
|
||||
Returns a CTCoreAddress set with the specified name and email.
|
||||
*/
|
||||
- (id)initWithName:(NSString *)aName email:(NSString *)aEmail;
|
||||
|
||||
/*!
|
||||
@abstract Returns the name as a NSString
|
||||
/**
|
||||
Returns the name as a NSString
|
||||
*/
|
||||
- (NSString *)name;
|
||||
-(NSString*)decodedName; // added by Gabor
|
||||
|
||||
/*!
|
||||
@abstract Sets the name.
|
||||
/**
|
||||
Sets the name.
|
||||
*/
|
||||
- (void)setName:(NSString *)aValue;
|
||||
|
||||
/*!
|
||||
@abstract Returns the e-mail as a NSString
|
||||
/**
|
||||
Returns the e-mail as a NSString
|
||||
*/
|
||||
- (NSString *)email;
|
||||
|
||||
/*!
|
||||
@abstract Sets the e-mail.
|
||||
/**
|
||||
Sets the e-mail.
|
||||
*/
|
||||
- (void)setEmail:(NSString *)aValue;
|
||||
|
||||
/*!
|
||||
@abstract Works like the typical isEqual: method
|
||||
/**
|
||||
Works like the typical isEqual: method
|
||||
*/
|
||||
- (BOOL)isEqual:(id)object;
|
||||
|
||||
/*!
|
||||
@abstract Standard description method
|
||||
/**
|
||||
Standard description method
|
||||
*/
|
||||
- (NSString *)description;
|
||||
@end
|
||||
|
||||
@@ -32,13 +32,31 @@
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "CTBareAttachment.h"
|
||||
|
||||
/**
|
||||
A message's attachment
|
||||
*/
|
||||
@interface CTCoreAttachment : CTBareAttachment {
|
||||
NSData *mData;
|
||||
}
|
||||
@property(retain) NSData *data;
|
||||
|
||||
/**
|
||||
Load the attachment from a local file
|
||||
NOTE: This currently only works on Mac OS X, use initWithData:contentType:filename: instead on iOS
|
||||
*/
|
||||
|
||||
- (id)initWithContentsOfFile:(NSString *)path;
|
||||
- (id)initWithData:(NSData *)data contentType:(NSString *)contentType
|
||||
filename:(NSString *)filename;
|
||||
/**
|
||||
Create an attachment from a chunk of data
|
||||
|
||||
@param data The actual attachment data
|
||||
@param contentType The MIME content type you'd like to use
|
||||
@param filename The filename you'd like the attachment to be given in the e-mail message
|
||||
*/
|
||||
- (id)initWithData:(NSData *)data contentType:(NSString *)contentType filename:(NSString *)filename;
|
||||
|
||||
/**
|
||||
Used to save the attachment locally
|
||||
*/
|
||||
- (BOOL)writeToFile:(NSString *)path;
|
||||
@end
|
||||
|
||||
@@ -41,8 +41,8 @@
|
||||
NSString *filePathExt = [path pathExtension];
|
||||
|
||||
NSString *contentType = nil;
|
||||
//TODO: This won't work on iOS
|
||||
NSDictionary *contentTypes = [NSDictionary dictionaryWithContentsOfFile:CTContentTypesPath];
|
||||
NSString *typesPath = [[NSBundle mainBundle] pathForResource:@"types" ofType:@"plist"];
|
||||
NSDictionary *contentTypes = [NSDictionary dictionaryWithContentsOfFile:typesPath];
|
||||
for (NSString *key in [contentTypes allKeys]) {
|
||||
NSArray *fileExtensions = [contentTypes objectForKey:key];
|
||||
for (NSString *ext in fileExtensions) {
|
||||
|
||||
+149
-131
@@ -33,11 +33,10 @@
|
||||
#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.
|
||||
/**
|
||||
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.
|
||||
*/
|
||||
|
||||
@class CTCoreMessage, CTCoreAccount;
|
||||
@@ -48,197 +47,216 @@
|
||||
NSString *myPath;
|
||||
BOOL connected;
|
||||
NSError *lastError;
|
||||
|
||||
BOOL idling;
|
||||
int idlePipe[2];
|
||||
}
|
||||
/*!
|
||||
@abstract If an error occurred (nil or return of NO) call this method to get the error
|
||||
*/
|
||||
@property(nonatomic, retain) NSError *lastError;
|
||||
/**
|
||||
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.
|
||||
@property (nonatomic, retain) CTCoreAccount *parentAccount;
|
||||
|
||||
/**
|
||||
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.
|
||||
@return Return YES on success, NO on error. Call method lastError to get error if one occurred
|
||||
/**
|
||||
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
|
||||
*/
|
||||
- (BOOL)connect;
|
||||
|
||||
/*!
|
||||
@abstract This method terminates the connection, make sure you don't have any message
|
||||
connections open from this folder before disconnecting.
|
||||
/**
|
||||
This method terminates the connection
|
||||
|
||||
Make sure you don't have any message connections open from this folder before disconnecting.
|
||||
*/
|
||||
- (void)disconnect;
|
||||
|
||||
/*!
|
||||
@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.
|
||||
/**
|
||||
This will return the message from this folder with the UID that was passed in.
|
||||
|
||||
A CTMessage object is returned which can be used to get further information and perform operationson the message.
|
||||
@return A CTCoreMessage or if not found, nil
|
||||
*/
|
||||
- (CTCoreMessage *)messageWithUID:(NSUInteger)uid;
|
||||
|
||||
/*!
|
||||
@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
|
||||
/**
|
||||
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. Pass in
|
||||
CTFetchAttrDefaultsOnly to attrs 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
|
||||
|
||||
|
||||
@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.
|
||||
@return Returns a NSArray of CTCoreMessage's. Returns nil on error
|
||||
*/
|
||||
- (NSArray *)messagesFromSequenceNumber:(NSUInteger)startNum to:(NSUInteger)endNum withFetchAttributes:(CTFetchAttributes)attrs;
|
||||
|
||||
/*!
|
||||
@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
|
||||
/**
|
||||
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.
|
||||
|
||||
@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.
|
||||
@return Returns a NSArray of CTCoreMessage's. Returns nil on error
|
||||
@see messagesFromSequenceNumber:to:withFetchAttributes:
|
||||
*/
|
||||
- (NSArray *)messagesFromUID:(NSUInteger)startUID to:(NSUInteger)endUID withFetchAttributes:(CTFetchAttributes)attrs;
|
||||
|
||||
/*!
|
||||
@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
|
||||
/**
|
||||
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
|
||||
*/
|
||||
- (BOOL)sequenceNumberForUID:(NSUInteger)uid sequenceNumber:(NSUInteger *)sequenceNumber;
|
||||
|
||||
|
||||
/*!
|
||||
@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
|
||||
/**
|
||||
Perform an IMAP check command
|
||||
|
||||
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.
|
||||
/**
|
||||
The entire path of the 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.
|
||||
@return Return YES on success, NO on error. Call method lastError to get error if one occurred
|
||||
/**
|
||||
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
|
||||
*/
|
||||
- (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.
|
||||
@return Return YES on success, NO on error. Call method lastError to get error if one occurred
|
||||
/**
|
||||
Sends the idle command to the server.
|
||||
*/
|
||||
- (CTIdleResult)idleWithTimeout:(NSUInteger)timeout;
|
||||
- (void)cancelIdle;
|
||||
@property (atomic) BOOL idling;
|
||||
|
||||
|
||||
/**
|
||||
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
|
||||
*/
|
||||
- (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.
|
||||
@return Return YES on success, NO on error. Call method lastError to get error if one occurred
|
||||
/**
|
||||
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
|
||||
*/
|
||||
- (BOOL)delete;
|
||||
|
||||
/*!
|
||||
@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
|
||||
/**
|
||||
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
|
||||
*/
|
||||
- (BOOL)subscribe;
|
||||
|
||||
/*!
|
||||
@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
|
||||
/**
|
||||
The folder will be listed as unsubscribed.
|
||||
@return Return YES on success, NO on error. Call method lastError to get error if one occurred
|
||||
*/
|
||||
- (BOOL)unsubscribe;
|
||||
|
||||
/*!
|
||||
@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
|
||||
/**
|
||||
Exposes the IMAP APPEND command, see the IMAP RFC 4549.
|
||||
@return Return YES on success, NO on error. Call method lastError to get error if one occurred
|
||||
*/
|
||||
- (BOOL) appendMessage: (CTCoreMessage *) msg;
|
||||
|
||||
/**
|
||||
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
|
||||
*/
|
||||
- (BOOL)flagsForMessage:(CTCoreMessage *)msg flags:(NSUInteger *)flags;
|
||||
|
||||
/*!
|
||||
@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
|
||||
/**
|
||||
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
|
||||
*/
|
||||
- (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.
|
||||
@return Return YES on success, NO on error. Call method lastError to get error if one occurred
|
||||
/**
|
||||
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
|
||||
*/
|
||||
- (BOOL)expunge;
|
||||
|
||||
/*!
|
||||
@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;
|
||||
/**
|
||||
Copies a message to a folder
|
||||
@return Return YES on success, NO on error. Call method lastError to get error if one occurred
|
||||
*/
|
||||
- (BOOL)copyMessageWithUID:(NSUInteger)uid toPath:(NSString *)path;
|
||||
|
||||
/*!
|
||||
@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;
|
||||
/**
|
||||
Moves a message to a folder
|
||||
@return Return YES on success, NO on error. Call method lastError to get error if one occurred
|
||||
*/
|
||||
- (BOOL)moveMessageWithUID:(NSUInteger)uid toPath:(NSString *)path;
|
||||
|
||||
/*!
|
||||
@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
|
||||
/**
|
||||
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
|
||||
/**
|
||||
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
|
||||
/**
|
||||
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
|
||||
/**
|
||||
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;
|
||||
|
||||
|
||||
+232
-91
@@ -38,6 +38,9 @@
|
||||
#import "MailCoreTypes.h"
|
||||
#import "MailCoreUtilities.h"
|
||||
|
||||
#include <unistd.h>
|
||||
|
||||
|
||||
//int imap_fetch_result_to_envelop_list(clist * fetch_result, struct mailmessage_list * env_list);
|
||||
//
|
||||
int uid_list_to_env_list(clist * fetch_result, struct mailmessage_list ** result,
|
||||
@@ -46,8 +49,10 @@ int uid_list_to_env_list(clist * fetch_result, struct mailmessage_list ** result
|
||||
@interface CTCoreFolder ()
|
||||
@end
|
||||
|
||||
static const int MAX_PATH_SIZE = 1024;
|
||||
|
||||
@implementation CTCoreFolder
|
||||
@synthesize lastError;
|
||||
@synthesize lastError, parentAccount=myAccount, idling;
|
||||
|
||||
- (id)initWithPath:(NSString *)path inAccount:(CTCoreAccount *)account; {
|
||||
struct mailstorage *storage = (struct mailstorage *)[account storageStruct];
|
||||
@@ -57,7 +62,9 @@ int uid_list_to_env_list(clist * fetch_result, struct mailmessage_list ** result
|
||||
myPath = [path retain];
|
||||
connected = NO;
|
||||
myAccount = [account retain];
|
||||
myFolder = mailfolder_new(storage, (char *)[myPath cStringUsingEncoding:NSUTF8StringEncoding], NULL);
|
||||
|
||||
char buffer[MAX_PATH_SIZE];
|
||||
myFolder = mailfolder_new(storage, [self getUTF7String:buffer fromString:myPath], NULL);
|
||||
if (!myFolder) {
|
||||
return nil;
|
||||
}
|
||||
@@ -78,11 +85,21 @@ int uid_list_to_env_list(clist * fetch_result, struct mailmessage_list ** result
|
||||
}
|
||||
|
||||
|
||||
- (const char *)getUTF7String:(char *)buffer fromString:(NSString *)str {
|
||||
if (CFStringGetCString((CFStringRef)str, buffer, MAX_PATH_SIZE, kCFStringEncodingUTF7_IMAP)) {
|
||||
return buffer;
|
||||
}
|
||||
else {
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
- (BOOL)connect {
|
||||
int err = MAIL_NO_ERROR;
|
||||
err = mailfolder_connect(myFolder);
|
||||
if (err != MAILIMAP_NO_ERROR) {
|
||||
self.lastError = MailCoreCreateErrorFromCode(err);
|
||||
self.lastError = MailCoreCreateErrorFromIMAPCode(err);
|
||||
return NO;
|
||||
}
|
||||
connected = YES;
|
||||
@@ -99,22 +116,12 @@ int uid_list_to_env_list(clist * fetch_result, struct mailmessage_list ** result
|
||||
return lastError;
|
||||
}
|
||||
|
||||
- (NSString *)name {
|
||||
//Get the last part of the path
|
||||
NSArray *pathParts = [myPath componentsSeparatedByString:@"."];
|
||||
return [pathParts objectAtIndex:[pathParts count]-1];
|
||||
}
|
||||
|
||||
|
||||
- (NSString *)path {
|
||||
return myPath;
|
||||
}
|
||||
|
||||
|
||||
- (BOOL)setPath:(NSString *)path; {
|
||||
int err;
|
||||
const char *newPath = [path cStringUsingEncoding:NSUTF8StringEncoding];
|
||||
const char *oldPath = [myPath cStringUsingEncoding:NSUTF8StringEncoding];
|
||||
|
||||
BOOL success = [self connect];
|
||||
if (!success) {
|
||||
@@ -125,26 +132,125 @@ int uid_list_to_env_list(clist * fetch_result, struct mailmessage_list ** result
|
||||
if (!success) {
|
||||
return NO;
|
||||
}
|
||||
|
||||
char newPath[MAX_PATH_SIZE];
|
||||
[self getUTF7String:newPath fromString:path];
|
||||
|
||||
char oldPath[MAX_PATH_SIZE];
|
||||
[self getUTF7String:newPath fromString:myPath];
|
||||
|
||||
err = mailimap_rename([myAccount session], oldPath, newPath);
|
||||
|
||||
if (err != MAILIMAP_NO_ERROR) {
|
||||
self.lastError = MailCoreCreateErrorFromCode(err);
|
||||
self.lastError = MailCoreCreateErrorFromIMAPCode(err);
|
||||
return NO;
|
||||
}
|
||||
|
||||
[path retain];
|
||||
[myPath release];
|
||||
myPath = path;
|
||||
|
||||
success = [self subscribe];
|
||||
return success;
|
||||
}
|
||||
|
||||
- (CTIdleResult)idleWithTimeout:(NSUInteger)timeout {
|
||||
NSAssert(!self.idling, @"Can't call idle when we are already idling!");
|
||||
self.lastError = nil;
|
||||
|
||||
BOOL success = [self connect];
|
||||
if (!success) {
|
||||
return CTIdleError;
|
||||
}
|
||||
|
||||
CTIdleResult result = CTIdleError;
|
||||
int r = 0;
|
||||
|
||||
self.idling = YES;
|
||||
r = pipe(idlePipe);
|
||||
if (r == -1) {
|
||||
return CTIdleError;
|
||||
}
|
||||
|
||||
self.imapSession->imap_selection_info->sel_exists = 0;
|
||||
r = mailimap_idle(self.imapSession);
|
||||
if (r != MAILIMAP_NO_ERROR) {
|
||||
self.lastError = MailCoreCreateErrorFromIMAPCode(r);
|
||||
result = CTIdleError;
|
||||
}
|
||||
|
||||
if (r == MAILIMAP_NO_ERROR && self.imapSession->imap_selection_info->sel_exists == 0) {
|
||||
int fd;
|
||||
int maxfd;
|
||||
fd_set readfds;
|
||||
struct timeval delay;
|
||||
|
||||
fd = mailimap_idle_get_fd(self.imapSession);
|
||||
|
||||
FD_ZERO(&readfds);
|
||||
FD_SET(fd, &readfds);
|
||||
FD_SET(idlePipe[0], &readfds);
|
||||
maxfd = fd;
|
||||
if (idlePipe[0] > maxfd) {
|
||||
maxfd = idlePipe[0];
|
||||
}
|
||||
delay.tv_sec = timeout;
|
||||
delay.tv_usec = 0;
|
||||
|
||||
r = select(maxfd + 1, &readfds, NULL, NULL, &delay);
|
||||
if (r == 0) {
|
||||
result = CTIdleTimeout;
|
||||
} else if (r == -1) {
|
||||
// select error condition, just ignore this
|
||||
} else {
|
||||
if (FD_ISSET(fd, &readfds)) {
|
||||
// The server sent something down
|
||||
result = CTIdleNewData;
|
||||
} else if (FD_ISSET(idlePipe[0], &readfds)) {
|
||||
// the idle was explicitly cancelled
|
||||
char ch;
|
||||
read(idlePipe[0], &ch, 1);
|
||||
result = CTIdleCancelled;
|
||||
}
|
||||
}
|
||||
} else if (r == MAILIMAP_NO_ERROR) {
|
||||
result = CTIdleNewData;
|
||||
}
|
||||
|
||||
r = mailimap_idle_done(self.imapSession);
|
||||
if (r != MAILIMAP_NO_ERROR) {
|
||||
self.lastError = MailCoreCreateErrorFromIMAPCode(r);
|
||||
result = CTIdleError;
|
||||
}
|
||||
|
||||
self.idling = NO;
|
||||
close(idlePipe[1]);
|
||||
close(idlePipe[0]);
|
||||
idlePipe[1] = -1;
|
||||
idlePipe[0] = -1;
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
- (void)cancelIdle {
|
||||
if (self.idling) {
|
||||
int r;
|
||||
char c;
|
||||
|
||||
c = 0;
|
||||
r = write(idlePipe[1], &c, 1);
|
||||
}
|
||||
}
|
||||
|
||||
- (BOOL)create {
|
||||
int err;
|
||||
const char *path = [myPath cStringUsingEncoding:NSUTF8StringEncoding];
|
||||
|
||||
char path[MAX_PATH_SIZE];
|
||||
[self getUTF7String:path fromString:myPath];
|
||||
|
||||
err = mailimap_create([myAccount session], path);
|
||||
if (err != MAILIMAP_NO_ERROR) {
|
||||
self.lastError = MailCoreCreateErrorFromCode(err);
|
||||
self.lastError = MailCoreCreateErrorFromIMAPCode(err);
|
||||
return NO;
|
||||
}
|
||||
BOOL success = [self connect];
|
||||
@@ -158,7 +264,9 @@ int uid_list_to_env_list(clist * fetch_result, struct mailmessage_list ** result
|
||||
|
||||
- (BOOL)delete {
|
||||
int err;
|
||||
const char *path = [myPath cStringUsingEncoding:NSUTF8StringEncoding];
|
||||
|
||||
char path[MAX_PATH_SIZE];
|
||||
[self getUTF7String:path fromString:myPath];
|
||||
|
||||
BOOL success = [self connect];
|
||||
if (!success) {
|
||||
@@ -171,7 +279,7 @@ int uid_list_to_env_list(clist * fetch_result, struct mailmessage_list ** result
|
||||
}
|
||||
err = mailimap_delete([myAccount session], path);
|
||||
if (err != MAILIMAP_NO_ERROR) {
|
||||
self.lastError = MailCoreCreateErrorFromCode(err);
|
||||
self.lastError = MailCoreCreateErrorFromIMAPCode(err);
|
||||
return NO;
|
||||
}
|
||||
return YES;
|
||||
@@ -180,7 +288,9 @@ int uid_list_to_env_list(clist * fetch_result, struct mailmessage_list ** result
|
||||
|
||||
- (BOOL)subscribe {
|
||||
int err;
|
||||
const char *path = [myPath cStringUsingEncoding:NSUTF8StringEncoding];
|
||||
|
||||
char path[MAX_PATH_SIZE];
|
||||
[self getUTF7String:path fromString:myPath];
|
||||
|
||||
BOOL success = [self connect];
|
||||
if (!success) {
|
||||
@@ -189,7 +299,7 @@ int uid_list_to_env_list(clist * fetch_result, struct mailmessage_list ** result
|
||||
err = mailimap_subscribe([myAccount session], path);
|
||||
err = mailimap_unsubscribe([myAccount session], path);
|
||||
if (err != MAILIMAP_NO_ERROR) {
|
||||
self.lastError = MailCoreCreateErrorFromCode(err);
|
||||
self.lastError = MailCoreCreateErrorFromIMAPCode(err);
|
||||
return NO;
|
||||
}
|
||||
return YES;
|
||||
@@ -198,7 +308,9 @@ int uid_list_to_env_list(clist * fetch_result, struct mailmessage_list ** result
|
||||
|
||||
- (BOOL)unsubscribe {
|
||||
int err;
|
||||
const char *path = [myPath cStringUsingEncoding:NSUTF8StringEncoding];
|
||||
|
||||
char path[MAX_PATH_SIZE];
|
||||
[self getUTF7String:path fromString:myPath];
|
||||
|
||||
BOOL success = [self connect];
|
||||
if (!success) {
|
||||
@@ -206,19 +318,35 @@ int uid_list_to_env_list(clist * fetch_result, struct mailmessage_list ** result
|
||||
}
|
||||
err = mailimap_unsubscribe([myAccount session], path);
|
||||
if (err != MAILIMAP_NO_ERROR) {
|
||||
self.lastError = MailCoreCreateErrorFromCode(err);
|
||||
self.lastError = MailCoreCreateErrorFromIMAPCode(err);
|
||||
return NO;
|
||||
}
|
||||
return YES;
|
||||
}
|
||||
|
||||
- (BOOL) appendMessage: (CTCoreMessage *) msg
|
||||
{
|
||||
int err = MAILIMAP_NO_ERROR;
|
||||
NSString *msgStr = [msg render];
|
||||
if (![self connect])
|
||||
return NO;
|
||||
err = mailsession_append_message ([self folderSession],
|
||||
[msgStr cStringUsingEncoding: NSUTF8StringEncoding],
|
||||
[msgStr lengthOfBytesUsingEncoding: NSUTF8StringEncoding]);
|
||||
if (MAILIMAP_NO_ERROR != err)
|
||||
self.lastError = MailCoreCreateErrorFromIMAPCode (err);
|
||||
return MAILIMAP_NO_ERROR == err;
|
||||
}
|
||||
|
||||
- (struct mailfolder *)folderStruct {
|
||||
return myFolder;
|
||||
}
|
||||
|
||||
- (NSUInteger)uidValidity {
|
||||
[self connect];
|
||||
BOOL success = [self connect];
|
||||
if (!success) {
|
||||
return 0;
|
||||
}
|
||||
mailimap *imapSession;
|
||||
imapSession = [self imapSession];
|
||||
if (imapSession->imap_selection_info != NULL) {
|
||||
@@ -228,7 +356,10 @@ int uid_list_to_env_list(clist * fetch_result, struct mailmessage_list ** result
|
||||
}
|
||||
|
||||
- (NSUInteger)uidNext {
|
||||
[self connect];
|
||||
BOOL success = [self connect];
|
||||
if (!success) {
|
||||
return 0;
|
||||
}
|
||||
mailimap *imapSession;
|
||||
imapSession = [self imapSession];
|
||||
if (imapSession->imap_selection_info != NULL) {
|
||||
@@ -244,7 +375,7 @@ int uid_list_to_env_list(clist * fetch_result, struct mailmessage_list ** result
|
||||
}
|
||||
int err = mailfolder_check(myFolder);
|
||||
if (err != MAILIMAP_NO_ERROR) {
|
||||
self.lastError = MailCoreCreateErrorFromCode(err);
|
||||
self.lastError = MailCoreCreateErrorFromIMAPCode(err);
|
||||
return NO;
|
||||
}
|
||||
return YES;
|
||||
@@ -264,7 +395,7 @@ int uid_list_to_env_list(clist * fetch_result, struct mailmessage_list ** result
|
||||
}
|
||||
set = mailimap_set_new_single(uid);
|
||||
if (set == NULL) {
|
||||
self.lastError = MailCoreCreateErrorFromCode(MAIL_ERROR_MEMORY);
|
||||
self.lastError = MailCoreCreateErrorFromIMAPCode(MAIL_ERROR_MEMORY);
|
||||
return NO;
|
||||
}
|
||||
|
||||
@@ -272,14 +403,14 @@ int uid_list_to_env_list(clist * fetch_result, struct mailmessage_list ** result
|
||||
fetch_att = mailimap_fetch_att_new_uid();
|
||||
r = mailimap_fetch_type_new_fetch_att_list_add(fetch_type, fetch_att);
|
||||
if (r != MAILIMAP_NO_ERROR) {
|
||||
self.lastError = MailCoreCreateErrorFromCode(r);
|
||||
self.lastError = MailCoreCreateErrorFromIMAPCode(r);
|
||||
mailimap_fetch_att_free(fetch_att);
|
||||
return NO;
|
||||
}
|
||||
|
||||
r = mailimap_uid_fetch([self imapSession], set, fetch_type, &fetch_result);
|
||||
if (r != MAILIMAP_NO_ERROR) {
|
||||
self.lastError = MailCoreCreateErrorFromCode(r);
|
||||
self.lastError = MailCoreCreateErrorFromIMAPCode(r);
|
||||
return NO;
|
||||
}
|
||||
|
||||
@@ -319,7 +450,7 @@ int uid_list_to_env_list(clist * fetch_result, struct mailmessage_list ** result
|
||||
if (r != MAILIMAP_NO_ERROR) {
|
||||
mailimap_fetch_att_free(fetch_att);
|
||||
mailimap_fetch_type_free(fetch_type);
|
||||
self.lastError = MailCoreCreateErrorFromCode(r);
|
||||
self.lastError = MailCoreCreateErrorFromIMAPCode(r);
|
||||
return nil;
|
||||
}
|
||||
|
||||
@@ -329,7 +460,7 @@ int uid_list_to_env_list(clist * fetch_result, struct mailmessage_list ** result
|
||||
if (r != MAILIMAP_NO_ERROR) {
|
||||
mailimap_fetch_att_free(fetch_att);
|
||||
mailimap_fetch_type_free(fetch_type);
|
||||
self.lastError = MailCoreCreateErrorFromCode(r);
|
||||
self.lastError = MailCoreCreateErrorFromIMAPCode(r);
|
||||
return nil;
|
||||
}
|
||||
|
||||
@@ -339,7 +470,7 @@ int uid_list_to_env_list(clist * fetch_result, struct mailmessage_list ** result
|
||||
if (r != MAILIMAP_NO_ERROR) {
|
||||
mailimap_fetch_att_free(fetch_att);
|
||||
mailimap_fetch_type_free(fetch_type);
|
||||
self.lastError = MailCoreCreateErrorFromCode(r);
|
||||
self.lastError = MailCoreCreateErrorFromIMAPCode(r);
|
||||
return nil;
|
||||
}
|
||||
|
||||
@@ -350,7 +481,7 @@ int uid_list_to_env_list(clist * fetch_result, struct mailmessage_list ** result
|
||||
if (r != MAILIMAP_NO_ERROR) {
|
||||
mailimap_fetch_att_free(fetch_att);
|
||||
mailimap_fetch_type_free(fetch_type);
|
||||
self.lastError = MailCoreCreateErrorFromCode(r);
|
||||
self.lastError = MailCoreCreateErrorFromIMAPCode(r);
|
||||
return nil;
|
||||
}
|
||||
}
|
||||
@@ -360,7 +491,7 @@ int uid_list_to_env_list(clist * fetch_result, struct mailmessage_list ** result
|
||||
r = imap_add_envelope_fetch_att(fetch_type);
|
||||
if (r != MAIL_NO_ERROR) {
|
||||
mailimap_fetch_type_free(fetch_type);
|
||||
self.lastError = MailCoreCreateErrorFromCode(r);
|
||||
self.lastError = MailCoreCreateErrorFromIMAPCode(r);
|
||||
return nil;
|
||||
}
|
||||
}
|
||||
@@ -371,7 +502,7 @@ int uid_list_to_env_list(clist * fetch_result, struct mailmessage_list ** result
|
||||
r = mailimap_fetch([self imapSession], set, fetch_type, &fetch_result);
|
||||
}
|
||||
if (r != MAIL_NO_ERROR) {
|
||||
self.lastError = MailCoreCreateErrorFromCode(r);
|
||||
self.lastError = MailCoreCreateErrorFromIMAPCode(r);
|
||||
return nil;
|
||||
}
|
||||
|
||||
@@ -381,12 +512,12 @@ int uid_list_to_env_list(clist * fetch_result, struct mailmessage_list ** result
|
||||
env_list = NULL;
|
||||
r = uid_list_to_env_list(fetch_result, &env_list, [self folderSession], imap_message_driver);
|
||||
if (r != MAIL_NO_ERROR) {
|
||||
self.lastError = MailCoreCreateErrorFromCode(r);
|
||||
self.lastError = MailCoreCreateErrorFromIMAPCode(r);
|
||||
return nil;
|
||||
}
|
||||
r = imap_fetch_result_to_envelop_list(fetch_result, env_list);
|
||||
if (r != MAIL_NO_ERROR) {
|
||||
self.lastError = MailCoreCreateErrorFromCode(r);
|
||||
self.lastError = MailCoreCreateErrorFromIMAPCode(r);
|
||||
return nil;
|
||||
}
|
||||
|
||||
@@ -403,7 +534,7 @@ int uid_list_to_env_list(clist * fetch_result, struct mailmessage_list ** result
|
||||
struct mailmessage * msg = carray_get(env_list->msg_tab, i);
|
||||
struct mailimap_msg_att *msg_att = (struct mailimap_msg_att *)clist_content(fetchResultIter);
|
||||
if (msg_att == nil) {
|
||||
self.lastError = MailCoreCreateErrorFromCode(MAIL_ERROR_MEMORY);
|
||||
self.lastError = MailCoreCreateErrorFromIMAPCode(MAIL_ERROR_MEMORY);
|
||||
return nil;
|
||||
}
|
||||
|
||||
@@ -413,57 +544,60 @@ int uid_list_to_env_list(clist * fetch_result, struct mailmessage_list ** result
|
||||
struct mailimap_body * imap_body = NULL;
|
||||
struct mailimap_envelope * envelope = NULL;
|
||||
|
||||
r = imap_get_msg_att_info(msg_att, &uid, &envelope, &references, &ref_size, NULL, &imap_body);
|
||||
if (r != MAIL_NO_ERROR) {
|
||||
mailimap_fetch_list_free(fetch_result);
|
||||
self.lastError = MailCoreCreateErrorFromCode(r);
|
||||
return nil;
|
||||
}
|
||||
|
||||
if (imap_body != NULL) {
|
||||
r = imap_body_to_body(imap_body, &body);
|
||||
if (attrs & CTFetchAttrBodyStructure) {
|
||||
r = imap_get_msg_att_info(msg_att, &uid, &envelope, &references, &ref_size, NULL, &imap_body);
|
||||
if (r != MAIL_NO_ERROR) {
|
||||
mailimap_fetch_list_free(fetch_result);
|
||||
self.lastError = MailCoreCreateErrorFromCode(r);
|
||||
self.lastError = MailCoreCreateErrorFromIMAPCode(r);
|
||||
return nil;
|
||||
}
|
||||
}
|
||||
|
||||
if (envelope != NULL) {
|
||||
r = imap_env_to_fields(envelope, references, ref_size, &fields);
|
||||
if (r != MAIL_NO_ERROR) {
|
||||
if (imap_body != NULL) {
|
||||
r = imap_body_to_body(imap_body, &body);
|
||||
if (r != MAIL_NO_ERROR) {
|
||||
mailimap_fetch_list_free(fetch_result);
|
||||
self.lastError = MailCoreCreateErrorFromIMAPCode(r);
|
||||
return nil;
|
||||
}
|
||||
}
|
||||
|
||||
if (envelope != NULL) {
|
||||
r = imap_env_to_fields(envelope, references, ref_size, &fields);
|
||||
if (r != MAIL_NO_ERROR) {
|
||||
mailmime_free(body);
|
||||
mailimap_fetch_list_free(fetch_result);
|
||||
self.lastError = MailCoreCreateErrorFromIMAPCode(r);
|
||||
return nil;
|
||||
}
|
||||
}
|
||||
|
||||
content_message = mailmime_get_content_message();
|
||||
if (content_message == NULL) {
|
||||
if (fields != NULL)
|
||||
mailimf_fields_free(fields);
|
||||
mailmime_free(body);
|
||||
mailimap_fetch_list_free(fetch_result);
|
||||
self.lastError = MailCoreCreateErrorFromCode(r);
|
||||
self.lastError = MailCoreCreateErrorFromIMAPCode(MAIL_ERROR_MEMORY);
|
||||
return nil;
|
||||
}
|
||||
}
|
||||
|
||||
content_message = mailmime_get_content_message();
|
||||
if (content_message == NULL) {
|
||||
if (fields != NULL)
|
||||
mailimf_fields_free(fields);
|
||||
mailmime_free(body);
|
||||
mailimap_fetch_list_free(fetch_result);
|
||||
self.lastError = MailCoreCreateErrorFromCode(MAIL_ERROR_MEMORY);
|
||||
return nil;
|
||||
}
|
||||
new_body = mailmime_new(MAILMIME_MESSAGE, NULL,
|
||||
0, NULL, content_message,
|
||||
NULL, NULL, NULL, NULL, fields, body);
|
||||
|
||||
new_body = mailmime_new(MAILMIME_MESSAGE, NULL,
|
||||
0, NULL, content_message,
|
||||
NULL, NULL, NULL, NULL, fields, body);
|
||||
|
||||
if (new_body == NULL) {
|
||||
mailmime_content_free(content_message);
|
||||
if (fields != NULL)
|
||||
mailimf_fields_free(fields);
|
||||
mailmime_free(body);
|
||||
mailimap_fetch_list_free(fetch_result);
|
||||
self.lastError = MailCoreCreateErrorFromCode(MAIL_ERROR_MEMORY);
|
||||
return nil;
|
||||
if (new_body == NULL) {
|
||||
mailmime_content_free(content_message);
|
||||
if (fields != NULL)
|
||||
mailimf_fields_free(fields);
|
||||
mailmime_free(body);
|
||||
mailimap_fetch_list_free(fetch_result);
|
||||
self.lastError = MailCoreCreateErrorFromIMAPCode(MAIL_ERROR_MEMORY);
|
||||
return nil;
|
||||
}
|
||||
}
|
||||
|
||||
CTCoreMessage* msgObject = [[CTCoreMessage alloc] initWithMessageStruct:msg];
|
||||
msgObject.parentFolder = self;
|
||||
[msgObject setSequenceNumber:msg_att->att_number];
|
||||
if (fields != NULL) {
|
||||
[msgObject setFields:fields];
|
||||
@@ -504,7 +638,7 @@ int uid_list_to_env_list(clist * fetch_result, struct mailmessage_list ** result
|
||||
struct mailmessage *msgStruct;
|
||||
char uidString[100];
|
||||
|
||||
sprintf(uidString, "%d", uid);
|
||||
sprintf(uidString, "%d-%d", (uint32_t)[self uidValidity], (uint32_t)uid);
|
||||
|
||||
BOOL success = [self connect];
|
||||
if (!success) {
|
||||
@@ -512,22 +646,24 @@ int uid_list_to_env_list(clist * fetch_result, struct mailmessage_list ** result
|
||||
}
|
||||
err = mailfolder_get_message_by_uid([self folderStruct], uidString, &msgStruct);
|
||||
if (err != MAIL_NO_ERROR) {
|
||||
self.lastError = MailCoreCreateErrorFromCode(err);
|
||||
self.lastError = MailCoreCreateErrorFromIMAPCode(err);
|
||||
return nil;
|
||||
}
|
||||
err = mailmessage_fetch_envelope(msgStruct,&(msgStruct->msg_fields));
|
||||
if (err != MAIL_NO_ERROR) {
|
||||
self.lastError = MailCoreCreateErrorFromCode(err);
|
||||
self.lastError = MailCoreCreateErrorFromIMAPCode(err);
|
||||
return nil;
|
||||
}
|
||||
//TODO Fix me, i'm missing alot of things that aren't being downloaded,
|
||||
// I just hacked this in here for the mean time
|
||||
err = mailmessage_get_flags(msgStruct, &(msgStruct->msg_flags));
|
||||
if (err != MAIL_NO_ERROR) {
|
||||
self.lastError = MailCoreCreateErrorFromCode(err);
|
||||
self.lastError = MailCoreCreateErrorFromIMAPCode(err);
|
||||
return nil;
|
||||
}
|
||||
return [[[CTCoreMessage alloc] initWithMessageStruct:msgStruct] autorelease];
|
||||
CTCoreMessage *msg = [[[CTCoreMessage alloc] initWithMessageStruct:msgStruct] autorelease];
|
||||
msg.parentFolder = self;
|
||||
return msg;
|
||||
}
|
||||
|
||||
/* Why are flagsForMessage: and setFlags:forMessage: in CTCoreFolder instead of CTCoreMessage?
|
||||
@@ -549,7 +685,7 @@ int uid_list_to_env_list(clist * fetch_result, struct mailmessage_list ** result
|
||||
struct mail_flags *flagStruct;
|
||||
err = mailmessage_get_flags([msg messageStruct], &flagStruct);
|
||||
if (err != MAIL_NO_ERROR) {
|
||||
self.lastError = MailCoreCreateErrorFromCode(err);
|
||||
self.lastError = MailCoreCreateErrorFromIMAPCode(err);
|
||||
return NO;
|
||||
}
|
||||
*flags = flagStruct->fl_flags;
|
||||
@@ -567,10 +703,15 @@ int uid_list_to_env_list(clist * fetch_result, struct mailmessage_list ** result
|
||||
[msg messageStruct]->msg_flags->fl_flags=flags;
|
||||
err = mailmessage_check([msg messageStruct]);
|
||||
if (err != MAIL_NO_ERROR) {
|
||||
self.lastError = MailCoreCreateErrorFromCode(err);
|
||||
self.lastError = MailCoreCreateErrorFromIMAPCode(err);
|
||||
return NO;
|
||||
}
|
||||
return [self check];
|
||||
err = mailfolder_check(myFolder);
|
||||
if (err != MAIL_NO_ERROR) {
|
||||
self.lastError = MailCoreCreateErrorFromIMAPCode(err);
|
||||
return NO;
|
||||
}
|
||||
return YES;
|
||||
}
|
||||
|
||||
|
||||
@@ -582,37 +723,37 @@ int uid_list_to_env_list(clist * fetch_result, struct mailmessage_list ** result
|
||||
}
|
||||
err = mailfolder_expunge(myFolder);
|
||||
if (err != MAIL_NO_ERROR) {
|
||||
self.lastError = MailCoreCreateErrorFromCode(err);
|
||||
self.lastError = MailCoreCreateErrorFromIMAPCode(err);
|
||||
return NO;
|
||||
}
|
||||
return YES;
|
||||
}
|
||||
|
||||
- (BOOL)copyMessage:(CTCoreMessage *)msg toPath:(NSString *)path {
|
||||
- (BOOL)copyMessageWithUID:(NSUInteger)uid toPath:(NSString *)path {
|
||||
BOOL success = [self connect];
|
||||
if (!success) {
|
||||
return NO;
|
||||
}
|
||||
|
||||
const char *mbPath = [path cStringUsingEncoding:NSUTF8StringEncoding];
|
||||
int err = mailsession_copy_message([self folderSession], [msg uid], mbPath);
|
||||
int err = mailsession_copy_message([self folderSession], uid, mbPath);
|
||||
if (err != MAIL_NO_ERROR) {
|
||||
self.lastError = MailCoreCreateErrorFromCode(err);
|
||||
self.lastError = MailCoreCreateErrorFromIMAPCode(err);
|
||||
return NO;
|
||||
}
|
||||
return YES;
|
||||
}
|
||||
|
||||
- (BOOL)moveMessage:(CTCoreMessage *)msg toPath:(NSString *)path {
|
||||
- (BOOL)moveMessageWithUID:(NSUInteger)uid toPath:(NSString *)path {
|
||||
BOOL success = [self connect];
|
||||
if (!success) {
|
||||
return NO;
|
||||
}
|
||||
|
||||
const char *mbPath = [path cStringUsingEncoding:NSUTF8StringEncoding];
|
||||
int err = mailsession_move_message([self folderSession], [msg uid], mbPath);
|
||||
int err = mailsession_move_message([self folderSession], uid, mbPath);
|
||||
if (err != MAIL_NO_ERROR) {
|
||||
self.lastError = MailCoreCreateErrorFromCode(err);
|
||||
self.lastError = MailCoreCreateErrorFromIMAPCode(err);
|
||||
return NO;
|
||||
}
|
||||
return YES;
|
||||
@@ -626,9 +767,9 @@ int uid_list_to_env_list(clist * fetch_result, struct mailmessage_list ** result
|
||||
if (!success) {
|
||||
return NO;
|
||||
}
|
||||
err = mailfolder_status(myFolder, &junk, &junk, unseenCount);
|
||||
err = mailfolder_status(myFolder, &junk, &junk, (uint32_t *)unseenCount);
|
||||
if (err != MAIL_NO_ERROR) {
|
||||
self.lastError = MailCoreCreateErrorFromCode(err);
|
||||
self.lastError = MailCoreCreateErrorFromIMAPCode(err);
|
||||
return NO;
|
||||
}
|
||||
return YES;
|
||||
|
||||
+180
-126
@@ -32,13 +32,12 @@
|
||||
#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
|
||||
convenience method messageWithUID: to get a message object you can work with.
|
||||
/**
|
||||
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.
|
||||
Anything that begins with "fetch", requires that an active network connection is present.
|
||||
*/
|
||||
|
||||
@class CTCoreFolder, CTCoreAddress, CTCoreAttachment, CTMIME;
|
||||
@@ -49,241 +48,296 @@
|
||||
CTMIME *myParsedMIME;
|
||||
NSUInteger mySequenceNumber;
|
||||
NSError *lastError;
|
||||
CTCoreFolder *parentFolder;
|
||||
}
|
||||
/*!
|
||||
@abstract If an error occurred (nil or return of NO) call this method to get the error
|
||||
*/
|
||||
@property(nonatomic, retain) NSError *lastError;
|
||||
/**
|
||||
If an error occurred (nil or return of NO) call this method to get the error
|
||||
*/
|
||||
@property (nonatomic, retain) NSError *lastError;
|
||||
|
||||
/*!
|
||||
@abstract If the body structure has been fetched, this will contain the MIME structure
|
||||
*/
|
||||
@property (nonatomic, retain) CTCoreFolder *parentFolder;
|
||||
|
||||
/**
|
||||
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.
|
||||
/**
|
||||
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.
|
||||
/**
|
||||
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.
|
||||
/**
|
||||
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
|
||||
/**
|
||||
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
|
||||
/**
|
||||
If a method returns nil or in the case of a BOOL returns NO, call this to get the error that occured
|
||||
*/
|
||||
- (id)init;
|
||||
|
||||
/*!
|
||||
@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 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
|
||||
*/
|
||||
/**
|
||||
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.
|
||||
/**
|
||||
This method returns the parsed plain text message body as an NSString.
|
||||
|
||||
If a plaintext body isn't found an empty string is returned
|
||||
*/
|
||||
- (NSString *)body;
|
||||
|
||||
/*!
|
||||
@abstract This method returns the html body as an NSString.
|
||||
*/
|
||||
/**
|
||||
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;
|
||||
/**
|
||||
Returns a message body as an NSString.
|
||||
|
||||
/*!
|
||||
@abstract This method sets the message body. Plaintext only please!
|
||||
@param isHTML Pass in a BOOL pointer that will be set to YES if an HTML body is loaded
|
||||
|
||||
First attempts to retrieve a plain text body, if that fails then
|
||||
tries for an HTML body.
|
||||
*/
|
||||
- (NSString *)bodyPreferringPlainText:(BOOL *)isHTML;
|
||||
|
||||
/**
|
||||
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.
|
||||
/**
|
||||
Use this method to set the body if you have HTML content.
|
||||
*/
|
||||
- (void)setHTMLBody:(NSString *)body;
|
||||
|
||||
/**
|
||||
A list of attachments this message has
|
||||
*/
|
||||
- (NSArray *)attachments;
|
||||
|
||||
/**
|
||||
Add an attachment to the message.
|
||||
|
||||
Only used when sending e-mail
|
||||
*/
|
||||
- (void)addAttachment:(CTCoreAttachment *)attachment;
|
||||
|
||||
/*!
|
||||
@abstract Returns the subject of the message.
|
||||
/**
|
||||
Returns the subject of the message.
|
||||
*/
|
||||
- (NSString *)subject;
|
||||
|
||||
/*!
|
||||
@abstract Will set the subject of the message, use this when composing e-mail.
|
||||
/**
|
||||
Will set the subject of the message, use this when composing e-mail.
|
||||
*/
|
||||
- (void)setSubject:(NSString *)subject;
|
||||
|
||||
/*! @abstract Returns the timezone of the sender of the message (got from the Date field timezone attribute) */
|
||||
/**
|
||||
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) */
|
||||
/**
|
||||
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 */
|
||||
/**
|
||||
Returns the date in the Date field converted to GMT
|
||||
*/
|
||||
- (NSDate *)sentDateGMT;
|
||||
|
||||
/*!
|
||||
@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
|
||||
*/
|
||||
/**
|
||||
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.
|
||||
*/
|
||||
/**
|
||||
Returns YES if the message is unread.
|
||||
*/
|
||||
- (BOOL)isUnread;
|
||||
|
||||
/*!
|
||||
@abstract Returns YES if the message is recent and unread.
|
||||
/**
|
||||
Returns YES if the message is recent and unread.
|
||||
*/
|
||||
- (BOOL)isNew;
|
||||
|
||||
/*!
|
||||
@abstract Returns YES if the message is starred (flagged in IMAP terms).
|
||||
*/
|
||||
/**
|
||||
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
|
||||
/**
|
||||
A machine readable ID that is guaranteed unique by the
|
||||
host that generated the message
|
||||
*/
|
||||
- (NSString *)messageId;
|
||||
|
||||
/*!
|
||||
@abstract Returns an NSUInteger containing the messages UID. This number is unique across sessions
|
||||
/**
|
||||
Returns an NSUInteger containing the messages UID. This number is unique across sessions
|
||||
*/
|
||||
- (NSUInteger)uid;
|
||||
|
||||
/*!
|
||||
@abstract Returns the message sequence number, this number cannot be used across sessions
|
||||
/**
|
||||
Returns the message sequence number, this number cannot be used across sessions
|
||||
*/
|
||||
- (NSUInteger)sequenceNumber;
|
||||
|
||||
/*!
|
||||
@abstract Returns the message size in bytes
|
||||
*/
|
||||
/**
|
||||
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
|
||||
*/
|
||||
/**
|
||||
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.
|
||||
/**
|
||||
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
|
||||
/**
|
||||
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
|
||||
/**
|
||||
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.
|
||||
/**
|
||||
Returns the sender.
|
||||
|
||||
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.
|
||||
/**
|
||||
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
|
||||
/**
|
||||
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.
|
||||
/**
|
||||
Return the list of messageIds from the in-reply-to field
|
||||
*/
|
||||
- (NSArray *)inReplyTo;
|
||||
|
||||
/**
|
||||
Sets the message's in-reply-to messageIds
|
||||
@param messageIds A NSArray containing NSString messageId's
|
||||
*/
|
||||
- (void)setInReplyTo:(NSArray *)messageIds;
|
||||
|
||||
/**
|
||||
Return the list of messageIds from the references field
|
||||
*/
|
||||
- (NSArray *)references;
|
||||
|
||||
/**
|
||||
Sets the message's references
|
||||
@param messageIds A NSArray containing NSString messageId's
|
||||
*/
|
||||
- (void)setReferences:(NSArray *)messageIds;
|
||||
|
||||
/**
|
||||
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
|
||||
/**
|
||||
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.
|
||||
/**
|
||||
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
|
||||
/**
|
||||
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.
|
||||
/**
|
||||
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
|
||||
/**
|
||||
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.
|
||||
/**
|
||||
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.
|
||||
/**
|
||||
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
|
||||
/**
|
||||
Fetches from the server the rfc822 content of the message, which are the headers and the message body.
|
||||
@return Return nil on error. Call method lastError to get error if one occurred
|
||||
*/
|
||||
- (NSString *)rfc822;
|
||||
|
||||
/**
|
||||
Fetches from the server the rfc822 content of the message headers.
|
||||
@return Return nil on error. Call method lastError to get error if one occurred
|
||||
*/
|
||||
- (NSString *)rfc822Header;
|
||||
|
||||
/* Intended for advanced use only */
|
||||
- (struct mailmessage *)messageStruct;
|
||||
- (mailimap *)imapSession;
|
||||
|
||||
+94
-17
@@ -43,21 +43,11 @@
|
||||
#import "CTMIME_HtmlPart.h"
|
||||
#import "MailCoreUtilities.h"
|
||||
|
||||
@interface CTCoreMessage ()
|
||||
- (CTCoreAddress *)_addressFromMailbox:(struct mailimf_mailbox *)mailbox;
|
||||
- (NSSet *)_addressListFromMailboxList:(struct mailimf_mailbox_list *)mailboxList;
|
||||
- (struct mailimf_mailbox_list *)_mailboxListFromAddressList:(NSSet *)addresses;
|
||||
- (NSSet *)_addressListFromIMFAddressList:(struct mailimf_address_list *)imfList;
|
||||
- (struct mailimf_address_list *)_IMFAddressListFromAddresssList:(NSSet *)addresses;
|
||||
- (void)_buildUpBodyText:(CTMIME *)mime result:(NSMutableString *)result;
|
||||
- (void)_buildUpHtmlBodyText:(CTMIME *)mime result:(NSMutableString *)result;
|
||||
@end
|
||||
|
||||
@implementation CTCoreMessage
|
||||
@synthesize mime=myParsedMIME, lastError;
|
||||
@synthesize mime=myParsedMIME, lastError, parentFolder;
|
||||
|
||||
- (id)init {
|
||||
[super init];
|
||||
self = [super init];
|
||||
if (self) {
|
||||
struct mailimf_fields *fields = mailimf_fields_new_empty();
|
||||
myFields = mailimf_single_fields_new(fields);
|
||||
@@ -104,6 +94,7 @@
|
||||
mailimf_single_fields_free(myFields);
|
||||
}
|
||||
self.lastError = nil;
|
||||
self.parentFolder = nil;
|
||||
[myParsedMIME release];
|
||||
[super dealloc];
|
||||
}
|
||||
@@ -122,19 +113,24 @@
|
||||
//Retrieve message mime and message field
|
||||
err = mailmessage_get_bodystructure(myMessage, &dummyMime);
|
||||
if (err != MAIL_NO_ERROR) {
|
||||
self.lastError = MailCoreCreateErrorFromCode(err);
|
||||
self.lastError = MailCoreCreateErrorFromIMAPCode(err);
|
||||
return NO;
|
||||
}
|
||||
|
||||
CTMIME *oldMIME = myParsedMIME;
|
||||
myParsedMIME = [[CTMIMEFactory createMIMEWithMIMEStruct:[self messageStruct]->msg_mime
|
||||
forMessage:[self messageStruct]] retain];
|
||||
[oldMIME release];
|
||||
|
||||
return YES;
|
||||
}
|
||||
|
||||
- (void)setBodyStructure:(struct mailmime *)mime {
|
||||
CTMIME *oldMIME = myParsedMIME;
|
||||
myMessage->msg_mime = mime;
|
||||
myParsedMIME = [[CTMIMEFactory createMIMEWithMIMEStruct:[self messageStruct]->msg_mime
|
||||
forMessage:[self messageStruct]] retain];
|
||||
[oldMIME release];
|
||||
}
|
||||
|
||||
- (void)setFields:(struct mailimf_fields *)fields {
|
||||
@@ -179,10 +175,12 @@
|
||||
return result;
|
||||
}
|
||||
|
||||
- (NSString *)bodyPreferringPlainText {
|
||||
- (NSString *)bodyPreferringPlainText:(BOOL *)isHTML {
|
||||
NSString *body = [self body];
|
||||
*isHTML = NO;
|
||||
if ([body length] == 0) {
|
||||
body = [self htmlBody];
|
||||
*isHTML = YES;
|
||||
}
|
||||
return body;
|
||||
}
|
||||
@@ -502,6 +500,45 @@
|
||||
myFields->fld_to = mailimf_to_new(imf);
|
||||
}
|
||||
|
||||
- (NSArray *)inReplyTo {
|
||||
if (myFields->fld_in_reply_to == NULL)
|
||||
return nil;
|
||||
else
|
||||
return [self _stringArrayFromClist:myFields->fld_in_reply_to->mid_list];
|
||||
}
|
||||
|
||||
|
||||
- (void)setInReplyTo:(NSArray *)messageIds {
|
||||
struct mailimf_in_reply_to *imf = mailimf_in_reply_to_new([self _clistFromStringArray:messageIds]);
|
||||
|
||||
if (myFields->fld_in_reply_to != NULL) {
|
||||
mailimf_in_reply_to_free(myFields->fld_in_reply_to);
|
||||
myFields->fld_in_reply_to = imf;
|
||||
}
|
||||
else
|
||||
myFields->fld_in_reply_to = imf;
|
||||
}
|
||||
|
||||
|
||||
- (NSArray *)references {
|
||||
if (myFields->fld_references == NULL)
|
||||
return nil;
|
||||
else
|
||||
return [self _stringArrayFromClist:myFields->fld_references->mid_list];
|
||||
}
|
||||
|
||||
|
||||
- (void)setReferences:(NSArray *)messageIds {
|
||||
struct mailimf_references *imf = mailimf_references_new([self _clistFromStringArray:messageIds]);
|
||||
|
||||
if (myFields->fld_references != NULL) {
|
||||
mailimf_references_free(myFields->fld_references);
|
||||
myFields->fld_references = imf;
|
||||
}
|
||||
else
|
||||
myFields->fld_references = imf;
|
||||
}
|
||||
|
||||
|
||||
- (NSSet *)cc {
|
||||
if (myFields->fld_cc == NULL)
|
||||
@@ -588,7 +625,7 @@
|
||||
NSString *msgContent = [[self rfc822] stringByReplacingOccurrencesOfString:@"\r\n" withString:@"\n"];
|
||||
NSData *msgContentAsData = [msgContent dataUsingEncoding:NSUTF8StringEncoding];
|
||||
NSMutableData *emlx = [NSMutableData data];
|
||||
[emlx appendData:[[NSString stringWithFormat:@"%-10d\n", msgContentAsData.length] dataUsingEncoding:NSUTF8StringEncoding]];
|
||||
[emlx appendData:[[NSString stringWithFormat:@"%-10d\n", (uint32_t)msgContentAsData.length] dataUsingEncoding:NSUTF8StringEncoding]];
|
||||
[emlx appendData:msgContentAsData];
|
||||
|
||||
|
||||
@@ -626,13 +663,26 @@
|
||||
if (r == MAIL_NO_ERROR) {
|
||||
nsresult = [[NSString alloc] initWithCString:result encoding:NSUTF8StringEncoding];
|
||||
} else {
|
||||
self.lastError = MailCoreCreateErrorFromCode(r);
|
||||
self.lastError = MailCoreCreateErrorFromIMAPCode(r);
|
||||
return nil;
|
||||
}
|
||||
mailimap_msg_att_rfc822_free(result);
|
||||
return [nsresult autorelease];
|
||||
}
|
||||
|
||||
- (NSString *)rfc822Header {
|
||||
char *result = NULL;
|
||||
NSString *nsresult;
|
||||
int r = mailimap_fetch_rfc822_header([self imapSession], [self sequenceNumber], &result);
|
||||
if (r == MAIL_NO_ERROR) {
|
||||
nsresult = [[NSString alloc] initWithCString:result encoding:NSUTF8StringEncoding];
|
||||
} else {
|
||||
self.lastError = MailCoreCreateErrorFromIMAPCode(r);
|
||||
return nil;
|
||||
}
|
||||
mailimap_msg_att_rfc822_free(result);
|
||||
return [nsresult autorelease];
|
||||
}
|
||||
|
||||
- (struct mailmessage *)messageStruct {
|
||||
return myMessage;
|
||||
@@ -652,7 +702,6 @@
|
||||
return data->imap_session;
|
||||
}
|
||||
|
||||
/*********************************** myprivates ***********************************/
|
||||
- (CTCoreAddress *)_addressFromMailbox:(struct mailimf_mailbox *)mailbox; {
|
||||
CTCoreAddress *address = [CTCoreAddress address];
|
||||
if (mailbox == NULL) {
|
||||
@@ -751,4 +800,32 @@
|
||||
return imfList;
|
||||
}
|
||||
|
||||
- (NSArray *)_stringArrayFromClist:(clist *)list {
|
||||
clistiter *iter;
|
||||
NSMutableArray *stringSet = [NSMutableArray array];
|
||||
char *string;
|
||||
|
||||
if(list == NULL)
|
||||
return stringSet;
|
||||
|
||||
for(iter = clist_begin(list); iter != NULL; iter = clist_next(iter)) {
|
||||
string = clist_content(iter);
|
||||
NSString *strObj = [[NSString alloc] initWithUTF8String:string];
|
||||
[stringSet addObject:strObj];
|
||||
[strObj release];
|
||||
}
|
||||
|
||||
return stringSet;
|
||||
}
|
||||
|
||||
- (clist *)_clistFromStringArray:(NSArray *)strings {
|
||||
clist * str_list = clist_new();
|
||||
|
||||
for (NSString *str in strings) {
|
||||
clist_append(str_list, strdup([str UTF8String]));
|
||||
}
|
||||
|
||||
return str_list;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
+3
-4
@@ -32,10 +32,9 @@
|
||||
#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.
|
||||
/*
|
||||
This class is used internally by CTSMTPConnection for ESMTP connections, clients
|
||||
should not use this directly.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
+17
-28
@@ -101,25 +101,15 @@ static int fill_local_ip_port(mailstream * stream, char * local_ip_port, size_t
|
||||
|
||||
|
||||
- (BOOL)startTLS {
|
||||
mailstream_low * low;
|
||||
int fd;
|
||||
mailstream_low * new_low;
|
||||
|
||||
int ret = mailesmtp_starttls([self resource]);
|
||||
int ret = mailsmtp_socket_starttls([self resource]);
|
||||
if (ret != MAIL_NO_ERROR) {
|
||||
self.lastError = MailCoreCreateErrorFromCode(ret);
|
||||
self.lastError = MailCoreCreateErrorFromSMTPCode(ret);
|
||||
return NO;
|
||||
}
|
||||
|
||||
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);
|
||||
self.lastError = MailCoreCreateErrorFromSMTPCode(ret);
|
||||
return NO;
|
||||
}
|
||||
return YES;
|
||||
@@ -152,22 +142,21 @@ static int fill_local_ip_port(mailstream * stream, char * local_ip_port, size_t
|
||||
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);
|
||||
|
||||
*/
|
||||
ret = mailesmtp_auth_sasl([self resource], "PLAIN", cServer, local_ip_port, remote_ip_port,
|
||||
char *authType = "PLAIN";
|
||||
mailsmtp *session = [self resource];
|
||||
if (session->auth & MAILSMTP_AUTH_CHECKED) {
|
||||
// If the server doesn't support PLAIN but does support the older LOGIN,
|
||||
// fall back to LOGIN. This can happen with older servers like Exchange 2003
|
||||
if (!(session->auth & MAILSMTP_AUTH_PLAIN) && session->auth & MAILSMTP_AUTH_LOGIN) {
|
||||
authType = "LOGIN";
|
||||
}
|
||||
}
|
||||
|
||||
ret = mailesmtp_auth_sasl(session, authType, cServer, local_ip_port, remote_ip_port,
|
||||
cUsername, cUsername, cPassword, cServer);
|
||||
if (ret != MAIL_NO_ERROR) {
|
||||
self.lastError = MailCoreCreateErrorFromCode(ret);
|
||||
self.lastError = MailCoreCreateErrorFromSMTPCode(ret);
|
||||
return NO;
|
||||
}
|
||||
return YES;
|
||||
@@ -177,7 +166,7 @@ static int fill_local_ip_port(mailstream * stream, char * local_ip_port, size_t
|
||||
- (BOOL)setFrom:(NSString *)fromAddress {
|
||||
int ret = mailesmtp_mail([self resource], [fromAddress cStringUsingEncoding:NSUTF8StringEncoding], 1, "MailCoreSMTP");
|
||||
if (ret != MAIL_NO_ERROR) {
|
||||
self.lastError = MailCoreCreateErrorFromCode(ret);
|
||||
self.lastError = MailCoreCreateErrorFromSMTPCode(ret);
|
||||
return NO;
|
||||
}
|
||||
return YES;
|
||||
@@ -188,7 +177,7 @@ static int fill_local_ip_port(mailstream * stream, char * local_ip_port, size_t
|
||||
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);
|
||||
self.lastError = MailCoreCreateErrorFromSMTPCode(ret);
|
||||
return NO;
|
||||
}
|
||||
return YES;
|
||||
|
||||
+4
-1
@@ -106,11 +106,14 @@
|
||||
int err = 0;
|
||||
NSString *resultStr;
|
||||
|
||||
mailmime_write_mem(str, &col, [self buildMIMEStruct]);
|
||||
struct mailmime *mime = [self buildMIMEStruct];
|
||||
mailmime_write_mem(str, &col, mime);
|
||||
err = mmap_string_ref(str);
|
||||
resultStr = [[NSString alloc] initWithBytes:str->str length:str->len
|
||||
encoding:NSUTF8StringEncoding];
|
||||
mmap_string_free(str);
|
||||
mime->mm_data.mm_message.mm_fields = NULL;
|
||||
mailmime_free(mime);
|
||||
return [resultStr autorelease];
|
||||
}
|
||||
|
||||
|
||||
@@ -89,19 +89,23 @@
|
||||
struct mailmime *mime_sub;
|
||||
struct mailmime_content *content;
|
||||
struct mailmime_parameter *param;
|
||||
struct mailmime_disposition *disposition;
|
||||
struct mailmime_mechanism *encoding;
|
||||
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);
|
||||
encoding = mailmime_mechanism_new(MAILMIME_MECHANISM_QUOTED_PRINTABLE, NULL);
|
||||
disposition = mailmime_disposition_new_with_data(MAILMIME_DISPOSITION_TYPE_INLINE, NULL, NULL, NULL, NULL, -1);
|
||||
mime_fields = mailmime_fields_new_with_data(encoding, NULL, NULL, disposition, NULL);
|
||||
|
||||
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]);
|
||||
NSData * data = [str dataUsingEncoding:NSUTF8StringEncoding];
|
||||
r = mailmime_set_body_text(mime_sub, strdup([data bytes]), [data length]);
|
||||
return mime_sub;
|
||||
}
|
||||
|
||||
|
||||
@@ -60,6 +60,7 @@
|
||||
self = [super init];
|
||||
if (self) {
|
||||
myContentList = [[NSMutableArray alloc] init];
|
||||
self.contentType = @"multipart/mixed";
|
||||
}
|
||||
return self;
|
||||
}
|
||||
@@ -78,8 +79,7 @@
|
||||
}
|
||||
|
||||
- (struct mailmime *)buildMIMEStruct {
|
||||
//TODO make this smarter so it builds different types other than multipart/mixed
|
||||
struct mailmime *mime = mailmime_multiple_new("multipart/mixed");
|
||||
struct mailmime *mime = mailmime_multiple_new([self.contentType UTF8String]);
|
||||
|
||||
NSEnumerator *enumer = [myContentList objectEnumerator];
|
||||
|
||||
|
||||
@@ -44,6 +44,7 @@ typedef void (^CTProgressBlock)(size_t curr, size_t max);
|
||||
BOOL mFetched;
|
||||
NSString *mFilename;
|
||||
NSString *mContentId;
|
||||
NSError *lastError;
|
||||
}
|
||||
@property(nonatomic) BOOL attached;
|
||||
@property(nonatomic) BOOL fetched;
|
||||
@@ -52,9 +53,9 @@ typedef void (^CTProgressBlock)(size_t curr, size_t max);
|
||||
@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
|
||||
*/
|
||||
/*
|
||||
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;
|
||||
|
||||
@@ -152,7 +152,7 @@ static void download_progress_callback(size_t current, size_t maximum, void * co
|
||||
if (mimeFields != NULL && mimeFields->fld_encoding != NULL)
|
||||
encoding = mimeFields->fld_encoding->enc_type;
|
||||
|
||||
char *fetchedData;
|
||||
char *fetchedData = NULL;
|
||||
size_t fetchedDataLen;
|
||||
int r;
|
||||
|
||||
@@ -164,8 +164,10 @@ static void download_progress_callback(size_t current, size_t maximum, void * co
|
||||
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);
|
||||
if (fetchedData) {
|
||||
mailmessage_fetch_result_free(mMessage, fetchedData);
|
||||
}
|
||||
self.lastError = MailCoreCreateErrorFromIMAPCode(r);
|
||||
return NO;
|
||||
}
|
||||
|
||||
@@ -177,7 +179,7 @@ static void download_progress_callback(size_t current, size_t maximum, void * co
|
||||
encoding, &result, &result_len);
|
||||
if (r != MAILIMF_NO_ERROR) {
|
||||
mailmime_decoded_part_free(result);
|
||||
self.lastError = MailCoreCreateErrorFromCode(r);
|
||||
self.lastError = MailCoreCreateError(r, @"Error parsing the message");
|
||||
return NO;
|
||||
}
|
||||
NSData *data = [NSData dataWithBytes:result length:result_len];
|
||||
@@ -201,8 +203,11 @@ static void download_progress_callback(size_t current, size_t maximum, void * co
|
||||
int r;
|
||||
|
||||
if (mFilename) {
|
||||
char *charData = (char *)[mFilename cStringUsingEncoding:NSUTF8StringEncoding];
|
||||
char *dupeData = malloc(strlen(charData));
|
||||
strcpy(dupeData, charData);
|
||||
mime_fields = mailmime_fields_new_filename( MAILMIME_DISPOSITION_TYPE_ATTACHMENT,
|
||||
(char *)[mFilename cStringUsingEncoding:NSUTF8StringEncoding],
|
||||
dupeData,
|
||||
MAILMIME_MECHANISM_BASE64 );
|
||||
} else {
|
||||
mime_fields = mailmime_fields_new_encoding(MAILMIME_MECHANISM_BASE64);
|
||||
|
||||
@@ -91,15 +91,14 @@
|
||||
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);
|
||||
mime_fields = mailmime_fields_new_encoding(MAILMIME_MECHANISM_QUOTED_PRINTABLE);
|
||||
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]);
|
||||
NSData * data = [str dataUsingEncoding:NSUTF8StringEncoding];
|
||||
r = mailmime_set_body_text(mime_sub, strdup([data bytes]), [data length]);
|
||||
return mime_sub;
|
||||
}
|
||||
@end
|
||||
|
||||
+7
-7
@@ -32,23 +32,23 @@
|
||||
#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.
|
||||
/*
|
||||
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 */
|
||||
NSError *lastError;
|
||||
}
|
||||
/*!
|
||||
@abstract If an error occurred (nil or return of NO) call this method to get the error
|
||||
*/
|
||||
/*
|
||||
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;
|
||||
- (BOOL)connectToServer:(NSString *)server port:(unsigned int)port;
|
||||
- (BOOL)connectWithTlsToServer:(NSString *)server port:(unsigned int)port;
|
||||
- (BOOL)helo;
|
||||
- (BOOL)startTLS;
|
||||
- (BOOL)authenticateWithUsername:(NSString *)username password:(NSString *)password server:(NSString *)server;
|
||||
|
||||
+16
-6
@@ -55,7 +55,17 @@
|
||||
/* first open the stream */
|
||||
int ret = mailsmtp_socket_connect([self resource], [server cStringUsingEncoding:NSUTF8StringEncoding], port);
|
||||
if (ret != MAIL_NO_ERROR) {
|
||||
self.lastError = MailCoreCreateErrorFromCode(ret);
|
||||
self.lastError = MailCoreCreateErrorFromSMTPCode(ret);
|
||||
return NO;
|
||||
}
|
||||
return YES;
|
||||
}
|
||||
|
||||
- (BOOL)connectWithTlsToServer:(NSString *)server port:(unsigned int)port {
|
||||
/* first open the stream */
|
||||
int ret = mailsmtp_ssl_connect([self resource], [server cStringUsingEncoding:NSUTF8StringEncoding], port);
|
||||
if (ret != MAIL_NO_ERROR) {
|
||||
self.lastError = MailCoreCreateErrorFromSMTPCode(ret);
|
||||
return NO;
|
||||
}
|
||||
return YES;
|
||||
@@ -65,7 +75,7 @@
|
||||
/* 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);
|
||||
self.lastError = MailCoreCreateErrorFromSMTPCode(ret);
|
||||
return NO;
|
||||
}
|
||||
return YES; /* The server supports helo so return YES */
|
||||
@@ -82,7 +92,7 @@
|
||||
- (BOOL)setFrom:(NSString *)fromAddress {
|
||||
int ret = mailsmtp_mail([self resource], [fromAddress cStringUsingEncoding:NSUTF8StringEncoding]);
|
||||
if (ret != MAIL_NO_ERROR) {
|
||||
self.lastError = MailCoreCreateErrorFromCode(ret);
|
||||
self.lastError = MailCoreCreateErrorFromSMTPCode(ret);
|
||||
return NO;
|
||||
}
|
||||
return YES;
|
||||
@@ -105,7 +115,7 @@
|
||||
- (BOOL)setRecipientAddress:(NSString *)recAddress {
|
||||
int ret = mailsmtp_rcpt([self resource], [recAddress cStringUsingEncoding:NSUTF8StringEncoding]);
|
||||
if (ret != MAIL_NO_ERROR) {
|
||||
self.lastError = MailCoreCreateErrorFromCode(ret);
|
||||
self.lastError = MailCoreCreateErrorFromSMTPCode(ret);
|
||||
return NO;
|
||||
}
|
||||
return YES;
|
||||
@@ -115,12 +125,12 @@
|
||||
NSData *dataObj = [data dataUsingEncoding:NSUTF8StringEncoding];
|
||||
int ret = mailsmtp_data([self resource]);
|
||||
if (ret != MAIL_NO_ERROR) {
|
||||
self.lastError = MailCoreCreateErrorFromCode(ret);
|
||||
self.lastError = MailCoreCreateErrorFromSMTPCode(ret);
|
||||
return NO;
|
||||
}
|
||||
ret = mailsmtp_data_message([self resource], [dataObj bytes], [dataObj length]);
|
||||
if (ret != MAIL_NO_ERROR) {
|
||||
self.lastError = MailCoreCreateErrorFromCode(ret);
|
||||
self.lastError = MailCoreCreateErrorFromSMTPCode(ret);
|
||||
return NO;
|
||||
}
|
||||
return YES;
|
||||
|
||||
+46
-19
@@ -30,12 +30,12 @@
|
||||
*/
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "MailCoreTypes.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.
|
||||
/**
|
||||
This is not a class you instantiate! It has only two class methods, 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;
|
||||
@@ -43,19 +43,46 @@
|
||||
@interface CTSMTPConnection : NSObject {
|
||||
|
||||
}
|
||||
/*!
|
||||
@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
|
||||
/**
|
||||
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 connectionType What kind of connection, either: CTSMTPConnectionTypePlain, CTSMTPConnectionTypeStartTLS, CTSMTPConnectionTypeTLS
|
||||
@param auth Pass in YES if you would like to use SASL authentication
|
||||
@param error Will contain an error when the method returns NO
|
||||
@return Returns YES on success, NO on error
|
||||
*/
|
||||
+ (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)sendMessage:(CTCoreMessage *)message
|
||||
server:(NSString *)server
|
||||
username:(NSString *)username
|
||||
password:(NSString *)password
|
||||
port:(unsigned int)port
|
||||
connectionType:(CTSMTPConnectionType)connectionType
|
||||
useAuth:(BOOL)auth
|
||||
error:(NSError **)error;
|
||||
|
||||
/**
|
||||
Use this method to test the user's credentials.
|
||||
|
||||
This is useful for account setup. You can have the user enter in their credentials and then verify they work without sending a message.
|
||||
@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 connectionType What kind of connection, either: CTSMTPConnectionTypePlain, CTSMTPConnectionTypeStartTLS, CTSMTPConnectionTypeTLS
|
||||
@param auth Pass in YES if you would like to use SASL authentication
|
||||
@param error Will contain an error when the method returns NO
|
||||
@return Returns YES on success, NO on error
|
||||
*/
|
||||
+ (BOOL)canConnectToServer:(NSString *)server
|
||||
username:(NSString *)username
|
||||
password:(NSString *)password
|
||||
port:(unsigned int)port
|
||||
connectionType:(CTSMTPConnectionType)connectionType
|
||||
useAuth:(BOOL)auth
|
||||
error:(NSError **)error;
|
||||
|
||||
@end
|
||||
|
||||
@@ -41,13 +41,18 @@
|
||||
//TODO Add more descriptive error messages using mailsmtp_strerror
|
||||
@implementation CTSMTPConnection
|
||||
+ (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 {
|
||||
password:(NSString *)password port:(unsigned int)port connectionType:(CTSMTPConnectionType)connectionType
|
||||
useAuth:(BOOL)auth error:(NSError **)error {
|
||||
BOOL success;
|
||||
mailsmtp *smtp = NULL;
|
||||
smtp = mailsmtp_new(0, NULL);
|
||||
|
||||
CTSMTP *smtpObj = [[CTESMTP alloc] initWithResource:smtp];
|
||||
success = [smtpObj connectToServer:server port:port];
|
||||
if (connectionType == CTSMTPConnectionTypeStartTLS || connectionType == CTSMTPConnectionTypePlain) {
|
||||
success = [smtpObj connectToServer:server port:port];
|
||||
} else if (connectionType == CTSMTPConnectionTypeTLS) {
|
||||
success = [smtpObj connectWithTlsToServer:server port:port];
|
||||
}
|
||||
if (!success) {
|
||||
goto error;
|
||||
}
|
||||
@@ -60,14 +65,14 @@
|
||||
goto error;
|
||||
}
|
||||
}
|
||||
if (tls) {
|
||||
if (connectionType == CTSMTPConnectionTypeStartTLS) {
|
||||
success = [smtpObj startTLS];
|
||||
if (!success) {
|
||||
goto error;
|
||||
}
|
||||
}
|
||||
if (auth) {
|
||||
[smtpObj authenticateWithUsername:username password:password server:server];
|
||||
success = [smtpObj authenticateWithUsername:username password:password server:server];
|
||||
if (!success) {
|
||||
goto error;
|
||||
}
|
||||
@@ -93,6 +98,10 @@
|
||||
if (!success) {
|
||||
goto error;
|
||||
}
|
||||
|
||||
mailsmtp_quit(smtp);
|
||||
mailsmtp_free(smtp);
|
||||
|
||||
[smtpObj release];
|
||||
return YES;
|
||||
error:
|
||||
@@ -101,4 +110,54 @@ error:
|
||||
mailsmtp_free(smtp);
|
||||
return NO;
|
||||
}
|
||||
|
||||
+ (BOOL)canConnectToServer:(NSString *)server username:(NSString *)username password:(NSString *)password
|
||||
port:(unsigned int)port connectionType:(CTSMTPConnectionType)connectionType
|
||||
useAuth:(BOOL)auth error:(NSError **)error {
|
||||
BOOL success;
|
||||
mailsmtp *smtp = NULL;
|
||||
smtp = mailsmtp_new(0, NULL);
|
||||
|
||||
CTSMTP *smtpObj = [[CTESMTP alloc] initWithResource:smtp];
|
||||
if (connectionType == CTSMTPConnectionTypeStartTLS || connectionType == CTSMTPConnectionTypePlain) {
|
||||
success = [smtpObj connectToServer:server port:port];
|
||||
} else if (connectionType == CTSMTPConnectionTypeTLS) {
|
||||
success = [smtpObj connectWithTlsToServer: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 (connectionType == CTSMTPConnectionTypeStartTLS) {
|
||||
success = [smtpObj startTLS];
|
||||
if (!success) {
|
||||
goto error;
|
||||
}
|
||||
}
|
||||
if (auth) {
|
||||
success = [smtpObj authenticateWithUsername:username password:password server:server];
|
||||
if (!success) {
|
||||
goto error;
|
||||
}
|
||||
}
|
||||
|
||||
mailsmtp_quit(smtp);
|
||||
mailsmtp_free(smtp);
|
||||
|
||||
[smtpObj release];
|
||||
return YES;
|
||||
error:
|
||||
*error = smtpObj.lastError;
|
||||
[smtpObj release];
|
||||
mailsmtp_free(smtp);
|
||||
return NO;
|
||||
}
|
||||
@end
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
/*
|
||||
* MailCore
|
||||
*
|
||||
* Copyright (C) 2012 - Kris Wong
|
||||
* 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 <Foundation/Foundation.h>
|
||||
|
||||
@interface CTXlistResult : NSObject
|
||||
|
||||
@property (nonatomic, retain) NSString *name;
|
||||
@property (nonatomic, strong, readonly) NSArray *flags;
|
||||
|
||||
- (void)addFlag:(NSString *)flag;
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,62 @@
|
||||
/*
|
||||
* MailCore
|
||||
*
|
||||
* Copyright (C) 2012 - Kris Wong
|
||||
* 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 "CTXlistResult.h"
|
||||
|
||||
@implementation CTXlistResult
|
||||
{
|
||||
NSMutableArray *_flags;
|
||||
}
|
||||
|
||||
@synthesize name, flags = _flags;
|
||||
|
||||
- (id)init
|
||||
{
|
||||
self = [super init];
|
||||
if (self) {
|
||||
_flags = [[NSMutableArray alloc] init];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)dealloc
|
||||
{
|
||||
self.name = nil;
|
||||
[_flags release];
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
- (void)addFlag:(NSString *)flag
|
||||
{
|
||||
[_flags addObject:flag];
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -1,74 +0,0 @@
|
||||
/*******************************************************************************
|
||||
JRLog.h
|
||||
Copyright (c) 2006-2007 Jonathan 'Wolf' Rentzsch: <http://rentzsch.com>
|
||||
Some rights reserved: <http://opensource.org/licenses/mit-license.php>
|
||||
|
||||
***************************************************************************/
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
// What you need to remember: Debug > Info > Warn > Error > Fatal.
|
||||
|
||||
typedef enum {
|
||||
JRLogLevel_UNSET,
|
||||
JRLogLevel_Debug,
|
||||
JRLogLevel_Info,
|
||||
JRLogLevel_Warn,
|
||||
JRLogLevel_Error,
|
||||
JRLogLevel_Fatal,
|
||||
JRLogLevel_Off,
|
||||
} JRLogLevel;
|
||||
|
||||
@interface NSObject (JRLogAdditions)
|
||||
+ (JRLogLevel)classJRLogLevel;
|
||||
+ (void)setClassJRLogLevel:(JRLogLevel)level_;
|
||||
|
||||
+ (JRLogLevel)defaultJRLogLevel;
|
||||
+ (void)setDefaultJRLogLevel:(JRLogLevel)level_;
|
||||
@end
|
||||
|
||||
BOOL IsJRLogLevelActive(id self_, JRLogLevel level_);
|
||||
void JRLog(id self_, JRLogLevel level_, unsigned line_, const char *file_, const char *function_, NSString *format_, ...);
|
||||
|
||||
#define JRLOG_CONDITIONALLY(sender,LEVEL,format,...) \
|
||||
if(IsJRLogLevelActive(sender,LEVEL)){JRLog(sender,LEVEL,__LINE__,__FILE__,__PRETTY_FUNCTION__,(format),##__VA_ARGS__);}
|
||||
|
||||
#if JRLogOverrideNSLog
|
||||
id self;
|
||||
#define NSLog JRLogInfo
|
||||
#endif
|
||||
|
||||
//
|
||||
// Scary macros!
|
||||
// The 1st #if is a filter, which you can read "IF any of the symbols are defined, THEN don't log for that level, ELSE log for that level."
|
||||
//
|
||||
|
||||
#if defined(JRLOGLEVEL_OFF) || defined(JRLOGLEVEL_FATAL) || defined(JRLOGLEVEL_ERROR) || defined(JRLOGLEVEL_WARN) || defined(JRLOGLEVEL_INFO)
|
||||
#define JRLogDebug(format,...)
|
||||
#else
|
||||
#define JRLogDebug(format,...) JRLOG_CONDITIONALLY(self, JRLogLevel_Debug, format, ##__VA_ARGS__)
|
||||
#endif
|
||||
|
||||
#if defined(JRLOGLEVEL_OFF) || defined(JRLOGLEVEL_FATAL) || defined(JRLOGLEVEL_ERROR) || defined(JRLOGLEVEL_WARN)
|
||||
#define JRLogInfo(format,...)
|
||||
#else
|
||||
#define JRLogInfo(format,...) JRLOG_CONDITIONALLY(self, JRLogLevel_Info, format, ##__VA_ARGS__)
|
||||
#endif
|
||||
|
||||
#if defined(JRLOGLEVEL_OFF) || defined(JRLOGLEVEL_FATAL) || defined(JRLOGLEVEL_ERROR)
|
||||
#define JRLogWarn(format,...)
|
||||
#else
|
||||
#define JRLogWarn(format,...) JRLOG_CONDITIONALLY(self, JRLogLevel_Warn, format, ##__VA_ARGS__)
|
||||
#endif
|
||||
|
||||
#if defined(JRLOGLEVEL_OFF) || defined(JRLOGLEVEL_FATAL)
|
||||
#define JRLogError(format,...)
|
||||
#else
|
||||
#define JRLogError(format,...) JRLOG_CONDITIONALLY(self, JRLogLevel_Error, format, ##__VA_ARGS__)
|
||||
#endif
|
||||
|
||||
#if defined(JRLOGLEVEL_OFF)
|
||||
#define JRLogFatal(format,...)
|
||||
#else
|
||||
#define JRLogFatal(format,...) JRLOG_CONDITIONALLY(self, JRLogLevel_Fatal, format, ##__VA_ARGS__)
|
||||
#endif
|
||||
-306
@@ -1,306 +0,0 @@
|
||||
/*******************************************************************************
|
||||
JRLog.m
|
||||
Copyright (c) 2006-2007 Jonathan 'Wolf' Rentzsch: <http://rentzsch.com>
|
||||
Some rights reserved: <http://opensource.org/licenses/mit-license.php>
|
||||
|
||||
***************************************************************************/
|
||||
|
||||
#import "JRLog.h"
|
||||
#include <unistd.h>
|
||||
|
||||
#if JRLogOverrideNSLog
|
||||
id self = nil;
|
||||
#endif
|
||||
#undef NSLog
|
||||
|
||||
//
|
||||
// Globals
|
||||
//
|
||||
#pragma mark Globals
|
||||
|
||||
BOOL gLoadedJRLogSettings = NO;
|
||||
JRLogLevel gDefaultJRLogLevel = JRLogLevel_Debug;
|
||||
|
||||
//
|
||||
//
|
||||
//
|
||||
|
||||
@interface NSObject (JRLogDestinationDO)
|
||||
- (void)logWithDictionary:(NSDictionary*)dictionary_;
|
||||
@end
|
||||
|
||||
@interface JRLogOutput : NSObject {
|
||||
NSString *sessionUUID;
|
||||
BOOL tryDO;
|
||||
id destination;
|
||||
}
|
||||
+ (id)sharedOutput;
|
||||
@end
|
||||
@implementation JRLogOutput
|
||||
+ (id)sharedOutput {
|
||||
static JRLogOutput *output = nil;
|
||||
if (!output) {
|
||||
output = [[JRLogOutput alloc] init];
|
||||
}
|
||||
return output;
|
||||
}
|
||||
- (id)init {
|
||||
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_
|
||||
file:(const char*)file_
|
||||
line:(unsigned)line_
|
||||
function:(const char*)function_
|
||||
message:(NSString*)message_
|
||||
{
|
||||
#if 0
|
||||
if (tryDO) {
|
||||
tryDO = NO;
|
||||
destination = [[NSConnection rootProxyForConnectionWithRegisteredName:@"JRLogDestinationDO" host:nil] retain];
|
||||
}
|
||||
if (destination) {
|
||||
@try {
|
||||
[destination logWithDictionary:[NSDictionary dictionaryWithObjectsAndKeys:
|
||||
[[NSBundle mainBundle] bundleIdentifier], @"bundleID",
|
||||
sessionUUID, @"sessionUUID",
|
||||
[NSNumber numberWithLong:getpid()], @"pid",
|
||||
[NSDate date], @"date",
|
||||
[NSNumber numberWithInt:callerLevel_], @"level",
|
||||
instance_, @"instance",
|
||||
[NSString stringWithUTF8String:file_], @"file",
|
||||
[NSNumber numberWithUnsignedInt:line_], @"line",
|
||||
[NSString stringWithUTF8String:function_], @"function",
|
||||
message_, @"message",
|
||||
nil]];
|
||||
} @catch(NSException *x) {
|
||||
if ([[x name] isEqualToString:NSObjectInaccessibleException]) {
|
||||
[destination release];
|
||||
destination = nil;
|
||||
} else {
|
||||
@throw x;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// "MyClass.m:123: blah blah"
|
||||
NSLog(@"%@:%u: %@",
|
||||
[[NSString stringWithUTF8String:file_] lastPathComponent],
|
||||
line_,
|
||||
message_);
|
||||
}
|
||||
#endif
|
||||
|
||||
NSLog(@"%@:%u: %@",
|
||||
[[NSString stringWithUTF8String:file_] lastPathComponent],
|
||||
line_,
|
||||
message_);
|
||||
}
|
||||
@end
|
||||
|
||||
//
|
||||
//
|
||||
//
|
||||
|
||||
static JRLogLevel parseJRLogLevel(NSString *level_) {
|
||||
static NSDictionary *levelLookup = nil;
|
||||
if (!levelLookup) {
|
||||
levelLookup = [NSDictionary dictionaryWithObjectsAndKeys:
|
||||
[NSNumber numberWithInt:JRLogLevel_Debug], @"debug",
|
||||
[NSNumber numberWithInt:JRLogLevel_Info], @"info",
|
||||
[NSNumber numberWithInt:JRLogLevel_Warn], @"warn",
|
||||
[NSNumber numberWithInt:JRLogLevel_Error], @"error",
|
||||
[NSNumber numberWithInt:JRLogLevel_Fatal], @"fatal",
|
||||
[NSNumber numberWithInt:JRLogLevel_Off], @"off",
|
||||
nil];
|
||||
}
|
||||
NSNumber *result = [levelLookup objectForKey:[level_ lowercaseString]];
|
||||
return result ? [result intValue] : JRLogLevel_UNSET;
|
||||
}
|
||||
|
||||
static void LoadJRLogSettings() {
|
||||
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
|
||||
|
||||
// Load+interpret the Info.plist-based settings.
|
||||
NSMutableDictionary *settings = [NSMutableDictionary dictionary];
|
||||
[settings addEntriesFromDictionary:[[NSBundle mainBundle] infoDictionary]];
|
||||
[settings addEntriesFromDictionary:[[NSUserDefaults standardUserDefaults] dictionaryRepresentation]];
|
||||
|
||||
NSArray *keys = [settings allKeys];
|
||||
unsigned keyIndex = 0, keyCount = [keys count];
|
||||
for(; keyIndex < keyCount; keyIndex++) {
|
||||
NSString *key = [keys objectAtIndex:keyIndex];
|
||||
if ([key hasPrefix:@"JRLogLevel"]) {
|
||||
JRLogLevel level = parseJRLogLevel([settings objectForKey:key]);
|
||||
if (JRLogLevel_UNSET == level) {
|
||||
NSLog(@"JRLog: can't parse \"%@\" JRLogLevel value for key \"%@\"", [settings objectForKey:key], key);
|
||||
} else {
|
||||
NSArray *keyNames = [key componentsSeparatedByString:@"."];
|
||||
if ([keyNames count] == 2) {
|
||||
// It's a pseudo-keypath: JRLogLevel.MyClassName.
|
||||
Class c = NSClassFromString([keyNames lastObject]);
|
||||
if (c) {
|
||||
[c setClassJRLogLevel:level];
|
||||
} else {
|
||||
NSLog(@"JRLog: unknown class \"%@\"", [keyNames lastObject]);
|
||||
}
|
||||
} else {
|
||||
// Just a plain "JRLogLevel": it's for the default level.
|
||||
[NSObject setDefaultJRLogLevel:level];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[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);
|
||||
|
||||
if (!gLoadedJRLogSettings) {
|
||||
gLoadedJRLogSettings = YES;
|
||||
LoadJRLogSettings();
|
||||
}
|
||||
|
||||
// Setting the default level to OFF disables all logging, regardless of everything else.
|
||||
if (JRLogLevel_Off == gDefaultJRLogLevel)
|
||||
return NO;
|
||||
|
||||
JRLogLevel currentLevel;
|
||||
if (self_) {
|
||||
currentLevel = [[self_ class] classJRLogLevel];
|
||||
if (JRLogLevel_UNSET == currentLevel) {
|
||||
currentLevel = gDefaultJRLogLevel;
|
||||
}
|
||||
} else {
|
||||
currentLevel = gDefaultJRLogLevel;
|
||||
// TODO It would be cool if we could use the file's name was a symbol to set logging levels for JRCLog... functions.
|
||||
}
|
||||
|
||||
return callerLevel_ >= currentLevel;
|
||||
}
|
||||
#endif
|
||||
|
||||
void
|
||||
JRLog(
|
||||
id self_,
|
||||
JRLogLevel callerLevel_,
|
||||
unsigned line_,
|
||||
const char *file_,
|
||||
const char *function_,
|
||||
NSString *format_,
|
||||
...)
|
||||
{
|
||||
assert(callerLevel_ >= JRLogLevel_Debug && callerLevel_ <= JRLogLevel_Fatal);
|
||||
assert(file_);
|
||||
assert(function_);
|
||||
assert(format_);
|
||||
|
||||
//
|
||||
va_list args;
|
||||
va_start(args, format_);
|
||||
NSString *message = [[NSString alloc] initWithFormat:format_ arguments:args];
|
||||
va_end(args);
|
||||
|
||||
[[JRLogOutput sharedOutput] logWithLevel:callerLevel_
|
||||
instance:self_ ? [NSString stringWithFormat:@"<%@: %p>", [self_ class], self_] : @"nil"
|
||||
file:file_
|
||||
line:line_
|
||||
function:function_
|
||||
message:message];
|
||||
|
||||
if (JRLogLevel_Fatal == callerLevel_) {
|
||||
exit(0);
|
||||
}
|
||||
}
|
||||
|
||||
@implementation NSObject (JRLogAdditions)
|
||||
|
||||
#if 0
|
||||
NSMapTable *gClassLoggingLevels = NULL;
|
||||
+ (void)load {
|
||||
if (!gClassLoggingLevels) {
|
||||
gClassLoggingLevels = NSCreateMapTable(NSIntMapKeyCallBacks, NSIntMapValueCallBacks, 32);
|
||||
}
|
||||
}
|
||||
|
||||
+ (JRLogLevel)classJRLogLevel {
|
||||
void *mapValue = NSMapGet(gClassLoggingLevels, self);
|
||||
if (mapValue) {
|
||||
return (JRLogLevel)mapValue;
|
||||
} else {
|
||||
Class superclass = [self superclass];
|
||||
return superclass ? [superclass classJRLogLevel] : JRLogLevel_UNSET;
|
||||
}
|
||||
}
|
||||
|
||||
+ (void)setClassJRLogLevel:(JRLogLevel)level_ {
|
||||
if (JRLogLevel_UNSET == level_) {
|
||||
NSMapRemove(gClassLoggingLevels, self);
|
||||
} else {
|
||||
NSMapInsert(gClassLoggingLevels, self, (const void*)level_);
|
||||
}
|
||||
}
|
||||
|
||||
+ (JRLogLevel)defaultJRLogLevel {
|
||||
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_;
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -35,6 +35,13 @@
|
||||
#import "CTCoreMessage.h"
|
||||
#import "CTSMTPConnection.h"
|
||||
#import "CTBareAttachment.h"
|
||||
#import "CTCoreAttachment.h"
|
||||
#import <libetpan/libetpan.h>
|
||||
#import "MailCoreTypes.h"
|
||||
#import "MailCoreUtilities.h"
|
||||
#import "CTMIME_HtmlPart.h"
|
||||
#import "CTMIME_MessagePart.h"
|
||||
#import "CTMIME_MultiPart.h"
|
||||
#import "CTMIME_SinglePart.h"
|
||||
#import "CTMIME_TextPart.h"
|
||||
#import "CTMIME.h"
|
||||
|
||||
+16
-2
@@ -36,15 +36,29 @@
|
||||
|
||||
/** Constants for fetching messages **/
|
||||
|
||||
typedef enum
|
||||
{
|
||||
typedef enum {
|
||||
CTFetchAttrDefaultsOnly = 0,
|
||||
CTFetchAttrBodyStructure = 1 << 0,
|
||||
CTFetchAttrEnvelope = 1 << 1,
|
||||
} CTFetchAttributes;
|
||||
|
||||
/** Constants for IDLE **/
|
||||
|
||||
typedef enum {
|
||||
CTIdleNewData = 0,
|
||||
CTIdleTimeout,
|
||||
CTIdleCancelled,
|
||||
CTIdleError,
|
||||
} CTIdleResult;
|
||||
|
||||
/** Connection Constants **/
|
||||
|
||||
typedef enum {
|
||||
CTSMTPConnectionTypePlain = 0,
|
||||
CTSMTPConnectionTypeStartTLS,
|
||||
CTSMTPConnectionTypeTLS
|
||||
} CTSMTPConnectionType;
|
||||
|
||||
/* 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) */
|
||||
|
||||
@@ -32,17 +32,22 @@
|
||||
#import <Foundation/Foundation.h>
|
||||
#import <libetpan/libetpan.h>
|
||||
|
||||
/*!
|
||||
@abstract Enables logging of all streams, data is output to standard out.
|
||||
/**
|
||||
Enables logging of all streams, data is output to standard out.
|
||||
*/
|
||||
void MailCoreEnableLogging();
|
||||
void MailCoreDisableLogging();
|
||||
|
||||
NSError* MailCoreCreateError(int errcode, NSString *description);
|
||||
|
||||
/*!
|
||||
@abstract Translates the LibEtPan error code into NSError with error description
|
||||
*/
|
||||
NSError* MailCoreCreateErrorFromCode(int errcode);
|
||||
/**
|
||||
Translates the LibEtPan IMAP error code into NSError with error description
|
||||
*/
|
||||
NSError* MailCoreCreateErrorFromIMAPCode(int errcode);
|
||||
|
||||
/**
|
||||
Translates a LibEtPan SMTP specific error code into an NSError with a description
|
||||
*/
|
||||
NSError* MailCoreCreateErrorFromSMTPCode(int errcode);
|
||||
|
||||
NSString *MailCoreDecodeMIMEPhrase(char *data);
|
||||
|
||||
@@ -30,7 +30,6 @@
|
||||
*/
|
||||
|
||||
#import "MailCoreUtilities.h"
|
||||
#import "JRLog.h"
|
||||
#import "MailCoreTypes.h"
|
||||
|
||||
/* direction is 1 for send, 0 for receive, -1 when it does not apply */
|
||||
@@ -67,7 +66,26 @@ NSError* MailCoreCreateError(int errcode, NSString *description) {
|
||||
return [NSError errorWithDomain:@"mailcore" code:errcode userInfo:errorDetail];
|
||||
}
|
||||
|
||||
NSError* MailCoreCreateErrorFromCode(int errcode) {
|
||||
NSError* MailCoreCreateErrorFromSMTPCode(int errcode) {
|
||||
NSString *description = @"Unknown error";
|
||||
|
||||
switch (errcode) {
|
||||
case MAILSMTP_ERROR_AUTH_LOGIN:
|
||||
description = @"Invalid username or password";
|
||||
break;
|
||||
|
||||
default: {
|
||||
const char *errStr = mailsmtp_strerror(errcode);
|
||||
if (errStr) {
|
||||
description = [[[NSString alloc] initWithCString:errStr encoding:NSUTF8StringEncoding] autorelease];
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
return MailCoreCreateError(errcode, description);
|
||||
}
|
||||
|
||||
NSError* MailCoreCreateErrorFromIMAPCode(int errcode) {
|
||||
NSString *description = @"";
|
||||
switch (errcode) {
|
||||
case MAILIMAP_ERROR_BAD_STATE:
|
||||
@@ -237,7 +255,7 @@ NSError* MailCoreCreateErrorFromCode(int errcode) {
|
||||
description = @"Folder errror";
|
||||
break;
|
||||
default:
|
||||
description = [NSString stringWithFormat:@"Error: %@", exp];
|
||||
description = [NSString stringWithFormat:@"Error: %d", errcode];
|
||||
break;
|
||||
}
|
||||
return MailCoreCreateError(errcode, description);
|
||||
@@ -249,7 +267,7 @@ NSString *MailCoreDecodeMIMEPhrase(char *data) {
|
||||
char *decodedSubject;
|
||||
NSString *result;
|
||||
|
||||
if (*data != '\0') {
|
||||
if (data && *data != '\0') {
|
||||
err = mailmime_encoded_phrase_parse(DEST_CHARSET, data, strlen(data),
|
||||
&currToken, DEST_CHARSET, &decodedSubject);
|
||||
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
appledoc --no-create-docset --no-install-docset --project-name MailCore --project-company "Central Atomics Inc." --company-id com.centralatomics --output ~/help Source
|
||||
+1
-1
Submodule iOSPorts updated: c0c5dc0d11...2bca07dff7
+1
-1
Submodule libetpan updated: 60ff71fe4c...e43d8a0a11
Reference in New Issue
Block a user