161 Commits

Author SHA1 Message Date
Giovanni Donelli 817197d390 new call to set HTML and Text body at once 2014-10-30 11:35:29 -07:00
Matt Ronge 1246cdd99a Update libetpan 2014-10-09 09:42:28 -05:00
Matt Ronge b465d1bd3e Merge branch 'master' of https://github.com/mronge/MailCore 2014-08-11 11:35:28 -05:00
Matt Ronge e4a4b6091a Updated to latest libetpan because of an iOS 8 bug 2014-08-11 11:35:21 -05:00
Matt Ronge 1e18a6b4dd Update README.md 2014-03-24 15:47:23 -05:00
Matt Ronge 3732a9769e Check for NULL buffer as well 2014-02-03 18:16:50 -06:00
Matt Ronge 6a4cd6a255 Copy paste error, dammit 2014-02-03 18:06:33 -06:00
Matt Ronge 33069f8df1 Protect against NULL mailbox names 2014-02-03 18:01:09 -06:00
Matt Ronge 1d4ee055d3 Don't include empty BCC field 2014-01-28 11:26:05 -06:00
Matt Ronge b85d0934c8 Don't include inline disposition on HTML parts 2013-11-21 13:00:10 -05:00
Matt Ronge 7b03944277 Merge commit '8268e848030a6ecbe603c3c6a713d5ab248d709d' 2013-11-18 13:34:42 -06:00
Matt Ronge 8268e84803 Updated libetpan 2013-11-18 13:34:09 -06:00
Matt Ronge c215161f81 Merge branch 'master' of github.com:mronge/MailCore 2013-11-06 14:32:35 -06:00
Matt Ronge 78a4b47019 Argh typo 2013-10-11 18:37:51 -05:00
Matt Ronge e1a9f74a4c Argh typo 2013-10-11 18:35:36 -05:00
Matt Ronge 39e7a13614 Switch libetpan ref 2013-10-11 18:34:21 -05:00
Matt Ronge 8913c60fe2 iPhone 5S fixes 2013-10-11 13:27:20 -05:00
Matt Ronge 66618c90ef Merge branch 'experimental-1' 2013-10-10 22:04:15 -05:00
Matt Ronge 34751e29f3 arm64 support 2013-09-24 18:59:40 -05:00
Matt Ronge e58612d790 Attachments from outlook now get properly handled 2013-09-06 12:53:47 -05:00
Matt Ronge 72def8c7c8 Switched over to offical version of libetpan 2013-07-29 15:39:38 -05:00
Matt Ronge f75d94f68e Fix mailcore build 2013-07-28 11:04:27 -05:00
Matt Ronge 68b3518822 Merge branch 'master' of https://github.com/mronge/MailCore 2013-07-27 14:20:46 -05:00
Matt Ronge 55c2017fab Uses new version of libetpan and CFNetworking 2013-07-27 14:20:37 -05:00
Matt Ronge 1b20901351 Merge branch 'master' of github.com:mronge/MailCore 2013-06-03 15:22:12 -05:00
Matt Ronge b048483811 Strip out BCC before sending 2013-06-03 15:22:00 -05:00
Matt Ronge d44138be77 Updated readme 2013-06-01 21:16:02 -05:00
Matt Ronge d716226a79 Merge pull request #91 from pitiphong-p/outgoing_priority_header
Add support for outgoing mail priority header.
2013-06-01 18:08:43 -07:00
Matt Ronge 66a851115d Merge pull request #105 from pitiphong-p/fix_crash_xlist_return_NoInferiors
Fixed crash when XLIST command return \NoInferiors flag.
2013-06-01 18:07:42 -07:00
Matt Ronge dd2ad745e7 Merge pull request #108 from tipbit/is-deleted
Implement [CTCoreMessage isDeleted].
2013-06-01 18:06:24 -07:00
Matt Ronge 6bb4d1ca84 Merge pull request #109 from tipbit/define-error-domain
Put the hard-coded error domain name in a #define.
2013-06-01 18:05:17 -07:00
Ewan Mellor e6d5e8648e Put the hard-coded error domain name in a #define.
This allows callers to use the name without hard-coding it themselves.
2013-05-27 12:07:26 -07:00
Ewan Mellor 905bf5aeaa Implement [CTCoreMessage isDeleted].
This cleans up some almost-copy-and-paste code at the same time.
2013-05-25 22:13:35 -07:00
Pitiphong Phongpattranont 814478c94d Fixed crash when XLIST command return \NoInferiors flag. 2013-05-17 17:08:24 +07:00
Matt Ronge 8fb4ed3bbe Merge pull request #84 from pitiphong-p/extionsion_flags_support
Support for get/set the extension flags for CTCoreMessage.
2013-04-04 17:15:57 -07:00
Matt Ronge e22a886fbe Merge pull request #93 from DanGonz/master
Fix to CTSMTPAsyncConnection so that it can also use SMTP with SSL on port 465.
2013-04-04 17:14:52 -07:00
DanGonz 73380c7541 Fix to CTSMTPAsyncConnection so that it can also use SMTP with SSL on port 465.
Copied the changes made in the commit to CTSMTPConnection 2ac9928971 on 20th November 2012 to enable the same feature.
2013-04-04 23:52:27 +01:00
Pitiphong Phongpattranont 2e1e550483 Beautify the code. With 120 character page guide. 2013-04-04 13:45:51 +07:00
Pitiphong Phongpattranont 1169458c58 Rename the mail core utility functions. Add the 'MailCore' namespace. 2013-04-04 13:38:17 +07:00
Matt Ronge 3a5e94af79 Merge pull request #90 from pitiphong-p/fetch_with_indexset
Add Fetching mail with UID or Sequence number Index set.
2013-04-03 14:17:34 -07:00
Pitiphong Phongpattranont 2d6e895593 Add support for outgoing mail priority header. 2013-04-02 16:37:49 +07:00
Pitiphong Phongpattranont 00d390c35e Add Fetching mail with UID or Sequence number Index set. 2013-04-01 23:42:09 +07:00
Matt Ronge 1e8a68c08b Merge pull request #85 from dropperY/fix-copy-filename
fix copy filename
2013-03-25 12:06:52 -07:00
Xiaocheng Ye e22aca18fc fix the copy filename 2013-03-22 23:46:14 +08:00
Pitiphong Phongpattranont f9f2b930d8 Support for get/set the extension flags for CTCoreMessage. 2013-03-21 15:32:41 +07:00
Matt Ronge 8e7d1c50d6 Clean up some method docs, fixes #83 2013-03-19 11:33:07 -10:00
Matt Ronge 28aa229fdd Merge pull request #64 from ghdk/InvalidMailMessageDereferences
Protects the dereferences of the struct mailmessage *myMessage.
2013-03-14 14:03:28 -07:00
Matt Ronge b74d05fcfb Fix problem with Chinese folder names not working with move/copy. Fixes #73 2013-03-14 16:02:12 -05:00
Matt Ronge ee1760ebaf Import of CTXlistResult was messed up. Fixed #78 2013-03-14 15:49:17 -05:00
Matt Ronge a0bd47f488 Merge pull request #77 from pitiphong-p/fixed-folder-setpath-bug
Fixed: Cannot set the folder's path.
2013-03-06 06:24:25 -08:00
Pitiphong Phongpattranont 15fe9c9210 Fixed: Cannot set the folder's path. 2013-03-06 14:58:36 +07:00
Matt Ronge b52df2d647 No longer always download RFC822.Size as it is slow on some servers 2013-02-28 22:12:26 -06:00
Matt Ronge 95861d3764 Change to CTCoreAddress description output 2013-02-28 22:12:04 -06:00
Matt Ronge 0c096356c0 More error handling when fetching message body 2013-02-28 14:31:29 -06:00
Matt Ronge d5b029aa80 Merge branch 'master' of github.com:mronge/MailCore 2013-02-08 11:45:17 -06:00
Matt Ronge bc90b0946f Added a way to get at a single parts struct mailmime_single_fields 2013-02-08 11:45:08 -06:00
Matt Ronge 6a7c75bbeb Merge pull request #67 from NiKnight/master
Fixes to MailCore tests; no hard-coding of mail account data, proper test data file access
2013-01-22 18:52:02 -08:00
Matt Ronge 7883a1b021 Updated libetpan 2013-01-21 15:21:36 -06:00
Scott Nonnenberg 1934f9cd51 CTCoreMessage.htmlBody now behaves like .body
It calls fetchBodyStructure if myFields or myParsedMIME is null, just like .body does. Two new tests added; the change to htmlBody is required to get them both to pass.
2012-12-21 15:15:05 -08:00
Scott Nonnenberg fc5c8a324e Properly pulling MIMETests/testBruteForce files 2012-12-20 20:29:48 -08:00
Scott Nonnenberg dcd20b44d7 Fix to Core Folder tests; senderDate returns nil
Noticed that this change was necessary to get all Core Folder tests passing. Those tests expected senderDate to return nil if there was no message loaded.
2012-12-20 20:18:12 -08:00
Scott Nonnenberg b5fee7f1c9 Core Message tests whitespace 2012-12-20 20:16:57 -08:00
Scott Nonnenberg c98f744b1b Core Message tests: files in bundle, testSentDate
testSentDate wasn't quite passing: sentDateGMT has been removed and the number of seconds representing the date the email was sent is not what was there before. Fixed.

Also, we needed to pull the message files out of the test bundle.
2012-12-20 20:16:44 -08:00
Scott Nonnenberg 7565fd2e46 MIME/CoreAttachment tests get files from bundle
Because in the newest simulators, your current working directory is more like it is in when you're on the phone itself.

Also no need for the filePrefix var any longer.
2012-12-20 20:06:32 -08:00
Scott Nonnenberg d28da84cfd Fixing Core Folder tests
sentDateGMT has been removed, changing to senderDate. Also, changing from bodyPreferringPlainText to just body - the former required an out parameter that was not being provided.
2012-12-20 20:04:27 -08:00
Scott Nonnenberg d3bf550e1d account.plist used to specify mail account data
Instead of hardcoding it. Excluded from the repository via .gitignore. Also adding TestData to the project, compiled into the Test bundle.

Pushing the iOS deployment target down to 4.3, and ensuring that all projects have the same value there.
2012-12-20 20:02:46 -08:00
Matt Ronge 9c6c77e15b Appended messages are marked as unread 2012-12-20 16:35:20 -06:00
Matt Ronge 1e5dbbbd19 Always parse content ID if is part of the MIME fields 2012-12-07 15:54:56 -06:00
Dionysios Kalofonos d9a69fe3c7 Protects the dereferences of the struct mailmessage *myMessage. 2012-12-01 18:00:49 +02:00
Matt Ronge 1ce31638f1 Reverting mem leak fix, seems to be causing crashers 2012-11-26 14:03:26 -06:00
Matt Ronge 2eeb378cf3 Merge branch 'master' of github.com:mronge/MailCore 2012-11-24 21:54:28 -06:00
Matt Ronge 80011253ef Updated the example to use the latest SMTP code 2012-11-24 21:18:19 -06:00
Matt Ronge 3449724ef5 Merge branch 'smtp_tls' 2012-11-24 20:41:44 -06:00
Matt Ronge 5515f5c5d2 Minor brace formatting changes 2012-11-24 20:11:39 -06:00
Matt Ronge 50f14d03f4 Merge pull request #60 from ghdk/CTCoreMessageMemLeaksFixes
Fixes for CTCoreMessage memory leaks.
2012-11-24 18:09:56 -08:00
Matt Ronge 405965d4a8 Cleaned up the message date methods. Only senderDate remains
The other methods have been deleted, as the timezone is only taken into
account when formatting as a string for display. The NSDate is an absolute
time and there is an attached timezone that is used for display purposes.
2012-11-24 19:59:08 -06:00
Matt Ronge e452c5c34d Added hasBodyStructure to check if body structure has been downloaded (thanks Daishi) 2012-11-24 19:50:23 -06:00
Matt Ronge 2ac9928971 Added TLS support for SMTP 2012-11-20 13:41:39 -06:00
Matt Ronge 1766cf21d2 Merged 2012-11-19 10:29:40 -06:00
Dionysios Kalofonos a608925308 Fixes for CTCoreMessage memory leaks. 2012-11-17 19:10:27 +02:00
Kris Wong bb29c7911f Additional cleanups for memory handling. 2012-11-16 17:37:26 -06:00
Kris Wong 899bf653ce Addressed review comments by mronge. 2012-11-16 17:06:45 -06:00
Kris Wong e44d7169a6 Fix for attachment content type handling on iOS. 2012-11-16 14:24:28 -06:00
Kris Wong 053ab837fb Update the iOS target to include new source file. 2012-11-15 16:01:30 -06:00
Kris Wong 5d97ad5220 Cleanup memory leak. 2012-11-15 15:57:31 -06:00
Matt Ronge 8a89fd2fc8 SMTP memory leak fixes 2012-11-09 16:03:45 -06:00
Matt Ronge a857dd00af Fixes bug #36 where a double free as occuring 2012-11-09 15:25:46 -06:00
Matt Ronge 1ce5f390c7 When doing SMTP auth if PLAIN is not available, fallback to LOGIN. Also some TLS fixes for older servers 2012-11-09 12:03:05 -06:00
Matt Ronge 9aec18fe31 Misc fixes 2012-11-06 14:35:34 -06:00
Matt Ronge e0396cbf50 Reworked IDLE implementation and moved it to CTCoreFolder 2012-11-02 14:05:53 -05:00
Matt Ronge e67020cc10 Added way to git a list of the capabilities from the server 2012-10-31 18:26:59 -05:00
Matt Ronge 4dd4759fb5 Reworking the IDLE implementation 2012-10-31 17:45:14 -05:00
Kris Wong b3a1e0689f Added rfc822Header method to CTCoreMessage for fetching the full message headers. 2012-10-26 19:22:49 -05:00
Kris Wong 81e574398c Added support for the XLIST command. Fixed mailbox names to be converted to/from UTF-7. 2012-10-16 15:08:40 -05:00
Matt Ronge 483a932dd5 Remove the disconnect in the example that was causing crashes 2012-10-15 19:04:37 -05:00
Matt Ronge 784d4e4bae Fix a nasty memory leak 2012-10-10 16:46:56 -05:00
Matt Ronge 3dfe73d8df Update README.md 2012-10-08 22:20:36 -05:00
Matt Ronge 016aca79d9 Added disposition type inline to html parts 2012-10-08 20:21:32 -05:00
Matt Ronge d2fd023d68 Switched to using quoted printable for text and html parts. (Thanks for the patch Michael Koziarski) 2012-10-08 20:15:18 -05:00
Matt Ronge 5a033e98ec Merge pull request #50 from NZKoz/flag_setting_error
Ensure flag changes are persisted to imap after setFlags:forMesssage: is called
2012-10-08 15:02:51 -07:00
Michael Koziarski 175b398c5c Do a folder check to ensure flags get stored immediately
Prevents loss of flags if the app terminates or otherwise doesn't call logout or expunge.
2012-10-05 09:35:03 +13:00
Matt Ronge 48e04c6471 Merge pull request #46 from mkdynamic/patch-1
Consistent submodule initialization with libmailcore.com
2012-09-26 16:51:50 -07:00
Mark Dodwell b0180fbfcd Consistent submodule initialization with libmailcore.com 2012-09-25 00:16:59 -07:00
Matt Ronge c6eab3fff5 Merge pull request #45 from yonder-innovation/master
Fix for double release issue
2012-09-21 08:37:19 -07:00
Ovidiu Sabou 829a820342 Merge https://github.com/yonder-innovation/MailCore into HEAD 2012-09-21 14:33:04 +03:00
Ovidiu Sabou 92cc79a5c6 Fixed a double release issue 2012-09-21 14:31:58 +03:00
Matt Ronge a182d018ae Project fixes for Xcode 4.5 and armv7s 2012-09-20 14:46:27 -05:00
Matt Ronge 182298db69 Deployment targets are now set to default 2012-09-20 10:35:24 -05:00
Matt Ronge d05b8bbeb3 Check connect error condition in uidValidity and uidNext, should help avoid crashes (i hope) 2012-09-19 12:40:06 -05:00
Matt Ronge 4012917c5c Merge pull request #43 from Electriclabs/Fixup
Fix for crash when data is nil
2012-09-19 08:01:02 -07:00
Christopher Lyon Anderson d8034d4c83 Fix for crash when data is nil 2012-09-19 09:13:04 +01:00
Matt Ronge 859c5b794f Fixes a crasher that could occur when tearing down the CTMIME_SinglePart in an error condition. (Thanks Daishi) 2012-09-17 19:40:15 -05:00
Matt Ronge 406bd77197 Submodules now support armv7s 2012-09-17 18:42:34 -05:00
Matt Ronge c4098c1f06 Fixed an Xcode 4.5 compile issue 2012-09-12 15:45:53 -05:00
Matt Ronge 7daedee7aa MIME headers are imported by MailCore.h for use by clients of the library 2012-09-12 15:45:43 -05:00
Matt Ronge abb0520f0b Removed the name method from CTCoreFolder.
At this point we don't know what the proper path delimiter is. The only way to get the delimiter is to make a IMAP call to the server to get a list of mailboxes. So instead this should be doing by the user of the framework
2012-09-10 18:43:03 -05:00
Matt Ronge fef9c331f3 Fixed an SMTP bug where an error wasn't returned when the username/login was wrong. Also added a nicer error message for when this happens 2012-09-10 16:46:28 -05:00
Matt Ronge f9581ee615 Had to change the reference and inReplyTo to use arrays 2012-09-10 11:30:01 -05:00
Matt Ronge 44d69c9b03 It is now possible to set a specific multipart type 2012-09-10 11:24:00 -05:00
Matt Ronge 9037bf3350 Had a duplicate init definition in the header 2012-09-10 11:19:23 -05:00
Matt Ronge 6e5e72d502 Had an extra IMAP check being sent to the server when setting the flags 2012-09-10 11:18:57 -05:00
Matt Ronge d39296426a Merge pull request #37 from jdg/master
Add setInReplyTo, references and setReferences functionality to CTCoreMessage
2012-09-08 08:37:12 -07:00
Jonathan George 163cb86770 Add references, setReferences and setInReplyTo functionality for CTCoreMessage. 2012-09-07 16:58:39 -05:00
Matt Ronge fbd1774f0c Changed how path delimiters are handles 2012-09-07 13:41:08 -05:00
Matt Ronge 4a7a6f817c Fixed a memory leak that popped up when sending messages. 2012-09-02 20:35:07 -05:00
Matt Ronge 1840b6ee95 Merge pull request #34 from rgigger/master
added an inReplyTo method to CTCoreMessage
2012-09-02 16:51:05 -07:00
Rick Gigger bd9e3296d7 added inReplyTo method to CTCoreMessage 2012-09-01 01:25:36 -06:00
Matt Ronge 358e58e029 Merge pull request #33 from ghdk/master
IMAP APPEND
2012-08-31 06:59:48 -07:00
Dionysios Kalofonos 1f64ed5b56 Exposes the IMAP APPEND command, see the IMAP RFC 4549. 2012-08-31 09:39:27 +03:00
Matt Ronge e10dc48ea1 New version of iOS ports 2012-08-06 15:10:17 -05:00
Matt Ronge ba2b0ea12a Merge branch 'master' of github.com:mronge/MailCore 2012-08-03 15:16:57 -05:00
Matt Ronge 28594aff21 Somehow CTCoreAttachment wasn't being included 2012-08-03 14:54:00 -05:00
Matt Ronge 4511d3b133 Merge pull request #26 from HenningJ/issue23
Added instance variable for property parentFolder. Fixes #23.
2012-08-03 11:11:54 -07:00
Henning Jungkurth 538f405a1b Added instance variable for property parentFolder. Fixes #23. 2012-08-03 19:21:55 +02:00
Matt Ronge 5537a637a1 Merge branch 'master' of github.com:mronge/MailCore 2012-07-27 15:24:46 -05:00
Matt Ronge 8230b1e8e4 Updated to build with Xcode 4.5 2012-07-26 21:05:10 -05:00
Matt Ronge a89ce29177 Changed copy and move methods to only take the UID, this is much more efficient than having to construct an entire CTCoreMessage 2012-07-25 22:58:03 -05:00
Matt Ronge 99a87a418f Fixed a bug where the message could end up without its parent folder, which causes a crash 2012-07-25 10:59:37 -05:00
Matt Ronge 25c22d15f4 Merge branch 'master' of github.com:mronge/MailCore 2012-07-23 14:36:00 -05:00
Matt Ronge 057a96d531 Folders that can't be selected won't be returned in the folder list. Also all folder path delimiters are converted to / 2012-07-23 14:35:50 -05:00
Matt Ronge 69e90c1bda Merge branch 'master' of github.com:mronge/MailCore 2012-07-21 16:05:10 -05:00
Matt Ronge 8419f444e9 Updated contributor list 2012-07-16 21:32:07 -05:00
Matt Ronge 2bfd413f8a Merge pull request #18 from holtwick/master
Example improvement
2012-07-16 19:28:19 -07:00
Dirk Holtwick d76fd2946a Added connection error alert
Signed-off-by: Dirk Holtwick <dirk.holtwick@gmail.com>
2012-07-14 11:29:34 +02:00
Dirk Holtwick b350ef36d3 Improved Inbox Fetcher Example
- Remeber field values
- Make SSL default
- Add an error output to log if not connected

Modified using Xcode 4 therfore may introduce incompatibilities with older Xcodes

Signed-off-by: Dirk Holtwick <dirk.holtwick@gmail.com>
2012-07-14 11:25:52 +02:00
Matt Ronge 704741e85b IMPORTANT: Changed how importing mailcore headers works so it behaves when archiving your app for distribution. Please see the docs for more info 2012-07-12 14:55:50 -05:00
Matt Ronge 99a3147be4 Minor doc update 2012-07-11 16:40:08 -05:00
Matt Ronge c570d2d85b Added a method for testing SMTP credentials and in the process fixed up some of the error messages 2012-07-11 16:36:24 -05:00
Matt Ronge ad39f14b2d OpenSSL is now configured to be thread safe 2012-07-11 11:08:27 -05:00
Matt Ronge a656b30632 Updated submodule refs 2012-07-09 13:20:11 -05:00
Matt Ronge 7e08f69d88 Added a way to tell if a message body is HTML or not when fetching 2012-07-07 15:13:40 -05:00
Matt Ronge b4ba0f6ab3 Fixed a bug where messageWithUid wasn't working 2012-07-07 15:13:21 -05:00
Matt Ronge 7a496655f2 Found a really nasty memory leak that occurred when fetching messages 2012-07-06 10:57:27 -05:00
Matt Ronge 6f823c7804 Switched to using my own fork of iOSPorts 2012-07-05 19:34:59 -05:00
Matt Ronge 33070d46a8 Merge pull request #17 from jwilling/master
fix small mistake and silence an error
2012-07-05 15:43:03 -07:00
Jonathan Willing fe1049ec3b fix small mistake, silence error 2012-07-05 17:13:18 -05:00
Matt Ronge 1d833fb599 Fixed a bug where messages with multi-byte characters would be truncated, thanks to Denis Kutlubaev and Dinh Viet Hoa for their help 2012-07-03 21:56:14 -05:00
Matt Ronge c95e8fc483 Updated the inline API docs 2012-07-03 15:41:43 -05:00
Matt Ronge a19d761806 Cleaned up the messagesender example for OS X and made a few OS X related fixes to MailCore in the process 2012-07-03 11:44:12 -05:00
Matt Ronge ee03eb476b More minor readme changes 2012-07-03 00:52:37 -05:00
Matt Ronge 7cfa165d1c Updated README 2012-07-03 00:51:23 -05:00
75 changed files with 11008 additions and 1946 deletions
+1
View File
@@ -4,3 +4,4 @@ xcuserdata
.DS_Store
include/
.idea
TestData/account.plist
+2 -2
View File
@@ -1,6 +1,6 @@
[submodule "libetpan"]
path = libetpan
url = https://github.com/mronge/libetpan.git
url = https://github.com/dinhviethoa/libetpan.git
[submodule "iOSPorts"]
path = iOSPorts
url = https://github.com/bindle/iOSPorts.git
url = https://github.com/mronge/iOSPorts.git
+10 -9
View File
@@ -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>
@@ -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;
};
+21 -14
View File
@@ -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];
@@ -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>
@@ -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,48 @@
#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);
CTSMTPConnectionType connectionType = CTSMTPConnectionTypePlain;
if ([useTLS state] == NSOnState) {
connectionType = CTSMTPConnectionTypeStartTLS;
}
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
connectionType:connectionType
useAuth:auth
error:&error];
if (!success) {
dispatch_async(dispatch_get_main_queue(), ^{
[NSApp presentError:error];
});
}
});
}
@end
@@ -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);
}
-27
View File
@@ -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
-79
View File
@@ -1,79 +0,0 @@
#import "MyController.h"
@implementation MyController
- (id)init
{
self = [super init];
if(self)
{
myMessage = [[CTCoreMessage alloc] init];
}
return self;
}
- (void)dealloc
{
[myMessage release];
[super dealloc];
}
- (IBAction)sendMessage:(id)sender
{
CTCoreMessage *msg = [[CTCoreMessage alloc] init];
[msg setTo:[myMessage to]];
[msg setFrom:[myMessage from]];
[msg setBody:[myMessage body]];
[msg setSubject:[myMessage subject]];
BOOL auth = ([useAuth state] == NSOnState);
BOOL tls = ([useTLS state] == NSOnState);
[CTSMTPConnection sendMessage:msg server:[server stringValue] username:[username stringValue]
password:[password stringValue] port:[port intValue] useTLS:tls useAuth:auth];
[msg release];
}
- (NSString *)to
{
return [[[myMessage to] anyObject] email];
}
- (void)setTo:(NSString *)aValue
{
CTCoreAddress *addr = [CTCoreAddress address];
[addr setEmail:aValue];
[myMessage setTo:[NSSet setWithObject:addr]];
}
- (NSString *)from
{
return [[[myMessage from] anyObject] email];
}
- (void)setFrom:(NSString *)aValue
{
CTCoreAddress *addr = [CTCoreAddress address];
[addr setEmail:aValue];
[addr setName:@""];
[myMessage setFrom:[NSSet setWithObject:addr]];
}
- (NSString *)subject
{
return [myMessage subject];
}
- (void)setSubject:(NSString *)aValue
{
[myMessage setSubject:aValue];
}
- (NSString *)body
{
return [myMessage body];
}
- (void)setBody:(NSString *)aValue
{
[myMessage setBody:aValue];
}
@end
-14
View File
@@ -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;
};
+175 -320
View File
@@ -7,10 +7,15 @@
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 */; };
8DC2EF570486A6940098B216 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7B1FEA5585E11CA2CBB /* Cocoa.framework */; };
F80A105917A576910063BCD2 /* libetpan-ios.a in Frameworks */ = {isa = PBXBuildFile; fileRef = F80A105117A573A50063BCD2 /* libetpan-ios.a */; };
F81A8ADC0C03FC3B002F780A /* CTMIME_MessagePart.h in Headers */ = {isa = PBXBuildFile; fileRef = F81A8AD20C03FC3B002F780A /* CTMIME_MessagePart.h */; settings = {ATTRIBUTES = (Public, ); }; };
F81A8ADD0C03FC3B002F780A /* CTMIME_MessagePart.m in Sources */ = {isa = PBXBuildFile; fileRef = F81A8AD30C03FC3B002F780A /* CTMIME_MessagePart.m */; };
F81A8ADE0C03FC3B002F780A /* CTMIME_MultiPart.h in Headers */ = {isa = PBXBuildFile; fileRef = F81A8AD40C03FC3B002F780A /* CTMIME_MultiPart.h */; settings = {ATTRIBUTES = (Public, ); }; };
@@ -40,12 +45,12 @@
F81E266F0C6ED4E100B3FBAC /* CTCoreAttachment.m in Sources */ = {isa = PBXBuildFile; fileRef = F81E266D0C6ED4E100B3FBAC /* CTCoreAttachment.m */; };
F8245A6D0C041C8C005E08A8 /* CTMIMEFactory.h in Headers */ = {isa = PBXBuildFile; fileRef = F8245A2F0C04089D005E08A8 /* CTMIMEFactory.h */; settings = {ATTRIBUTES = (Public, ); }; };
F8245A700C041C91005E08A8 /* CTMIMEFactory.m in Sources */ = {isa = PBXBuildFile; fileRef = F8245A300C04089D005E08A8 /* CTMIMEFactory.m */; };
F82AA54116F26F2300BF76A8 /* CTXlistResult.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F369D01162DF5030043A3ED /* CTXlistResult.h */; settings = {ATTRIBUTES = (Public, ); }; };
F8430BB10C72B16000753941 /* CTMIME_Enumerator.h in Headers */ = {isa = PBXBuildFile; fileRef = F8430BAF0C72B16000753941 /* CTMIME_Enumerator.h */; settings = {ATTRIBUTES = (Public, ); }; };
F8430BB20C72B16000753941 /* CTMIME_Enumerator.m in Sources */ = {isa = PBXBuildFile; fileRef = F8430BB00C72B16000753941 /* CTMIME_Enumerator.m */; };
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,89 +66,92 @@
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 */; };
F888630D158102680088CF38 /* CTCoreMessageTests.m in Sources */ = {isa = PBXBuildFile; fileRef = F8EADFB40B3BB178000C8371 /* CTCoreMessageTests.m */; };
F888630E1581026A0088CF38 /* CTMIMETests.m in Sources */ = {isa = PBXBuildFile; fileRef = F81A8AEC0C03FC58002F780A /* CTMIMETests.m */; };
F8886336158103080088CF38 /* libsasl2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = F8886333158102F50088CF38 /* libsasl2.a */; };
F8886338158103250088CF38 /* CFNetwork.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F8886337158103250088CF38 /* CFNetwork.framework */; };
F8886345158103500088CF38 /* libssl.a in Frameworks */ = {isa = PBXBuildFile; fileRef = F8886340158103460088CF38 /* libssl.a */; };
F8886346158103610088CF38 /* libcrypto.a in Frameworks */ = {isa = PBXBuildFile; fileRef = F8886342158103460088CF38 /* libcrypto.a */; };
F88CA0CE0BF7A7B00055AC29 /* CTSMTP.h in Headers */ = {isa = PBXBuildFile; fileRef = F88CA0CC0BF7A7B00055AC29 /* CTSMTP.h */; settings = {ATTRIBUTES = (Public, ); }; };
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 */; };
F8DFCF4E15801A5000C01975 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F8DFCF4D15801A5000C01975 /* UIKit.framework */; };
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 */; };
F8EC5B0514C37F60006AF4D8 /* CTCoreFolderTests.m in Sources */ = {isa = PBXBuildFile; fileRef = F8EC5B0514C37F60006AF4D7 /* CTCoreFolderTests.m */; };
F9FC3A731683FC07004B2D1E /* TestData in Resources */ = {isa = PBXBuildFile; fileRef = F9FC3A721683FC07004B2D1E /* TestData */; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
F80A104E17A573A50063BCD2 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = F890D38D10CEECD50039817C /* libetpan.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = C69AB10A10546FE500F32FBD;
remoteInfo = "static libetpan";
};
F80A105017A573A50063BCD2 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = F890D38D10CEECD50039817C /* libetpan.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = C682E2C015B315EF00BE9DA7;
remoteInfo = "libetpan ios";
};
F80A105317A573AD0063BCD2 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = F890D38D10CEECD50039817C /* libetpan.xcodeproj */;
proxyType = 1;
remoteGlobalIDString = C682E21815B315EF00BE9DA7;
remoteInfo = "libetpan ios";
};
F80A105517A575D00063BCD2 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = F890D38D10CEECD50039817C /* libetpan.xcodeproj */;
proxyType = 1;
remoteGlobalIDString = C682E21815B315EF00BE9DA7;
remoteInfo = "libetpan ios";
};
F80A105717A575D80063BCD2 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = F890D38D10CEECD50039817C /* libetpan.xcodeproj */;
proxyType = 1;
remoteGlobalIDString = C69AB10910546FE500F32FBD;
remoteInfo = "static libetpan";
};
F88863041581019F0088CF38 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 0867D690FE84028FC02AAC07 /* Project object */;
@@ -151,48 +159,6 @@
remoteGlobalIDString = F8618B5610DADB5C00C41188;
remoteInfo = "MailCore iOS";
};
F8886332158102F50088CF38 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = F888632D158102F50088CF38 /* Cyrus SASL.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = D2AAC07E0554694100DB518D;
remoteInfo = sasl2;
};
F8886334158102FD0088CF38 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = F888632D158102F50088CF38 /* Cyrus SASL.xcodeproj */;
proxyType = 1;
remoteGlobalIDString = D2AAC07D0554694100DB518D;
remoteInfo = sasl2;
};
F888633F158103460088CF38 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = F8886339158103460088CF38 /* openssl.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = D2AAC07E0554694100DB518D;
remoteInfo = ssl;
};
F8886341158103460088CF38 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = F8886339158103460088CF38 /* openssl.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = A0511C5A127770FD00DE46C4;
remoteInfo = crypto;
};
F88863431581034C0088CF38 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = F8886339158103460088CF38 /* openssl.xcodeproj */;
proxyType = 1;
remoteGlobalIDString = D2AAC07D0554694100DB518D;
remoteInfo = ssl;
};
F8886347158103630088CF38 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = F8886339158103460088CF38 /* openssl.xcodeproj */;
proxyType = 1;
remoteGlobalIDString = A0511C51127770FD00DE46C4;
remoteInfo = crypto;
};
F890D39510CEECD50039817C /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = F890D38D10CEECD50039817C /* libetpan.xcodeproj */;
@@ -200,110 +166,14 @@
remoteGlobalIDString = 8DC2EF5B0486A6940098B216;
remoteInfo = libetpan;
};
F8B245C9144BABA4002B56DA /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = F890D38D10CEECD50039817C /* libetpan.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = F8B2455E144B8C48002B56DA;
remoteInfo = "static libetpan iOS";
};
F8B245CC144BAC04002B56DA /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = F890D38D10CEECD50039817C /* libetpan.xcodeproj */;
proxyType = 1;
remoteGlobalIDString = F8B244B6144B8C48002B56DA;
remoteInfo = "static libetpan iOS";
};
F8B6D4EB156EE173008DE9EB /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = F890D38D10CEECD50039817C /* libetpan.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = F8B6D4CC156EE0B6008DE9EB;
remoteInfo = "static libetpan Mac";
};
F8B6D4EE156EE183008DE9EB /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = F890D38D10CEECD50039817C /* libetpan.xcodeproj */;
proxyType = 1;
remoteGlobalIDString = F8B6D422156EE0B6008DE9EB;
remoteInfo = "static libetpan Mac";
};
F8DFCF7E15801B8200C01975 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = F890D38D10CEECD50039817C /* libetpan.xcodeproj */;
proxyType = 1;
remoteGlobalIDString = F8B244B6144B8C48002B56DA;
remoteInfo = "static libetpan iOS";
};
/* 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 +197,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>"; };
@@ -355,16 +225,12 @@
F88804D50B4243C000D400E7 /* MailCoreUtilities.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = MailCoreUtilities.h; path = Source/MailCoreUtilities.h; sourceTree = SOURCE_ROOT; };
F88804D60B4243C000D400E7 /* MailCoreUtilities.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = MailCoreUtilities.m; path = Source/MailCoreUtilities.m; sourceTree = SOURCE_ROOT; };
F88863091581023C0088CF38 /* libiconv.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libiconv.dylib; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk/usr/lib/libiconv.dylib; sourceTree = DEVELOPER_DIR; };
F888632D158102F50088CF38 /* Cyrus SASL.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = "Cyrus SASL.xcodeproj"; path = "iOSPorts/ports/security/cyrus-sasl/Cyrus SASL.xcodeproj"; sourceTree = "<group>"; };
F8886337158103250088CF38 /* CFNetwork.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CFNetwork.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk/System/Library/Frameworks/CFNetwork.framework; sourceTree = DEVELOPER_DIR; };
F8886339158103460088CF38 /* openssl.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = openssl.xcodeproj; path = iOSPorts/ports/security/openssl/openssl.xcodeproj; sourceTree = "<group>"; };
F88CA0CC0BF7A7B00055AC29 /* CTSMTP.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CTSMTP.h; path = Source/CTSMTP.h; sourceTree = "<group>"; };
F88CA0CD0BF7A7B00055AC29 /* CTSMTP.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CTSMTP.m; path = Source/CTSMTP.m; sourceTree = "<group>"; };
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; };
@@ -385,6 +251,7 @@
F8EC5B0514C37F60006AF4D6 /* CTConnectedTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CTConnectedTest.h; path = Tests/CTConnectedTest.h; sourceTree = "<group>"; };
F8EC5B0514C37F60006AF4D7 /* CTCoreFolderTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CTCoreFolderTests.m; path = Tests/CTCoreFolderTests.m; sourceTree = "<group>"; };
F8EC5B0514C37F60006AF4D9 /* CTCoreFolderTests.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CTCoreFolderTests.h; path = Tests/CTCoreFolderTests.h; sourceTree = "<group>"; };
F9FC3A721683FC07004B2D1E /* TestData */ = {isa = PBXFileReference; lastKnownFileType = folder; path = TestData; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
@@ -392,7 +259,6 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
F8B6D4F0156EE189008DE9EB /* libetpan_mac.a in Frameworks */,
8DC2EF570486A6940098B216 /* Cocoa.framework in Frameworks */,
F8483E4109CE7B9000B80440 /* libssl.dylib in Frameworks */,
F8483E4309CE7B9C00B80440 /* libiconv.dylib in Frameworks */,
@@ -405,7 +271,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
F8B245CE144BAC15002B56DA /* libetpan_ios.a in Frameworks */,
F80A105917A576910063BCD2 /* libetpan-ios.a in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -413,13 +279,9 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
F8886346158103610088CF38 /* libcrypto.a in Frameworks */,
F8886345158103500088CF38 /* libssl.a in Frameworks */,
F8886338158103250088CF38 /* CFNetwork.framework in Frameworks */,
F8886336158103080088CF38 /* libsasl2.a in Frameworks */,
F888630A1581023C0088CF38 /* libiconv.dylib in Frameworks */,
F8886306158101A50088CF38 /* libmailcore.a in Frameworks */,
F8DFCF7415801B3500C01975 /* libetpan_ios.a in Frameworks */,
F8DFCF4C15801A5000C01975 /* SenTestingKit.framework in Frameworks */,
F8DFCF4E15801A5000C01975 /* UIKit.framework in Frameworks */,
F8DFCF5015801A5000C01975 /* Foundation.framework in Frameworks */,
@@ -442,10 +304,9 @@
0867D691FE84028FC02AAC07 /* MailCore */ = {
isa = PBXGroup;
children = (
F8886339158103460088CF38 /* openssl.xcodeproj */,
F888632D158102F50088CF38 /* Cyrus SASL.xcodeproj */,
F890D38D10CEECD50039817C /* libetpan.xcodeproj */,
F85A18AF09C7D8F200305C06 /* Tests */,
F9FC3A721683FC07004B2D1E /* TestData */,
08FB77AEFE84172EC02AAC07 /* Classes */,
32C88DFF0371C24200C91783 /* Other Sources */,
089C1665FE841158C02AAC07 /* Resources */,
@@ -470,6 +331,7 @@
089C1665FE841158C02AAC07 /* Resources */ = {
isa = PBXGroup;
children = (
0F134A861656D718000D1E83 /* types.plist */,
F81B88700A74AAD800143DF6 /* Info.plist */,
);
name = Resources;
@@ -492,6 +354,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 +391,6 @@
32C88DFF0371C24200C91783 /* Other Sources */ = {
isa = PBXGroup;
children = (
F8A70EED0C4059E100D1D694 /* JRLog.h */,
F8A70EEE0C4059E100D1D694 /* JRLog.m */,
F81B88710A74AAD800143DF6 /* MailCore_Prefix.pch */,
F8D31A3109C524EA00468234 /* main.m */,
);
@@ -595,29 +457,12 @@
name = Tests;
sourceTree = "<group>";
};
F888632E158102F50088CF38 /* Products */ = {
isa = PBXGroup;
children = (
F8886333158102F50088CF38 /* libsasl2.a */,
);
name = Products;
sourceTree = "<group>";
};
F888633A158103460088CF38 /* Products */ = {
isa = PBXGroup;
children = (
F8886340158103460088CF38 /* libssl.a */,
F8886342158103460088CF38 /* libcrypto.a */,
);
name = Products;
sourceTree = "<group>";
};
F890D39010CEECD50039817C /* Products */ = {
isa = PBXGroup;
children = (
F890D39610CEECD50039817C /* libetpan.framework */,
F8B245CA144BABA4002B56DA /* libetpan_ios.a */,
F8B6D4EC156EE173008DE9EB /* libetpan_mac.a */,
F80A104F17A573A50063BCD2 /* libetpan.a */,
F80A105117A573A50063BCD2 /* libetpan-ios.a */,
);
name = Products;
sourceTree = "<group>";
@@ -667,12 +512,41 @@
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 */,
F82AA54116F26F2300BF76A8 /* CTXlistResult.h in Headers */,
F86B542614F476200080FB8F /* CTESMTP.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -689,12 +563,11 @@
8DC2EF540486A6940098B216 /* Sources */,
8DC2EF560486A6940098B216 /* Frameworks */,
F848422D09CFACA000B80440 /* ShellScript */,
F8A2FAA9144FA7BA00C03DB4 /* CopyFiles */,
);
buildRules = (
);
dependencies = (
F8B6D4EF156EE183008DE9EB /* PBXTargetDependency */,
F80A105817A575D80063BCD2 /* PBXTargetDependency */,
);
name = MailCore;
productInstallPath = "$(HOME)/Library/Frameworks";
@@ -708,12 +581,12 @@
buildPhases = (
F8618B5410DADB5C00C41188 /* Sources */,
F8618B5510DADB5C00C41188 /* Frameworks */,
F86B542214F475DE0080FB8F /* CopyFiles */,
F831808C15AE74CE00448FC5 /* Headers */,
);
buildRules = (
);
dependencies = (
F8B245CD144BAC04002B56DA /* PBXTargetDependency */,
F80A105617A575D00063BCD2 /* PBXTargetDependency */,
);
name = "MailCore iOS";
productName = "MailCore iPhone";
@@ -732,11 +605,8 @@
buildRules = (
);
dependencies = (
F8886348158103630088CF38 /* PBXTargetDependency */,
F88863441581034C0088CF38 /* PBXTargetDependency */,
F8886335158102FD0088CF38 /* PBXTargetDependency */,
F80A105417A573AD0063BCD2 /* PBXTargetDependency */,
F88863051581019F0088CF38 /* PBXTargetDependency */,
F8DFCF7F15801B8200C01975 /* PBXTargetDependency */,
);
name = Tests;
productName = Tests;
@@ -749,7 +619,7 @@
0867D690FE84028FC02AAC07 /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0430;
LastUpgradeCheck = 0450;
};
buildConfigurationList = 1DEB91B108733DA50010E9CD /* Build configuration list for PBXProject "MailCore" */;
compatibilityVersion = "Xcode 3.2";
@@ -762,18 +632,10 @@
productRefGroup = 034768DFFF38A50411DB9C8B /* Products */;
projectDirPath = "";
projectReferences = (
{
ProductGroup = F888632E158102F50088CF38 /* Products */;
ProjectRef = F888632D158102F50088CF38 /* Cyrus SASL.xcodeproj */;
},
{
ProductGroup = F890D39010CEECD50039817C /* Products */;
ProjectRef = F890D38D10CEECD50039817C /* libetpan.xcodeproj */;
},
{
ProductGroup = F888633A158103460088CF38 /* Products */;
ProjectRef = F8886339158103460088CF38 /* openssl.xcodeproj */;
},
);
projectRoot = ..;
targets = (
@@ -785,25 +647,18 @@
/* End PBXProject section */
/* Begin PBXReferenceProxy section */
F8886333158102F50088CF38 /* libsasl2.a */ = {
F80A104F17A573A50063BCD2 /* libetpan.a */ = {
isa = PBXReferenceProxy;
fileType = archive.ar;
path = libsasl2.a;
remoteRef = F8886332158102F50088CF38 /* PBXContainerItemProxy */;
path = libetpan.a;
remoteRef = F80A104E17A573A50063BCD2 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
F8886340158103460088CF38 /* libssl.a */ = {
F80A105117A573A50063BCD2 /* libetpan-ios.a */ = {
isa = PBXReferenceProxy;
fileType = archive.ar;
path = libssl.a;
remoteRef = F888633F158103460088CF38 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
F8886342158103460088CF38 /* libcrypto.a */ = {
isa = PBXReferenceProxy;
fileType = archive.ar;
path = libcrypto.a;
remoteRef = F8886341158103460088CF38 /* PBXContainerItemProxy */;
path = "libetpan-ios.a";
remoteRef = F80A105017A573A50063BCD2 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
F890D39610CEECD50039817C /* libetpan.framework */ = {
@@ -813,20 +668,6 @@
remoteRef = F890D39510CEECD50039817C /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
F8B245CA144BABA4002B56DA /* libetpan_ios.a */ = {
isa = PBXReferenceProxy;
fileType = archive.ar;
path = libetpan_ios.a;
remoteRef = F8B245C9144BABA4002B56DA /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
F8B6D4EC156EE173008DE9EB /* libetpan_mac.a */ = {
isa = PBXReferenceProxy;
fileType = archive.ar;
path = libetpan_mac.a;
remoteRef = F8B6D4EB156EE173008DE9EB /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
/* End PBXReferenceProxy section */
/* Begin PBXResourcesBuildPhase section */
@@ -834,6 +675,7 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
0F134A871656D718000D1E83 /* types.plist in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -842,6 +684,7 @@
buildActionMask = 2147483647;
files = (
F8DFCF5615801A5000C01975 /* InfoPlist.strings in Resources */,
F9FC3A731683FC07004B2D1E /* TestData in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -908,13 +751,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 +764,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 +780,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 +795,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 */,
@@ -964,41 +804,26 @@
/* End PBXSourcesBuildPhase section */
/* Begin PBXTargetDependency section */
F80A105417A573AD0063BCD2 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
name = "libetpan ios";
targetProxy = F80A105317A573AD0063BCD2 /* PBXContainerItemProxy */;
};
F80A105617A575D00063BCD2 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
name = "libetpan ios";
targetProxy = F80A105517A575D00063BCD2 /* PBXContainerItemProxy */;
};
F80A105817A575D80063BCD2 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
name = "static libetpan";
targetProxy = F80A105717A575D80063BCD2 /* PBXContainerItemProxy */;
};
F88863051581019F0088CF38 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = F8618B5610DADB5C00C41188 /* MailCore iOS */;
targetProxy = F88863041581019F0088CF38 /* PBXContainerItemProxy */;
};
F8886335158102FD0088CF38 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
name = sasl2;
targetProxy = F8886334158102FD0088CF38 /* PBXContainerItemProxy */;
};
F88863441581034C0088CF38 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
name = ssl;
targetProxy = F88863431581034C0088CF38 /* PBXContainerItemProxy */;
};
F8886348158103630088CF38 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
name = crypto;
targetProxy = F8886347158103630088CF38 /* PBXContainerItemProxy */;
};
F8B245CD144BAC04002B56DA /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
name = "static libetpan iOS";
targetProxy = F8B245CC144BAC04002B56DA /* PBXContainerItemProxy */;
};
F8B6D4EF156EE183008DE9EB /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
name = "static libetpan Mac";
targetProxy = F8B6D4EE156EE183008DE9EB /* PBXContainerItemProxy */;
};
F8DFCF7F15801B8200C01975 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
name = "static libetpan iOS";
targetProxy = F8DFCF7E15801B8200C01975 /* PBXContainerItemProxy */;
};
/* End PBXTargetDependency section */
/* Begin PBXVariantGroup section */
@@ -1016,7 +841,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 = (
@@ -1029,6 +857,7 @@
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = MailCore_Prefix.pch;
HEADER_SEARCH_PATHS = "\"$(SRCROOT)/libetpan/build-mac/include/**";
INFOPLIST_FILE = Info.plist;
INSTALL_PATH = "@loader_path/../Frameworks";
LIBRARY_SEARCH_PATHS = (
@@ -1050,6 +879,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 = (
@@ -1061,6 +893,7 @@
GCC_MODEL_TUNING = G5;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = MailCore_Prefix.pch;
HEADER_SEARCH_PATHS = "\"$(SRCROOT)/libetpan/build-mac/include/**";
INFOPLIST_FILE = Info.plist;
INSTALL_PATH = "@loader_path/../Frameworks";
LIBRARY_SEARCH_PATHS = (
@@ -1081,16 +914,16 @@
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;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
HEADER_SEARCH_PATHS = "libetpan/build-mac/include/**";
IPHONEOS_DEPLOYMENT_TARGET = 4.3;
LIBRARY_SEARCH_PATHS = "";
MACOSX_DEPLOYMENT_TARGET = 10.6;
SDKROOT = macosx;
SYMROOT = build;
};
name = Debug;
};
@@ -1098,16 +931,16 @@
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;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
HEADER_SEARCH_PATHS = "libetpan/build-mac/include/**";
IPHONEOS_DEPLOYMENT_TARGET = 4.3;
LIBRARY_SEARCH_PATHS = "";
MACOSX_DEPLOYMENT_TARGET = 10.6;
SDKROOT = macosx;
SYMROOT = build;
};
name = Release;
};
@@ -1115,13 +948,24 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ARCHS = "$(ARCHS_STANDARD_32_BIT)";
ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)";
COPY_PHASE_STRIP = NO;
GCC_DYNAMIC_NO_PIC = NO;
GCC_OPTIMIZATION_LEVEL = 0;
ONLY_ACTIVE_ARCH = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = NO;
HEADER_SEARCH_PATHS = "$BUILT_PRODUCTS_DIR/include/libetpan/**";
IPHONEOS_DEPLOYMENT_TARGET = 7.0;
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"/Users/mronge/Projects/virtru-ios-mail/MailCore/Prebuilt/libetpan-ios/lib",
"/Users/mronge/Projects/virtru-ios-mail/MailCore/Prebuilt/libsasl-ios/lib",
);
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;
};
@@ -1129,12 +973,23 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ARCHS = "$(ARCHS_STANDARD_32_BIT)";
ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)";
COPY_PHASE_STRIP = YES;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
GCC_WARN_64_TO_32_BIT_CONVERSION = NO;
HEADER_SEARCH_PATHS = "$BUILT_PRODUCTS_DIR/include/libetpan/**";
IPHONEOS_DEPLOYMENT_TARGET = 7.0;
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"/Users/mronge/Projects/virtru-ios-mail/MailCore/Prebuilt/libetpan-ios/lib",
"/Users/mronge/Projects/virtru-ios-mail/MailCore/Prebuilt/libsasl-ios/lib",
);
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;
@@ -1162,7 +1017,7 @@
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
GCC_WARN_UNINITIALIZED_AUTOS = YES;
INFOPLIST_FILE = "Tests/Tests-Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 5.1;
IPHONEOS_DEPLOYMENT_TARGET = 4.3;
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"\"$(SRCROOT)/iOSPorts/ports/security/cyrus-sasl/build/Debug-iphoneos\"",
@@ -1189,7 +1044,7 @@
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
GCC_WARN_UNINITIALIZED_AUTOS = YES;
INFOPLIST_FILE = "Tests/Tests-Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 5.1;
IPHONEOS_DEPLOYMENT_TARGET = 4.3;
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"\"$(SRCROOT)/iOSPorts/ports/security/cyrus-sasl/build/Debug-iphoneos\"",
+65 -20
View File
@@ -5,37 +5,82 @@
\/_/ \/_/ \/_/\/_/ \/_/ \/_____/ \/_____/ \/_____/ \/_/ /_/ \/_____/
Getting Started
---------------
## What is MailCore
MailCore is a Mac and iOS library designed to ease the pain of dealing with e-mail protocols. MailCore makes the process of sending e-mail easy by hiding the nasty details like MIME composition from you. Instead, there is a single method required to send a message. Checking e-mail on an IMAP server is a more complex beast, but MailCore makes the job much simpler by presenting everything as a set of objects like Messages, Folders and Accounts.
## Example
This example shows how you can send email using MailCore.
```obj-c
CTCoreMessage *msg = [[CTCoreMessage alloc] init];
CTCoreAddress *toAddress = [CTCoreAddress addressWithName:@"Monkey"
email:@"monkey@monkey.com"];
[msg setTo:[NSSet setWithObject:toAddress]];
[msg setBody:@"This is a test message!"];
NSError *error;
BOOL success = [CTSMTPConnection sendMessage:testMsg
server:@"mail.test.com"
username:@"test"
password:@"test"
port:587
connectionType:CTSMTPConnectionTypeStartTLS
useAuth:YES
error:&error];
```
## 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
## Adding MailCore to Your iOS Project
- 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
1. First checkout the latest code and make sure you get the required submodules
2. Locate MailCore.xcodeproj and add it to your project as a subproject. You can do this by dragging the Mailcore.xcodeproj file into your Xcode project.
3. Navigate to your apps target and switch to your apps Build Phases. Once in Build Phases expand “Link Binary With Libraries” and click the + button. And add these libraries:
```
libmailcore.a
libssl.a
libsasl2.a
libcrypto.a
libiconv.dylib
CFNetwork.framework
```
4. Add “MailCore iOS” under “Target Dependencies”
5. Under your apps target, switch to Build Settings. Locate “Header Search Paths” in the Build Settings and add `"$(BUILT_PRODUCTS_DIR)/../../include"`
6. You are now ready to use MailCore. To use MailCore add `#import <MailCore/MailCore.h>` to the top of your Objective-C files.
Contact
-------
## Adding MailCore to Your Mac Project
If you have any questions contact me:
1. First checkout the latest code and make sure you get the required submodules
2. Locate MailCore.xcodeproj and add it to your project as a subproject. You can do this by dragging the Mailcore.xcodeproj file into your Xcode project.
3. Navigate to your apps target and switch to your apps Build Phases. Once in Build Phases expand “Link Binary With Libraries” and click the + button. From there add MailCore.framework.
4. While still under Build Phases click “Add Build Phase” in the lower right and select “Add Copy Files”. A new copy files phase will be added, make sure the destination is set to “Frameworks”. Now add MailCore.framework to that copy files phase by using the + button.
5. Add “MailCore” under “Target Dependencies”
6. You are now ready to use MailCore. To use MailCore add `#import <MailCore/MailCore.h>` to the top of your Objective-C files.
Matt Ronge
## More Docs
mronge@mronge.com
* [Getting Started](https://github.com/MailCore/MailCore/wiki/Getting-Started)
* [FAQ](https://github.com/MailCore/MailCore/wiki/FAQ)
* [API Docs](http://libmailcore.com/api/)
* [Wiki](https://github.com/MailCore/MailCore/wiki)
## Consulting
Consulting services are available via [Astro HQ](http://www.astro-hq.com). At Astro HQ we have years of experience working on email apps. If you need custom e-mail functionality developed, please get in touch via our website.
Thanks,
Matt Ronge
[@mronge](http://www.twitter.com/mronge)
+568
View File
@@ -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>
+11 -1
View File
@@ -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
-1
View File
@@ -29,7 +29,6 @@
* SUCH DAMAGE.
*/
#import <MailCore/MailCore.h>
#import "CTBareAttachment.h"
#import "MailCoreUtilities.h"
+45 -54
View File
@@ -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;
+139 -35
View File
@@ -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,96 @@
//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;
if (flagName == NULL && oflagStruct->of_type == MAILIMAP_MBX_LIST_OFLAG_NOINFERIORS) {
flagName = "NoInferiors";
}
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
View File
@@ -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
+1 -1
View File
@@ -95,7 +95,7 @@
- (NSString *)description {
return [NSString stringWithFormat:@"<%@,%@>", [self name],[self email]];
return [NSString stringWithFormat:@"%@ <%@>", [self name],[self email]];
}
+20 -2
View File
@@ -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
+2 -2
View File
@@ -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) {
+203 -131
View File
@@ -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,270 @@
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 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, size, 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
/**
Use this method to download message lists from the server.
This method uses sequence numbers indexset to determine which messages to download.
@param sequenceNumbers The indexset of sequence numbers to load.
@param attrs This controls what is fetched.
@return Returns a NSArray of CTCoreMessage's. Returns nil on error
@see messagesFromSequenceNumber:to:withFetchAttributes:
*/
- (NSArray *)messagesWithSequenceNumbers:(NSIndexSet *)sequenceNumbers
fetchAttributes:(CTFetchAttributes)attrs;
/**
Use this method to download message lists from the server.
This method uses uid numbers indexset to determine which messages to download.
@param uidNumbers The indexset of uid numbers to load.
@param attrs This controls what is fetched.
@return Returns a NSArray of CTCoreMessage's. Returns nil on error
@see messagesFromSequenceNumber:to:withFetchAttributes:
*/
- (NSArray *)messagesWithUIDs:(NSIndexSet *)uidNumbers
fetchAttributes:(CTFetchAttributes)attrs;
/**
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
/**
Retrieves the message extension flags.
@return Return YES on success, NO on error. Call method lastError to get error if one occurred
*/
- (BOOL)extensionFlagsForMessage:(CTCoreMessage *)msg flags:(NSArray **)flags;
/**
Sets the message's extension flags on the server.
@return Return YES on success, NO on error. Call method lastError to get error if one occurred
*/
- (BOOL)setExtensionFlags:(NSArray *)flags forMessage:(CTCoreMessage *)msg;
/**
Retrieves the message's flags and extension flags, 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)flagsForMessage:(CTCoreMessage *)msg flags:(NSUInteger *)flags extensionFlags:(NSArray **)extensionFlags;
/**
Sets the message's flags and extension flags on the server.
@return Return YES on success, NO on error. Call method lastError to get error if one occurred
*/
- (BOOL)setFlags:(NSUInteger)flags extensionFlags:(NSArray *)extensionFlags forMessage:(CTCoreMessage *)msg;
/**
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
/**
Pass in a pointer to a NSUInteger to get 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
/**
Pass in a pointer to a NSUInteger to get 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;
+390 -117
View File
@@ -38,6 +38,13 @@
#import "MailCoreTypes.h"
#import "MailCoreUtilities.h"
#include <unistd.h>
NSError* MailCoreCreateStringConvError() {
return MailCoreCreateError(1, @"Unable to convert folder name");
}
//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 +53,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 +66,13 @@ 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];
if (![self getUTF7String:buffer fromString:myPath]) {
return nil;
}
myFolder = mailfolder_new(storage, buffer, NULL);
if (!myFolder) {
return nil;
}
@@ -78,11 +93,20 @@ int uid_list_to_env_list(clist * fetch_result, struct mailmessage_list ** result
}
- (BOOL)getUTF7String:(char *)buffer fromString:(NSString *)str {
if (str == nil || buffer == nil) {
return NO;
}
return CFStringGetCString((CFStringRef)str, buffer, MAX_PATH_SIZE, kCFStringEncodingUTF7_IMAP);
}
- (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 +123,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 +139,135 @@ int uid_list_to_env_list(clist * fetch_result, struct mailmessage_list ** result
if (!success) {
return NO;
}
err = mailimap_rename([myAccount session], oldPath, newPath);
if (err != MAILIMAP_NO_ERROR) {
self.lastError = MailCoreCreateErrorFromCode(err);
char newPath[MAX_PATH_SIZE];
if (![self getUTF7String:newPath fromString:path]) {
self.lastError = MailCoreCreateStringConvError();
return NO;
}
char oldPath[MAX_PATH_SIZE];
[self getUTF7String:oldPath fromString:myPath];
if (![self getUTF7String:oldPath fromString:myPath]) {
self.lastError = MailCoreCreateStringConvError();
return NO;
}
err = mailimap_rename([myAccount session], oldPath, newPath);
if (err != MAILIMAP_NO_ERROR) {
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];
if (![self getUTF7String:path fromString:myPath]) {
self.lastError = MailCoreCreateStringConvError();
return NO;
}
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 +281,12 @@ 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];
if (![self getUTF7String:path fromString:myPath]) {
self.lastError = MailCoreCreateStringConvError();
return NO;
}
BOOL success = [self connect];
if (!success) {
@@ -171,7 +299,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 +308,12 @@ 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];
if (![self getUTF7String:path fromString:myPath]) {
self.lastError = MailCoreCreateStringConvError();
return NO;
}
BOOL success = [self connect];
if (!success) {
@@ -189,7 +322,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 +331,12 @@ 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];
if (![self getUTF7String:path fromString:myPath]) {
self.lastError = MailCoreCreateStringConvError();
return NO;
}
BOOL success = [self connect];
if (!success) {
@@ -206,19 +344,41 @@ 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;
struct mail_flags *flags = mail_flags_new(MAIL_FLAG_SEEN, clist_new());
err = mailsession_append_message_flags([self folderSession],
[msgStr cStringUsingEncoding: NSUTF8StringEncoding],
[msgStr lengthOfBytesUsingEncoding: NSUTF8StringEncoding],
flags);
mail_flags_free(flags);
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 +388,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 +407,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 +427,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 +435,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;
}
@@ -296,7 +459,7 @@ int uid_list_to_env_list(clist * fetch_result, struct mailmessage_list ** result
return YES;
}
// We always fetch UID, RFC822.Size, and Flags
// We always fetch UID and Flags
- (NSArray *)messagesForSet:(struct mailimap_set *)set fetchAttributes:(CTFetchAttributes)attrs uidFetch:(BOOL)uidFetch {
BOOL success = [self connect];
if (!success) {
@@ -319,7 +482,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,18 +492,20 @@ 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;
}
// Always fetch RFC822.Size
fetch_att = mailimap_fetch_att_new_rfc822_size();
r = mailimap_fetch_type_new_fetch_att_list_add(fetch_type, fetch_att);
if (r != MAILIMAP_NO_ERROR) {
mailimap_fetch_att_free(fetch_att);
mailimap_fetch_type_free(fetch_type);
self.lastError = MailCoreCreateErrorFromCode(r);
return nil;
// We only fetch RFC822.Size if the envelope is being fetched
if (attrs & CTFetchAttrEnvelope) {
fetch_att = mailimap_fetch_att_new_rfc822_size();
r = mailimap_fetch_type_new_fetch_att_list_add(fetch_type, fetch_att);
if (r != MAILIMAP_NO_ERROR) {
mailimap_fetch_att_free(fetch_att);
mailimap_fetch_type_free(fetch_type);
self.lastError = MailCoreCreateErrorFromIMAPCode(r);
return nil;
}
}
// We only fetch the body structure if requested
@@ -350,7 +515,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 +525,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 +536,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 +546,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 +568,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 +578,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];
@@ -499,12 +667,33 @@ int uid_list_to_env_list(clist * fetch_result, struct mailmessage_list ** result
return results;
}
- (NSArray *)messagesWithSequenceNumbers:(NSIndexSet *)sequenceNumbers
fetchAttributes:(CTFetchAttributes)attrs {
struct mailimap_set *set = mailimap_set_new_empty();
[sequenceNumbers enumerateRangesUsingBlock:^(NSRange range, BOOL *stop) {
mailimap_set_add_interval(set, range.location, range.location + range.length - 1);
}];
return [self messagesForSet:set fetchAttributes:attrs uidFetch:NO];
}
- (NSArray *)messagesWithUIDs:(NSIndexSet *)uidNumbers
fetchAttributes:(CTFetchAttributes)attrs {
struct mailimap_set *set = mailimap_set_new_empty();
[uidNumbers enumerateRangesUsingBlock:^(NSRange range, BOOL *stop) {
mailimap_set_add_interval(set, range.location, range.location + range.length - 1);
}];
return [self messagesForSet:set fetchAttributes:attrs uidFetch:YES];
}
- (CTCoreMessage *)messageWithUID:(NSUInteger)uid {
int err;
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 +701,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?
@@ -539,21 +730,7 @@ int uid_list_to_env_list(clist * fetch_result, struct mailmessage_list ** result
already depends on CTCoreMessage so we aren't adding any dependencies here. */
- (BOOL)flagsForMessage:(CTCoreMessage *)msg flags:(NSUInteger *)flags {
BOOL success = [self connect];
if (!success) {
return NO;
}
self.lastError = nil;
int err;
struct mail_flags *flagStruct;
err = mailmessage_get_flags([msg messageStruct], &flagStruct);
if (err != MAIL_NO_ERROR) {
self.lastError = MailCoreCreateErrorFromCode(err);
return NO;
}
*flags = flagStruct->fl_flags;
return YES;
return [self flagsForMessage:msg flags:flags extensionFlags:NULL];
}
@@ -567,12 +744,98 @@ 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;
}
- (BOOL)extensionFlagsForMessage:(CTCoreMessage *)msg flags:(NSArray **)flags {
return [self flagsForMessage:msg flags:NULL extensionFlags:flags];
}
- (BOOL)setExtensionFlags:(NSArray *)flags forMessage:(CTCoreMessage *)msg {
BOOL success = [self connect];
if (!success) {
return NO;
}
int err;
clist *extensionFlags = MailCoreClistFromStringArray(flags);
if ([msg messageStruct]->msg_flags->fl_extension) {
clist_free([msg messageStruct]->msg_flags->fl_extension);
[msg messageStruct]->msg_flags->fl_extension = NULL;
}
[msg messageStruct]->msg_flags->fl_extension = extensionFlags;
err = mailmessage_check([msg messageStruct]);
if (err != MAIL_NO_ERROR) {
self.lastError = MailCoreCreateErrorFromIMAPCode(err);
return NO;
}
err = mailfolder_check(myFolder);
if (err != MAIL_NO_ERROR) {
self.lastError = MailCoreCreateErrorFromIMAPCode(err);
return NO;
}
return YES;
}
- (BOOL)flagsForMessage:(CTCoreMessage *)msg flags:(NSUInteger *)flags extensionFlags:(NSArray **)extensionFlags {
BOOL success = [self connect];
if (!success) {
return NO;
}
self.lastError = nil;
int err;
struct mail_flags *flagStruct;
err = mailmessage_get_flags([msg messageStruct], &flagStruct);
if (err != MAIL_NO_ERROR) {
self.lastError = MailCoreCreateErrorFromIMAPCode(err);
return NO;
}
if (flags) {
*flags = flagStruct->fl_flags;
}
if (extensionFlags) {
NSArray *extionsionFlags = MailCoreStringArrayFromClist(flagStruct->fl_extension);
*extensionFlags = extionsionFlags;
}
return YES;
}
- (BOOL)setFlags:(NSUInteger)flags extensionFlags:(NSArray *)extensionFlags forMessage:(CTCoreMessage *)msg {
BOOL success = [self connect];
if (!success) {
return NO;
}
int err;
[msg messageStruct]->msg_flags->fl_flags = flags;
clist *extensions = MailCoreClistFromStringArray(extensionFlags);
if ([msg messageStruct]->msg_flags->fl_extension) {
clist_free([msg messageStruct]->msg_flags->fl_extension);
[msg messageStruct]->msg_flags->fl_extension = NULL;
}
[msg messageStruct]->msg_flags->fl_extension = extensions;
err = mailmessage_check([msg messageStruct]);
if (err != MAIL_NO_ERROR) {
self.lastError = MailCoreCreateErrorFromIMAPCode(err);
return NO;
}
err = mailfolder_check(myFolder);
if (err != MAIL_NO_ERROR) {
self.lastError = MailCoreCreateErrorFromIMAPCode(err);
return NO;
}
return YES;
}
- (BOOL)expunge {
int err;
@@ -582,37 +845,45 @@ 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);
char mbPath[MAX_PATH_SIZE];
if (![self getUTF7String:mbPath fromString:path]) {
self.lastError = MailCoreCreateStringConvError();
return NO;
}
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);
char mbPath[MAX_PATH_SIZE];
if (![self getUTF7String:mbPath fromString:path]) {
self.lastError = MailCoreCreateStringConvError();
return NO;
}
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 +897,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;
@@ -748,4 +1019,6 @@ int uid_list_to_env_list(clist * fetch_result, struct mailmessage_list ** result
err:
return res;
}
@end
+205 -129
View File
@@ -32,258 +32,334 @@
#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;
typedef enum {
CTCoreMessageUrgentPriority = 1,
CTCoreMessageNormalPriority = 2,
CTCoreMessageNonUrgentPriority
} CTCoreMessagePriority;
@interface CTCoreMessage : NSObject {
struct mailmessage *myMessage;
struct mailimf_single_fields *myFields;
CTMIME *myParsedMIME;
NSUInteger mySequenceNumber;
NSError *lastError;
CTCoreFolder *parentFolder;
CTCoreMessagePriority mailPriority;
}
/*!
@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
/**
Returns YES if this message body structure has been downloaded, and NO otherwise.
*/
- (BOOL)hasBodyStructure;
/**
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;
/**
Use this method to set both body Plaintext and HTML content.
HTML will have higher priority
*/
- (void) setHTMLBody:(NSString*)htmlString textBody:(NSString*)plainString;
/**
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) */
- (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
*/
- (NSDate *)senderDate;
/*! @abstract 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 YES if the message is deleted.
*/
- (NSDate *)sentDateLocalTimeZone;
- (BOOL)isDeleted;
/*!
@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.
/**
Returns the message extionsion flags.
The extension flags contain flags other than standard flags in flags property. This include "Draft" flag.
See MailCoreTypes.h for a list of constants
*/
- (NSArray *)extionsionFlags;
/**
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;
/**
Sets the outgoing message's priority header value.
Support for Mail Prioirty header defined in IMAP 4021 and X-Prioirty header.
*/
- (void)setMailPriority:(CTCoreMessagePriority)priority;
/* Intended for advanced use only */
- (struct mailmessage *)messageStruct;
- (mailimap *)imapSession;
+267 -76
View File
@@ -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];
}
@@ -112,6 +103,13 @@
return lastError;
}
- (BOOL)hasBodyStructure {
if (myParsedMIME == nil) {
return NO;
}
return YES;
}
- (BOOL)fetchBodyStructure {
if (myMessage == NULL) {
return NO;
@@ -122,19 +120,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 {
@@ -148,7 +151,10 @@
[self fetchBodyStructure];
}
NSMutableString *result = [NSMutableString string];
[self _buildUpBodyText:myParsedMIME result:result];
BOOL success = [self _buildUpBodyText:myParsedMIME result:result];
if (!success) {
return nil;
}
return result;
}
@@ -174,34 +180,46 @@
}
- (NSString *)htmlBody {
if (myFields == NULL || myParsedMIME == nil) {
[self fetchBodyStructure];
}
NSMutableString *result = [NSMutableString string];
[self _buildUpHtmlBodyText:myParsedMIME result:result];
BOOL success = [self _buildUpHtmlBodyText:myParsedMIME result:result];
if (!success) {
return nil;
}
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;
}
- (void)_buildUpBodyText:(CTMIME *)mime result:(NSMutableString *)result {
- (BOOL)_buildUpBodyText:(CTMIME *)mime result:(NSMutableString *)result {
if (mime == nil)
return;
return NO;
if ([mime isKindOfClass:[CTMIME_MessagePart class]]) {
[self _buildUpBodyText:[mime content] result:result];
return [self _buildUpBodyText:[mime content] result:result];
}
else if ([mime isKindOfClass:[CTMIME_TextPart class]]) {
if ([[mime.contentType lowercaseString] rangeOfString:@"text/plain"].location != NSNotFound) {
[(CTMIME_TextPart *)mime fetchPart];
NSString* y = [mime content];
if(y != nil) {
[result appendString:y];
BOOL success = [(CTMIME_TextPart *)mime fetchPart];
if (!success) {
return NO;
}
NSString* y = [mime content];
if(y == nil) {
return NO;
}
[result appendString:y];
}
}
else if ([mime isKindOfClass:[CTMIME_MultiPart class]]) {
@@ -209,25 +227,34 @@
NSEnumerator *enumer = [[mime content] objectEnumerator];
CTMIME *subpart;
while ((subpart = [enumer nextObject])) {
[self _buildUpBodyText:subpart result:result];
BOOL success = [self _buildUpBodyText:subpart result:result];
if (!success) {
return NO;
}
}
}
return YES;
}
- (void)_buildUpHtmlBodyText:(CTMIME *)mime result:(NSMutableString *)result {
- (BOOL)_buildUpHtmlBodyText:(CTMIME *)mime result:(NSMutableString *)result {
if (mime == nil)
return;
return NO;
if ([mime isKindOfClass:[CTMIME_MessagePart class]]) {
[self _buildUpHtmlBodyText:[mime content] result:result];
return [self _buildUpHtmlBodyText:[mime content] result:result];
}
else if ([mime isKindOfClass:[CTMIME_TextPart class]]) {
if ([[mime.contentType lowercaseString] rangeOfString:@"text/html"].location != NSNotFound) {
[(CTMIME_TextPart *)mime fetchPart];
NSString* y = [mime content];
if(y != nil) {
[result appendString:y];
BOOL success = [(CTMIME_TextPart *)mime fetchPart];
if (!success) {
return NO;
}
NSString* y = [mime content];
if(y == nil) {
return NO;
}
[result appendString:y];
}
}
else if ([mime isKindOfClass:[CTMIME_MultiPart class]]) {
@@ -235,9 +262,42 @@
NSEnumerator *enumer = [[mime content] objectEnumerator];
CTMIME *subpart;
while ((subpart = [enumer nextObject])) {
[self _buildUpHtmlBodyText:subpart result:result];
BOOL success = [self _buildUpHtmlBodyText:subpart result:result];
if (!success) {
return NO;
}
}
}
return YES;
}
- (void) setHTMLBody:(NSString*)htmlString textBody:(NSString*)plainString {
/*
* Message structure:
*
* [ msg root ]
* --> multipart/alternative (Body)
* -----> text
* -----> html
*/
// Body (multipart/alternative)
CTMIME_MultiPart* bodyMultipart = [CTMIME_MultiPart mimeMultiPart];
bodyMultipart.contentType = @"multipart/alternative";
CTMIME_TextPart* bodyTextPart = [CTMIME_TextPart mimeTextPartWithString:plainString];
CTMIME_HtmlPart* bodyHtmlPart = [CTMIME_HtmlPart mimeTextPartWithString:htmlString];
[bodyMultipart addMIMEPart: bodyTextPart ];
[bodyMultipart addMIMEPart: bodyHtmlPart ];
// Root
CTMIME_MessagePart* messagePartRoot = [CTMIME_MessagePart mimeMessagePartWithContent:bodyMultipart];
[myParsedMIME release];
myParsedMIME = [messagePartRoot retain];
}
@@ -292,11 +352,38 @@
msg = (CTMIME_MessagePart *)myParsedMIME;
CTMIME *sub = [msg content];
// Creat new multimime part if needed
if ([sub isKindOfClass:[CTMIME_MultiPart class]]) {
multi = (CTMIME_MultiPart *)sub;
} else {
// Assuming this is the body
if ([sub.contentType isEqualToString:@"multipart/alternative"]) {
/*
* Transform the following
* message structure:
*
* [ msg root ]
* --> multipart/alternative
* -----> text
* -----> html
*
* into:
*
* [ MessagePart Root ]
* --> multipart/mixed
* -----> attachments
* -----> multipart/alternative
* --------> text
* --------> html
*/
CTMIME_MultiPart* multipartMixed = [CTMIME_MultiPart mimeMultiPart];
[multipartMixed addMIMEPart:sub];
multi = multipartMixed;
[msg setContent:multipartMixed];
}
else
multi = (CTMIME_MultiPart *)sub;
}
else {
multi = [CTMIME_MultiPart mimeMultiPart];
[multi addMIMEPart:sub];
[msg setContent:multi];
@@ -349,7 +436,7 @@
- (NSDate *)senderDate {
if ( myFields->fld_orig_date == NULL) {
return [NSDate distantPast];
return nil;
} else {
struct mailimf_date_time *d;
@@ -357,6 +444,7 @@
return nil;
NSCalendar *calendar = [[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar];
calendar.timeZone = [self senderTimeZone];
NSDateComponents *comps = [[NSDateComponents alloc] init];
[comps setYear:d->dt_year];
@@ -366,53 +454,34 @@
[comps setMinute:d->dt_min];
[comps setSecond:d->dt_sec];
NSDate *messageDateNoTimezone = [calendar dateFromComponents:comps];
NSDate *messageDate = [calendar dateFromComponents:comps];
[comps release];
[calendar release];
// no timezone applied
return messageDateNoTimezone;
return messageDate;
}
}
- (NSDate *)sentDateGMT {
struct mailimf_date_time *d;
if((d = [self libetpanDateTime]) == NULL)
return nil;
NSInteger timezoneOffsetInSeconds = 3600*d->dt_zone/100;
NSDate *date = [self senderDate];
return [date dateByAddingTimeInterval:timezoneOffsetInSeconds * -1];
}
- (NSDate*)sentDateLocalTimeZone {
return [[self sentDateGMT] dateByAddingTimeInterval:[[NSTimeZone localTimeZone] secondsFromGMT]];
}
- (BOOL)isUnread {
struct mail_flags *flags = myMessage->msg_flags;
if (flags != NULL) {
BOOL flag_seen = (flags->fl_flags & MAIL_FLAG_SEEN);
return !flag_seen;
}
return NO;
return ![self isFlagSet:MAIL_FLAG_SEEN withDefault:YES];
}
- (BOOL)isDeleted {
return [self isFlagSet:MAIL_FLAG_DELETED withDefault:NO];
}
- (BOOL)isStarred {
struct mail_flags *flags = myMessage->msg_flags;
if (flags != NULL) {
BOOL flag_starred = (flags->fl_flags & MAIL_FLAG_FLAGGED);
return flag_starred;
}
return NO;
return [self isFlagSet:MAIL_FLAG_FLAGGED withDefault:NO];
}
- (BOOL)isFlagSet:(NSUInteger)flag withDefault:(BOOL)def {
struct mail_flags *flags = myMessage ? myMessage->msg_flags : NULL;
return flags == NULL ? def : flags->fl_flags & flag;
}
- (BOOL)isNew {
struct mail_flags *flags = myMessage->msg_flags;
struct mail_flags *flags = myMessage ? myMessage->msg_flags : NULL;
if (flags != NULL) {
BOOL flag_seen = (flags->fl_flags & MAIL_FLAG_SEEN);
BOOL flag_new = (flags->fl_flags & MAIL_FLAG_NEW);
@@ -430,7 +499,7 @@
}
- (NSUInteger)uid {
if (myMessage->msg_uid) {
if (myMessage && myMessage->msg_uid) {
NSString *uidString = [[NSString alloc] initWithCString:myMessage->msg_uid encoding:NSASCIIStringEncoding];
NSUInteger uid = (NSUInteger)[[[uidString componentsSeparatedByString:@"-"] objectAtIndex:1] intValue];
[uidString release];
@@ -450,6 +519,13 @@
return 0;
}
- (NSArray *)extionsionFlags {
if (myMessage != NULL && myMessage->msg_flags != NULL) {
return MailCoreStringArrayFromClist(myMessage->msg_flags->fl_extension);
}
return nil;
}
- (NSUInteger)sequenceNumber {
return mySequenceNumber;
}
@@ -493,7 +569,10 @@
- (void)setTo:(NSSet *)addresses {
struct mailimf_address_list *imf = [self _IMFAddressListFromAddresssList:addresses];
if (!imf) {
return;
}
if (myFields->fld_to != NULL) {
mailimf_address_list_free(myFields->fld_to->to_addr_list);
myFields->fld_to->to_addr_list = imf;
@@ -502,6 +581,45 @@
myFields->fld_to = mailimf_to_new(imf);
}
- (NSArray *)inReplyTo {
if (myFields->fld_in_reply_to == NULL)
return nil;
else
return MailCoreStringArrayFromClist(myFields->fld_in_reply_to->mid_list);
}
- (void)setInReplyTo:(NSArray *)messageIds {
struct mailimf_in_reply_to *imf = mailimf_in_reply_to_new(MailCoreClistFromStringArray(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 MailCoreStringArrayFromClist(myFields->fld_references->mid_list);
}
- (void)setReferences:(NSArray *)messageIds {
struct mailimf_references *imf = mailimf_references_new(MailCoreClistFromStringArray(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)
@@ -513,6 +631,10 @@
- (void)setCc:(NSSet *)addresses {
struct mailimf_address_list *imf = [self _IMFAddressListFromAddresssList:addresses];
if (!imf) {
return;
}
if (myFields->fld_cc != NULL) {
mailimf_address_list_free(myFields->fld_cc->cc_addr_list);
myFields->fld_cc->cc_addr_list = imf;
@@ -532,6 +654,10 @@
- (void)setBcc:(NSSet *)addresses {
struct mailimf_address_list *imf = [self _IMFAddressListFromAddresssList:addresses];
if (!imf) {
return;
}
if (myFields->fld_bcc != NULL) {
mailimf_address_list_free(myFields->fld_bcc->bcc_addr_list);
myFields->fld_bcc->bcc_addr_list = imf;
@@ -551,6 +677,10 @@
- (void)setReplyTo:(NSSet *)addresses {
struct mailimf_address_list *imf = [self _IMFAddressListFromAddresssList:addresses];
if (!imf) {
return;
}
if (myFields->fld_reply_to != NULL) {
mailimf_address_list_free(myFields->fld_reply_to->rt_addr_list);
myFields->fld_reply_to->rt_addr_list = imf;
@@ -576,9 +706,49 @@
clist *references = (myFields->fld_references != NULL) ? (myFields->fld_references->mid_list) : NULL;
char *subject = (myFields->fld_subject != NULL) ? (myFields->fld_subject->sbj_value) : NULL;
fields = mailimf_fields_new_with_data(from, sender, replyTo, to, cc, bcc, inReplyTo, references, subject);
if (self->mailPriority != 0) {
char * xPriorityValue;
char * rfcPriorityValue;
switch (self->mailPriority) {
case CTCoreMessageUrgentPriority: {
xPriorityValue = "1";
rfcPriorityValue = "urgent";
break;
}
case CTCoreMessageNormalPriority: {
xPriorityValue = "3";
rfcPriorityValue = "normal";
break;
}
case CTCoreMessageNonUrgentPriority: {
xPriorityValue = "5";
rfcPriorityValue = "non-urgent";
break;
}
default:
break;
}
struct mailimf_optional_field * priority = mailimf_optional_field_new("X-Priority", xPriorityValue);
struct mailimf_field * priorityField = mailimf_field_new(MAILIMF_FIELD_OPTIONAL_FIELD, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, priority);
mailimf_fields_add(fields, priorityField);
priority = mailimf_optional_field_new("Priority", rfcPriorityValue);
priorityField = mailimf_field_new(MAILIMF_FIELD_OPTIONAL_FIELD, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, priority);
mailimf_fields_add(fields, priorityField);
}
//TODO uh oh, when this get freed it frees stuff in the CTCoreMessage
//TODO Need to make sure that fields gets freed somewhere
fields = mailimf_fields_new_with_data(from, sender, replyTo, to, cc, bcc, inReplyTo, references, subject);
[(CTMIME_MessagePart *)msgPart setIMFFields:fields];
}
return [myParsedMIME render];
@@ -588,11 +758,11 @@
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];
struct mail_flags *flagsStruct = myMessage->msg_flags;
struct mail_flags *flagsStruct = myMessage ? myMessage->msg_flags : NULL;
uint64_t flags = 0;
if (flagsStruct != NULL) {
BOOL seen = (flagsStruct->fl_flags & CTFlagSeen) > 0;
@@ -626,13 +796,30 @@
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];
}
- (void)setMailPriority:(CTCoreMessagePriority)priority {
mailPriority = priority;
}
- (struct mailmessage *)messageStruct {
return myMessage;
@@ -652,7 +839,6 @@
return data->imap_session;
}
/*********************************** myprivates ***********************************/
- (CTCoreAddress *)_addressFromMailbox:(struct mailimf_mailbox *)mailbox; {
CTCoreAddress *address = [CTCoreAddress address];
if (mailbox == NULL) {
@@ -734,6 +920,10 @@
- (struct mailimf_address_list *)_IMFAddressListFromAddresssList:(NSSet *)addresses {
if (!addresses) {
return NULL;
}
struct mailimf_address_list *imfList = mailimf_address_list_new_empty();
NSEnumerator *objEnum = [addresses objectEnumerator];
@@ -751,4 +941,5 @@
return imfList;
}
@end
+3 -4
View File
@@ -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
View File
@@ -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
View File
@@ -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];
}
+6 -4
View File
@@ -89,19 +89,21 @@
struct mailmime *mime_sub;
struct mailmime_content *content;
struct mailmime_parameter *param;
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);
mime_fields = mailmime_fields_new_with_data(encoding, NULL, NULL, NULL, 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;
}
+2 -2
View File
@@ -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];
+7 -3
View File
@@ -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,13 +53,16 @@ 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;
- (id)initWithData:(NSData *)data;
- (BOOL)fetchPart;
- (BOOL)fetchPartWithProgress:(CTProgressBlock)block;
// Advanced use only
- (struct mailmime_single_fields *)mimeFields;
@end
+44 -34
View File
@@ -87,11 +87,15 @@ static void download_progress_callback(size_t current, size_t maximum, void * co
mMimeFields = mailmime_single_fields_new(mMime->mm_mime_fields, mMime->mm_content_type);
if (mMimeFields != NULL) {
if (mMimeFields->fld_id != NULL) {
self.contentId = [NSString stringWithCString:mMimeFields->fld_id encoding:NSUTF8StringEncoding];
}
struct mailmime_disposition *disp = mMimeFields->fld_disposition;
if (disp != NULL) {
if (disp->dsp_type != NULL) {
self.attached = (disp->dsp_type->dsp_type ==
MAILMIME_DISPOSITION_TYPE_ATTACHMENT);
self.attached = (disp->dsp_type->dsp_type == MAILMIME_DISPOSITION_TYPE_ATTACHMENT ||
disp->dsp_type->dsp_type == MAILMIME_DISPOSITION_TYPE_INLINE);
if (self.attached)
{
@@ -109,35 +113,33 @@ static void download_progress_callback(size_t current, size_t maximum, void * co
if (mMimeFields->fld_disposition_filename != NULL) {
self.filename = [NSString stringWithCString:mMimeFields->fld_disposition_filename encoding:NSUTF8StringEncoding];
if (mMimeFields->fld_id != NULL)
self.contentId = [NSString stringWithCString:mMimeFields->fld_id encoding:NSUTF8StringEncoding];
NSString* lowercaseName = [self.filename lowercaseString];
if([lowercaseName hasSuffix:@".xls"] ||
[lowercaseName hasSuffix:@".xlsx"] ||
[lowercaseName hasSuffix:@".key.zip"] ||
[lowercaseName hasSuffix:@".numbers.zip"] ||
[lowercaseName hasSuffix:@".pages.zip"] ||
[lowercaseName hasSuffix:@".pdf"] ||
[lowercaseName hasSuffix:@".ppt"] ||
[lowercaseName hasSuffix:@".doc"] ||
[lowercaseName hasSuffix:@".docx"] ||
[lowercaseName hasSuffix:@".rtf"] ||
[lowercaseName hasSuffix:@".rtfd.zip"] ||
[lowercaseName hasSuffix:@".key"] ||
[lowercaseName hasSuffix:@".numbers"] ||
[lowercaseName hasSuffix:@".pages"] ||
[lowercaseName hasSuffix:@".png"] ||
[lowercaseName hasSuffix:@".gif"] ||
[lowercaseName hasSuffix:@".png"] ||
[lowercaseName hasSuffix:@".jpg"] ||
[lowercaseName hasSuffix:@".jpeg"] ||
[lowercaseName hasSuffix:@".tiff"]) { // hack by gabor, improved by waseem, based on http://developer.apple.com/iphone/library/qa/qa2008/qa1630.html
self.attached = YES;
}
} else if (mMimeFields->fld_location != NULL) {
self.filename = [NSString stringWithCString:mMimeFields->fld_location encoding:NSUTF8StringEncoding];
}
NSString* lowercaseName = [self.filename lowercaseString];
if([lowercaseName hasSuffix:@".xls"] ||
[lowercaseName hasSuffix:@".xlsx"] ||
[lowercaseName hasSuffix:@".key.zip"] ||
[lowercaseName hasSuffix:@".numbers.zip"] ||
[lowercaseName hasSuffix:@".pages.zip"] ||
[lowercaseName hasSuffix:@".pdf"] ||
[lowercaseName hasSuffix:@".ppt"] ||
[lowercaseName hasSuffix:@".doc"] ||
[lowercaseName hasSuffix:@".docx"] ||
[lowercaseName hasSuffix:@".rtf"] ||
[lowercaseName hasSuffix:@".rtfd.zip"] ||
[lowercaseName hasSuffix:@".key"] ||
[lowercaseName hasSuffix:@".numbers"] ||
[lowercaseName hasSuffix:@".pages"] ||
[lowercaseName hasSuffix:@".png"] ||
[lowercaseName hasSuffix:@".gif"] ||
[lowercaseName hasSuffix:@".png"] ||
[lowercaseName hasSuffix:@".jpg"] ||
[lowercaseName hasSuffix:@".jpeg"] ||
[lowercaseName hasSuffix:@".tiff"]) { // hack by gabor, improved by waseem, based on http://developer.apple.com/iphone/library/qa/qa2008/qa1630.html
self.attached = YES;
}
}
}
return self;
@@ -152,7 +154,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 +166,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 +181,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 +205,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) + 1);
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);
@@ -222,6 +229,9 @@ static void download_progress_callback(size_t current, size_t maximum, void * co
return 0;
}
- (struct mailmime_single_fields *)mimeFields {
return mMimeFields;
}
- (void)dealloc {
mailmime_single_fields_free(mMimeFields);
+3 -4
View File
@@ -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
View File
@@ -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
View File
@@ -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;
+5 -5
View File
@@ -47,7 +47,7 @@
@class CTSMTP;
@interface CTSMTPAsyncConnection : NSObject
@interface CTSMTPAsyncConnection : NSObject
{
CTSMTP* mSMTPObj;
mailsmtp* mSMTP;
@@ -63,11 +63,11 @@
@property (retain) CTCoreMessage* message;
@property (readonly) CTSMTPAsyncStatus status;
- (id)initWithServer:(NSString *)aServer
- (id)initWithServer:(NSString *)aServer
username:(NSString *)aUsername
password:(NSString *)aPassword
port:(unsigned int)aPort
useTLS:(BOOL)aTls
password:(NSString *)aPassword
port:(unsigned int)aPort
connectionType:(CTSMTPConnectionType)connectionType
useAuth:(BOOL)aAuth
delegate:(id<CTSMTPConnectionDelegate>)aDelegate;
+26 -10
View File
@@ -73,7 +73,7 @@ smtpProgress(size_t aCurrent, size_t aTotal) {
username:(NSString *)aUsername
password:(NSString *)aPassword
port:(unsigned int)aPort
useTLS:(BOOL)aTls
connectionType:(CTSMTPConnectionType)connectionType
useAuth:(BOOL)aAuth
delegate:(id <CTSMTPConnectionDelegate>)aDelegate {
@@ -90,7 +90,7 @@ smtpProgress(size_t aCurrent, size_t aTotal) {
aUsername, @"username",
aPassword, @"password",
[NSNumber numberWithInt:aPort], @"port",
[NSNumber numberWithBool:aTls], @"tls",
[NSNumber numberWithInt:connectionType], @"connectionType",
[NSNumber numberWithBool:aAuth], @"auth", nil] retain];
//save clients from themselves (they could be leaking us - no dealloc)
@@ -169,9 +169,19 @@ smtpProgress(size_t aCurrent, size_t aTotal) {
mSMTPObj = [[CTESMTP alloc] initWithResource:mSMTP];
NSDictionary *theSettings = self.serverSettings;
success = [mSMTPObj connectToServer:[theSettings objectForKey:@"server"]
port:[[theSettings objectForKey:@"port"] unsignedIntValue]];
CTSMTPConnectionType connectionType = [[theSettings objectForKey:@"connectionType"] unsignedIntValue];
NSString* server = [theSettings objectForKey:@"server"];
unsigned int port = [[theSettings objectForKey:@"port"] unsignedIntValue];
BOOL auth = [[theSettings objectForKey:@"auth"] boolValue];
NSString* username = [theSettings objectForKey:@"username"];
NSString* password = [theSettings objectForKey:@"password"];
if (connectionType == CTSMTPConnectionTypeStartTLS || connectionType == CTSMTPConnectionTypePlain) {
success = [mSMTPObj connectToServer:server port:port];
} else if (connectionType == CTSMTPConnectionTypeTLS) {
success = [mSMTPObj connectWithTlsToServer:server port:port];
}
if (!success) {
goto error;
}
@@ -184,16 +194,16 @@ smtpProgress(size_t aCurrent, size_t aTotal) {
goto error;
}
}
if ([(NSNumber *) [theSettings objectForKey:@"tls"] boolValue]) {
if (connectionType == CTSMTPConnectionTypeStartTLS) {
success = [mSMTPObj startTLS];
if (!success) {
goto error;
}
}
if ([(NSNumber *) [theSettings objectForKey:@"auth"] boolValue]) {
success = [mSMTPObj authenticateWithUsername:[theSettings objectForKey:@"username"]
password:[theSettings objectForKey:@"password"]
server:[theSettings objectForKey:@"server"]];
if (auth) {
success = [mSMTPObj authenticateWithUsername:username password:password server:server];
if (!success) {
goto error;
}
@@ -213,9 +223,15 @@ smtpProgress(size_t aCurrent, size_t aTotal) {
if (!success) {
goto error;
}
NSSet *tmpBcc = theMessage.bcc;
// Temporarily wipe out BCC so it isn't sent with the message
theMessage.bcc = nil;
//send
success = [mSMTPObj setData:[theMessage render]];
theMessage.bcc = tmpBcc;
if (success) {
mStatus = CTSMTPAsyncSuccess;
} else if (success && [mMailThread isCancelled]) {
+46 -19
View File
@@ -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
+71 -4
View File
@@ -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;
}
@@ -87,12 +92,24 @@
if (!success) {
goto error;
}
NSSet *tmpBcc = message.bcc;
// Temporarily wipe out BCC so it isn't sent with the message
message.bcc = nil;
/* data */
success = [smtpObj setData:[message render]];
message.bcc = tmpBcc;
if (!success) {
goto error;
}
mailsmtp_quit(smtp);
mailsmtp_free(smtp);
[smtpObj release];
return YES;
error:
@@ -101,4 +118,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
+41
View File
@@ -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
+62
View File
@@ -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
-74
View File
@@ -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
View File
@@ -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
+8
View File
@@ -35,6 +35,14 @@
#import "CTCoreMessage.h"
#import "CTSMTPConnection.h"
#import "CTBareAttachment.h"
#import "CTCoreAttachment.h"
#import "CTXlistResult.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
View File
@@ -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) */
+17 -6
View File
@@ -32,17 +32,28 @@
#import <Foundation/Foundation.h>
#import <libetpan/libetpan.h>
/*!
@abstract Enables logging of all streams, data is output to standard out.
#define MailCoreErrorDomain @"mailcore"
/**
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);
NSArray * MailCoreStringArrayFromClist(clist *list);
clist *MailCoreClistFromStringArray(NSArray *strings);
+51 -5
View File
@@ -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 */
@@ -64,10 +63,29 @@ void MailCoreDisableLogging() {
NSError* MailCoreCreateError(int errcode, NSString *description) {
NSMutableDictionary *errorDetail = [NSMutableDictionary dictionary];
[errorDetail setValue:description forKey:NSLocalizedDescriptionKey];
return [NSError errorWithDomain:@"mailcore" code:errcode userInfo:errorDetail];
return [NSError errorWithDomain:MailCoreErrorDomain 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);
@@ -266,3 +284,31 @@ NSString *MailCoreDecodeMIMEPhrase(char *data) {
free(decodedSubject);
return result;
}
NSArray * MailCoreStringArrayFromClist(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 *MailCoreClistFromStringArray(NSArray *strings) {
clist * str_list = clist_new();
for (NSString *str in strings) {
clist_append(str_list, strdup([str UTF8String]));
}
return str_list;
}
+1
View File
@@ -38,4 +38,5 @@
@interface CTConnectedTest : SenTestCase
@property (nonatomic, strong) CTCoreAccount *account;
@property (nonatomic, strong) CTCoreFolder *folder;
@property (nonatomic, strong) NSDictionary *credentials;
@end
+49 -8
View File
@@ -35,15 +35,41 @@
@implementation CTConnectedTest {
}
@synthesize account, folder;
NSString *SERVER = @"imap.gmail.com";
NSString *USERNAME = @"mailcoretests@gmail.com";
NSString *PASSWORD = @"MailCoreRockz";
@synthesize account, folder, credentials;
/* Create a TestData/account.plist file to make these tests work. Start with this:
<?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>username</key>
<string>username</string>
<key>password</key>
<string>password</string>
<key>server</key>
<string>server</string>
<key>port</key>
<integer>993</integer>
<key>path</key>
<string>MailCoreTests</string>
</dict>
</plist>
Because account.plist is included in the .gitignore file, your credentials won't be added
to source control.
*/
- (void)setUp {
NSString *filePath = [[NSBundle bundleForClass:[self class]] pathForResource:@"TestData/account" ofType:@"plist"];
self.credentials = [NSDictionary dictionaryWithContentsOfFile:filePath];
STAssertNotNil(self.credentials, @"These tests will fail anyway if they can't connect");
self.account = [[CTCoreAccount alloc] init];
[self connect];
self.folder = [self.account folderWithPath:@"Test"];
self.folder = [self.account folderWithPath:[self.credentials valueForKey:@"path"]];
[self.folder connect];
}
@@ -60,12 +86,27 @@ NSString *PASSWORD = @"MailCoreRockz";
}
- (void)connect {
[self.account connectToServer:SERVER port:993 connectionType:CTConnectionTypeTLS authType:CTImapAuthTypePlain
login:USERNAME password:PASSWORD];
NSString *server = [self.credentials valueForKey:@"server"];
int port = [[self.credentials objectForKey:@"port"] intValue];
NSString *username = [self.credentials valueForKey:@"username"];
NSString *password = [self.credentials valueForKey:@"password"];
STAssertFalse([server isEqualToString:@"server"], @"You need to provide your own account info");
STAssertFalse([username isEqualToString:@"username"], @"You need to provide your own account info");
STAssertFalse([password isEqualToString:@"password"], @"You need to provide your own account info");
/* Once you've provided your own account info, create a folder with six messages in it.
The path key in the account.plist should point to this directory, and you're ready! */
BOOL success = [self.account connectToServer:server port:port connectionType:CTConnectionTypeTLS authType:CTImapAuthTypePlain login:username password:password];
STAssertTrue(success, @"should successfully connect to email account");
if (!success) {
NSLog(@"!!!!!!! Can't connect to account !!!!!!! Error: %@", [[self.account lastError] localizedDescription]);
}
}
- (void)disconnect {
[self.folder disconnect];
[self.account disconnect];
}
@end
@end
+8 -8
View File
@@ -34,32 +34,32 @@
@implementation CTCoreAttachmentTests
- (void)testJPEG {
NSString *path = [NSString stringWithFormat:@"%@%@",filePrefix,@"TestData/DSC_6201.jpg"];
CTCoreAttachment *attach = [[CTCoreAttachment alloc] initWithContentsOfFile:path];
NSString *filePath = [[NSBundle bundleForClass:[self class]] pathForResource:@"TestData/DSC_6201" ofType:@"jpg"];
CTCoreAttachment *attach = [[CTCoreAttachment alloc] initWithContentsOfFile:filePath];
STAssertEqualObjects(@"image/jpeg", [attach contentType], @"The content-type should have been image/jpeg");
STAssertTrue([attach data] != nil, @"Data should not have been nil");
[attach release];
}
- (void)testPNG {
NSString *path = [NSString stringWithFormat:@"%@%@",filePrefix,@"TestData/DSC_6202.png"];
CTCoreAttachment *attach = [[CTCoreAttachment alloc] initWithContentsOfFile:path];
NSString *filePath = [[NSBundle bundleForClass:[self class]] pathForResource:@"TestData/DSC_6202" ofType:@"png"];
CTCoreAttachment *attach = [[CTCoreAttachment alloc] initWithContentsOfFile:filePath];
STAssertEqualObjects(@"image/png", [attach contentType], @"The content-type should have been image/png");
STAssertTrue([attach data] != nil, @"Data should not have been nil");
[attach release];
}
- (void)testTIFF {
NSString *path = [NSString stringWithFormat:@"%@%@",filePrefix,@"TestData/DSC_6193.tif"];
CTCoreAttachment *attach = [[CTCoreAttachment alloc] initWithContentsOfFile:path];
NSString *filePath = [[NSBundle bundleForClass:[self class]] pathForResource:@"TestData/DSC_6193" ofType:@"tif"];
CTCoreAttachment *attach = [[CTCoreAttachment alloc] initWithContentsOfFile:filePath];
STAssertEqualObjects(@"image/tiff", [attach contentType], @"The content-type should have been image/TIFF");
STAssertTrue([attach data] != nil, @"Data should not have been nil");
[attach release];
}
- (void)testNEF {
NSString *path = [NSString stringWithFormat:@"%@%@",filePrefix,@"TestData/DSC_6204.NEF"];
CTCoreAttachment *attach = [[CTCoreAttachment alloc] initWithContentsOfFile:path];
NSString *filePath = [[NSBundle bundleForClass:[self class]] pathForResource:@"TestData/DSC_6204" ofType:@"NEF"];
CTCoreAttachment *attach = [[CTCoreAttachment alloc] initWithContentsOfFile:filePath];
STAssertEqualObjects(@"application/octet-stream", [attach contentType],
@"The content-type should have been application/octet-stream");
STAssertTrue([attach data] != nil, @"Data should not have been nil");
+11 -11
View File
@@ -43,7 +43,7 @@
STAssertTrue([msg uid] > 0, @"We should have the UID");
STAssertTrue([msg messageSize] > 0, @"We always download message size");
STAssertNil([msg sentDateGMT], @"We have no envelope so should be nil");
STAssertNil([msg senderDate], @"We have no envelope so should be nil");
STAssertNil([msg subject], @"We have no envelope so should be nil");
STAssertNil([msg to], @"We have no envelope so should be nil");
STAssertNil([msg cc], @"We have no envelope so should be nil");
@@ -52,7 +52,7 @@
STAssertNil([msg bcc], @"We have no envelope so should be nil");
// This will force another download of message body data, checking to make sure it works
NSString *body = [msg bodyPreferringPlainText];
NSString *body = [msg body];
STAssertTrue(body.length > 0, @"");
}
@@ -63,14 +63,14 @@
STAssertTrue([msg uid] > 0, @"We should have the UID");
STAssertTrue([msg messageSize] > 0, @"We always download message size");
STAssertNotNil([msg sentDateGMT], @"We DO HAVE AN envelope so shouldn't be nil");
STAssertNotNil([msg senderDate], @"We DO HAVE AN envelope so shouldn't be nil");
STAssertNotNil([msg subject], @"We DO HAVE AN envelope so shouldn't be nil");
STAssertNotNil([msg to], @"We DO HAVE AN envelope so shouldn't be nil");
STAssertNotNil([msg sender], @"We DO HAVE AN envelope so shouldn't be nil");
STAssertNotNil([msg from], @"We DO HAVE AN envelope so shouldn't be nil");
// This will force another download of message body data, checking to make sure it works
NSString *body = [msg bodyPreferringPlainText];
NSString *body = [msg body];
STAssertTrue(body.length > 0, @"");
}
@@ -81,14 +81,14 @@
STAssertTrue([msg uid] > 0, @"We should have the UID");
STAssertTrue([msg messageSize] > 0, @"We always download message size");
STAssertNotNil([msg sentDateGMT], @"We DO HAVE AN envelope so shouldn't be nil");
STAssertNotNil([msg senderDate], @"We DO HAVE AN envelope so shouldn't be nil");
STAssertNotNil([msg subject], @"We DO HAVE AN envelope so shouldn't be nil");
STAssertNotNil([msg to], @"We DO HAVE AN envelope so shouldn't be nil");
STAssertNotNil([msg sender], @"We DO HAVE AN envelope so shouldn't be nil");
STAssertNotNil([msg from], @"We DO HAVE AN envelope so shouldn't be nil");
// This will force another download of message body data, checking to make sure it works
NSString *body = [msg bodyPreferringPlainText];
NSString *body = [msg body];
STAssertTrue(body.length > 0, @"");
}
@@ -99,7 +99,7 @@
STAssertTrue([msg uid] > 0, @"We should have the UID");
STAssertTrue([msg messageSize] > 0, @"We always download message size");
STAssertNil([msg sentDateGMT], @"We have no envelope so should be nil");
STAssertNil([msg senderDate], @"We have no envelope so should be nil");
STAssertNil([msg subject], @"We have no envelope so should be nil");
STAssertNil([msg to], @"We have no envelope so should be nil");
STAssertNil([msg cc], @"We have no envelope so should be nil");
@@ -108,7 +108,7 @@
STAssertNil([msg bcc], @"We have no envelope so should be nil");
// A second call to fetch the body structure shouldn't be needed, we only need to fetch body
NSString *body = [msg bodyPreferringPlainText];
NSString *body = [msg body];
STAssertTrue(body.length > 0, @"");
}
@@ -119,14 +119,14 @@
STAssertTrue([msg uid] > 0, @"We should have the UID");
STAssertTrue([msg messageSize] > 0, @"We always download message size");
STAssertNotNil([msg sentDateGMT], @"We DO HAVE AN envelope so shouldn't be nil");
STAssertNotNil([msg senderDate], @"We DO HAVE AN envelope so shouldn't be nil");
STAssertNotNil([msg subject], @"We DO HAVE AN envelope so shouldn't be nil");
STAssertNotNil([msg to], @"We DO HAVE AN envelope so shouldn't be nil");
STAssertNotNil([msg sender], @"We DO HAVE AN envelope so shouldn't be nil");
STAssertNotNil([msg from], @"We DO HAVE AN envelope so shouldn't be nil");
// A second call to fetch the body structure shouldn't be needed, we only need to fetch body
NSString *body = [msg bodyPreferringPlainText];
NSString *body = [msg body];
STAssertTrue(body.length > 0, @"");
}
@end
@end
+39 -16
View File
@@ -38,7 +38,8 @@
@implementation CTCoreMessageTests
- (void)setUp {
myMsg = [[CTCoreMessage alloc] init];
myRealMsg = [[CTCoreMessage alloc] initWithFileAtPath:[NSString stringWithFormat:@"%@%@",filePrefix,@"TestData/kiwi-dev/1167196014.6158_0.theronge.com:2,Sab"]];
NSString *filePath = [[NSBundle bundleForClass:[self class]] pathForResource:@"TestData/kiwi-dev/1167196014.6158_0.theronge.com:2,Sab" ofType:@""];
myRealMsg = [[CTCoreMessage alloc] initWithFileAtPath:filePath];
}
- (void)tearDown {
@@ -46,6 +47,16 @@
[myRealMsg release];
}
- (void)testBody {
STAssertTrue([[myRealMsg body] rangeOfString:@"Kiwi-dev mailing list"].location != NSNotFound, @"Expect to pull out the right text");
NSLog(@"Body is %@", [myRealMsg body]);
}
- (void)testHtmlBody {
STAssertTrue([[myRealMsg htmlBody] rangeOfString:@"CTCoreMessage no longer depends"].location != NSNotFound, @"Expect to pull out the right text");
NSLog(@"Html body is %@", [myRealMsg htmlBody]);
}
- (void)testBasicSubject {
[myMsg setSubject:@"Test value1!"];
STAssertEqualObjects(@"Test value1!", [myMsg subject], @"Basic set and get of subject failed.");
@@ -78,7 +89,8 @@
}
- (void)testSubjectOnData {
CTCoreMessage *msg = [[CTCoreMessage alloc] initWithFileAtPath:[NSString stringWithFormat:@"%@%@",filePrefix,@"TestData/kiwi-dev/1167196014.6158_0.theronge.com:2,Sab"]];
NSString *filePath = [[NSBundle bundleForClass:[self class]] pathForResource:@"TestData/kiwi-dev/1167196014.6158_0.theronge.com:2,Sab" ofType:@""];
CTCoreMessage *msg = [[CTCoreMessage alloc] initWithFileAtPath:filePath];
[msg fetchBodyStructure];
STAssertEqualObjects(@"[Kiwi-dev] Revision 16", [msg subject], @"");
NSRange notFound = NSMakeRange(NSNotFound, 0);
@@ -93,11 +105,11 @@
/* Do a few sanity checks on the str */
NSRange notFound = NSMakeRange(NSNotFound, 0);
STAssertTrue(!NSEqualRanges([str rangeOfString:@"Date:"],notFound), @"Render sanity check failed!");
STAssertTrue(!NSEqualRanges([str rangeOfString:@"Message-ID:"],notFound), @"Render sanity check failed!");
STAssertTrue(!NSEqualRanges([str rangeOfString:@"MIME-Version: 1.0"],notFound), @"Render sanity check failed!");
STAssertTrue(!NSEqualRanges([str rangeOfString:@"Message-ID:"],notFound), @"Render sanity check failed!");
STAssertTrue(!NSEqualRanges([str rangeOfString:@"MIME-Version: 1.0"],notFound), @"Render sanity check failed!");
STAssertTrue(!NSEqualRanges([str rangeOfString:@"test"],notFound), @"Render sanity check failed!");
STAssertTrue(!NSEqualRanges([str rangeOfString:@"Content-Transfer-Encoding:"],notFound), @"Render sanity check failed!");
STAssertTrue(NSEqualRanges([str rangeOfString:@"not there"],notFound), @"Render sanity check failed!");
STAssertTrue(!NSEqualRanges([str rangeOfString:@"Content-Transfer-Encoding:"],notFound), @"Render sanity check failed!");
STAssertTrue(NSEqualRanges([str rangeOfString:@"not there"],notFound), @"Render sanity check failed!");
}
- (void)testRenderWithToField {
@@ -108,7 +120,7 @@
/* Do a few sanity checks on the str */
NSRange notFound = NSMakeRange(NSNotFound, 0);
STAssertTrue(!NSEqualRanges([str rangeOfString:@"message"],notFound), @"Render sanity check failed!");
STAssertTrue(!NSEqualRanges([str rangeOfString:@"To: Matt <test@test.com>"],notFound), @"Render sanity check failed!");
STAssertTrue(!NSEqualRanges([str rangeOfString:@"To: Matt <test@test.com>"],notFound), @"Render sanity check failed!");
}
- (void)testTo {
@@ -126,7 +138,8 @@
}
- (void)testFromSpecialChar {
CTCoreMessage *msg = [[CTCoreMessage alloc] initWithFileAtPath:[NSString stringWithFormat:@"%@%@",filePrefix,@"TestData/kiwi-dev/1162094633.15211_0.randymail-mx2:2,RSab"]];
NSString *filePath = [[NSBundle bundleForClass:[self class]] pathForResource:@"TestData/kiwi-dev/1162094633.15211_0.randymail-mx2:2,RSab" ofType:@""];
CTCoreMessage *msg = [[CTCoreMessage alloc] initWithFileAtPath:filePath];
CTCoreAddress *addr = [[msg from] anyObject];
STAssertEqualObjects(@"Joachim Mårtensson", [addr name], @"");
[msg release];
@@ -152,10 +165,19 @@
}
- (void)testSentDate {
// Is this right?? I'm super confused by this time zone stuff
NSDate *sentDate = [myRealMsg sentDateGMT];
NSDate *actualDate = [NSDate dateWithTimeIntervalSince1970:1167217609];
STAssertEqualObjects(sentDate, actualDate, @"Date's should be equal!");
NSTimeInterval sentSince1970 = [[myRealMsg senderDate] timeIntervalSince1970];
NSTimeInterval actualSince1970 = 1167196009;
/*
you can get this value by typing this into your browser console
> date = new Date('Tue, 26 Dec 2006 21:06:49 -0800 (PST)')
Tue Dec 26 2006 21:06:49 GMT-0800 (PST)
> date.getTime() / 1000
1167196009
*/
STAssertEquals(sentSince1970, actualSince1970, @"Dates should be equal!");
}
- (void)testSettingFromTwice {
@@ -166,16 +188,17 @@
}
- (void)testAttachments {
CTCoreMessage *msg = [[CTCoreMessage alloc] initWithFileAtPath:
[NSString stringWithFormat:@"%@%@",filePrefix,@"TestData/mime-tests/png_attachment"]];
NSString *filePath = [[NSBundle bundleForClass:[self class]] pathForResource:@"TestData/mime-tests/png_attachment" ofType:@""];
CTCoreMessage *msg = [[CTCoreMessage alloc] initWithFileAtPath:filePath];
[msg fetchBodyStructure];
NSArray *attachments = [msg attachments];
STAssertTrue([attachments count] == 1, @"Count should have been 1");
STAssertEqualObjects([[attachments objectAtIndex:0] filename], @"Picture 1.png", @"Incorrect filename");
CTBareAttachment *bareAttach = [attachments objectAtIndex:0];
CTCoreAttachment *attach = [bareAttach fetchFullAttachment];
NSData *origData = [NSData dataWithContentsOfFile:
[NSString stringWithFormat:@"%@%@",filePrefix,@"TestData/Picture 1.png"]];
filePath = [[NSBundle bundleForClass:[self class]] pathForResource:@"TestData/Picture 1" ofType:@"png"];
NSData *origData = [NSData dataWithContentsOfFile:filePath];
STAssertEqualObjects(origData, attach.data, @"Original data and attach data should be the same");
[msg release];
}
-2
View File
@@ -31,8 +31,6 @@
#import <SenTestingKit/SenTestingKit.h>
const NSString *filePrefix;
@interface CTMIMETests : SenTestCase {
}
+21 -12
View File
@@ -41,11 +41,10 @@
#import "CTMIME_TextPart.h"
#import "CTMIME_Enumerator.h"
const NSString *filePrefix = @"/Users/mronge/Projects/MailCore/";
@implementation CTMIMETests
- (void)testMIMETextPart {
CTCoreMessage *msg = [[CTCoreMessage alloc] initWithFileAtPath:[NSString stringWithFormat:@"%@%@",filePrefix,@"TestData/kiwi-dev/1167196014.6158_0.theronge.com:2,Sab"]];
NSString *filePath = [[NSBundle bundleForClass:[self class]] pathForResource:@"TestData/kiwi-dev/1167196014.6158_0.theronge.com:2,Sab" ofType:@""];
CTCoreMessage *msg = [[CTCoreMessage alloc] initWithFileAtPath:filePath];
CTMIME *mime = [CTMIMEFactory createMIMEWithMIMEStruct:[msg messageStruct]->msg_mime forMessage:[msg messageStruct]];
STAssertTrue([mime isKindOfClass:[CTMIME_MessagePart class]],@"Outmost MIME type should be Message but it's not!");
STAssertTrue([[mime content] isKindOfClass:[CTMIME_MultiPart class]],@"Incorrect MIME structure found!");
@@ -79,13 +78,19 @@ const NSString *filePrefix = @"/Users/mronge/Projects/MailCore/";
- (void)testBruteForce {
// run it on a bunch of the files in the test data directory and see if we can get it to crash
NSDirectoryEnumerator *dirEnumerator = [[NSFileManager defaultManager] enumeratorAtPath:[filePrefix stringByAppendingString:@"TestData/kiwi-dev/"]];
NSString *file;
NSString *directory = [[NSBundle bundleForClass:[self class]] resourcePath];
NSString *filesDirectory = [directory stringByAppendingPathComponent:@"TestData/kiwi-dev/"];
NSError *error;
NSArray *directoryContents = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:filesDirectory error:&error];
NSRange notFound = NSMakeRange(NSNotFound, 0);
while ((file = [dirEnumerator nextObject])) {
for (NSString *file in directoryContents) {
if (!NSEqualRanges([file rangeOfString:@".svn"],notFound))
continue;
CTCoreMessage *msg = [[CTCoreMessage alloc] initWithFileAtPath:[NSString stringWithFormat:@"%@TestData/kiwi-dev/%@",filePrefix,file]];
NSString *filePath = [[NSBundle bundleForClass:[self class]] pathForResource:[NSString stringWithFormat:@"TestData/kiwi-dev/%@",file] ofType:@""];
CTCoreMessage *msg = [[CTCoreMessage alloc] initWithFileAtPath:filePath];
NSLog(@"%@", [msg subject]);
[msg fetchBodyStructure];
NSString *stuff = [msg body];
@@ -95,7 +100,9 @@ const NSString *filePrefix = @"/Users/mronge/Projects/MailCore/";
}
- (void)testImageJPEGAttachment {
CTCoreMessage *msg = [[CTCoreMessage alloc] initWithFileAtPath:[NSString stringWithFormat:@"%@%@",filePrefix,@"TestData/mime-tests/imagetest"]];
NSString *filePath = [[NSBundle bundleForClass:[self class]] pathForResource:@"TestData/mime-tests/imagetest" ofType:@""];
CTCoreMessage *msg = [[CTCoreMessage alloc] initWithFileAtPath:filePath];
CTMIME *mime = [CTMIMEFactory createMIMEWithMIMEStruct:[msg messageStruct]->msg_mime forMessage:[msg messageStruct]];
STAssertTrue([mime isKindOfClass:[CTMIME_MessagePart class]],@"Outmost MIME type should be Message but it's not!");
STAssertTrue([[mime content] isKindOfClass:[CTMIME_MultiPart class]],@"Incorrect MIME structure found!");
@@ -111,8 +118,9 @@ const NSString *filePrefix = @"/Users/mronge/Projects/MailCore/";
}
- (void)testImagePNGAttachment {
CTCoreMessage *msg = [[CTCoreMessage alloc] initWithFileAtPath:
[NSString stringWithFormat:@"%@%@",filePrefix,@"TestData/mime-tests/png_attachment"]];
NSString *filePath = [[NSBundle bundleForClass:[self class]] pathForResource:@"TestData/mime-tests/png_attachment" ofType:@""];
CTCoreMessage *msg = [[CTCoreMessage alloc] initWithFileAtPath:filePath];
CTMIME *mime = [CTMIMEFactory createMIMEWithMIMEStruct:
[msg messageStruct]->msg_mime forMessage:[msg messageStruct]];
STAssertTrue([mime isKindOfClass:[CTMIME_MessagePart class]],
@@ -133,8 +141,9 @@ const NSString *filePrefix = @"/Users/mronge/Projects/MailCore/";
}
- (void)testEnumerator {
CTCoreMessage *msg = [[CTCoreMessage alloc] initWithFileAtPath:
[NSString stringWithFormat:@"%@%@",filePrefix,@"TestData/mime-tests/png_attachment"]];
NSString *filePath = [[NSBundle bundleForClass:[self class]] pathForResource:@"TestData/mime-tests/png_attachment" ofType:@""];
CTCoreMessage *msg = [[CTCoreMessage alloc] initWithFileAtPath:filePath];
CTMIME *mime = [CTMIMEFactory createMIMEWithMIMEStruct:
[msg messageStruct]->msg_mime forMessage:[msg messageStruct]];
CTMIME_Enumerator *enumerator = [mime mimeEnumerator];
+1
View File
@@ -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