pantomime1.2-1.2.2+dfsg1/000077500000000000000000000000001276751561200147425ustar00rootroot00000000000000pantomime1.2-1.2.2+dfsg1/ChangeLog000066400000000000000000000170321276751561200165170ustar00rootroot000000000000002014-07-25 Riccardo Mottola * Framework/Pantomime/NSString+Extensions.m Fix warning on FreeBSD too 2014-06-15 Riccardo Mottola * Framework/Pantomime/io.c Fix cast to signed ssize_t or error cannot be checked. * Framework/Pantomime/CWIMAPStore.m * Framework/Pantomime/CWLocalFolder+mbox.m * Framework/Pantomime/CWMIMEUtility.m Cast safely and properly chars to int. 2014-06-12 Riccardo Mottola * Framework/Pantomime/CWPOP3Folder.m Rewrite not to misues NSDate as NSCalendarDate, but to use only NSDate only. 2014-06-12 Riccardo Mottola * Framework/Pantomime/io.c Better check for fread() results and print some info. * Framework/Pantomime/CWIMAPCacheManager.m Fix recently introduced stuid bug of double ftruncate() * Framework/Pantomime/CWLocalFolder+mbox.m Add minor debug logs. 2014-06-12 Riccardo Mottola * Framework/Pantomime/NSString+Extensions.m Fix iconv cast. * Framework/Pantomime/CWLocalFolder+mbox.m Check for file function return values. 2014-06-11 Riccardo Mottola * Framework/Pantomime/NSString+Extensions.m in case of realloc() failure, return 2014-06-09 Riccardo Mottola * Framework/Pantomime/GNUmakefile Use LIBRARIES_DEPEND_UPON instead of ADDITIONAL_LDFLAGS. Extended version of Yavor Doganov's patch. 2014-06-09 Riccardo Mottola * Framework/Pantomime/CWIMAPCacheManager.m * Framework/Pantomime/CWLocalCacheManager.m Check for write() writing the requested number of bytes. 2014-06-09 Riccardo Mottola * Framework/Pantomime/CWIMAPCacheManager.m * Framework/Pantomime/CWLocalCacheManager.m * Framework/Pantomime/CWPOP3CacheManager.m check for ftruncate() return values. Extended rewrite of Yavor Doganov's patch. 2014-01-12: Sebastian Reitenbach * Framework/Pantomime/io.c * remove a commented out line and comment out printf debug string 2014-01-10 Riccardo Mottola * Framework/Pantomime/NSData+Extensions.m Inizialize char and throw an Exception if non-hex data is supplied. 2014-01-05 German Arias * Framework/Pantomime/NSData+Extensions.m (-unwrapWithLimit:): Revert last change. 2014-01-04 German Arias * Framework/Pantomime/CWParser.m (+_parameterValueUsingLine:range: decode:charset:): Ensure the length isn't a negative value. 2014-01-02 German Arias * Framework/Pantomime/NSData+Extensions.m (-unwrapWithLimit:): Use -setLength:, not -replaceBytesInRange:withBytes:length: which don't allows read the message. 2013-12-30 Riccardo Mottola * Framework/Pantomime/NSData+Extensions.m Revert patch that broke extended char decoding. 2013-11-01 Sebastian Reitenbach * Framework/Pantomime/NSData+Extensions.m * fix memory leak 2013-11-01 Sebastian Reitenbach * Framework/Pantomime/CWIMAPCacheManager.m * fix mem leak introduced with one of the last commits * Framework/Pantomime/CWSendmail.m * Framework/Pantomime/CWSMTP.m * introduce a _fail method to CWSMTP private category, and make the code similar to CWSendmail for better comparison, and fix potential initialization of dictionary with nil object * fix mem leak introduced in last commit to both files * Framework/Pantomime/CWIMAPStore.m * prevent initializing dictionary with nil object 2013-10-31 Sebastian Reitenbach * Framework/Pantomime/CWIMAPCacheManager.m * do not malloc( 0 or negative amount of memory) * do not memcpy( 0 or negative amount of bytes) * do not read( 0 or negative amount of bytes) * little reformatting * fixes a lot of crashers in GNUMail for me * Framework/Pantomime/CWIMAPFolder.m * initialize super correctly in init methods * Framework/Pantomime/CWLocalStore.m * remove unnecessary assignment * Framework/Pantomime/CWPOP3CacheManager.m * initialize super correctly in init methods * Framework/Pantomime/CWSendmail.m * do not autorelease too often, and line break fixes * Framework/Pantomime/CWPart.m * restructure init method a bit * Framework/Pantomime/CWIMAPStore.m * fix a couple of memory leaks * do not try to access uninitialized pointers * some line breaks 2013-10-24 German Arias * Framework/Pantomime/CWParser.m (_parameterValueUsingLine:...): Fix error when parse RFC2231 and don't assume that always are a language specified. 2013-10-21: Sebastian Reitenbach * Framework/Pantomime/CWDNSManager.m * Framework/Pantomime/CWIMAPStore.m * Framework/Pantomime/CWLocalFolder+mbox.m * Framework/Pantomime/CWLocalStore.m * Framework/Pantomime/CWMIMEUtility.m * Framework/Pantomime/CWMessage.m * Framework/Pantomime/CWParser.m * Framework/Pantomime/CWPart.m * Framework/Pantomime/NSData+Extensions.m * Framework/Pantomime/NSString+Extensions.m fix some problems reported by clang static analyzer 2013-10-20: Sebastian Reitenbach * Framework/Pantomime/CWIMAPFolder.m * Framework/Pantomime/CWLocalFolder.m * Framework/Pantomime/CWLocalStore.m * Framework/Pantomime/NSString+Extensions.m fix format strings and other few warnings emitted by clang * GNUmakefile add version variables to allow make dist to create a sane tarball * Framework/Pantomime/CWIMAPCacheManager.h * Framework/Pantomime/CWLocalCacheManager.h add - (void) initInRange: (NSRange) theRange; to the header, GNUMail is using it and otherwise whining about it * Framework/Pantomime/CWLocalCacheManager.m * Framework/Pantomime/CWIMAPCacheManager.m * Framework/Pantomime/CWLocalFolder.m get rid of some useless assignments spotty by clang static analyzer 2013-05-26: Sebastian Reitenbach * Framework/Pantomime/CWService.m fix tautological compare, and fix comment * Framework/Pantomime/CWMD5.m use memset correctly 2013-04-27 Riccardo Mottola * Framework/Pantomime/CWDNSManager.h Fix count to NSUInteger. * Framework/Pantomime/CWFolder.[h,m] Fix count to NSUInteger. 2013-03-04: Sebastian Reitenbach * Framework/Pantomime/NSString+Extensions.m make comparison work on 64 bit * Framework/Pantomime/CWCacheManager.h * Framework/Pantomime/CWDNSManager.h * Framework/Pantomime/CWFolder.h * Framework/Pantomime/CWIMAPCacheManager.[h|m] * Framework/Pantomime/CWIMAPMessage.h * Framework/Pantomime/CWMIMEMultipart.[h|m] some int -> NS(U)Integer transitions * Framework/Pantomime/CWIMAPMessage.h * Framework/Pantomime/CWIMAPMessage.m * Framework/Pantomime/CWLocalCacheManager.m some transitions missed 2013-02-24: Sebastian Reitenbach * Framework/Pantomime/CWIMAPCacheManager.m * Framework/Pantomime/CWLocalCacheManager.m * Framework/Pantomime/CWMessage.m * Framework/Pantomime/CWPOP3Folder.m * Framework/Pantomime/CWPart.m * Framework/Pantomime/CWService.m * Fix warnings found with clang 2012-08-15: Sebastian Reitenbach * Framework/Pantomime/io.c include missing header 2012-05-21 Riccardo Mottola * Framework/Pantomime/CWDNSManager.m Fix warning. 2012-04-13 Riccardo Mottola * Framework/Pantomime/CWDNSManager.m Use res_ninit() on NetBSD to fix long-standing incompatibility 2011-06-04 German Arias * Framework/Pantomime/NSString+Extensions.m: Removed GNUstepBase/ GSCategories.h and added GNUstepBase/Additions.h. 2011-06-01 German Arias * GNA: Initial repository at gna.org. pantomime1.2-1.2.2+dfsg1/ChangeLog.1000066400000000000000000005336201276751561200166640ustar00rootroot000000000000002007-04-22 Ludovic Marcotte * Modified CWMessage: -setReplyTo: / -replyTo to deal with an address list instead of a single address value. * Added a TLS example in SimpleSMTP and also documented some GMail behaviors. 2007-04-08 Ludovic Marcotte * We now respect the "content" parameter when creating a maildir-type mailbox. 2007-04-07 Ludovic Marcotte * Removed the pre2 compatibility for cache files and cleaned up the code. * Patches from Annard Brouwer that fixes: - compiler warnings wrt PERFORM_SELECTOR_1 - compiler warnings in CWIMAPCacheManager, in CWLocalCacheManager, in CWPOP3CacheManager, in CWPOP3Store and in CWParser. - CWLocalFolder+mbox: -unfoldLinesStartingWith: fileStream: when getting 8-bit input. - Now uses the enhanced capabilities of CoreFoundation for string decoding. - Parsing issues for addresses like "Joe" User * Added -setEnforceModes:/-isEnforcingMode in CWLocalStore to enforce or not secure file permissions for mailboxes. By default, secure permissions are enforced. Also removed the code to enforce permissions when opending the local store. * We no longer automatically assign a CWLocalCacheManager instance to the CWLocalFolder instance. It's up to the callee now to set one before calling -parse:. * Fixed addresses parsing in CWParser: +parseDestination: ... for addresses like "Bar, Foo" . * Fixed CWParser: +parseReferences: ... so that the Reference header is correctly parsed when loaded from cache files. Also fixed CWParser: +parseInReplyTo: ... to not include leading junk after the 1*msg-id. 2007-03-27 Ludovic Marcotte * Cleanups and updates to the documentation. 2007-03-25 Ludovic Marcotte * We also now return the unmodified data when posting the notification (or calling the delegate method) upon IMAP message append operations. * We close the fd after -connectionLost: has been called for cleanups purposes. 2007-03-23 Ludovic Marcotte * We now correctly handle entries set in /etc/hosts 2007-03-21 Ludovic Marcotte * Small adjustment in previous commit. We now use the supplied data instead of the newly constructed one when posting the notificatoin / calling the delegate in CWLocalFolder: -appendMessageFromRawSource: flags: 2007-03-17 Ludovic Marcotte * Cleaned up CWLocalFolder and finalized the error handling support in -appendMessageFromRawSource: flags: * Documentation fixes. * Additional cleanups. 2007-03-16 Ludovic Marcotte * We now correctly free up the memory used by our CFRunLoopSource objects. 2007-03-12 Ludovic Marcotte * Small optimization in unique_id(). 2007-03-11 Ludovic Marcotte * Added -lresolv in Xcode additional linking flags for the Pantomime target. * We now avoid using NSString: -cStringUsingEncoding: to preserve Mac OS X 10.3 compatibility. 2007-03-09 Ludovic Marcotte * Simplified CWDNSManager: -_parseResolvFile. Patch from Chris Vetter. 2007-03-04 Ludovic Marcotte * Fixed endian issues in CWDNSManager and ported the code to Mac OS X. 2007-03-01 Ludovic Marcotte * We make sure we have at least one nameserver defined before trying to send our DNS request. 2007-02-26 Ludovic Marcotte * Renamed timezone to _timezone in CWParser to avoid compilation errors on OpenBSD. * Implemented read/write timeouts support in CWService. * Removed NSData+Extensions: -dataWithCString: as it wasn't used anywhere. * Implemented and documented a new asynchronous UDP-based DNS resolver in CWDNSManager. 2007-02-05 Ludovic Marcotte * Small cleanups. * Tagged the source tree with revision c04a7f3e69aa5aa286dd3443c98c11ef42467c85 and tag name v1.2.0pre3. 2007-02-03 Ludovic Marcotte * We now re-thread correctly our threaded local mailbox after an expunge. 2007-02-01 Ludovic Marcotte * Added a patch from Christian Niles to improve parsing of malformated internet addresses. 2007-01-31 Ludovic Marcotte * Added a patch from Christian Niles that adds support of internal date while appending messages to an IMAP mailbox. 2007-01-29 Ludovic Marcotte * We now correctly return an error in case of a SSL handshake error. 2007-01-28 Ludovic Marcotte * We no longer abort if we can't create the local cache file. This can happen when reading from a mail spool file. * Added delegate / notification in CWIMAPStore (testing for now) in order to know when a command was sent and when it has completed. * Modified CWLocalFolder: -parse: so that we consider messages in /new and /tmp when opening a maildir-based mailbox using a cache. * Fixes to the Pantomime Xcode project files. * Modified the short/integer reading routines (from memory) to correct endianness. 2007-01-23 Ludovic Marcotte * We now correctly expunge the IMAP cache when we either receive an untagged EXPUNGE response or when we sync our cache with our IMAP folder when opening the mailbox. * Performed some cleanups. 2007-01-21 Ludovic Marcotte * Removed Documentation/LICENSE.ELM * Added the PantomimeContentDisposition enum and refactored the CWPart class to use it. * We now post notifications on success / error when opening a local mailbox. 2007-01-20 Ludovic Marcotte * Modified CWIMAPStore to not break when parsing only the initial set of headers. * Removed all the ELM code and rewrote the parts that were using it. Removed the following files: atonum.c date_util.c getword.c len_next.c parsarpdat.c parsarpmbox.c rfc822tlen.c strfcpy.c strincmp.c striparens.c elm_defs.h elm_lib.h and parseaddrs.h * Don't cache the array of IP addresses from a DNS name if it's empty. * Don't send the FETCH BODY.PEEK[HEADER.FIELDS.NOT ... IMAP command if we already sent it once. This prevents from adding headers continously to a message if it gets expired. * We now correctly inform our delegate and we post a notification if we can't expunge an IMAP mailbox. * Improved the randomness of the maildir filenames. * We now correctly empty the IMAP queue after handling a BAD response. * Removed the CWCacheManager (and subclasses) +cacheWithPath: method. * Dropped Framework/Pantomime/English.lproj and its content. * Implemented a brand new mailbox caching code for POP3, IMAP and local (mbox/maildir) type of mailboxes. Previously POP3 cache files are converted correctly, while IMAP and local ones are ignored. 2006-10-13 Ludovic Marcotte * Modified CWContainer: -setParent to avoid a loop. 2006-10-12 Ludovic Marcotte * We now call NSAssert2() if the stream isn't closed properly if if the file descriptor hasn't been closed in CWLocalFolder: -dealloc. Patch from Aaron Burghardt . * Prevent a potential crash in NSData+Extensions -decodeBase64: for incorrectly formatted base64 content. * Rewrote CWPart: -dataValue so it's much simpler and faster. That is now part of the new Pantomime message encoder. * Cleaned up the CWMessage/CWPart interfaces and removed ivars. 2006-10-06 Ludovic Marcotte * Documentation fixes. Many thanks goes to Christian Niles. * We can now forward messages as inline or as an attachment. * Implemented a consumer of RFC2231 output. * Added a boolean parameter to CWLocalFolder: -parse so we can now partially parse local mailboxes or fully parse them (at the headers level). * Modified NSData+Extensions: -dataByTrimmingWhiteSpaces to also trim tab characters. * Modified CWIMAPStore to break when we parsed the appropriate message part. * New Pantomime message decoding engine. Much more simpler than before, faster and more robust. Everything is now dedoced to a NSData, CWMessage or CWMIMEMultipart instance. * Patches from Annard Brouwer that fixes: - Fixed a bug where an instance from the wrong class was allocated in CWMIMEUtility. - Now use -UTF8String instead of -cString for all UNIX filenames. - Corrected CWContainer: -count to return the real children count. - Add comparison support to CWInternetAddress. - "unknown" charset support (buggy Outlook output) - added support for localized response and reference prefixes that are used in NSString+Extensions: -hasREPrefix. 2006-09-28 Ludovic Marcotte * Tagged the source tree with revision 81da7b5c5004326fc2476cb3f7c7637eff152aff and tag name v1.2.0pre2. * Fixed a memory leak in CWMessage. 2006-09-25 Ludovic Marcotte * RELEASE v1.2.0pre2. 2006-09-24 Ludovic Marcotte * Updated the documentation. 2006-09-19 Ludovic Marcotte * Updated the documentation. * Modified CWPOP3Message: -setFlags: to call [super setFlags: ...] and make sure that we have tasks in the queue before trying to empty it in CWPOP3Store. Suggestions from Matt Bendiksen. 2006-09-16 Ludovic Marcotte * We now properly call delegate (and post notifications) if the TLS code failed in CWSMTP. * Modified CWMessage: -dataValue so that we also include the User-Agent header in our list of additional headers that are being sent. * Cleaned up the POP3 code. Replaced CWPOP3Folder: -deleteMessageAtIndex: with CWPOP3Message: -setFlags: and CWPOP3Folder: -prefetchMessageAtIndex: with CWPOP3Message: -rawSource and -setInitialized: Also updated SimplePOP3 to reflect those changes. 2006-09-08 Ludovic Marcotte * Improved the documentation with regard to the SMTP RSET call. * Improved examples * We now initialize the message with its content after a RETR over POP3 instead of just setting the raw source of the message. * We now correctly destroy the connection timer when we cancel the actual request when we are connecting to a service. 2006-09-05 Ludovic Marcotte * Commented out unused define in elm_defs.h to avoid compilation error with OpenSSL. Bug reported by Marcelo Bezerra . 2006-09-04 Ludovic Marcotte * Fixed CWPOP3Folder: _deleteOldMessages. It was incorrectly using a 0-based index. * Modified CWMIMEUtility: unique_id() so we make sure we don't go out of bounds in the hexDigit array. Also improved the randomness of the ID. Patches from Matt Bendiksen . * Modified CWSMTP to correctly destroy recipients, message and message data when we are setting again those values. * Applied patches from Matt Bendiksen so that we correctly determine the byte border in CWMD5 and we now build Pantomime as the Universal Binary framework. 2006-09-02 Ludovic Marcotte * We now handle correctly EXPUNGE responses over IMAP when we haven't yet had the time to FETCH expunged messages. 2006-06-11 Ludovic Marcotte * Applied a patch from Lorenz Mösenlechner to set the maximum number of bytes to write when using SSL to 1024 in order to prevent a strange bug in SSL_write() under Mac OS X. 2006-06-06 Ludovic Marcotte * Cleaned a bit the IMAP code. 2006-05-28 Ludovic Marcotte * Improved the message reply code to consider all text parts. 2006-05-15 Ludovic Marcotte * Cleaned all the notification / perform selector code. * Removed the old Xcode project file and added the new one. 2006-05-10 Ludovic Marcotte * Modified CWMessage: -headerValueForName to perform the search in a case-insensitive way. 2006-05-07 Ludovic Marcotte * We now handle correctly "fast IMAP folder switching". * We now handly correctly messages with the broken iso8859_1 charset specification. * Fixed any potential memleaks in NSString+Extensions: +stringWithData: charset: and if we can't use iconv_open(), we fall back to US-ASCII. * Moved CWIMAPStore -capabilities to CWService and implemented it in CWPOP3Store and CWSMTP. * Documented CWFolder. * Modified CWService: -updateRead to replace the malloc/free call with a static buffer. 2006-04-30 Ludovic Marcotte * Fixes some issues on MingW with local mailboxes. 2006-04-29 Ludovic Marcotte * More cleanups. * Fixed a bug in CWIMAPMessage: -setInitialized where we really set the message as an initialized one when it's finished loading. Also modified CWIMAPStore to handle this. 2006-04-25 Ludovic Marcotte * Fixed a potential crashing bug in CWLocalStore: -folderForName: (if we are passing nil values). 2006-04-24 Ludovic Marcotte * Some cleanups. * We now use recv()/send() instead of read()/write() in CWTCPConnection (on sockets) so that the same code can be used on both UNIX and win32. * Fixed a bug CWLocalFolder+mbox: -numberOfMessagesFromData. * Fully ported Pantomime to MingW. This is an initial port that seems to work rather well so far. It likely contains some bugs and it needs a lot of testing and love, of course. 2006-04-09 Ludovic Marcotte * Corrected the notification names posted in the CWSMTP and CWSendmail classes. We were using PantomimeTransportMessageSent and PantomimeTransportMessageNotSent instead of PantomimeMessageSent and PantomimeMessageNotSent. * Modified CWFolder: -expunge - removed the parameter to return deleted messages. This logic should be done in the callee. * Defined all notification names as constants. Improved the documentation. * Fixed some compiler warnings with gcc 4.x 2006-04-08 Ludovic Marcotte * Fixed the IMAP code so that we if send an empty password and the server doesn't accept it, we inform our delegate that the authentication failed. * Fixes when informing the delegate on search completion and more. * Added notification/delegate methods to handle a SMTP transaction reset. * Improved the SimpleSMTP example to show how to send the same message over the same connection more than once. 2006-03-31 Ludovic Marcotte * It's now possible to obtain the last command sent by any CWService subclasses. 2006-03-25 Ludovic Marcotte * Added initial TLS support for IMAP, POP3 and SMTP services. 2005-12-23 Ludovic Marcotte * We now correctly strip Lotus Notes' and Novell GroupWise "re" prefix in the Subject when replying to a mail. 2005-12-22 Ludovic Marcotte * We correctly set the SONAME to 1.2. Bug reported by Hubert Chan . 2005-12-19 Ludovic Marcotte * Fixed the CWSMTP class in order to not remove the original recipients list when sending the message. * Rewrote the CWInternetAddress class to not use the old ELM address parsing code. More refactorings are to come with regard to this old ELM code, which doesn't support non-ASCII characters too well. * Fixed the non-blocking connect code in TCPConnection.m 2005-08-14 Ludovic Marcotte * Fixed a missing include in CWDNSManager for OS X. * Added a new version of striphtml(). Patch from Richard Frith-Macdonald . 2005-03-20 Ludovic Marcotte * Lots of small cleanups (wrt warnings) and documentation improvements. * Modified CWSMTP to post notifications before invoking the delegate methods. * Modified CWService: -writeData: so that we don't try to enable the write callback if we are not connected to the remote host. 2005-03-13 Ludovic Marcotte * Modified CWService: -cancelRequest to flush the command queue and CWIMAPStore: -reconnect to flush the read/write buffers before attempting to reconnect. 2005-03-02 Ludovic Marcotte * Modified CWFolder: -dealloc to set the CWMessage's instances folder to nil in case something was retaining those instances and try to access the _folder ivar. 2005-02-27 Ludovic Marcotte * Moved the timeout definition code from CWConnection to CWService. 2005-02-25 Ludovic Marcotte * Modified CWService: -_removeWatchers so we immediately return if we are not connected. 2005-02-23 Francis Lachapelle * Updated the XCode project file; added NSScanner+Extensions.{h,m} 2005-02-23 Ludovic Marcotte * Implemented service's disconnection support and IMAP reconnection support. Documented everything. 2005-02-06 Ludovic Marcotte * Improved CWLocalStore: -createFolderWithName: type: contents: 2005-01-24 Ludovic Marcotte * Modified CWSMTP: -authenticate:... so that if an unknown / unsupported mechanism is provided, we call -authenticationFailed: (and post the notification) * Modified CWService to post the notifcation before calling the delegate method. Same in CWConstants.h. * Added a note in CWService.h to clear up the deallocation process of CWService instances. * Modified CWService: _tick so that we honor the connection timeout of the CWTCPConnection instance (default to 60 seconds). 2005-01-22 Ludovic Marcotte * Modified CWIMAPStore: _folderNameFromString: to handle better literal responses. 2005-01-16 Ludovic Marcotte * Added NSScaner+Extensions in order to define the -scanUnsignedInt: method, which we implement. Those files need to be added to the PB and Xcode project files. * Added a patch from "Konstantin B. Bukharov" that replaces all occurences of int by unsigned int wrt the UID IMAP code in order to support very large UID:s. * Fixed the code that renamed maildir mailboxes. * Updated the PB project file. The Xcode project file NEEDS to be also updated. * Added a small fix to the NSScanner extension to not generate exceptions when -scanUnsignedInt: reaches the very end of the string. 2005-01-15 Ludovic Marcotte * We now post a PantomimeFolderCloseCompleted (and call -folderCloseCompleted: on the delegate) when we close a local or IMAP folder. 2005-01-10 Ludovic Marcotte * Modified CWSMTP to improve the data transparency code (in speed) and also to remove the Bcc: header before sending the DATA to the server. Some servers (like qmail) don't automatically remove it. 2005-01-09 Ludovic Marcotte * Modified CWService: -cancelRequest to unconditionally close the connection and remove the watchers even if we are not yet connected. 2005-01-08 Ludovic Marcotte * Added fixes to parse 8-bit mailbox names in CWIMAPStore: -_parseLIST and -_parseLSUB. 2005-01-02 Ludovic Marcotte * Set the tag to v1_2_0pre1 * Released 1.2.0pre1. 2005-01-01 Ludovic Marcotte * Modified CWIMAPStore: -sendCommand: ... so that we do NOT skip the command if it's an IMAP APPEND command which has the same parameters as an existing command in the command queue. 2004-12-26 Ludovic Marcotte * Modified the macros so they all accept the delegate. * Modified CWServer: -updateRead so that if we are connected and we read 0 byte, we call -connectionLost: and post the associated notification. * Modified CWService: -_removeWatchers to remove all ALL watchers, for all modes. 2004-12-24 Ludovic Marcotte * Fixed the message appending code in CWLocalFolder so it accepts messages composed of only headers. 2004-12-23 Ludovic Marcotte * Added code to obtain messages from a mail spool file. * Reviewed the mbox locking code so it is more robust and don't rely (unless we are on Linux) on flock(). * Small fixes so things compile on Solaris 2004-12-22 Ludovic Marcotte * We now use gethostname() instead of [[NSHost currentHost] name] since this causes problems on Cocoa when DNS resolutions can't be done properly. * Added some notes wrt using Pantomime in your application, especially on OS X with the -DMACOSX compiler flag. 2004-12-19 Ludovic Marcotte * Modified CWMessage: -setRecipients: to always remove the previous recipients. 2004-12-13 Ludovic Marcotte * Cleaned up some more the maildir code. Moved the generation of the "info" string into CWFlags (added the method -maildirString). * Modified the maildir and mbox code to return deleted messages in the notification. Updated the documentation. * Moved the code that parses the maildir's info string from CWLocalFolder+mbox (shared with the mbox code) to CWFlags's addFlagsFromData: for which the "format:" parameter was added. Updated the documentation. 2004-12-07 Ludovic Marcotte * Modified CWPart: -dataValue so we don't add an empty filename for no good reason when we deal with application/*, audio/*... parts. 2004-12-08 Ludovic Marcotte * Modified NSString+Extensions so we correctly cast the returned value of iconv_open() to a signed type. Patch from Robert L. Masterson 2004-12-06 Ludovic Marcotte * Modified CWLocalStore so we include the number of messages in the mbox we import (if any) when creating a mailbox. Added CWLocalFolder+mbox: +numberOfMessagesFromData: to help doing this. 2004-11-28 Ludovic Marcotte * Updated the documentation. * Renamed CWMessagew: -mimeVersion to -MIMEVersion and -setMimeVersion: to -setMIMEVersion: * Renamed CWPart: -isMimeType: subType: to -isMIMEType: subType: * Renamed Parser: +parseMimeVersion: inMessage: to +parseMIMEVersion: inMessage: * CWStore: -initWithURL: now accepts a CWURLName instead of a NSString instance. * Updated the XCode project file. Thanks goes to Julian Mayer. 2004-11-27 Ludovic Marcotte * Reoganized and reimported the sources. * Converted to a Framework under GNUstep. * Bumped the official version number (for the underlying libs) to 1.2.0. * Optimized the maildir code. It's now fully usable with large mailboxes. * Added the "CW" prefix to all classes. * Updated the OS X port and the PB file. * Fixed a bug in CWCacheManager. We now decode CacheManager as CWCacheManager. This issue was only occurring on OS X. 2004-11-22 Ludovic Marcotte * Modified the GNUmakefile files for the Examples so they work on OS X. * Improved the async I/O code by listening in all modes for write availability. This change affects only GNUstep users as it was already working well and this way on OS X. 2004-11-21 Ludovic Marcotte * Protected InternetAddress: -initWithString: against nil values. * Cleaned up the code related to the mbox message separator generation. 2004-11-09 Ludovic Marcotte * Cleaned quite a bit the documentation and added informal protocols (TransportClient, SMTPClient and ServiceClient). * Added examples! See the Examples directory. 2004-11-07 Ludovic Marcotte * Modified IMAPFolder: -close to set the folder to 'nil' for all messages. 2004-10-31 Ludovic Marcotte * We now assume that an empty charset is like iso-8859-1 when decoding messages. This is useful to prevent lame Ximian Evolution bugs. 2004-10-30 Ludovic Marcotte * We now cache correctly the Message-ID when generating a new message. 2004-10-10 Ludovic Marcotte * Fixed a small bug in LocalFolder: _findPart:... in which we were inverting the behavior of the PantomimeCaseInsensitiveSearch constraint. 2004-09-26 Ludovic Marcotte * We now space-stuff the "\nFrom " lines instead of inserting a > in LocalFolder: -appendMessageFromRawSource:. * Renamed -stringByReplacingOccurrencesOfString: withString: to stringByReplacingOccurrencesOfCharacter: withCharacter: in the NSString extension. * We now return a char instead of a NSString when calling -folderSeparator on a Store instance. 2004-09-25 Ludovic Marcotte * We now listen in all common modes (instead of just the default mode) for socket activity. 2004-09-18 Ludovic Marcotte * We correctly post the notification that the list of folders (or subscribed folders) is loaded in both IMAPStore and LocalStore. 2004-09-12 Ludovic Marcotte * We now correctly close the socket in case a name resolution (or an other error) occurs in TCPConnection: -initWithName: port: ... 2004-09-11 Ludovic Marcotte * Added a missing "break" in IMAPStore: -_parseNO * We correctly remove the folder from the list of open folders if we weren't able to open it. 2004-08-22 Ludovic Marcotte * Optimized the IMAP message expunge code when the folder is threaded. 2004-08-15 Ludovic Marcotte * Updated the OS X project file (PB). 2004-08-12 Ludovic Marcotte * Added code to set back the flags to messages after a STORE operation. We also now post a notification when the STORE operation has completed. 2004-07-25 Ludovic Marcotte * Enhanced the fetch and search IMAP code. 2004-07-23 Ujwal S. Setlur * Fixed a freeze problem by correcting CFSocket release method from free() from CFRelease() in Service. 2004-07-20 Ujwal S. Setlur * Fixed bug in NSRunLoop:-removeEvent. 2004-07-13 Ludovic Marcotte * We include Constants.h in DNSManager.m so the compilation won't fail on OS X. 2004-07-12 Ludovic Marcotte * Added a small DNS cache manager to Pantomime. It will eventually also offer async DNS resolutions. For now, it only cache DNS values returned by gethostbyname(). * Improved the code in IMAPStore that deals with creating, deleting and renaming mailboxes. 2004-07-05 Ludovic Marcotte * Added two new notifications/delegate methods: - PantomimeFolderOpenCompleted/-folderOpenCompleted: - PantomimeFolderOpenFailed/-folderOpenFailed: in order to correctly and asynchronously handle folder open operations. * Added some range checks in Message: (Private) -_computeBaseSubject. * Enabled partial writes support in SSL for well supporting progress indication. 2004-06-29 Ludovic Marcotte * Modified Service.m to support adding more runloop modes for network events. 2004-06-25 Ludovic Marcotte * We now handle untagged responses after a folder has been closed. Fixes a crash issue. 2004-06-15 Ludovic Marcotte * Some documentation fixes. 2004-06-09 Ludovic Marcotte * Modified the GNUmakefile and the README wrt RedHat 9 / Fedore / RHEL and their kerberos'ised OpenSSL packages. * Rewrote the code in POP3Store: -updateRead in order to handly errors properly and be a little bit faster than before. * Replaced the [_queue removeObject: [_queue lastObject]] calls to [_queue removeLastObject]. 2004-06-06 Ludovic Marcotte * Removed some NSLog() calls. 2004-06-04 Ludovic Marcotte * Documented Constants.h and improved the code wrt those changes. 2004-06-03 Ludovic Marcotte * Modified IMAPStore so that we now set a default empty body to messages for which we have read no literals. 2004-06-02 Ludovic Marcotte * Fixed a bug in the handling of untagged responses AFTER tagged responses. We were assuming that for a FETCH untagged responses occuring after a tagged FETCH response, a _currentQueueObject was present. This occurs with the NetMail server. * Updated the OS X project file wrt previous changes. * Renamed LocalFolderCacheManager to LocalCacheManager to match other CacheManager subclasses's name. * Updated again the OS X project file. * Removed Pantomime's SSL bundle. This code is no longer used as the SSL code is directly integrated into the framework (ie., no longer requires a bundle). 2004-05-31 Ludovic Marcotte * Added CacheManager and refactored LocalFolderCacheManager, POP3CacheManager and IMAPCacheManager to use the new superclass which does most of the work. * Documented io.h, URLName, CacheManager, LocalFolderCacheManager, IMAPCacheManager and POP3CacheManager. * Refactored a lot of code wrt the introduction of the CacheManager class. 2004-05-29 Ludovic Marcotte * Modified Service.m (the NSRunLoop's OS X extension) so that we don't deal with callbacks methods if the connection hasn't yet been established. This can happen on OS X and lead to a crash. * Modified Container: -childAtIndex: to be sure we don't get past the end of the child list. 2004-05-25 Ludovic Marcotte * Modified Service: _removeWatchers to correctly invalidate the _socket ivar on OS X and also remove the key/value from the fd_to_cfsocket map table. This should fix quite a lot of bugs in the new async I/O code on OS X. We also free the _socket ivar. 2004-05-24 Ludovic Marcotte * More documentation: MimeUtility, Part, Message, MimeMultipart, IMAPFolder, POP3Folder, LocalFolder, Store, LocalStore, LocalMessage, Container and Charset * Some refactorings, cleanups and optimizations. * Removed Charset: -characterForCode: since it was unused. 2004-05-23 Ludovic Marcotte * More documentation: FolderInformation, MacOSXGlue, UUFile, InternetAddress, MD5, NSFileManager+Extensions, Connection, TCPConnection, Transport, SMTP, Service, Sendmail, POP3Store, IMAPStore, IMAPMessage, POP3Message. * Changed MD5: -initWithString: encoding: to simply -initWithData: and modified the callers. * Refactored the Sendmail class. 2004-05-18 Ludovic Marcotte * Added TCPConnection: -isSSL so we can later know if we are using or not a SSL connection. 2004-05-17 Ludovic Marcotte * Fixed a small mem leak in Message: -dataValue. The code to obtain "aCalendarDate" was incorrect. Also did some tidyups. * Documented more classes/categories in Pantomime. In particular, NSString+Extensions, NSData+Extensions, CWRegEx, Parser and Flags. * Fixed a potential bug in CWRegEx: -initWithPattern: flags: in case an error was occuring. 2004-05-15 Ludovic Marcotte * Modified MimeUtility: +encodeWordUsingQuotedPrintable: prefixLength: to correctly fold line using quoted printable by always adding a leading space, ignoring the fact if one was there or not since it's actually part of the string, so it must NOT be considered as a folded line indicator (space or tab character). 2004-05-11 Ludovic Marcotte * Added a missing #import in Folder.h so things compile on OS X. 2004-05-10 Ludovic Marcotte * Added a two range checks in NSString+Extensions: -unwrapWithQuoteWrappingLimit: * Modified the IMAP code to fetch the Content-Type (and cache it) instead of the Mime-Version. This should fix strange issues when the Content-Type is folded on > 1 lines. This is still experimental and could change back over time. 2004-05-08 Ludovic Marcotte * Added more documentation to Folder.h 2004-05-03 Ludovic Marcotte * Lots of cleanups and refactorings. * Added support for non-ASCII passwords in IMAP. * Modified IMAPStore: -sendCommand::: so we never send a command that is already in queue. * Added a _selectedFolder ivar to IMAPStore and we now make use of it. Also, the folders that are open but not selected still get into the _openFolders ivar. * Added Folder: -propertyForKey: and -setProperty: forKey: so a developer can not set extra properties on Folder objects, much like it's possible on Message objects. * Modified LocalStore and IMAPStore to no longer return nil when a folder is already open and we ask to open it again. We rather send a reference to the open folder. * Added more documentation to Folder.h 2004-04-23 Ludovic Marcotte * Modified IMAPStore: -_parseOK to handle weird SEARCH untagged responses from UW IMAPd. 2004-04-20 Ludovic Marcotte * Improved the reading of the rest of FETCH responses for funky responses Microsoft Exchange can return. * Lots of refactorings and more documentation. 2004-04-18 Ludovic Marcotte * Finished all the big IMAP refactorisations and did even more optimizations. * We now correctly free the runloop source on OS X and its context. * Some refactorings in LocalFolder: -parse. 2004-04-15 Ludovic Marcotte * Removed the TCPSSLConnection target from the OS X project file and tested everything under OS X. 2004-04-14 Ludovic Marcotte * Refactored a good amount of code so that the SSL bundle is no longer used (will soon be removed). This also allows us to have full non-blocking SSL connect and handshaking (blocking call but not code). 2004-04-10 Ludovic Marcotte * Added a commands queue in the SMTP class. That will ease the use of this class for some other developers. Also refactored some code to move the _queue ivar up to the Service class. 2004-04-08 Ludovic Marcotte * Updated the OS X port, finally! * Minor cleanups. 2004-03-30 Ludovic Marcotte * Noticeable optimization in InternetAddress. * Fixed the #include in io.h so it works under BSD. 2004-03-29 Ludovic Marcotte * Added io.c/.h and moved some POSIX stuff there. 2004-03-26 Ludovic Marcotte * Refactored and cleaned even more code. Moved the mbox/maildir code in its own separate categories. More cleanups are still to come. * Added WHOIS to list contributors. 2004-03-25 Ludovic Marcotte * Corrected a small issue in Pantomime.h. Bug reported by Alexandre Carlhian . * Renamed +generateBoundary to +globallyUniqueBoundary and +generateOSID to +globallyUniqueID in MimeUtility. Also refactored some code. 2004-03-24 Ludovic Marcotte * Moved +allCharsets from MimeUtility to Charset. * More refactorings and cleanups. 2004-03-23 Ludovic Marcotte * More cleanups. * Removed the UTF8 class which was useless. 2004-03-22 Ludovic Marcotte * Continued the cleanups. 2004-03-21 Ludovic Marcotte * Did a bunch of cleanups everywhere. 2004-03-17 Ludovic Marcotte * Fixed a small memory leak in MimeUtility: +plainTextContentFromPart:. "bytes" was never freed properly. 2004-03-16 Ludovic Marcotte * We now enforce the 0600 mode after writing the message on disk in Sendmail.m 2004-03-14 Ludovic Marcotte * Modified Folder: -thread to set an extra property to each messages (its container). This is experimental. * Modified Folder: -thread to use Map Tables instead of NSMutableDictionary:s. This should speedup things. * Removed the "visible" stuff from Container and also the comparing category. Those are now useless. * Added Folder: -unthread. That might change in a soon future so don't rely on this. 2004-03-12 Ludovic Marcotte * Refactored some code in Flags and added the support to write the Flagged flag to the mbox file when expunging a local mailbox. * Many small refactorings and small optimizations. 2004-03-11 Ludovic Marcotte * Modified IMAPStore to correctly update the cache files for \Flagged message flag updates when opening a mailbox. 2004-03-10 Ludovic Marcotte * Modified IMAPCache: -_parseEXPUNGE to no longer synchronize the IMAP cache. Left the code there if that causes any problems (but it should definitively not and should greatly improve the performance of expunging IMAP mailboxes!). 2004-03-08 Ludovic Marcotte * Lots of cleanups and refactorings. * More cleanups, wrt the URLName class. * Added some code in MimeUtility: -decodeHeader... to detect the ISO-2022-JP announcer sequence in order to correctly decode that 7-bit encoding format. * Set the version number on OS X to 1.2.0. 2004-03-07 Ludovic Marcotte * Modified InternetAddress to NOT use NSString: -cString but rather -UTF8String (and -stringWithUTF8String). Also refactored all the code in this class. * Started to cleanup the "local" mbox/maildir code. * Refactored IMAPCacheManager and greatly optimized it. 2004-03-05 Ludovic Marcotte * Fixed an IMAP bug. With some servers (like UW IMAP), we get the FLAGS update as an other untagged response instead of getting them in the same untagged FETCH response. * Did some cleanups and refactorings in the IMAP code. * Small POP3 optimizations. 2004-03-04 Ludovic Marcotte * Did some minor refactorings. * We now post a notification when the FETCH RFC822 completed in IMAP. 2004-03-02 Ludovic Marcotte * Modified Service: -updateRead so that we read until we are done. 2004-03-01 Ludovic Marcotte * Replaced random() by rand() in MimeUtility since random() isn't available on MinGW. That increases the portability. * Moved +fileFromUUEncodedString and +rangeOfUUEncodedStringFromString: range: from MimeUtility to UUFile (and all the related stuff). * Moved MimeUtility: +isASCIIString: to NSString+Extensions: -is7bitSafe. * Reworked a little bit NSString+Extensions: -stringByTrimmingWhiteSpaces in order to avoid a method call under GNUstep. This will slightly optimize things on GNUstep. * Fixed a bug in IMAPStore: is_stub() that would lead to memory corruption and unpredictable results (would return 1 when it should have returned 0). 2004-02-27 Ludovic Marcotte * Optimized MimeUtility: -allCharsets * Cleaned up UUFile. * We now post a notification when the message's data was fully prefetched. 2004-02-24 Ludovic Marcotte * Commented out the NSLog() calls in POP3Store and IMAPStore. * Bumped up the version number to 1.2.0. * Commented out NSLog() calls in IMAPFolder.m 2004-02-22 Ludovic Marcotte * Modified IMAPStore and LocalStore to bring back support for creating/deleting/renaming mailboxes. Work needs to be done wrt error handling. * Also cleaned and optimized IMAPStore some more. * Modified Service: -updateWrite: to correctly reenable the write callback on OS X. 2004-02-20 Ludovic Marcotte * Improved the parsing of FETCH responses. We can now parse the rest of the response (ie., the bytes following the bytes that are considered part of the literal value). * Modified IMAPStore: _parseSTATUS so that we correctly react in case STATUS failed on a mailbox. * Corrected a small issue wrt previous commit. * Did some cleanups in IMAPStore.m 2004-02-18 Ludovic Marcotte * Updated the code to parse deprecated 8bit values when issuing a LIST/LSUB command. 2004-02-17 Ludovic Marcotte * Fixed a small bug in the SMTP code wrt the previous commit. * We correctly set the _connected flag to NO in Service: -_removeWatchers. * Updated the TODO 2004-02-16 Ludovic Marcotte * Did more cleanups to the IMAPStore class. * Added the code for fully support connecting to services in background for regular TCP connections. That will NOT work right now for SSL connection. 2004-02-15 Ludovic Marcotte * Updated the OS X project file to add the new NSFileManager+Extensions files. * Moved the initialization of the map table in Service.m to a safer place. * Fixed an IMAP flags update bug. * Cleaned the new IMAP code. * Moved and renamed some declarations of "constants" from LocalStore.h to Constants.h 2004-02-14 Ludovic Marcotte * Added NSFileManager+Extensions.{h,m} and refactored a lot of code. * Changed the BIG_ENDIAN check in MD5.m to be: #if defined BIG_ENDIAN || MACOSX * Cleaned the POP3 code. 2004-02-13 Ludovic Marcotte * Implemented more missing functionnalities in the new IMAP code (create, rename, delete mailboxes, LOGIN/CRAM-MD5 authentication support and more). * LOTS of other improvements! 2004-02-12 Ludovic Marcotte * General improvements to the SSL bundle. It's now using non-blocking I/O and the new I/O code should also fully work under OS X! * Fixed a bunch of small issues in the new IMAP code. 2004-02-11 Ludovic Marcotte * Same as yesterday :) 2004-02-10 Ludovic Marcotte * Again, LOTS of improvements on top of the previous commit. 2004-02-09 Ludovic Marcotte * Massively modified the IMAP code to use non-blocking I/O. THE CODE WILL NOT WORK RIGHT NOW SO DON'T USE IT. * LOTS of improvements on top of the previous commit. 2004-02-08 Ludovic Marcotte * Added CWRegEx.{h,m} and Service.m to the OS X project file. Also removed NSRegEx.{h,m} from the OS X project file. * Updated the OS X port wrt all changes made in the last weeks. It does NOT work right now, it just compiles. 2004-02-07 Ludovic Marcotte * Reworded some things in the SMTP class so we no longer use the word "bounce" but rather "redirect" to avoid any confusion. * Minor cleanups and enhancements to the SSL bundle. There's still a strange segfault in openssl when using it with non-blocking I/O (still disabled...) * Some cleanups in LocalStore.h * Added a workaround for a lame bug in Eudora which sometimes sends mails using "0" as the charset. We now treat that as ISO-8859-1. 2004-02-05 Ludovic Marcotte * Added Service: -cancelRequest so we are now able to immediately "stop" a running request. This is initial support and will shortly evolve. 2004-02-02 Ludovic Marcotte * Removed #define CRLF / LF from Constants.h and Messages.m and added the LF #define in Part.m and Message.m * Removed the boolean return value for the methods in the Transport protocol. * Moved the BCC/CC/TO/RESENT-* defines from InternetAddress.h to Constants.h (in an enum {}). Updated all the code wrt this. * Added Service.m (and moved this protocol to a real interface/implementation) * Added some methods to the Transport protocol. * Made TCPSSLConnection a subclass of TCPConnection and cleaned up both classes A LOT. * Converted the SMTP and POP3 code to use the new Service class and use the new non-blocking I/O scheme. IT WILL NOT WORK RIGHT NOW UNDER OS X. 2004-01-19 Ludovic Marcotte * Renamed NSRegEx to CWRegEx. The OS X project file needs to be updated. 2004-01-18 Ludovic Marcotte * Added NSString+Extensions: -stringByDeletingLastPathComponentWithSeparator: and: -stringByDeletingFirstPathSeparator: * Modified LocalStore and IMAPStore: -renameFolderWithName: toName: so it uses the -stringByDeletingFirstPathSeparator: to cleanup potentially invalid paths and to return an error in case theName or theNewName are either nil or have a length of 0. 2004-01-11 Ludovic Marcotte * Reworked the flags in Pantomime (moved the defines to an enum) and did the same for nearly all other #define:s. * Updated all the code wrt the changes in Constants.h. 2004-01-02 Ludovic Marcotte * Bumped up the OS X version number to 1.1.3. Also modified Constants.h wrt this. * Removed the NSDebugLog macro definition from MacOSXGlue.h and removed ALL calls to NSDebugLog. * Reactivated pch support in the OS X project file, removed -I/sw/... and -DBIG_ENDIAN. 2004-01-01 Ludovic Marcotte * Added support for renaming open local/IMAP mailboxes. Also made a bunch of other small modifications. THIS STUFF IS RATHER EXPERIMENTAL. IT WORKS BUT USE IT AT YOUR OWN RISK! 2003-12-30 Ludovic Marcotte * Added new capabilites in the Message's replying code. You can now do "simple" replies (ie., w/o a content) or normal replies by combining a reply all or not option. * Added Constants.m and cleaned its header. * Added a new class: VirtualFolder which implements the idea of a virtual folder. It's not yet finished but the innards are there. * Updated the OS X project file wrt the previous changes. 2003-12-26 Ludovic Marcotte * Added an improvement in the IMAP parsing code (_parseFetch:) so it works better with lame servers like Exchange. * Set the CVS tag to v1_1_2 * RELEASED VERSION 1.1.2 2003-12-21 Ludovic Marcotte * Added Folder: -setFlags: messages: and implemented a version in IMAPFolder to optimize deletion of messages. Modified IMAPMessage: -setFlags: to use that new method. 2003-12-13 Ludovic Marcotte * We now correctly decode/encode the Organization header using quoted-printable. 2003-12-07 Ludovic Marcotte * Removed Testing/*. The tests were old and broken and the small test framework should be replaced by a real framework, like OCUnit. * Modified the GNUmakefile.postamble file to remove the references to the Testing directory. 2003-12-06 Ludovic Marcotte * Added some notes (in the README) to properly compile and install Pantomime on RedHat 9 / Fedora. 2003-11-30 Ludovic Marcotte * Permuted the RETAIN/RELEASE calls in Message: -setFlags:. Bug reported by Alexandre Carlhian . 2003-11-29 Ludovic Marcotte * Fixed a bug in Parser: +_parameterValueUsingLine: range:. 2003-11-26 Ludovic Marcotte * Finally commited a fix for the reply bork when a attachment is put between to text/plain parts in a multipart/mixed message (only the first part was used in the reply). 2003-11-08 Ludovic Marcotte * Modified MimeUtility to add support on OS X for Hebrew, Arabic, BalticRim and Vietnamese encodings using the CoreFoundation. 2003-10-15 Ludovic Marcotte * Fixed a small bug in my previous commit on 2003-10-08. 2003-10-13 Ludovic Marcotte * Fixed a small issue in POP3Folder: -lengthOfMessageAtIndex: Bug reported by Alexandre Carlhian . * Modified NSData+Extensions: -dataFromQuotedData to be sure that our initial data length has length of at least 2 (since if we had only '"' we would get an range exception). 2003-10-12 Ludovic Marcotte * Modified MimeUtility: -stringEncodingForPart: so that if we get _at best_ NSASCIIStringEncoding from the part, we use NSISOLatin1StringEncoding instead in order to give us more success when decoding things. 2003-10-11 Ludovic Marcotte * Added POP3Folder: -prefetchMessageAtIndex: numberOfLines: and added a small cache for the message sizes. 2003-10-10 Ludovic Marcotte * Renamed -authenticateWithUsername: ... to -authenticate: password: mechanism: and implemented in the SMTP, POP3Store and IMAPStore classes. * Added -supportedMechanisms to the Service protocol and implemented in all the classes above. * Removed POP3Store: -setUseAPOP: / -useAPOP and -setTimestamp: * Added LOGIN and CRAM-MD5 SASL authentication mechanisms support in the IMAP code. * Added -DBIG_ENDIAN to the list of compiler flags on OS X so that the CRAM-MD5 code works. * Updated the OS X project to set the version number to 1.1.2. 2003-10-08 Ludovic Marcotte * Moved -isConnected from Connection to Store. Implemented in IMAPStore and provided a dumb implementations for LocalStore and POP3Store. Refactored all the code to use the Store's method instead of the TCPConnection's implementation. Much of the code in GNUMail will have to be retested wrt the handling of being disconnected from the IMAP server. * Added a hack so things work well with header prefetching when we are using a Novell IMAP server (which is utterly broken). * Added and implemented IMAPStore: -capabilities to return an array of the server's capabilities (result of the CAPABILITY command). 2003-10-05 Ludovic Marcotte * Added a "contents" parameter to Store: -createFolderWithName: type: so we are now able to create a folder with an initial content. Implemented in all Store subclasses but the only implementation that works right now is the LocalStore one using the standard mailbox format (maildir won't work). * Bumped version number to 1.1.2 in Constants.h 2003-09-28 Ludovic Marcotte * Updated the README for the release. * Set the CVS tag to v1_1_1 * RELEASED VERSION 1.1.1 2003-09-21 Ludovic Marcotte * Moved Message (Private): _-plainTextContentFromPart: to MimeUtility: +plainTextContentFromPart:. * Enhanced (and simplified) the code in Message: -forward to strip the html content of text/html part when forwarding an email. 2003-09-18 Ludovic Marcotte * Modified MimeUtility: +stringFromCharset: so that under GNUstep, we define utf-7 and unicode-1-1-utf-7 to use NSUTF7StringEncoding. The latter is to prevent a bug (sort of) in MS Hotmail. 2003-09-12 Ludovic Marcotte * Bumped up the version number to 1.1.1. * Same thing in OS X project file. 2003-09-06 Ludovic Marcotte * Removed a bunch of variable declarations in elm_defs.h (#if 0'ed them all). This was causing problems under OS X when -DMACOSX wasn't added to the compiler flags (we don't need them anyway so let's get rid of them). 2003-09-01 Ludovic Marcotte * Added support for read-only IMAP folders. More work needs to be done wrt this. Added Folder: -mode (and an ivar) and implemented this method in subclasses. Refactored IMAPStore so it's cleaner. * Modified Part: -initWithCoder: to remove support for older version (we now support only version 2). 2003-08-31 Ludovic Marcotte * Added an excellent patch from Ken Ferry to support the concept of "base subject" as described in http://www.ietf.org/internet-drafts/draft-ietf-imapext-sort-13.txt. The subject sorting code is now based on this concept. * Modified the message threading code to use the new -baseSubject accessor (for performing MT and for sorting containers). * Removed NSString+Extensions: -stringByRemovingRE * Modified Message: -initWithCoder: to remove support for the version 1 of the cache. 2003-08-22 Ludovic Marcotte * Modified Message: -initWithData: to return nil if the call to Part: -initWithData failed. * Modified MimeUtility: +setContentFromRawSource: inPart: to verify if the message/rfc822 is base64 encoded and if it is, we decode it properly (and we also replace \r\n by \n if the MUA sent that over. 2003-08-21 Ludovic Marcotte * Modified IMAPStore: -authenticateWithUsername: password: so we verify if the password has any whitespaces in it. If so, we also quote it properly. Bug reported by Aredridel . 2003-08-19 Ludovic Marcotte * Set the CVS tag to v1_1_0 * RELEASED VERSION 1.1.0 2003-08-12 Ludovic Marcotte * Added a Version file and set the version to 1.1.0 in it. * Modified Part: -dataValue to NOT unwrap the text before wrapping it since it's not in format=flowed format. * Modified an #include to avoid a warning under GNUstep with the new header structure. 2003-08-03 Ludovic Marcotte * Modified IMAPFolder: -close to not send the IMAP "CLOSE" command if we're not longer connected to the IMAP server. 2003-08-01 Ludovic Marcotte * Fixed a bug in MimeUtility: -encodeWordUsingQuotedPrintable: prefixLength: so that we don't pre-append a space to our folded header if we already have one. 2003-07-27 Ludovic Marcotte * Removed unused code in Folder: -appendMessageFromRawSource: flags: * "Fixed" the same method (and others) in LocalFolder (indentation and stuff) * Modified Folder: -removeMessage: to thread messages if we removed a message directly from the Folder's instance (happens in IMAPStore). 2003-07-23 Ludovic Marcotte * Modified MimeUtility: -stringWithData: charset: to be sure we always use the ASCII string of theCharset when using iconv_open(). 2003-07-22 Ludovic Marcotte * Minor cleanups and very tiny mem leak fixes. 2003-07-10 Ludovic Marcotte * Added the complete list of supported mailbox flags in Constants.h * Modified the code to use them instead of HOLDS_FOLDERS/HOLDS_MESSAGES * Finished the implementation of IMAPStore: -_parseList: 2003-07-02 Ludovic Marcotte * Modified IMAPStore: _parseExists: to NOT assume we got a valid folder since we might get this untagged response even if a folder is not SELECTed. This should fix the obscure segfault that could happen in IMAP with more than one IMAP account. * Modified POP3Store: -close to not attempt to close the connection if it's already closed. * Modified IMAPCacheManager: -synchronize to handle GNUstep -base exceptions that could occur when writing the cache to the disk if it contains non-latin1 characters. 2003-07-01 Ludovic Marcotte * Removed NSString+Extensions: -stringByRemovingLineFeedCharacters. Added -stringFromModifiedUTF7 and -modifiedUTF7String. Modified the IMAP code to use those two new methods. This new code will do _nothing_ on OS X as CF/NSString don't provide support for UTF-7. Under GNUstep, you need the latest CVS version of base (2003-07-01) if you want things to work properly (since UTF-7 support in GNUstep -base was heavily broken before today). 2003-06-29 Ujwal S. Sathyam * Rewrote maildir expunge and cache rebuild code based on maildir spec with flag information embedded in mail file name. 2003-06-27 Ludovic Marcotte * Modified MimeUtility: -encodeWordUsingQuotedPrintable: prefixLength: to fix the annoying bug where the subject would get repeated twice if it was exceeding 75 chars. 2003-06-26 Ludovic Marcotte * Modified IMAPFolder: -prefetch to use "UID FETCH %d:* (UID..." (we include UID in the FETCH command) since Microsoft Exchange doesn't return it if we don't ask for it. 2003-06-25 Ludovic Marcotte * Applied a patch from Andreas Heppel to fix var declarations for gcc < 3.0. * Added NSString+Extensions: -stringByReplacingOccurrencesOfString: withString:. * Renamed RAW -> Raw (or raw) in the code. 2003-06-24 Ujwal S. Sathyam * When a MAILDIR folder is expunged, the undeleted messages are re-writtenwith the latest flag information. This is so that if the cache file is dirty and needs to be rebuilt, the flag information can be restored. One concern is performace since this can involve a lot of I/O for a large number of messages. 2003-06-24 Ludovic Marcotte * Modified IMAPStore: -renameFolderWithName: toName: to not issue other IMAP commands if we are no longer connected to the IMAP st * Same thing for IMAPStore: -deleteFolderWithName: * Same thing for IMAPStore: -createFolderWithName: type: 2003-06-23 Ludovic Marcotte * Modified Message.h so that our rawSource ivar is a protected one. Also modified IMAPMessage: -rawSource to return the ivar directly instead of [super rawSource] to prevent a crash if the connection was lost to the IMAP server just after issueing the UID FETCH RFC822. * Updated Testing/Client so it compiles. * Modified IMAPMessage: -setInitialized: to NOT issue the 2nd IMAP command if we're no longer connected to the IMAP store. 2003-06-22 Ludovic Marcotte * Modified MimeUtility: -setContentFromRawSource: inPart: to treat "unsupported Content-Type:s" as a discrete type. * Modified LocalFolder: -_expungeMBOX to merge the message flags (using Pine's format) to the local mbox. Also modified Flags: -addFlagsFromData: to NOT remove the SEEN flag if we don't see "R". 2003-06-20 Ludovic Marcotte * Modified IMAPFolder: -close to NOT do a CLOSE if we are showing deleted messages. 2003-06-18 Ludovic Marcotte * Did some cleanups in the MimeUtility class. 2003-06-17 Ludovic Marcotte * Moved IMAPStore (Private): -_replaceCRLFInMutableData to NSData+Extensions: -replaceCRLFWithLF. * Moved SMTP (Private): -replaceLFInMutableData to NSData+Extensions: -replaceLFWithCRLF. 2003-06-16 Ludovic Marcotte * Modified IMAPMessage: -setFlags to call [super setFlags:], to use STORE -FLAGS if we are removing all flags and to use .SILENT in order to NOT generate an extra IMAP response. This should make things a little bit faster. 2003-06-15 Ludovic Marcotte * Renamed SMTP: -_readResponsesFromServer to -_parseServerOutput (like IMAP). * Refactored IMAPStore: -_parseFlags. * Modified IMAPFolder: -expunge: to NOT send the "UID FETCH %d:* UID" command as I have modified IMAPStore: -_parseExpunge: to automatically decrement MSN of messages when we get an * xyz EXPUNGE response. * Modified the TCPConnection code (and its SSL implementation) to automatically increase the buffer size when reading responses from the server. Also fixed a memory leak in -readDataToEndOfLine. * Some clean ups in IMAPStore. * Added delegate methods in IMAPStore and we now call them in _sendCommand: if messages were expunged of if messages flags have changed. This allows Pantomime to support concurrent accesses to an IMAP folder with other clients. 2003-06-13 Ludovic Marcotte * Modified IMAPCacheManager to correctly add/remove the entries in our hash when adding/removing messages from the cache. * Modifed IMAPFolder: -_updateMessagesFromUID: toUID: to correctly set the MSN of message we _keep_ in the cache when synchronizing our cache with the IMAP server. 2003-06-12 Ludovic Marcotte * Reworked the code related to a "dirty IMAP cache". It's now handled _correctly_ and it's way faster than before. This should fix all "remaining bugs" in the new IMAP code. 2003-06-10 Ludovic Marcotte * Reworked the IMAP EXPUNGE code so it's more efficient and can now expect expunge responses from the server even it if hasn't expunge mails (ie., an other client did). Also improved the fetch of MSN:s after an EXPUNGE so we don't fetch all of them, but only from the UID of the message of the lowest MSN that was deleted. * Added IMAPStore: -_parseExits: to record if new messages were received instead of using -_parseRecent:. 2003-06-09 Ludovic Marcotte * Fixed IMAPStore: -_parseFlags: since Seen and Recent can be set at the same time. I misinterpreted that in the RFC3501. The POP3 code will also have to be modified and also GNUMail. * Fixed all issues wrt the RECENT/SEEN flags. You MUST also update GNUMail.app. * Modified IMAPStore to not declare a static selector but rather use a define since it fails with Apple's gcc. * Moved Folder's allMessages ivar to be a public one. This is need to know the read folder's count and also to directly index messages in the folder (ie., from IMAP store). Also modified IMAP store to use the ivar directly. This fix the bug when we were hiding deleted messages and deleting messages on the server. 2003-06-08 Ludovic Marcotte * Removed IMAPFolder: -checkForBYE... * Removed the PantomimeLostConnectionException constant. * IMAPStore should now handle gracefully server's BYE responses. 2003-06-07 Ludovic Marcotte * Added the brand new IMAP code. This code has NOT been tested extensively but just quite well by me (since I use it). Please try it and report me any issue. More goodies will be added soon. * Fixed an #include warning. * More refactorings and fixed a recursivity bug. * Modified Message: -replyWithReplyToAll: to make use of -hasREPrefix 2003-06-06 Ludovic Marcotte * Added other great improvements in IMAPStore. This class is now completely cleaned of the old code. * Removed -checkForBYE.. in IMAPStore (moved temporarely in IMAPFolder) * Fixed a small bug in IMAPStore: -folderEnumerator. * Added -_parseRecent: and also modified to code to be "notified" that new messages have arrived. 2003-06-05 Ludovic Marcotte * Started the IMAP rewrite. Those who want stability shouldn't use the CVS version for a couple of days. It should work well, but expect bugs. Lots of debug info might appear on the console and that's normal for now. The new code is definitively smaller and faster than before. * Rewrote IMAPStore: -folderStatus and added -_parseStatus: 2003-06-04 Ludovic Marcotte * Added Folder: -cacheManager/setCacheManager: and removed all -{imap,local,pop3}CacheManager and -set{IMAP,Local,POP3}CacheManager methods. Refactored the code to use the new parent's method. 2003-06-01 Ludovic Marcotte * Refactored A LOT the SMTP code. It's now way more efficient and also added the support to obtain the last message or code received from the server. 2003-05-31 Ludovic Marcotte * Modified the GNUmakefile so we link with libucb under Solaris. 2003-05-25 Ludovic Marcotte * Added POP3Folder: -size and refactored -count into -_stat. Feature request by Arthur VIGAN . 2003-05-23 Ludovic Marcotte * Modified IMAPStore: -folderStatus to NOT call STATUS on the selected folder. This has been added in the RFC3501. 2003-05-16 Ludovic Marcotte * Modified Parser so that we don't assume we got a space separating the Subject/Content-Type/Content-Transfer-Encoding headers and their respective values. That sometimes happens with (surprised?) malformatted spam. 2003-05-14 Ludovic Marcotte * Modified Message: -replyWithReplyToAll: to trim whitespaces from the subject before verifying for re:. 2003-05-12 Ludovic Marcotte * Optimized POP3Folder: -UIDOfMessageAtIndex:. It should make a _huge_ difference for those who leaves their messages on the POP3 server and have a lot of them and also improves quite nicely the downloading speed of messages. 2003-05-07 Ludovic Marcotte * Added IMAPFolder: -copyMessages: toFolder: 2003-05-05 Ludovic Marcotte * Updated Message: -dataValue (the code to obtain the locale) wrt the recent changes in GNUstep's directory layout. 2003-04-27 Ludovic Marcotte * Optimized Parser: +_parameterValueUsingLine: range: * Modified Parser: +parseContentDisposition: inPart: to use _parameterValue... for parsing the filename parameter. 2003-04-26 Ludovic Marcotte * Set the OS X's version number to 1.1.0. * Fixed an index out of bounds error in Message: -replyWithReplyToAll: We were using the wrong local variables. 2003-04-23 Ludovic Marcotte * Modified Headers/Pantomime/elm_lib.h to comment out mkdir() since it causes problems under Solaris 2.8. Problem reported by Mario Antonio * Set the version number in Constants.h to 1.1.0. 2003-04-21 Ludovic Marcotte * Modified the OS X project file to not generate debug symbols for the TCPSSLConnection target. * Set the CVS tag to v1_1_0pre2 * RELEASED VERSION 1.1.0pre2 2003-04-18 Ludovic Marcotte * Modified the OS X project file to no longer "link" with Fink's version of OpenSSL. * Modified SMTP, POP3Store and IMAPStore to allow the TCPSSLConnection bundle to be load from the app's plug-in path under OS X. This allows developers to include Pantomime's SSL bundle in their own app's dmg. 2003-04-16 Ludovic Marcotte * Trivial optimizations in MimeUtility: -isASCIIString: * Modified MimeUtility: +allCharsets to add gb2312 under GNUstep and added an optimization. * Modified IMAPFolder: -_messageNumberFromUID to correctly read the untagged responses. * Added a temporary method (-_readStringSkippingUntaggedResponses) to IMAPFolder and modified the code to use it. After 1.1.0pre2 is released, untagged responses will be much better handled by introducing a new way to read all server responses, expecting any kind of untagged responses at any time. This temporary method is just there so the rest of the code can work properly under Cyrus. 2003-04-15 Ludovic Marcotte * Modified IMAPMessage: -setFlags to use IMAPFolder(Private): -_flagsAsStringFromFlags. * Modified SMTP (Private): -_decodeSupportedAuthenticationMechanismFromString: so that we try to declde the supported mechanisms even if we already have some in our array since some servers return the supported mechanisms (and different ones) on more than one line. * Cleaned the includes in Sendmail.m 2003-04-14 Ujwal S. Sathyam * Minor bugfix to parsing maildir folder. 2003-04-12 Ujwal S. Sathyam * Fixed an include problem in Sendmail.m that broke build on OS X. 2003-04-12 Ludovic Marcotte * Fixed a header include regarding the changes in GNUstep -base 2003-04-11 Ludovic Marcotte * Modified IMAPMessage: -setFlags to correctly set flags on the message (for read/unread messages). 2003-04-08 Ludovic Marcotte * Modified IMAPStore: -folderStatus to properly unquote the folder name before adding it to our dictionary. * Modified Sendmail: -sendMessageFromRawSource: to no longer use a pipe since it can get filled up pretty quickly and block the process. 2003-04-03 Ludovic Marcotte * Modified NSString+Extensions: -stringByTrimmingWhiteSpaces to use CF's CFStringTrimWhitespace() function in order to simplify the code and hopefully enhance performance a little bit. * Modified NSString+Extensions: -stringFromQuotedString: to cache the length of the string in order to speed up things. 2003-04-02 Ludovic Marcotte * Renamed NSDataExtensions to NSData+Extensions * Renamed NSStringExtensions to NSString+Extensions * Modified NSString+Extensions: -indexOfCharacter to cache the length of the string. * Updated the OS X project file 2003-03-25 Ludovic Marcotte * Added -Wno-import to the GNUmakefile:s 2003-03-22 Ludovic Marcotte * Minor fixes/cleanups in the Part and Message classes. 2003-03-17 Ludovic Marcotte * Fixed a bug in IMAPStore: -folderStatus. We weren't comparing correctly the response with BAD/NO (we were ignore the tag). 2003-03-16 Ludovic Marcotte * Fixed the OS X project file. Added back the @executable_path/../Frameworks installation location. Otherwise, the Pantomime.framework would be linked to an absolute path. * Added a .cvsignore file to the root folder of Pantomime 2003-03-14 Ujwal S. Sathyam * Extended InternetAddress class to help in scripting. 2003-03-13 Ludovic Marcotte * Modified LocalStore: -renameFolderWithName: toName: so that we verify if theNewName already exists before renaming the folder. If it does, we abort the operation in order to not overwrite the folder. 2003-03-10 Ujwal S. Sathyam * Fixed Installation setting in PB file that was GNUMail.app fail to build. 2003-03-09 Ludovic Marcotte * Added iso-8859-11 and gb2312 encodings support using GNUstep additions of iconv. 2003-03-02 Ludovic Marcotte * Added MimeUtility: -stringEncodingForPart and refactored Message (Private): _plainTextContentFromPart: to use it. * Fixed the version number on OS X (from 1.0.4 to 1.0.99) 2003-02-13 Ludovic Marcotte * Modified POP3Folder to cache the value -count returns. 2003-02-11 Ludovic Marcotte * Optimized MimeUtility: +stringWithData: charset: so we don't copy the bytes from iconv's output but we rather use them directly and let our NSData object free them when done. 2003-02-09 Ludovic Marcotte * Refactored TCPConnection and TCPSSLConnection to have a cleaner API. * Modified POP3Folder: -prefetchMessageAtIndex: to NOT use an NSString object. This makes things way faster when transferring large mails using POP3 and is way more safe when getting mails using rare encodings (like TIS-620). 2003-02-07 Ludovic Marcotte * Renamed Flags: -addFlagsFromString to -addFlagsFromData and modified Parser to use the new method. This should make things a little bit faster. Also removed -initWithString. 2003-02-05 Ludovic Marcotte * Modified MimeUtility: +stringEncodingForCharset to add "cyrillic (windows-1251)" (mapped to NSWindowsCP1251StringEncoding) to prevent a lame bug in MS's Hotmail encoding code. 2003-02-01 Ludovic Marcotte * Modified MimeUtility: +decodeHeader to add a charset parameter so that if defaultCharset is defined in Part, we use that to force the charset used to decode some headers. Modified Parser to use the new method. * Rewrote the local mailbox caching code. It's now faster and takes way less memory. 2003-01-31 Ludovic Marcotte * Modified LocalMessage: -setInitialized to set it to NO if we failed to open our file when using maildir. 2003-01-30 Ludovic Marcotte * Fixed a broken #include in Pantomime.h * Now include stdlib.h in Message.m Bugs reported by David Sinclair . * Guarded elm_defs.h, elm_lib.h and parseaddrs.h against multiple inclusions. 2003-01-28 Ludovic Marcotte * Modified Message.m to correctly free the buffer returned by striphtml() (since it was malloc'ed but never actually free'ed). Patch from Stefan Urbanek . 2003-01-27 Ludovic Marcotte * Modified Bundles/SSL/GNUmakefile to include ../../Headers 2003-01-24 Ujwal S. Sathyam * Fixed a bug in LocalStore where the folder tree was not being rebuilt after deleting a folder (not mbox or maildir). 2003-01-20 Ludovic Marcotte * Updated the version number to 1.0.99 2003-01-13 Ludovic Marcotte * Updated the README (in preparation for the 1.1.0pre1 release). * Tagged the cvs to v1_1_0pre1. * RELEASE VERSION 1.1.0pre1. 2003-01-08 Ludovic Marcotte * Modified Message: -dataValue so that if the user set its timezone in GNUstep's defaults, we try to use that first (before going back to the default tzset() function). 2003-01-06 Ludovic Marcotte * Added a missing import in POP3Folder.h 2003-01-05 Ludovic Marcotte * Modified POP3Folder to add a small UID cache so that we don't ask again and again the UID of a message at index X but we rather try to first get it from our cache. 2003-01-04 Ludovic Marcotte * Set the encoding to Mac OS roman in the OS X project file * Removed IMAPFolder: -deleteMessageWithUID, -setMessageFlags: forUID: and -removeMessage. * Re-implemented -setFlags: in IMAPMessage so that we send the flags immediately to the IMAP server. * Removed the flag TRANSFERRED and modified all the code that was using it. We will now consider those messages as DELETED. * Removed Folder: -numberOfTransferredMessages. 2003-01-02 Ludovic Marcotte * Added versioning support to the LocalMessage class. When maildir support was added to Pantomime, versioning hasn't been added to the LocalMessage class. That cause problems since between 1.0.5 and 1.0.98 (1.1.0 pre1), in the cvs version, no versionning was there and the format changed. We now invalidate all caches with a version number different from 1. * Set the version to 1.0.98 (1.1.0 pre1) in Constants.h. 2002-12-29 Ludovic Marcotte * Refactored POP3Folder: -prefetchMessageAtIndex: so that we no longer deal with the POP3CacheManager but a Pantomime client (like GNUMail.app) will. 2002-12-28 Ludovic Marcotte * Removed all the SEND_ constants and renamed Part: -dataUsingSendingMode to -dataValue. Refactored to code in Part and in Message (that implements this method) and also refactored all classes using the old method. Modified SMTP.m so that we replaced \n by \r\n when sending the mail. * Done TODO #101: Changed Message; -setExtraProperty: forKey: to -setProperty: forKey. 2002-12-20 Ujwal S. Sathyam * Fixed bug where localFolderCacheManager was not being synced up after a MAILDIR expunge. 2002-12-17 Ludovic Marcotte * Modified the implementation of Store: -openedFoldersEnumerator in all Store classes (and the code depending on the previous implementation) to return the enumeration of the opened folders instead of just their names. 2002-12-16 Ludovic Marcotte * Added IMAPStore: -noop. * Modified IMAPStore: -folderForName: select: to return the opened folder (from openedFolders) if asked for. 2002-12-15 Ludovic Marcotte * Modified all the IMAP code to handle disconnections by the server. Also refactored some parts and fixed two mem leaks. * Added SMTP: -reset to reset the state of a SMTP session. 2002-12-14 Ludovic Marcotte * Added the Cc header to the list of prefetched headers in IMAP. * Modified IMAPCacheManager to invalidate all caches with version < 2. 2002-12-09 Ludovic Marcotte * Modified IMAPCacheManager -initWithCoder to correctly invalidate all caches with version < 2. * Modified IMAPFolder to remove the "Content-Type" header from the list of automatically fetched headers when caching everything. * Modified MimeUtility: +charsetForString so that if we haven't found a charset using our 'tables of charsets', before returning UTF-8, we at least try to convert our string to some encodings (for now, only NSISO2022JPStringEncoding). Path from Tomio Arisaka 2002-12-08 Ludovic Marcotte * Added MimeUtility: +stringFromRecipients: type: * Entirely rewrote the implementation of all 'search' functions in IMAPFolder, LocalFolder and POP3Folder. 2002-12-07 Ludovic Marcotte * Nearly entirely rewritten IMAP support. More changes are coming but a lot is already in there. * We now correctly update all MSNs after an expunge in IMAP. 2002-12-05 Ludovic Marcotte * Modified MimeUtility: +stringWithData: charset: so that if we aren't using Mac OS X, we treat ks_c_5601-1987 encoding as euc-kr. * Rewrote Sendmail: -sendMessageFromRawSource to use the Foundation classes instead of popen/fwrite/pclose. 2002-12-03 Pierre-Yves Rivaille * Source/Parser.m: replaced 21 by 20 in "Content-Description:" parsing. 2002-12-02 Ludovic Marcotte * Added the UUFile class to remove all AppKit dependencies in the MimeUtility class (was using NSFileWrapper). * Updated the OS X project file to add this class. * Refactored a little bit LocalFolder: -appendMessageFromRawSource: flags: and fixed potential mem leaks in case of an error. 2002-12-01 Ludovic Marcotte * Modified Message: -setHeadersFromData to use "From " instead of "From -". * Modified MimeUtility: -stringEncodingForCharset: to consider unknown-8bit as NSISOLatin1StringEncoding. * Modified LocalFolder and LocalMessage to replace all "FileName" ivar/method names to "Filename" to be consistent with the rest of Pantomime's source. 2002-11-30 Ludovic Marcotte * Modified Fixed LocalStore: -createFolderWithName: type: so that the newly created folder has the mode 700 instead of 755. * Modified Message: -setHeadersFromData so that we do NOT parse the headers already parsed in Part as unknown headers. 2002-11-29 Ludovic Marcotte * Refactored most of the POP3 code. * Removed some compiler warnings on OS X 10.2 * Updaded the project file to work with Project Builder v2.0.1. 2002-11-28 Ludovic Marcotte * Fixed LocalStore: -createFolderWithName: type: We weren't rebuiling our folder enumerator when successfully creating a folder. 2002-11-28 Ujwal S. Sathyam * NULL wasn't defined in POP3Folder, so I included a standard C header file like stdio.h. 2002-11-28 Ludovic Marcotte * Added support for SMTP over SSL and refactored the SMTP class. 2002-11-26 Ludovic Marcotte * Modified LocalFolder: -appendMessageFromRawSource: flags: to append the sender and the delivery date to the "From " line. * Removed POP3Folder: -transferMessagesToFolder: since this method is no longer used. 2002-11-20 Ludovic Marcotte * Removed MimeBodyPart from the CVS and the OS X project file * Added FolderInformation to the OS X project file * Modified the #include/#import directives so everything compile under OS X. * Added FolderInformation.h as a public header on OS X. * Added the NSRegEx class. * Added Folder: -searchForString: searchInContent: caseSensitive: matchRegEx: and implemented this method in ALL Folder subclasses. * Added NSRegEx to the OS X project file and also set its header to public. 2002-11-18 Ludovic Marcotte * Modified LocalFolder: -appendMessageFromRawSource: flags: so that we use the theFlags parameters. 2002-11-17 Ludovic Marcotte * Updated Headers/Pantomime/Constants.h to set the version number to 1.1.0. * Added IMAPStore: -folderStatus. This method needs some refactoring. * Added the FolderInformation class. This class will soon be used in all Store classes. 2002-11-15 Ludovic Marcotte * Modified Part: -dataUsingSendingMode so that inner parts always use the SEND_TO_FOLDER mode. * More fixes in the method to prevent corrupted attachments (\r\n being replaced by \r\r\n at the end of the method). 2002-10-31 Ludovic Marcotte * Replaced all #import calls by #include and guarded all headers against multiple inclusion. * Refactored some code in LocalStore. Fixed security issues regarding maildir mode. * Refactored IMAPStore. Added -_folderNameFromString: and modified -folderEnumerator and -subscribedFolderEnumerator to use that method. 2002-10-28 Ludovic Marcotte * Fixed the buffer overrun problem in striphtml() 2002-10-27 Ludovic Marcotte * Added DESTROY(delegate) calls in IMAPFolder: -close and -dealloc. 2002-10-26 Ludovic Marcotte * Modified Message: -forward and -replyWithReplyToAll: so that we deal better with messages w/o a Subject. * Added striphtml() and ent() to the MimeUtility class. Moved from GNUMail.app. * Added Message (Private): -_plainTextContentFromPart: and modified -replyWithReplyToAll: to correct get the plain/text content of a part (for example, if it was an html mail). 2002-10-22 Ludovic Marcotte * Added exception handlers when unarchiving POP3 and IMAP cache files. 2002-10-20 Ludovic Marcotte * Added missing #include (NSDebug.h) in TestCase.m 2002-10-19 Ludovic Marcotte * Modified Message: -replyWithReplyToAll: so that we verify that -receivedDate isn't nil before trying to append its string value to our mutable string. This was causing a segfault on OS X. 2002-10-12 Ludovic Marcotte * Added basic sorting support (ie., comparing category) in the Container class. 2002-10-08 Ludovic Marcotte * Fixed a bug in IMAPFolder: -prefetchMessageBodyWithUID. We were waiting for a TCP timeout if we had a message with an empty body. 2002-10-05 Ludovic Marcotte * Fixed a bug in Message: -forward. We are now verifying that we really got a Date field before trying to append its description. 2002-10-02 Ludovic Marcotte * Modified NSStringExtensions and Folder to support "RE :" as a valid prefix and not only "RE:". This should be enhanced again (speedwise and feature-wise). * Fixed a bug in POP3Store that would prevent messages from being transferred when using POP3 over SSL. 2002-10-01 Ludovic Marcotte * Disabled the creation of empty nodes when threading by subject for now. * More fixes to the message threading code. 2002-09-30 Ludovic Marcotte * Improved message threading support. 2002-09-23 Ujwal S. Sathyam * Removed duplicate entry for ChangeLog from PB project. Hadn't realized that it was already there in the Documentation sub-group. 2002-09-23 Ludovic Marcotte * Modified Folder: -thread so that if we don't have a Message-ID for a message (which is utterly b0rken), we create a container for this message and we place it in the root set. 2002-09-22 Ujwal S. Sathyam * Bug fixes for LocalFolder when deleting and renaming maildir stores. Now accounting for OS X's ".DS_Store". * Added some method declarations for Container and Folder to remove compiler warnings. 2002-09-20 Ludovic Marcotte * Modified the previous commit to remove some compilation warnings, respect indentation style and some minor other things. * Added Ujwal as a co-author for LocalFolder due to his important contributions with maildir support. * Added a new class - Container, used for message threading. * Modified Folder and other classes to implement JWZ's message threading algorithm. * Updated the OS X project file. * Some refactoring in all Store subclasses and bugs fixing. 2002-09-20 Ujwal S. Sathyam * Todo #79: added maildir support. Seems to work fine, but needs more testing. 2002-09-14 Ludovic Marcotte * Updated the OS X's project file. 2002-09-13 Ludovic Marcotte * Modified the call to NSSearchPathForDirectoriesInDomains in IMAPStore and POP3Store to expand the tilde in the path. 2002-09-12 Ludovic Marcotte * Modified MimeUtility: +stringEncodingForCharset so that if we get x-unknown, we assume it is NSISOLatin1StringEncoding in order to prevent some lame bugs in other MUA like Pine 4.21. 2002-09-09 Ludovic Marcotte * Changed the version number in Constants.h to 1.0.6 * Removed entirely the class GSMD5 and added (complete rewrite by me) the class MD5 using some public domain code in md5.c from Colin Plumb. * Modified all the code to use the new MD5 class instead of the old (and removed GSMD5) class * Fixed SMTP CRAM-MD5 authentication. It now works perfectly. * Merged md5.c/.h in the MD5 class and removed those files. This was causing problems on OS X using HFS+ since it's not case sensitive. * Replaced GSMD5.h by MD5.h in Pantomime.h. * Added Pantomime.h in the GNUmakefile for GNUstep and also recoded the file from ibmpc to latin1. 2002-09-08 Ludovic Marcotte * Refactored some code in Parser. * Optimized NSStringExtensions: -stringFromQuotedString and refactored some code. 2002-09-07 Ujwal S. Sathyam * Fixed Parser:+ _parameterValueUsingLine: range: Key-value pairs with spaces between key and value were not being parsed properly. 2002-09-05 Ludovic Marcotte * Set the CVS tag to v1_0_5 * RELEASED v1.0.5 2002-08-20 Ludovic Marcotte * Modified IMAPFolder: -prefetch so that if our cached entry had the ANSWERED flag for a specific message, wet it back to the new Flags object. This is a temporary solution before the complete IMAP rewrite. * Changed all calls from bzero() to memset(). 2002-08-19 Ludovic Marcotte * Fixed IMAPFolder: -expunge. We weren't calling EXPUNGE on the IMAP server. That would cause problems if we would compact a mailbox and receive new mails right after (deleted mails where shown again). 2002-08-14 Ujwal S. Sathyam * IMAPFolder.m: -appendMessageFromRawSource: enclosing folder name in double quotes. 2002-08-14 Ludovic Marcotte * Added LocalStore (Private): _enforceFileAttributes and _enforceMode: atPath: so that for a local store, we ensure that the path to the local store has the 0700 mode and all its subfolders have 0700 and all mboxes have 0600. 2002-08-10 Ludovic Marcotte * Modified MacOSXGlue.h to define the NSDebugLog variadic macro. * Modified the OS X project file so that we use the traditional cpp. (added --traditional-cpp to the CFLAGS) 2002-08-09 Ludovic Marcotte * Added Message: -references/-setReferences: and also modified LocalFolder.m and Parser.m to parse the "References:" header value. More work to come on this in order to allow message threading. 2002-08-08 Ludovic Marcotte * Replaced all NSLog() calls for NSDebugLog(). I need to implement NSDebugLog() on OS X. 2002-08-04 Ludovic Marcotte * Added IMAPFolder: -delegate/-setDelegate and modified IMAPFolder: -_newMessagesHaveArrived so that if the delegate isn't nil and responds to newMessagesWereReceived:, we perform that selector. 2002-08-02 Ujwal S. Sathyam * Fixed bug in IMAP folder selection. When the folder name had a space it, it would break. Now enclosing the folder name in double quotes. 2002-08-01 Ujwal S. Sathyam * Fixed bug in IMAP folder subscription and un-subscription. When the folder name had a space it, it would break. Now enclosing the folder name in double quotes. 2002-07-31 Ludovic Marcotte * Added Message: -extraPropertyForKey and -setExtraProperty: forKey: to be able to get and set extra properties for messages. This is used, for example, in the PGP bundle of GNUMail.app. * *** NOTE *** You must recompile entirely Pantomime after upgrading (do a full distclean before compiling it). 2002-07-29 Ludovic Marcotte * Modified MimeUtility: +isASCIIString to return YES if the argument is nil. * Modified Part: -dataUsingSendingMode: to NOT add the Content-Transfer-Encoding if it's equal to NONE. * Modified Part: -dataUsingSendingMode: to REUSE the boundary if it was already defined. If it wasn't, we generate one. * Added Part: -protocol / -setProtocol: and modified -dataUsingSendingMode: to add the protocol if required. * Modified Part: -dataUsingSendingMode: to better manage encoding of application/* parts. * *** NOTE *** You must recompile entirely Pantomime after upgrading (do a full distclean before compiling it). 2002-07-24 Ludovic Marcotte * Added Connection: -isConnected. Implemented this method in TCPConnection and TCPSSLConnection so we can now safely if we're still connected to the foreign host. * Added a check to see if the connection is valid in POP3Store: -authenticateWithUsername: password: since some very lame POP3 servers might drop the connection if the APOP auth has failed. * Added MimeMultipart: -removeBodyPart so it is now possible to remove a MimeBodyPart object from a MimeMultipart. 2002-07-10 Ludovic Marcotte * Added some little fixes in TCPConnection.m and LocalFolder.m so that everything compiles fine under Solaris. 2002-07-09 Ludovic Marcotte * Fix in Message: -forward and -replyWithReplyToAll: so that we don't try the create a NSString object if the part isn't a NSData object. This could happen in multipart/alternative parts that had a text/plain Content-Type but a base64 Content-Transfer-Encoding. 2002-07-05 Ludovic Marcotte * Removed all test cases in .c files since we are never gonna use them. 2002-07-02 Ludovic Marcotte * Added a (temporary?) fix to Message: -init so that we always initialize our flags object with the RECENT flag on instead of no flags at all. 2002-06-15 Ludovic Marcotte * Modified Constants.h to set the version number to 1.0.5 2002-05-30 Ludovic Marcotte * Set the cvs tag to v1_0_4 * RELEASED v1.0.4. 2002-05-29 Ludovic Marcotte * Increased the default timeout value from 30s to 60s in TCPConnection.m. 2002-05-21 Ludovic Marcotte * Added Message: -setRawSource so we can properly set the rawSource ivar when we want to. 2002-05-20 Ludovic Marcotte * Updated the version number in the OS X project file to 1.0.4. 2002-05-19 Ludovic Marcotte * Added a patch from Vincent Ricard to POP3Folder and SMTP so that we deal better with lines containing a single dot. Slightly modified the patch so it's faster. 2002-05-19 Pierre-Yves Rivaille * Source/POP3Folder.m ([POP3Folder -expunge:]): delete the messages on the POP3Server according to the leaveOnServer and retainCount value. 2002-05-09 Francis Lachapelle * Fixed bug in SMTP that could happen when sending a message containing the character sequence ".". 2002-05-09 Ludovic Marcotte * Added three new constants: PantomimeReadTimeoutException, PantomimeStopException and PantomimeWriteTimeoutException. * Refactored SMTP a lot to avoid handling exceptions inside this class. They are now propagated to the caller. GNUMail.app, for example, now handles everything perfectly. * Did the same refactoring to POP3Store/POP3Folder. 2002-05-08 Ludovic Marcotte * Added URLName: -stringValue. * Modified IMAPFolder: -prefetch to add the DELETED flag to the flags obtained from our server if it was present in the cache. 2002-05-06 Ludovic Marcotte * Fixed a bug in SMTP: -decodeMaxSizeAllowedFromString. We weren't verifying properly if the server were sending us a value to the SIZE parameter. It would generate an index exception and we wouldn't be able to send the desired mail. * Removed a NSLog() calls and fixed some typos. 2002-05-05 Ludovic Marcotte * Added a patch from Vincent Ricard to support the SMTP SIZE extension (RFC1870). This patch also replaces bzero() calls by memset() class in TCPConnection. Modified slightly this patch before applying it to fix some var names, mem leak, etc. * Added rfc/rfc1870.txt. 2002-05-04 Ludovic Marcotte * Modified TCPConnection to add -setStopTarget and -setStopSelector. This selector is called quite often on the target to ensure that we don't forget to generate the PantomimeStopException. * Modified POP3Folder and SMTP to handle better the exceptions. More work needs to be done here. NOTE that more commits are to come to MAKE THINGS MORE STABLE. 2002-05-01 Ludovic Marcotte * Fixed a bug in Message: -replyWithReplyToAll:. If the initial decoding phase for the text/* part would fail, Pantomime would set the content as a NSData object (which is the raw source of the part). We were trying to use this part as a NSString object since we were expecting a a valid text/* part all the time. * Added Folder: -showRead/-setShowRead. 2002-04-29 Ludovic Marcotte * Modified Message: -dataUsingSendingMode to NOT add the <> in the In-Reply-To header. 2002-04-27 Ludovic Marcotte * Changed the version number to 1.0.4 in Constants.h 2002-04-26 Ludovic Marcotte * Set the CVS tag to v1_0_3 * RELEASED v1.0.3. 2002-04-25 Ludovic Marcotte * Modified POP3Folder: -prefetchMessageAtIndex to NOT append the X-UID header anymore. * Fixed a bug in last commit. * Fixed a bug in MimeUtility: +wrapPlainTextString: usingWrappingLimit: we were not verifying that the length of the line was > of the index j when removing any leading white spaces (if any). So the code was breaking if we had a single line with only ">" on it. 2002-04-25 Francis Lachapelle * Reversed for-loop in method expunge of class IMAPFolder to fixed possible bug when deleting messages. * Fixed possible problem with deleted messages in method expunge in class LocalFolder. 2002-04-24 Ludovic Marcotte * Modified MimeUtility: +stringEncodingForCharset to return NSISOLatin1StringEncoding when the charset is "x-user-defined" to prevent a bug from some versions Outlook. 2002-04-23 Ludovic Marcotte * Modified IMAPStore: -initSSLWithName: port: and POP3Store: -initSSLWithName: port: to add the NSUserDomainMask in the search path. * Fixed a retain bug in URLName: _decodeIMAP for the username. * Added a TCPSSLConnection target to the OS X project file. You need to have OpenSSL installed to compile it (from the Fink project). 2002-04-22 Ludovic Marcotte * Added Folder: -numberOfTransferredMessages and modified LocalFolder: -appendMessageFromRawSouce: to use [self count] + [self numberOfTransferredMessages] + 1 instead of [self count] + 1 since we can mark messages as transferred and append messages to a folder after and it'll get the 'wrong' message number. 2002-04-21 Ludovic Marcotte * Added Folder: -numberOfUnreadMessages and Folder: -size. 2002-04-19 Ludovic Marcotte * Modified MimeUtility: +allCharsets to remove iconv from the list. We will rather provide a list later that iconv supports. * Modified MimeUtility: +compositeMultipartContentFromRawSource: ... to set the size of the new mime body part object to the length of the data object (ie., its content). * Modified MimeUtility to add "support" of gb2312 and shift_jis charsets on OS X. 2002-04-18 Ludovic Marcotte * Modified the Service protocol to add a -username accessor. Modified all classes (POP3Store, IMAPStore and SMTP) implementing this protocol to return the username if one exist (defined when authenticating). Also refactored some code in those classes. * Added username support to URLName for IMAP URLs. * Minor change to SMTP: -dealloc to avoid a compiler warning. 2002-04-17 Ludovic Marcotte * Enhanced a lot MimeUtility: -allCharsets to that it's now way more descriptive and consistent. * Done TODO #89. Addded [Part -initWithData: charset:] so that people can chose which charset to fallback to when none has been specified for 8-bit message. * Fixed a bug in MimeUtility: +decodeBase64. We weren't verifying if our data object had a length > 0. * Fixed Part: -init to not set the defautl charset to nil. * Added Headers/Pantomime/Connection.h. This file defines the Connection protocol implemented in TCPConnection and TCPSSLConnection (the bundle). Cleaned all the code that was using TCPConnection to avoid a lot of compiler warnings. * Added Connection.h to the OS X project file. * Added the WINDOWS_1250, 1253 and 1254 classes to the OS X project file. * Defined the _() macro in Constants.h 2002-04-16 Ludovic Marcotte * Added support for the Windows-1250, Windows-1253 and Windows-1254 charsets. Modified all the files that are related to use them. * Modified MimeUtility: +discreteContentFromRawSource.. to correctly set the Part size when decoding a base64 encoded part - for now. * Modified Message: -forward to set the correct size to all parts contained in our forwarded message. 2002-04-15 Ludovic Marcotte * Modified LocalFolder: -expunge to break the look when a write error occurs instead of continuing it for no good reason. * Modified LocalFolder: -appendMessageFromRawSource to not synchronize the cache after each message append. * Modified the makefile to use ${MAKE} instead of make directly. Suggestion by Chris B. Vetter . 2002-04-14 Ludovic Marcotte * Modified MimeUtility: +stringEncodingForCharset to use the CoreFoundation under OS X to support way more encodings. * Added the CoreFoundation framwork to the OS X project file. * Modified MimeUtility: +stringEncodingForCharset to define our CFStringEncoding for most charsets. * Removed the use of a local autorelease pool in MimeUtility: +isASCIIString. * Added Bundles/SSL/.cvsignore. * Added ISO-2022-JP and EUC-JP support to MimeUtility: +stringEncodingForCharset: * Added a "dumb" implementation of SMTP: -initSSLWithName: port:. 2002-04-13 Ludovic Marcotte * Fixed TCPSSLConnection to allow big read/write operations. * Added timeout support to TCPSSLConnection when establishing connections and refactored TCPConnection to remove old code. * Removed TODO #91. * Added SSL support to POP3Store. 2002-04-12 Ludovic Marcotte * Done TODO #90. Optimized TCPConnection by rewriting -_readByte and -_writeByte and modified the code everywhere to use the new -_readBytes: length: and -_writeBytes: length: methods. * Added Service: -initSSLWithName: port: and implemented this method in IMAPStore. * Added Bundles/SSL/TCPSSLConnection. This allows Pantomime to use a SSL version of the TCPConnection class. Currently, only IMAPStore was modified to use it. It's pretty trivial to modify the other classes to support it to. This class should be enhanced in the future to allow multiplexed I/O and also to be able to verify certificates. 2002-04-10 Ludovic Marcotte * Fixed a bug in IMAPFolder: -appendMessageFromRawSource: flags:. We weren't nooping first. * Also added flags support for this method. We now consider the flags argument. * Modified IMAPStore: -folderForName: select: to return nil if the folder is already open. 2002-04-09 Francis Lachapelle * Improved the follwing methods of MimeUtility based on Alexander Malmberg patch: - unwrapPlainTextString:usingQuoteWrappingLimit: - wrapPlainTextString:usingWrappingLimit: - quotePlainTextString:quoteLevel:wrappingLimit: and removed method _breakWord. 2002-04-09 Ludovic Marcotte * Fixed a bug in MimeUtility: +stringWithData: charset: when freeing our o_bytes buffer if the iconv conversion failed and also fixed the leak of closing properly the iconv descriptor in case of a failure too. 2002-04-07 Ludovic Marcotte * Changed MimeUtility: +fileWrapperFromUUEncodedString to use -dataWithCapacity instead of -dataWithLength. * Added a patch from Alexander Malmberg to speed up the charset guessing mechanism. * Regenerated all charset classes. 2002-04-06 Ludovic Marcotte * Modified Parser: +parseMessageID: inMessage to not trim the <> in Message-ID header value. * Added robustness to POP3Folder so that we handle quite well TCP timeout and we manage transferred messages vs messages with which we had an error quite well. 2002-04-05 Ludovic Marcotte * We now correctly release the folderSeparator ivar in IMAPStore in -dealloc. * Modified LocalStore: -folderEnumerator to hide .DS_Store directories. * Modified IMAPStore: -renameFolderWithName: toName: to re-subscribe to the folder if the renamed operation failed. * Added MimeUtility: +allCharsets. This method returns an array of all "supported" charsets by Pantomime when sending messages. 2002-04-04 Ludovic Marcotte * Added Store: -folderSeparator and implemented this method in IMAPStore, POP3Store and LocalStore. 2002-04-03 Ludovic Marcotte * Fixed a bug in IMAPFolder: -expunge. We weren't removing the deleted mesasges from the array of "existing" messages. 2002-04-02 Ludovic Marcotte * Refactored the IMAPFolder class. * Modified IMAPFolder and LocalFolder: -appendMessageFromRawSource: flags: to generate a PantomimeFolderAppendMessageException in case if an error occured while appending a message from RAW source to Local or IMAP folder. * Modified POP3Folder: -transferMessagesToFolder to handle this exception. 2002-04-01 Ludovic Marcotte * Modified LocalStore: -createFolderWithName to support the creation of hierarchical folders. * Modified LocalStore: -deleteFolderWithName to support the deletion of hierarchical folders. * Added Store: -renameFolderWithName: toName:. Implemented it in POP3Store. * Implemented -renameFolderWithName: toName: in LocalStore. * Implemented IMAPStore: -deleteFolderWithName: * Implemented IMAPStore: -createFolderWithName: and -renameFolderWithName: toName: * Removed the use of a cached version of subscribed folders since it leads to errors and adds complexity for no good reason. * Modified IMAPFolder: -close to call IMAPStore: -removeFolderFromOpenedFolders:. * Fixed a bug in IMAPStore: -folderTypeForFolderName. We weren't read the OK .. response following our command. 2002-03-31 Ludovic Marcotte * Modified IMAPStore: -subscribedFolderEnumerator and -folderEnumerator to unquote folder names if they are quoted (Courier-IMAP does that). 2002-03-30 Ludovic Marcotte * Added IMAPStore: -subscribeToFolderWithName and -unsubscribeToFolderWithName. * Implemented IMAPFolder: -appendMessageFromRawSource: and appendMessageFromRawSource: flags: (w/o flags support right now) * Added IMAPStore: -folderForName: select: to be able to have a IMAPFolder w/o selecting it on the IMAP server. It's very useful in case we just want to append a message to an IMAP folder. * Added a quick and dumb implementation to IMAPStore: -folderTypeForFolderName. * Fixed a bug in IMAPStore: -subscribedFolderEnumerator. * Added URLName: -initWithString: path: so that we can use a predefined path (useful for Local). 2002-03-29 Ludovic Marcotte * Modified LocalStore: -folderEnumerator so that it now works correctly for hiding cache/summary files in subfolders. * Modified MimeUtility.m to only import iconv.h if HAVE_ICONV is defined. 2002-03-27 Ludovic Marcotte * Moved more generic methods to the Store protocol. Implememted them in LocalStore and POP3Store. Implemented them partially in IMAPStore. * Implemented IMAPStore: -folderEnumerator and -subscribedFolderEnumerator. 2002-03-26 Ludovic Marcotte * Moved -folderForNameIsOpen: to the Store protocol. Implemented it in POP3Store and provided a dumb implementation in IMAPStore. * Added Store: -folderTypeForFolderName:. Implemented this method in POP3Store and LocalStore. Provided a dumb implementation in IMAPStore. * Removed MimeUtility: +foldStringUsingSoftLineBreaks: length: since we no longer need this method. 2002-03-25 Ludovic Marcotte * Updated Constants.h to set the version number to 1.0.3 * Done TODO #88. Added iconv support to Pantomime (MimeUtility: +stringWithData: charset:. This is an initial implementation. 2002-03-24 Ludovic Marcotte * Modified POP3Store, POP3Folder and SMTP to use NS_VALUERETURN() when leaving the exception handling domain. * Set the CVS tag to v1_0_2 * RELEASED v1.0.2. 2002-03-22 Ludovic Marcotte * Added exception handling support in POP3Store: -authenticateWithUsername: password: -responseFromServerIsValid: and -close. * Same thing for POP3Folder for the methods: -deleteMessageAtIndex: -count -readUID and -readLength * Modified IMAPStore: -close to call [[self tcpConnection] close]. * Did the same thing in POP3Store: -close. This is just 'safe' to do that. 2002-03-20 Ludovic Marcotte * Done TODO #88. Added test cases for Pantomime and also a simple testing framework from Alexander Malmberg . * Did some cleanups everywhere for the next release. * Modified IMAPMessage: -setInitalize to release the content if the flag is NO. Also assign the ivar to nil after. Did the same thing for LocalMessage. 2002-03-17 Ludovic Marcotte * Modified the OS X project file to include URLName.h in the list of public headers. * Added more code to the URLName class and also implemented the missing methods from the Store protocol for URL handling in POP3Store and IMAPStore. * Updated Testing/Pantomime.m * Updated the README (need to write the section on how to compile Pantomime under Apple Mac OS X). * Done TODO #65. Added uudecode support to MimeUtility. Added two methods: +fileWrapperFromUUEncodedString: and +rangeOfUUEncodedStringFromString: range: Those methods haven't been. More work is coming for them. * Fixed a memory leak in MimeUtility: +encodeWordUsingQuotedPrintable: prefixLength: * Reactivated MimeUtility: +encodeWordUsingBase64: prefixLength: * Added the missing flags support in the IMAP mode. Modified IMAPFolder: -parseMessageFlagsFromString. 2002-03-16 Ludovic Marcotte * Added more code to the URLName (for Local and IMAP parsing) * Added Store: -initWithURL and -folderForURL. Implemented those two methods for LocalStore. 2002-03-15 Ludovic Marcotte * Modified SMTP: -initWithName: port: to handle read/write timeouts when establishing the connection with the SMTP server. We return nil in that case. * Added a new class - URLName. This call will be used to support Local/IMAP/POP3 URL scheme. Did an initial implemenation (mostly a skeleton). * Added the URLName class to the OS X project file and modified some files so that everything compiles cleanly under OS X. 2002-03-14 Francis Lachapelle * Added missing header (NSArray) in NSDataExtensions.h 2002-03-14 Ludovic Marcotte * Added SMTP AUTH support to SMTP. We currently support PLAIN, LOGIN (tested) and CRAM-MD5 (untested, if you have a server supporting this, please contact me!) (TODO #49). 2002-03-12 Ludovic Marcotte * Refactored TCPConnection. Added -_readByte and -_writeByte. All other read/write methods use those two non-blocking methods (TODO #83). Also fixed some little bugs and a memory leak in case of a failure. 2002-03-11 Ludovic Marcotte * Done some minor cleanups in MimeBodyPart.m * Fixed a bug in IMAPFolder (Private): _replaceCRLFInMutableData:. * Added NSDataExtensions: insertCString: atIndex. * Added a patch from Alexander Malmberg to NSDataExtensions: -cString so we don't lose any information while creating the cString reprensetation of a NSData object. * Modified LocalFolder: -appendMessageFromRawSource to NOT use a temporary NSString object using a latin1 encoding. That was slowing things down a lot. * Refactored a lot NSDataExtensions. Optimized some parts also. 2002-03-08 Ludovic Marcotte * Added versionning support to POP3CacheObject. Also added a date ivar and two accessors (-setDate/-date) * Added POP3Folder -setRetainPeriod/-retainPeriod and modified POP3Folder -prefech to delete messages that have a difference of 'retainPeriod' days between the current date and the date when they were first fetched. * Modified Message: -replyWithReplyToAll to NOT include the sender's signature in the newly created message. 2002-03-07 Ludovic Marcotte * Added a patch from Alexander Malmberg to return the 'raw data' of a part if it can't be decoded properly. * Added a patch from Alexander Malmberg to set the string of an address that can't be parsed to the personal part of an InternetAddress. * Modified LocalStore to NOT compare folder names in a case insensitive way since we want to support for example, a folder called 'Test' and 'test' in a distinc way. 2002-03-06 Francis Lachapelle * Removed unsupported encodings in MimeUtiliy.m (for Mac OS X) * Added import of NSDataExtensions.h and Constants.h in NSDataExtensions.m 2002-03-06 Ludovic Marcotte * Modified the Part class to properly encode the filename if it's not a pure ASCII string. It'll automatically encode it using QuotedPrintable and the right charset (guessed). 2002-03-04 Ludovic Marcotte * Refactored MimeUtility: +unfoldLinesFromData. * Refactored MimeUtility: +encodeBase64: lineLength: and fixed a memory leak. * Refactored MimeUtility: +encodeQuotedPrintable: lineLength: inHeader: * Refactored MimeUtility: +generateBoundary * Refactored MimeUtility: +generateOSID * Fixed a mem leak in MimeUtility: +encodeHeader * Removed unused code in MimeUtility: +encodeHeaders: usingCharset: encoding: * Added Part: -lineLength/-setLineLength to be able to specify the length limit when format of the mail is flowed. * Modified Part: -dataUsingSendingMode to format the mail as flowed is it has been specified to do so (using the right line length). * Refactored MimeUtility: +decodeHeader. * Modified POP3Folder: -prefetchMessageAtIndex to use the local autorelease pool at the very beginning of the method. 2002-03-03 Ludovic Marcotte * Added a patch from Alexander Malmberg . Added the NSDataExtensions class. This patch allows Pantomime to support 8bit messages. Modified the patch (refactored some parts and fixed some little bugs). This needs more work but this is an excellent starting point. The OSX port will need to be updated since this code won't work right now under OSX. Some of the API was changed and will need to be documented. In general, the library should 'behave' pretty much the same as it did before, minus the minor changes in the APIs. 2002-02-27 Ludovic Marcotte * Modified Contants.h to set the version number to 1.0.2. 2002-02-26 Ludovic Marcotte * Added a patch by Alexey I. Froloff so that we deal better with text/* parts encoded in base64. We now return those parts ONLY as a NSString object. * Set the CVS tag to v1_0_1 * RELEASED v1.0.1 2002-02-25 Francis Lachapelle * Updated Project Builder file to version 1.0.1. 2002-02-23 Ludovic Marcotte * Added RFC2384 (POP3 URL Scheme) and a TODO 2002-02-22 Ludovic Marcotte * Fixed some RETAIN/AUTORELEASE bugs in MimeUtility if the initial conditions for some methods were not met. Patch from Alexander Malmberg . * Added rfc/rfc2192.txt (IMAP URL Scheme) and a TODO 2002-02-21 Ludovic Marcotte * Added MimeUtility: +stringEncodingForPart to be able to get the best string encoding for a NSString object that will be used to represent a specific part. * Added the support for the Windows-1252 charset. * Modified Parser: +parseDestination: forType: inMessage: to decode the possibly encoded personal value of an InternetAddress object. * Fixed little bugs in CharsetDecoder.m and updated the update_sets.sh script. * Updated the OSX project file to include the new WINDOWS_1252 class. 2002-02-20 Ludovic Marcotte * Changed the return type of Store: -folderForName and -defaultFolder from Folder * to id. Modified the classes implementing the Store protocol for those changes. * Changed IMAPStore to return IMAPFolder * instead of Folder * for -folderForName: prefetch: and -folderForName: withIMAPCacheManager: * Changed POP3Store to return POP3Folder * instead of Folder * for folderForName: prefetch: 2002-02-19 Ludovic Marcotte * Modified LocalFolder: -parse to output useful logs when the cache is used or needs to be build. * Modified MimeUtility: -encodeWordUsingBase64 to return the received string (as argument) if it doesn't need to be encoded. * Cleaned some comments in MimeUtility.m 2002-02-17 Ludovic Marcotte * Moved LocalFolder.h: - (void) appendMessageFromRawSource: (NSString *) theString; in Folder.h. * Added LocalFolder: -appendMessageFromRawSource: flags: to be able to transfer a message from a raw source with a set of flags. * Fixed some #import / @class in the Folder class. * Added Folder: -updateCache to update the cache 'hidden' in the Folder class in case messages have been transferred and we want to hide right now those messages. * Added NSCopying support to the Flags class. Also added -initWithFlags: (int) theFlags. 2002-02-16 Ludovic Marcotte * Fixed some missing #imports in Pantomime.h * Modified Folder: -setShowDeleted to TEST_RELEASE our allVisibleMessages array before setting this ivar to nil. * Fixed a bug in LocalFolder: -expunge. We were NOT adding the message separator (\n) after each messages. 2002-02-15 Ludovic Marcotte * Optimized Folder: -allMessages. We now use a 'ghost' array (allVisibleMessages) so that we don't have to recreate it everytime Folder: -allMessages is called. * Modified Folder: -appendMessage to also append the message to our allVisibleMessages array if it exists. * Did the same thing for Folder: -removeMessage. * Modified Folder: -setMessages to release the allVisibleMessages array if it does exist. We also set this ivar to nil after. * Modified Folder: -messageAtIndex to use [self allMessages] instead of the allMessages ivar directly. 2002-02-15 Francis Lachapelle * Modified the method replyWithReplyToAll of Message so it uses the method quotePlainTextString from the class MimeUtility. * Improved methods: quotePlainTextString (added conditional space char insertion); unwrapPlainTextString (fixed wrong quoted block insertion location); wrapPlainTextString (added proper space-stuffing). 2002-02-15 Ludovic Marcotte * Added Folder: -numberOfDeletedMessages. This method returns the number of deleted messages in a folder. 2002-02-14 Ludovic Marcotte * Modified TCPConnection: -writeLine / -writeString to return YES on success and NO on error. Suggestion by Luis Garcia Alanis 2002-02-14 Pierre-Yves Rivaille * New Message methods to support sorting by size 2002-02-14 Ludovic Marcotte * Modified Message (Sorting) to use compareAccordingToNumber instead of reverseCompareAccordingToNumber in compareAccordingToDate. 2002-02-13 Francis Lachapelle * Updated Project Builder file: added LocalFolderCacheManager; added KOI8_R and KOI8_U; added WINDOWS_1251. 2002-02-13 Ludovic Marcotte * Modified LocalFolder: -appendMessageFromRawSource to only initialize the message from the headers and not entirely. This speedups things a lot and uses far less memory. * Cleaned A LOT the Folder class and it's subclasses. Removed the -setCount method and moved generic implementation of most methods (cout, messageAtIndex, etc) in the Folder class and removed them from their subclasses. * Implemented LocalFolder: -expunge. * Modified LocalStore: -deleteFolderWithName to also remove the cache when deleting a folder. * Some bug fix for Message's comparing methods. Patch from Pierre-Yves Rivaille . * Added a fix to support nil dates for the Sorting Message's category. 2002-02-12 Ludovic Marcotte * Done more work on caching support for local folders. * Added a patch from Pierre-Yves Rivaille to support comparisons in the Message class. 2002-02-11 Ludovic Marcotte * Added coding support to LocalMessage. * Added the LocalFolderCacheManager class. This is an initial implementation. * Added support for caching for local mboxes. This support is currently BROKEN and YOU SHOULD NOT USE PANTOMIME right now. 2002-02-08 Ludovic Marcotte * Modified LocalStore: -folderEnumerator to NOT return Netscape Mail's summary files when enumerating mboxes. * Modified the license in all .m files from GPL to LGPL. That was a mistake due to "copy & paste". The lib was always under LGPL so nothing changes. * Done the same thing with all .h files. 2002-02-07 Ludovic Marcotte * Added a patch from Sir Raorn for koi8-r, koi8-u and windows-1251 charsets (cyrillic) support. 2002-02-04 Ludovic Marcotte * Modified Constants.h to set the version number to 1.0.1. 2002-01-30 Ludovic Marcotte * RELEASE OF 1.0.0 * Set the CVS tag to v1_0_0 2002-01-28 Ludovic Marcotte * Modified MimeUtility: +decodeStringFromQuotedPrintable: charset: to add an handler for exceptions. 2002-01-27 Ludovic Marcotte * Added a local autorelease pool in MimeUtility: +charsetForString. 2002-01-26 Ludovic Marcotte * Added local autorelease pool in MimeUtility: +isASCIIString, +encodeText: usingCharset: encoding: and +foldStringUsingSoftLineBreaks: length: * Optimized SMTP: -sendMessageFromRawSource. * Moved the TEST_RELEASE(pool) in MimeUtility: +encodeText: usingCharset: encoding: after the for loop. That was causing a segfault. 2002-01-25 Ludovic Marcotte * Added version control support to IMAPCacheManager and modified -initWithCoder so we can safely discard IMAP caches from previous releases of Pantomime. 2002-01-24 Ludovic Marcotte * Modified MimeUtility: +discreteContentFromRawSource: usingContentTransferEncoding: charset: to accept the part parameter and enabled the decoding of the content format=flowed in this method using MimeUtility: +unwrapPlainTextString: usingQuoteWrappingLimit:. * Added missing @end at the end of the public Message implementation. * Modified POP3Folder: -prefetchMessageAtIndex so that we verify if we get the Status: header while receiving our message. If we don't, we just add it. * Done TODO #84. Changed -setFileName and -fileName to -setFilename / filename everywhere. 2002-01-23 Ludovic Marcotte * Modified Message: -replyWithReplyToAll so that we when we verify for text parts, we verify for text/plain, text/enriched and text/html instead of text/* in case for example, we have a text/x-vcard or anything else. * Modified TCPConnection: -readLineBySkippingCR to increase our buffer to 4096 chars and also added an extra verification on the aString local var to not call -length on it if it's nil. 2002-01-22 Ludovic Marcotte * Renamed Folder: -removeTransferredMessage to -removeMessage and modified IMAPFolder the same way. * Modified MimeUtility: -compositeMultipartContentFromRawSource: usingBoundary: to separate our components by "\n--" instead of "--". * Modified MimeBodyPart: -initWithString to sent the length of the range for the bodyString to [theString length] - aRange.location - 2 instead of [theString length] - aRange.location - 3. 2002-01-21 Ludovic Marcotte * Added a private category to IMAPFolder and defined: - (void) _replaceCRLFInMutableString: (NSMutableString *) theMutableString in it in order to ease the replace operation of \r\n by \n. * Fixed a bug IMAPFolder: -prefetchNewMessagesStartingAtUID. We were NOT replacing \r\n by \n in our headers so that headers will have wrong values (all ending by a \r). You MUST again remove your IMAP cache since the old copy probably contains wrong serialized headers. 2002-01-20 Ludovic Marcotte * Modified Part.m to not rely on subclasses for most methods and added NSCoding support. * Modified MimeBodyPart to remove unused methods. * Added NSCoding support to MimeBodyPart. * Added NSCoding support to Message. * Modified IMAPCacheObject to use a Message ivar instead of a dictionnary of headers. * Modified IMAPFolder to use the new IMAPCacheObject. * YOU MUST REMOVE ALL YOUR IMAP CACHE FILES BEFORE USING THIS NEW CODE. Just rm -f ~/GNUstep/Library/GNUMail/IMAPCache* (or rm -f ~/Library/GNUMail/IMAPCache* under OS-X) * Added a Private category to message and moved the method formatRecipientsWithType in it (renamed _formatRecipientsWithType). 2002-01-19 Ludovic Marcotte * Modified IMAPFolder: -prefetch to remove from the cache to objects (ie., messages) that have been deleted from the IMAP server. Patch written with Anthony W. Juckel . * Modified Message: -replyWithReplyToAll to verify the encoding of a text/* part when searching for one in a multipart/alternative body part in case it was base64 encoded. We don't assume it's a NSString anymore. * Did the same thing in Message: -forward. * Corrected the ivar headers type in IMAPCacheObject (it was a NSString instead of a NSDictionary) and changed the parameter type of -setHeaders (same mistake). * Added NSCoding support to Flags. * Refactored a little bit Part.h 2002-01-18 Ludovic Marcotte * Included a patch from Anthony W. Juckel to implending encoding/decoding support in InternetAddress. Also, the patch modifies IMAPCacheObject to serialize the headers as a NSDictionnary instead as a string - this should make things faster when opening the cache. The patch also cleans some method names in Message so we don't confuse -initWithHeaders / -initWithHeadersFromString methods (same thing with -setHeaders / -setHeadersFromString). Modified SMTP.m to use -setHeadersFromString instead of -setHeaders. YOU MUST REMOVE ALL YOUR IMAP CACHE FILES BEFORE USING THIS NEW CODE. Just rm -f ~/GNUstep/Library/GNUMail/IMAPCache* (or rm -f ~/Library/GNUMail/IMAPCache* under OS-X) 2002-01-17 Francis Lachapelle * Fixed wrong releases in method wrapPlainTextString of MimeUtility. 2002-01-17 Ludovic Marcotte * Modified Contants.h to add PANTOMIME_VERSION and to set it to 1.0.0. * Modified Message.m to set the Pantomime version number to use PANTOMIME_VERSION. 2002-01-15 Ludovic Marcotte * Modified MimeUtility: +unwrapPlainTextString: usingQuoteWrappingLimit: +wrapPlainTextString: usingWrappingLimit: +quotePlainTextString: quoteLevel: wrappingLimit: to use a local autorelease pool. * RELEASED 0.9.0 and set the CVS tag to v0_9_0. 2002-01-14 Ludovic Marcotte * Modified MimeUtility: -foldStringUsingSoftLineBreaks: length: so that we verify the length of our string before try to obtain the characters near the end of that string. * Modified Part to accept a new ivar for holding the format of the mail (flowed / unknown). Patch from Francis Lachepelle * Modified Contants.h to define two new contants for the format: FORMAT_UNKNOWN -> 0 FORMAT_FLOWED -> 1 Patch from Francis Lachepelle * Added MimeUtility: +unwrapPlainTextString: usingQuoteWrappingLimit: and +quotePlainTextString: quoteLevel: wrappingLimit. This completes TODO #78 (see Format flowed...) Refactored +wrapPlainTextString: usingWrappingLimit. This completes TODO #81 (rewrite this method) Patch from Francis Lachepelle . * Modified Parser: -parserContentType: inPart: to decode the format parameter and set the part's format to FORMAT_UNKNOWN or FORMAT_FLOWED depending on the value that has been read. Patch from Francis Lachepelle . * Added Parser: _parameterValueUsingLine: range: to be able to read parameter values all the time. For example the charset parameter encoded using multipart format like charset="us-ascii" charset=us-ascii charset=us-ascii; We now call this method for decoding the boundary, the charset, the format and the name. * Modified Message: -stringValueUsingSendingMode to add the flowed parameter IIF the Content-Transfer-Encoding is NOT QuotedPrintable or Base64. * Done the same thing in MimeBodyPart: -stringValueUsingSendingMode. 2002-01-13 Ludovic Marcotte * Modified POP3Folder: -prefetchMessageAtIndex to use a local autorelease pool for this method. * Modified Message: -forward to set the Content-Type of our forward text part (in case it's a text/html or text/enriched). * Modified MimeBodyPart: -stringValueUsingSendingMode to replace all 'appendString' call by 'appendFormat'. * Same thing for Message: -stringValueUsingSendingMode. * Modified Message: -forward to set the filename to the new part when the Content-Type is message/rfc822 or any other type like application/*, audio/*, image/* or video/*. * Modifed MimeUtility: -setContentFromRawSource: inPart: to treat message/delivery-status like a discrete type. * Same thing for MimeBodyPart: -stringValueUsingSendingMode and also modified that method when the Content-Type is message/rfc822 OR message/partial (replaced since it was originally message/*) 2002-01-12 Ludovic Marcotte * Modified LocalFolder: -close to not use a mutable string for writing our temporary message but we rather write it directly. * Rewritten MimeBodyPart: -stringValueUsingSendingMode to support most kind of parts. It still more work and a little bit of refactoring (to generalize some parts of this method). 2002-01-11 Ludovic Marcotte * Implemented -contentDisposition/-setContentDisposition in Message.m * Modified some comments in MimeUtility.m * Refactored Message: -replyWithReplyToAll and -forward so they are both more stable and should work way better with various messages. * Modified Parser: -parseContentType: in Part: to decode the filename before setting it in case it was QP (or base64) encoded. * Modified Message: -replyWithReplyToAll to search for multipart/alternative text/plain parts inside a multipart/mixed (or related) part. * Modified Message: -forward to set all body parts disposition to "attachment" when adding them to our new multipart object. 2002-01-09 Ludovic Marcotte * Moved setContent/content from MimeBodyPart / Message to Part. * Modified MimeBodyPart: -initWithString to use MimeUtility: +setContentFromRawSource: inPart. * Modified Message: -setContentFromRawSource to use MimeUtility: +setContentFromRawSource: inPart. * Added new methods to MimeUtility: +discreteContentFromRawSource: usingContentTransferEncoding: charset: +compositeMessageContentFromRawSource +compositeMultipartContentFromRawSource: +usingBoundary +setContentFromRawSource: inPart: Those new methods are used to decode ALL parts's content. * Modified Charset: -characterForCode to return \t \n or \r if we get such char as the parameter. 2002-01-08 Ludovic Marcotte * Modified MimeBodyPart: -initWithString so that if our part is a message/rfc822, we use Message: -initWithString instead of separating the headers from body and setting both to the message. * Modified Message to set the rawSource ivar in -initWithString instead of -setContentFromRawSource since the latter was wrong (not including the headers). 2002-01-07 Ludovic Marcotte * Modified IMAPStore: -close to replace %d by %@ in the string to verify when closing. Otherwise, were we looping endlessly. This bug has been introduced by on saturday. 2002-01-06 Ludovic Marcotte * Modified IMAPFolder: -prefetchMessageBodyWithUID to read the extra two lines sent by the IMAP server at the end of a FETCH BODY[TEXT]. Only one of them was read. Modified the comment to describe this part of the code. * Done the same thing in -prefetchMessageWithUID and also added the code to replace all \r\n by \n in the content of the message returned by the IMAP server. * Modified IMAPStore: -close to read the response sent by the IMAP server when we issue a LOGOUT. Currently, we just ignore the result. * Added rfcs/rfc2183.txt (The Content-Disposition Header Field) * Modified Message: -rawSource to return the rawSource ivar if it's not nil. This ivar is ONLY set in setContentFromRawSource since we migth be able to retrieve the raw source of a message (for example, from a message/rfc822 part). YOU MUST recompile Pantomime ENTIRELY (make distclean; make) since this change was made. 2002-01-04 Ludovic Marcotte * Included a patch from Anthony W. Juckel to progressively read from the socket instead of trying to read everything in one step. This bug is fixed in TCPConnection: -readStringOfLength: . * Included a patch from Anthony W. Juckel so that Flags now uses a bitstring instead of a mutable array to manage the flags. It should make things way faster. GNUMail.app *** NEEDS *** to be recompiled (entirely). * Modified POP3Folder: -count to use TCPConnection: -readLine instead of TCPConnection: -readStringOfLength: 80 to prevent it from blocking. * Included a patch from Anthony W. Juckel (modified by myself) to optimize the IMAPFolder code. * Fixed a little bug in IMAPFolder: -prefetchNewMessagesStartingAtUID so that we prevent a 'bug' from IMAP server that always return the last UID even if we started our prefetch at this UID. * Renamed MimeUtility: +encodeWordUsingQuotedPrintable to +encodeWordUsingQuotedPrintable: prefixLength: and implemented the support of folding the result if it needs to be folded to 75 characters (to be RFC2047 compliant). * Modified InternetAddress: -stringValue to call this new method instead of the old one. * Modified IMAPFolder: -prefetchNewMessagesStartingAtUID so that it makes the verification for the 'wrong' UID after we get it from -parseMessageUIDFromString and corrected a memory leak. * Modified MimeUtility: +encodeText: usingCharset: encoding: to always return an encoded string (even if it's pure ASCII). * Modified IMAPFolder: -prefetch to use a 'rotating' autorelease pool that we release after every 100 iterations of the loop. * Modified Message: -setHeaders to use a local autorelease pool during this method call. * Optimized MimeUtility: -unfoldLinesFromString. 2002-01-03 Ludovic Marcotte * Modified MimeUtility: -encodeText: usingCharset: encoding: so that when we see a '?', we append directly the =3f code. This is to be fully RFC2047 compliant. * Added missing return in MimeUtility: --encodeText: usingCharset: encoding: when the encoding was BASE64. 2001-12-30 Ludovic Marcotte * Modified MimeBodyPart: -initWithString so that we remove the extra junk for multipart/appledouble before the mime boundary if we need to (like we do for multipart/alternative). This fix some warning we had. * Modified Parser: -parseContentType: inPart: so that when we decode our boundary, we read the substring only between the quotes if we have some and if not, we read the boundary until the end of the string. This fix a bug with mailman for example that adds junk after the Content-Type. 2001-12-28 Ludovic Marcotte * Modified UTF8.h to make the class inherit from NSObject. 2001-12-26 Ludovic Marcotte * Modified Message: -setContentFromRawSource to verify not only for image/* Content-Types but also application/*, audio/* and video/*. 2001-12-25 Ludovic Marcotte * Applied a small fix in MimeUtility: -unfoldSoftLineBreaksFromString. We now make our new range from aRange.location instead of aRange.location + 1. Modified the length of our new range too. 2001-12-23 Ludovic Marcotte * Applied a small fix in MimeUtility: -unfoldSoftLineBreaksFromString. we were replacing "=\n" by "\n" instead of just deleting that range of characters. 2001-12-22 Ludovic Marcotte * Modified Message: -setContentFromRaw source. When the Content-Transfer-Encoding is quoted-printable, we actually decode our string so we don't do it in Utilities.m (from GNUMail.app) but rather inside the library. * Modified MimeBodyPart: -initWithString so that when the Content-Transfer-Encoding is quoted-printable, we don't break our string on \n and decode all the lines but rather decode the string directly. * Optimized MimeUtility: -foldStringUsingSoftLineBreaks: length: 2001-12-21 Ludovic Marcotte * We now make an extra verification in MimeBodyPart: -initWithString when the Content-Type is a multipart/alternative before removing the 'junk'. We now also verify that our aRange has a length > 0 and a location > 0. 2001-12-20 Ludovic Marcotte * Modified Message: -forward to be use the same code as text/plain parts when we want to forward a message with a Content-Type of text/enriched. 2001-12-19 Ludovic Marcotte * Added GSMD5.h/.m from gscrypt. Modified this class to not depend on other gscrypt's classes and also refactored a little bit the code. * Added GSMD5.h/.m to the GNUmakefile * Added POP3Store: -apopAuthenticateWithUsername: password: and POP3Store: -useAPOP and -setUseAPOP to allow APOP authentication. * Modified POP3Store: -authenticateWithUsername: password: to use apopAuthenticateWithUsername: password: if the server only supports APOP or if we must use APOP. Done TODO #48. * Modified MimeUtility: +decodeStringFromQuotedPrintable: charset: to use a 'local' autorelease pool that we release every 100th iteration in the loop. This fix the problem of messages eating A LOT of RAM when being decoded from QP (if they are big). * Modified LocalFolder: -appendMessageFromRawSource to replace all occurences of "\nFrom " to "\n>From ". Otherwise, it will break the mbox format. * Added GNUmakefile.postamble and modified GNUmakefile to include it. Done TODO #31. * Modified Parser: +parseSubject: inMessage: to support empty subjects. * Done the same thing for +parseOrganization: inMessage: +parseContentDisposition: inPart: +parseContentID: inPart: +parseContentTransferEncoding: inPart: +parseContentType: inPart: +parseDate: inMessage: +parseDestination: forType: inMessage: +parseFrom: inMessage: +parseMessageID: inMessage: +parseMimeVersion: inMessage: +parseReplyTo: inMessage: +parseResentFrom: inMessage: +parseStatus: inMessage: +parseXStatus: inMessage: * Modified POP3Store: -initWithName: port: to set useAPOP to NO by default. * Done TODO #62. Patch from Vicent Ricard . Added new class: UTF8. Modified the GNUmakefile to include it. * Added MimeUtility: +decodeStringFromUTF8 which uses the new class UTF8. * Modified MimeUtility: +decodeStringFromQuotedPrintable: charset: to use MimeUtility: +decodeStringFromUTF8 if the charset is UTF-8. * Added missing #import in UTF8.m * Updated MacOS-X project file. * Corrected a tiny bug of a misplace ; in GSMD5.m 2001-12-18 Ludovic Marcotte * Removed all references to the NSUserDefaults in Message.m * Added Parser: +parseOrganization: inMessage: and modified LocalFolder: -parse and Message: -setHeaders to use this method. * Added Message: -setOrganization and -organization to set and get the Organization header value. * Removed TODO #8. We now define -authenticateWithUsername: password: in the Service protocol and we implement this method in SMTP.m (dummy implementation right now). * Cleaned some headers and the TODO list. * Done TODO #58. Implemented MimeUtility: +encodeWordUsingBase64 and modified MimeUtility: +encodeText: usingCharset: encoding: to use it. * Changed POP3Store: -responseFromServerIsValid to -responseFromServerIsValid: (NSString **) theResponse so we can read back the response from our server. Updated all methods calls in POP3Store.m and POP3Folder.m * Added POP3Store: -timestamp and -setTimestamp for APOP support * Modified POP3Store: -initWithName: port: to detect APOP support 2001-12-17 Ludovic Marcotte * We include in TCPConnection.m * Refactored SMTP so that we use TCPConnection. * Same thing for POP3Store and POP3Folder * Same thing for IMAPStore and IMAPFolder * Removed unused methods from Service.h * Added TCPConnection: -readLineBySkippingCR: so that we can generalize the process of reading a line for SMTP, POP3 and IMAP. Modified -readLine to call readLineBySkippingCR with NO as the parameter. YES is passed only when using IMAP. * Modified Message.m to now use the version number 0.9.0. * Modified MimeUtility: -wrapPlainTextString: usingWrappingLimit: and -foldStringUsingSoftLineBreaks: length: since we were removing the last two characters and not the last one. * Same thing for MimeUtility: -_breakWord: usingLimit: * Added missing #import of Constants.h in TCPConnection.m * Updated MacOS-X project file (added TCPConnection) 2001-12-16 Ludovic Marcotte * Done TODO #66. Added TCPConnection with non-blocking connect. Needs more work for read/write operations and needs to be integrated in all classes that do socket I/Os. * Fixed a bug in POP3Folder: -transferMessagesToFolder. We now correctly delete the messages if we don't need to keep them on the server. * Done the same thing in POP3Folder: -prefetch. 2001-12-14 Ludovic Marcotte * Modified IMAPFolder: -prefetchMessageBodyWithUID so that we verify that aString isn't nil before adding it to our mutable string since under OS-X, appending a nil value to a NSMutableString will generate a segfault. * RELEASE OF 0.8.0. * Added tag v0_8_0 for current files 2001-12-12 Ludovic Marcotte * Modified LocalFolder: -close to catch potential errors while saving the mailbox to a temporary file. If an error occurs, we don't remove the original one. 2001-12-11 Francis Lachapelle * Improved Project Buillder file definition 2001-12-11 Ludovic Marcotte * 'Finished' the implementation of wrapPlainTextString: usingWrappingLimit:. This method WILL have to be rewritten since it's VERY ugly. * Added MimeUtility: _breakWord: usingLimit: to break a word that is longer than a specified limit into words separated by \n. 2001-12-10 Ludovic Marcotte * Added MimeUtility: -wrapPlainTextString: usingWrappingLimit: to wrap text/plain messages to the specified line limit. This method is just a skeleton. 2001-12-09 Ludovic Marcotte * Modified MimeUtility: -decodeText so that we make an initial verification to see if the text has been QP/Base64 encoded before created the mutable string and looping. It should make the parsing of mailboxes a little bit faster. It also reduce memory requirements. * Fixed a small leak in both Message.m and MimeBodyPart.m when decoding message/rfc822 messages. We were not releasing the new message after setting it as the content. 2001-12-08 Ludovic Marcotte * Implemented the support of message/rfc822 as the Content-Type of messages (not only mime body parts). * Fixed Message: -forward when we try to forward messages that has message/rfc822 as their Content-Type. * Done the same thing for Message: -replyWithReplyToAll. 2001-12-06 Ludovic Marcotte * Modified MimeUtility: +generateBoundary to include "=_" at the beginning of the generated boundary like it's recommended in RFC2045 - 6.7. * Created MimeUtility: +unfoldSoftLineBreaksFromString. * Modified Message and MimeBodyPart to use this new method. * Created MimeUtility: +foldStringUsingSoftLineBreaks: length: to fold using the soft line breaks methods the line that are longer than length. * Fixed a bug in Message: -forward, we weren't keeping the Content-Transfer-Encoding and the Charset of the text parts. * Modified Message: -replyWithReplyToAll to set the In-Reply-To header when replying to an E-Mail. Modified Message: -stringValueUsingSendingMode to actually use this header. 2001-12-05 Ludovic Marcotte * Modified MimeBodyPart: -initWithString so that we consider "binary" content transfer encoding like 8bit. * Modified MimeBodyPart: -initWithString so that we remove the 'junk' before the real boundary of a multipart/alternative part. * Modified Message: -setContentFromRawSource so that we remove the first \n only if it's present. Done the same thing in MimeBodyPart: -initWithString. * Since we made the last modification, changed the comparison: if (! [aString hasPrefix: @"-\n"] ) to: if (! [aString hasPrefix: @"--\n"] ) in both Message and MimeBodyPart. * Refactored some other parts of MimeBodyPart. 2001-12-03 Ludovic Marcotte * In Charset: - characterIsInCharset added a test to verify that the character isn't a control character. If it is, we simply return YES. 2001-11-30 Francis Lachapelle * Added tag v0_7_0 for current files 2001-11-30 Ludovic Marcotte * Modified Message.m since we are now at 0.8.0 * Modified POP3Folder: -prefetch so we don't use the autorelease pool. * Done the same thing in IMAPFolder: -prefetch and in -prefetchNewMessagesStartingAtUID. * Modified Charset: -characterForCode so that we never return nil but if the character isn't found, we return @"". 2001-11-30 Ludovic Marcotte * RELEASE OF 0.7.0 2001-11-29 Ludovic Marcotte * Fixed Message: -setContentFromRawSource to unfold soft-folded lines in a Content-Type: text/plain with a Content-Transer-Encoding set to QP. * Modified MimeBodyPart to support multipart/appledouble * Added MimeBodyPart: _mimeMultipartFromRawSource to reuse code defined when parsing multipart/alternative parts for multipart/appledouble. * Fixed a memory leak in Message: -forward. We were not releasing the newMimeBodyPart. * Fixed a memory leak in Message: -forward. We were not releasing the newMimeMultipart. * Fixed a bug in IMAPStore: -authenticateWithUsername: ... It should now work with all kind of imap servers. * Modified IMAPFolder: -prefetchNewMessagesStartingAtUID so that we use an autorelease pool for each loop iteration since that method is very memory-consuming on the standard autorelease pool. * Modified LocalFolder: -parse and Message: -setContentFromRawSource to use a new autorelease pool while beeing in those methods since they can be memory consuming on our default autorelease pool. * Removed unused variable in LocalMessage: -setInitialized 2001-11-26 Ludovic Marcotte * Modified Message: -setContentFromRawSource and MimeBodyPart: -initWithString to make an extra verification when we decode the parts to be sure that the length of the strings (ie., components) separated by the boundary are not nil and have a length > 0. 2001-11-25 Ludovic Marcotte * Implemented multipart/alternative support in MimeBodyPart: -initWithString. * Fixed two small memory leaks in MimeBodyPart: -initWithString. -initWithName: port: Same thing in LocalStore, LocalMessage, Message, POP3Store, SMTP and IMAPStore. All those leaks could append if the init* methods of those classes were failing (returning nil). We were not autoreleasing the object 'self'. 2001-11-24 Ludovic Marcotte * Modified IMAPStore: -authenticateWithUsername: password: to quote the password if it contains punctuation characters. 2001-11-23 Ludovic Marcotte * Modified Message: -stringValueUsingSendingMode: so that under OS-X, we initialize aLocale properly. Patch from Stephane Corthesy . 2001-11-22 Ludovic Marcotte * Modified LocalFolder/LocalStore so that we don't need to parse a folder when we open it. For example, that might be useful if we simply want to append a message from raw source and close the folder right after this operation. * Added Charset: -characterIsInCharset to verify if a character is in this charset. Patch from Vincent Ricard. * Optimized MimeUtility: -charsetForString. Patch from Vincent Ricard. * Updated charsets/CharsetDecoder to use #import instead of #import <...> 2001-11-21 Ludovic Marcotte * Refactored LocalFolder: -parse (removed unused code) and fixed a bug if the last message of the mbox file was an empty message. Suggestion by Alexander Malmberg * Reorganized all the source code * Some cleanups after import. * Updated Project Builder project file for MacOS-X. * Added English.lproj/InfoPlist.strings 2001-11-20 Ludovic Marcotte * Added Pantomime.h (From Stephane Corthesy ) to ease #imports in projects depending on Pantomime. * Added a patch from Stephane Corthesy that modifies all #imports in .h files, and uses #import instead of #import "...". It corrects a var initialization in LocalFolder.m, adds a missing initialization in Parser.m, and adds a cast in strincmp.c to avoid a #warning. * Optimized MimeUtility: -decodeStringFromQuotedPrintable: charset: We now replace the characters in a range instead of using a mutable string. It's an order of magnitude faster than before. * Added RFCs 2045 and 2046. * Changed the generation of QP codes from lowercase to uppercase. Suggestion by Vicent Ricard to be more RFC2045 compliant. * Fixed the GNUmakefile to skip warning from the patch from Stephane Corthesy. * Added MacOS-X project file 2001-11-19 Ludovic Marcotte * Modified MimeBodyPart: -initWithString so that we verify that we don't have an empty body part content. * Updated Testing/Pantomime.m 2001-11-18 Ludovic Marcotte * Refactored a lot of files to eliminate all warning under MacOS-X and GNUstep/Linux. * Changed the GNUmakefile to include -Wall when we compile 2001-11-16 Ludovic Marcotte * Renamed POP3Store: -verifyResponse to -responseFromServerIsValid * Modified InternetAddress: -personal so that we return a quoted string if the string contains a ',' and is not currently quoted. TODO #75 2001-11-15 Ludovic Marcotte * Modified Message: -setHeaders so that we always unfold the string received before trying to decode the headers. This fix the bug that GNUMail.app was showing the content of an attachment since the mime boundary was folded on an other line, sometimes. 2001-11-14 Ludovic Marcotte * Added Parser: -parseResentFrom: inMessage: * Added SMTP: -sendMessage: withRawSource in order to make it possible to reuse the code for sending messages when we send them as rawSource. * Refactored SMTP to use this new method * Modified Message: -setHeaders in order to parse the Resent-From, Resent-To, Resent-Cc, Resent-Bcc. * Modified SMTP: -writeMailBody: toSocket: so that it returns a BOOL. YES on sucess, NO otherwise. * Modified SMTP: -writeRecipients: toSocket .. so that we verify that we have at least one recipient. If NO, we return NO. * Modified Message: -stringValueUsingSendingMode to remove any references to bounce operations. * Modified Message: -setHeaders to NOT try to parse "From -" as an internet address. * Removed some 'bounce' related items in TODO 2001-11-13 Ludovic Marcotte * Modified Message: -stringValueUsingSendingMode so we now add our additional headers (beginning with X-) 2001-11-12 Ludovic Marcotte * Modified Message: -replyWithReplyToAll and -forward so that we now return a message in the autorelease pool. 2001-11-08 Ludovic Marcotte * In MimeUtility, moved the charsets cache in +initialize (TODO #77). 2001-11-07 Ludovic Marcotte * Fixed a range bug in NSStringExtensions -stringByTrimmingWhiteSpaces * Modified NSStringExtensions so that if we are under GNUstep, we use the method stringByTrimmingSpaces which is quite efficient. Otherwise, we use our own method. * Added a new RFC (RFC2646) in rfcs/ * Removed the #ifdef in NSStringExtensions.h * Now imports NSStringExtensions.h in Parser.m 2001-11-06 Ludovic Marcotte * In Message: -setHeaders we verify if the string received is not nil or if it's length > 0 * Optimized LocalFolder: -parse so we don't create a mutable string to build all the headers but we rather parse them directly. Left the old code here in case something is wrong. * Fixed a memory leak in LocalFolder: -unfoldLinesStartingWith * We now use static buffers in LocalFolder: -unfoldLinesStartingWith * We use static buffers again in LocalFolder: -parse and -close * Done the same thing in LocalMessage: -rawSource and -setInitialized * Removed the used of the autorelease pool in most methods in Parser * In Message: -setContentFromRAWSource removed the used of the autorelease pool. * Modified Message: -init so that we use an initial capacity for the dictionary holding all our headers to avoid a lot of reallocation. * Fixed a potential bug in InternetAddress: -initWithString. We now verify that the address has been correctly parsed. If not, we simply return nil. * Done some refactoring in most classes * Updated Testing/Pantomime.m * Modifie NSStringExtention to ALWAYS include our own version of stringByTrimmingWhiteSpaces since GNUstep's version consume a mammoth amount of RAM 2001-11-02 Ludovic Marcotte * Refactored some code (MimeUtility) * Modified IMAPStore and IMAPFolder so they both now work way better with most IMAP servers. 2001-10-31 Ludovic Marcotte * Implemented + (NSString *) encodeText: (NSString *) theText and + (NSString *) encodeText: (NSString *) theText usingCharset: (Charset *) theCharset encoding: (int) encoding in order to provide a mechanism to encode the body of messages. * Fixed a bug in MimeUtility: -stringByRemovingLineFeedCharacters patch from Pierre-Yves Rivaille . * Modified Message: -stringValueUsingSendingMode so that we specify the charset to our Content-Type header value and the Content-Transfer-Encoding value when our message has the Content-Type == "text/plain" * Fixed MimeBodyPart: -stringValueUsingSendingMode so that we include the charset in our Content-Type * Removed some unused NSLog calls in MimeBodyPart: -stringValueUsingSendingMode * Fixed a bug in LocalFolder: -parse. We were only reading a buffer of 128 characters while we had a buffer of 1024 characters. This would cause a problem with headers that are longer than 128 characters. * Done the same thing in LocalFolder: -close. 2001-10-29 Ludovic Marcotte * Fixed a bug in Parser: + (void) parseContentType: inPart: We now trim the receiving content-type in case we have: Content-Type: text/plain. * Modified Message: -setHeaders so we parse the Content-Transfer-Encoding header. * Implemented NSStringExtension: -stringByRemovingLineFeedCharacters that destructively removes \n characters into a string * Modified MimeBodyPart to use this function (and kept the old code in case something is wrong) * Implemented the support of image/* as the only content of a mail in Message: -setContentFromRawSource * Modified Message: -setHeaders so we parse the Content-Disposition header. 2001-10-27 Ludovic Marcotte * Fixed a memory leak in Charset.m. We were retaining the dict object and we shouldn't have to. 2001-10-26 Ludovic Marcotte * Modified Message.m so we are now using the version number 0.7.0 * We now generate the date in Message: -stringValueUsingSendingMode ONLY in english. 2001-10-25 Ludovic Marcotte * Released 0.6.0. 2001-10-24 Ludovic Marcotte * Modified LocalFolder: -initWithPathToFile so that we remove the .tmp file in case there's one. 2001-10-23 Ludovic Marcotte * Changed Message: -setContentFromRawSource so we compare with text/* and not only text/plain. The MUA will do the formatting. 2001-10-22 Ludovic Marcotte * Fixed a 'crash' when releasing fileManager in LocalStore: -dealloc. We now RETAIN fileManager in -initWithPathToDirectory. 2001-10-19 Ludovic Marcotte * Removed a NSLog from Part: -setContentID. * Created MimeUtility: -isASCIIString * In Folder: we do NOT retain the store and we don't release it in dealloc * In Message: we do NOT retain our folder and we don't retain it 2001-10-18 Ludovic Marcotte * Fixed a serious bug in LocalFolder: -appendMessageFromRawSource we were checking for "From -" instead of "From " 2001-10-16 Ludovic Marcotte * Modified MimeBodyPart: -init to support message/rfc822. It's an initial implementation. * Modified Part.m to exclude some NSLog from the compilation * Implemented MimeUtility: + (NSString *) unfoldLinesFromString: (NSString *) theString in order to simplify the unfolding of lines in various parts of messages and mimebody parts (I still need to 'deploy' it in the code) * Fixed MimeBodyPart: -init to unfold the headers of a message/rfc822. * Fixed POP3Store: -authenticateWithUsername:password:. We were not returning NO in case of a bad password. 2001-10-15 Ludovic Marcotte * Changed MacOSGlue to what it was before and removed it from the building process on GNUstep. * Fixed Message: -replyWithReplyToAll and -forward so we use the unicode string of an InternetAddress * Sendmail: -sendMessageFromRawSource removed the reference to NSRunAlertPanel. We don't need that. Especially in Pantomime that won't necessarily use AppKit * In POP3Store, moved #import "Constants.h" outside the #ifdef MACOSX * In date_util.c, we now #include for atoi() 2001-10-12 Ludovic Marcotte * Integrated a patch from Stephane Corthesy so that it cleans some stuff and makes Pantomime works under MacOS-X * Removed some #import * Changed Message.m to 0.6.0 * Modified MacOSXGlue.m so that it can link with GNUMail.app * Removed some junk in Testing/Pantomime.m 2001-10-11 Ludovic Marcotte * Added LICENSE.elm for the small parts of elm code we use. * Release of 0.5.0 2001-10-10 Ludovic Marcotte * Implemented MimeUtility: - charsetForString. Patch from Vincent Ricard 2001-10-09 Ludovic Marcotte * Modified InternetAddress: -stringValue so that it encodes the 'personal' value of an InternetAddress object before returning it. * Created InternetAddress: -unicodeStringValue that returns the string value of an InternetAddress w/o any encoding. * Re-implemented -name in all Charsets (TODO #67) * Modified charset/CharsetDecoder so that it includes an empty body for -name methods * In MimeUtility: -encodeWordUsingQuotedPrintable now returns @"" instead of nil. * Now defines DESTROY and CREATE_AUTORELEASE_POOL in Constants.h * In Message: -stringValueUsingSendingMode, we don't set the subject if it's length is equal to zero. * In LocalStore: -createFolderWithName we now verify that the folder with the name theName is not actually present in our current store. 2001-10-08 Ludovic Marcotte * Return a default value whenever we use subclassResponsibility so that Pantomime can compiles 'cleanly' on MacOS-X 2001-10-05 Ludovic Marcotte * In LocalFolder: -close, added the name of the folder in NSLog to make the debugging easier. 2001-10-04 Ludovic Marcotte * Fixed a bug in Parser: -parseMessageID: inMessage so that we don't include the "<>" in the actual string of the message ID. * Simplified MimeUtility: -decodeStringFromBase64 2001-10-03 Ludovic Marcotte * Fixed memory leaks in Parser: -parseFrom: inMessage: in Parser: -parseDestination: forType:... in Parser: -parseReplyTo: inMessage: * Optimized MimeUtility: -decodeText * Fixed memory leaks in MimeUtility: -charsetForName * Fixed a memory leak in Message: -formatRecipientsWithType * Fixed some memory leaks in Message: -stringValueUsingSendingMode * We no longer use the autorelease pool in Message: -forward and in Message: -setContentFromRawSource * Fixed some memory leaks in MimeBodyPart: -initWithString * Fixed a memory leak in MimeBodyPart: -stringValueUsingSendingMode * Fixed a memory leak in LocalMessage: -setInitialized * Fixed a memory leak in LocalFolder: -parse * Optimized LocalFolder: -unfoldLinesStartingWith so that we play more with the cString before appending everything to our mutable string. I left the old code here in case something is wrong with the new one. * Optimized LocalFolder: -close to use appendFormat instead of appendString for the mutable string. * Fixed a memory leak in LocalStore: -initWithPathToDirectory * Fixed a memory leak in Flags: -init * Minor enhancements to InternetAddress * Optimized POP3Store/IMAPStore: -lineFromSocket. It's now FAST. It clears TODO #41. * Fixed a memory leak in IMAPFolder: -deleteMessageWithUID * Fixed a memory leak in IMAPFolder: -fetchMessageFlagsWithUID * Optimized IMAPFolder: -setMessageFlags: forUID: * Fixed a memory leak in Part: -setCharseT * Fixed a memory leak in SMTP. Added -dealloc to release name. * Fixed a memory leak in Folder: -initWithName. Removed the RETAIN on allMessages. 2001-10-02 Ludovic Marcotte * Changed all init methods in all classes to return non AUTORELEASED object since it is NOT the "Cocoa way" of doing things * Modified some other RETAIN/RELEASE/AUTORELEASE calls to make it work correctly with the first changes I made. * Now every .m includes Constants.h in order to define the RETAIN/RELEASE/... placeholders if we are not using GNUstep * Fixed a memory leak in LocalFolder (a big one!) * In LocalFolder/POP3Folder/IMAPFolder, we should add the Message in the AUTORELEASE pool before adding it to our folder (TODO #67) * Integrated new charset engine from Alexander Malmberg. It's now way faster and more clean too. Thanks! 2001-10-01 Ludovic Marcotte * Added .cvsignore * We no longer include "nl_types.h" * Implemented IMAPFolder: -prefetchNewMessagesStartingWithUID in order to have better IMAP support when new mails arrive. 2001-09-28 Ludovic Marcotte * Imported source on CVS - module Pantomime * Implemented IMAPFolder: -noop and now call it in prefetchMessageBodyForUID. We should call it in other methods and in a separate thread. 2001-09-27 Ludovic Marcotte * Added in LocalFolder: -appendMessageFromRawSource a condition to verify if From - is present. If not present, we add it. * A LOT of IMAP enchancements * Two new methods in Store: - (BOOL) createFolderWithName: (NSString *) theName; - (BOOL) deleteFolderWithName: (NSString *) theName; * Lots of enchancements everywhere. * RELEASE OF 0.4.0 2001-09-26 Ludovic Marcotte * Support of IMAP (nearly finished) - LOT of work on it * Reworked the support of the POP3 caching. Now it acts like the IMAP cache. So it's easier to understand / maintain. 2001-09-25 Ludovic Marcotte * Added: if ( theMode == SEND_TO_FOLDER ) { [mstr appendString:@"\n"]; } in Message -stringValueUsingSendingMode so that we can decode correctly our message in Message -setContentFromRawSource when when send it to Outbox. * Fixed a bug in IMAPStore: - initWithName. Changed port from 110 to 143. * Now support the UIDVALIDITY in IMAPFolder 2001-09-21 Ludovic Marcotte * Implemented Bounce support. 2001-09-20 Ludovic Marcotte * Finished support for POP3 Leave On Server by integrating two new classes: POP3UID and POP3UIDManager. Those classes are used in POP3Folder to manager the persistence of a POP3 message on the server. * Initial support for MimeUtility: - charsetForString - encodeWordUsingBase64 - encodeWordUsingQuotedPrintable 2001-09-19 Ludovic Marcotte * Initial support for POP3 Leave On server 2001-09-18 Ludovic Marcotte * More work on IMAP support 2001-09-18 Ludovic Marcotte * Created Message: - setContentFromRawSource: (NSObject *) theString * Modified SMTP: put the EHLO in init and the QUIT in close * Fixed a bug in MimeUtility (se bzero our buffer in encodeDataUsingBase64) * Created Transport: sendMessageFromRawSource: (NSString *) theString implemented it in Sendmail, SMTP is a todo. * Cleaned SMTP * IMAPFolder -> now support the size of the messages * Fixed Message: -setFolder RETAIN/RELEASE (added them) * Fixed a bug in LocalFolder for NOT including From - lines * Released Pantomime 0.3.0 2001-09-17 Ludovic Marcotte * Fixed a small bug in LocalFolder: -appendMessageFromRawSource Changed: [aMessage setSize: ( ftell( [self stream] ) - position) ] to: [aMessage setSize: ( ftell( [self stream] ) - position + 1) ] * Finished POP3Store: - (Folder *) folderForName: (NSString *) theName prefetch: (BOOL) aBOOL 2001-09-16 Ludovic Marcotte * Changed SEND_TO_OUTBOX to SEND_TO_FOLDER * Fixed a retain/release bug in Folder.m 2001-09-15 Ludovic Marcotte * New method expunge in Folder. Implemented it in LocalFolder. * Finished the implementation of -close in LocalFolder 2001-09-14 Ludovic Marcotte * Support the name parameter in Content-Type for MimeBodyPart objects (TODO #42) * Support for the charset parameter in Content-Type * Support for all ISO-8859-X charsets when decoding * Finished LocalStore so it caches opened folders and you can even obtain them by calling: -openedFoldersEnumerator * Fixed a small bug in the GNUmakefile (forgot to include Service.h) * Now set the size of POP3Messages * Corrected a bug in LocalStore (folderEnumerator) and removed setFolderEnumerator * Added LocalStore: - (BOOL) folderForNameIsOpen: (NSString *) theName to verify if a folder is already open. 2001-09-13 Ludovic Marcotte * Fixed a small bug in MimeBodyPart. We now set the content to a part directly to the string if the encoding is NONE or EIGHTBIT (added EIGHTBIT). 2001-09-13 Ludovic Marcotte * Speedups in MimeBodyPart * Speedups in POP3Folder * Fixed bug in Parser: parseContentType so that we trim the white spaces at the beginning and at the end of our boundary. * Added a check in Message: -setContent to see if the closing mime boundary is missing or not: if (! [aString hasPrefix: @"-\n"] ) ... * Release 0.2.0 2001-09-12 Ludovic Marcotte * Speedups in LocalMessage * Changed name for methods 'fp/setFP' and added bodyFilePosition/setBodyFilePosition in order to parse way faster (in LocalMessage) * Implemented LocalStore: -folderForName * Mostly finished Testing/Pantomime.m * Fixed a small bug in Message: -initWithString. We use for (j = i+1; j < [anArray count]; j++) instead of j = i. * Fixed the generation of an ID (for Message-ID) in Message (implemented the function in MimeUtility) * Fixed a small bug in MimeBodyPart: -initWithString. We now use: if ([aLine length] == 0 && !endOfHeaders) { endOfHeaders = YES; i = i + 1; aLine = [allMessageLines objectAtIndex: i]; } instead of: if ([aLine length] == 0) { endOfHeaders = YES; } in order to prevent to add the \n that separates the body part headers from the actual content of the body part. * Changed LocalMessage: setInitialized aMutableString = [[NSMutableString alloc] init] to: lengthOfBody = ([self filePosition] + [self size] - [self bodyFilePosition]) aMutableString = [[NSMutableString alloc] initWithCapacity: lengthOfBody]; In order to speedup the initialization of messages. 2001-09-11 Ludovic Marcotte * Now compiles as a library * Moved test programs in Testing * Worked on Testing/Pantomime.m in order to have a very good test program. 2001-09-10 Ludovic Marcotte * Initial implementation of IMAP * Cleaned a LOT of things in POP3 and other classes * We now use a more generic Service protocol in POP3Store, IMAPStore and SMTP * Message: -rawSource now supported in all Folder modes * We can now append a message to a LocalFolder * Removed unused methods in Message (-isDeleted, -setDeleted) 2001-09-07 Ludovic Marcotte * Initial release (0.1.0) pantomime1.2-1.2.2+dfsg1/Documentation/000077500000000000000000000000001276751561200175535ustar00rootroot00000000000000pantomime1.2-1.2.2+dfsg1/Documentation/AUTHORS000066400000000000000000000011261276751561200206230ustar00rootroot00000000000000Ludovic Marcotte ==================================== - main developer Jonathan B. Leffert ========================================== - some methods in the NSString category Alexander Malmberg ============================================ - some bug fixes and enhanced support of qp and base64 Ujwal S. Sathyam ======================================== - frequent contributor - contributor on the maildir code Riccardo Mottola ============================= - portability and bug fixingpantomime1.2-1.2.2+dfsg1/Documentation/LICENSE000066400000000000000000000634761276751561200206000ustar00rootroot00000000000000 GNU LESSER GENERAL PUBLIC LICENSE Version 2.1, February 1999 Copyright (C) 1991, 1999 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the Lesser GPL. It also counts as the successor of the GNU Library Public License, version 2, hence the version number 2.1.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Lesser General Public License, applies to some specially designated software packages--typically libraries--of the Free Software Foundation and other authors who decide to use it. You can use it too, but we suggest you first think carefully about whether this license or the ordinary General Public License is the better strategy to use in any particular case, based on the explanations below. When we speak of free software, we are referring to freedom of use, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish); that you receive source code or can get it if you want it; that you can change the software and use pieces of it in new free programs; and that you are informed that you can do these things. To protect your rights, we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link other code with the library, you must provide complete object files to the recipients, so that they can relink them with the library after making changes to the library and recompiling it. And you must show them these terms so they know their rights. We protect your rights with a two-step method: (1) we copyright the library, and (2) we offer you this license, which gives you legal permission to copy, distribute and/or modify the library. To protect each distributor, we want to make it very clear that there is no warranty for the free library. Also, if the library is modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original author's reputation will not be affected by problems that might be introduced by others. Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a restrictive license from a patent holder. Therefore, we insist that any patent license obtained for a version of the library must be consistent with the full freedom of use specified in this license. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License. This license, the GNU Lesser General Public License, applies to certain designated libraries, and is quite different from the ordinary General Public License. We use this license for certain libraries in order to permit linking those libraries into non-free programs. When a program is linked with a library, whether statically or using a shared library, the combination of the two is legally speaking a combined work, a derivative of the original library. The ordinary General Public License therefore permits such linking only if the entire combination fits its criteria of freedom. The Lesser General Public License permits more lax criteria for linking other code with the library. We call this license the "Lesser" General Public License because it does Less to protect the user's freedom than the ordinary General Public License. It also provides other free software developers Less of an advantage over competing non-free programs. These disadvantages are the reason we use the ordinary General Public License for many libraries. However, the Lesser license provides advantages in certain special circumstances. For example, on rare occasions, there may be a special need to encourage the widest possible use of a certain library, so that it becomes a de-facto standard. To achieve this, non-free programs must be allowed to use the library. A more frequent case is that a free library does the same job as widely used non-free libraries. In this case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License. In other cases, permission to use a particular library in non-free programs enables a greater number of people to use a large body of free software. For example, permission to use the GNU C Library in non-free programs enables many more people to use the whole GNU operating system, as well as its variant, the GNU/Linux operating system. Although the Lesser General Public License is Less protective of the users' freedom, it does ensure that the user of a program that is linked with the Library has the freedom and the wherewithal to run that program using a modified version of the Library. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run. GNU LESSER GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library or other program which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Lesser General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (1) uses at run time a copy of the library already present on the user's computer system, rather than copying library functions into the executable, and (2) will operate properly with a modified version of the library, if the user installs one, as long as the modified version is interface-compatible with the version that the work was made with. c) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. d) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. e) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the materials to be distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties with this License. 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. , 1 April 1990 Ty Coon, President of Vice That's all there is to it! pantomime1.2-1.2.2+dfsg1/Documentation/README000066400000000000000000000041701276751561200204350ustar00rootroot00000000000000Pantomime v1.2.0 =============================================================================== Compiling Pantomime for GNUstep =============================================================================== To try Pantomime, your first need to install GNUstep. You can get GNUstep at: http://www.gnustep.org Be sure to fully read and understand the GNUstep installation procedure. You can read a comprehensive guide on how to install GNUstep on Unix systems here: http://documents.made-it.com/GNUstep/Build/ Once you have installed GNUstep, you can compile Pantomime. To compile and install it: cd Pantomime make make install If you are using RedHat 9 or Fedora, you might have to define the ADDITIONAL_OBJCFLAGS environment variable, like this: export ADDITIONAL_OBJCFLAGS="-I/usr/kerberos/include" in order to include the Kerberos headers during compilation (since your OpenSSL installation requires them). Compiling Pantomime for Apple Mac OS X =============================================================================== In order to compile Pantomime under OS X, you first need to install Apple's developer tools. You can get them at: http://developer.apple.com/tools/ Once you've downloaded and installed the developer tools, open Xcode. Once Xcode is started, open the Pantomime's project file (Pantomime.xcode). To compile it, choose the "Build" menu item from the "Build" menu. This will create a "Pantomime.framework" directory inside the Pantomime's build directory. You can safely move this framework where you want, or simply add it to your application from Xcode (Project->Add Frameworks...). Using Pantomime in your application =============================================================================== Under GNUstep, you must add the following line to your GNUmakefile: ADDITIONAL_LDFLAGS = -lPantomime Under Apple Mac OS X, you must add the following compiler flag: -DMACOSX Otherwise, you'll get errors when compiling your application. =============================================================================== Author: Ludovic Marcotte (ludovic@Sophos.ca) The name "Pantomime" was proposed by Jay Kominek.pantomime1.2-1.2.2+dfsg1/Documentation/TODO000066400000000000000000000007401276751561200202440ustar00rootroot0000000000000021- clean all FIXME 79- support other mailbox format like mh, Mail.app, etc. 87- Add Mail-Followup-To support (see IETF draft) 92- We should use a bit string for Store: -folderTypeForFolderName in order to return all the types an IMAP server can return. 93- Support RFC850 (Standard for Interchange of USENET Messages) 94- Add certificates validation for the SSL bundle? 95- support IMAP namespaces (rfc2342) 99- fix quoting bug for big5 mails (mails from Koichi and Toshiro) pantomime1.2-1.2.2+dfsg1/Examples/000077500000000000000000000000001276751561200165205ustar00rootroot00000000000000pantomime1.2-1.2.2+dfsg1/Examples/SimplePOP3/000077500000000000000000000000001276751561200204135ustar00rootroot00000000000000pantomime1.2-1.2.2+dfsg1/Examples/SimplePOP3/GNUmakefile000066400000000000000000000015511276751561200224670ustar00rootroot00000000000000# # This GNUmakefile is public domain. # Do whatever you want with it. # # Author: Ludovic Marcotte # -include $(GNUSTEP_MAKEFILES)/common.make APP_NAME = SimplePOP3 SimplePOP3_OBJC_FILES = SimplePOP3.m SimplePOP3_LIB_DIRS = -L../$(GNUSTEP_LIBRARIES_ROOT) ADDITIONAL_OBJCFLAGS = -Wall -Wno-import ifeq ($(GNUSTEP_TARGET_OS),mingw32) ADDITIONAL_GUI_LIBS = -lPantomime else ADDITIONAL_LDFLAGS = -lPantomime endif -include $(GNUSTEP_MAKEFILES)/application.make # # If GNUstep Make isn't installed, as it is # often the case on Mac OS X, we compile # things 'manually'. To compile and run it: # a) Copy Pantomime.framework in /Library/Frameworks # b) Type "make" # c) Type "SimplePOP3.app/SimplePOP3" # example: mkdir -p SimplePOP3.app gcc -DMACOSX -o SimplePOP3.app/SimplePOP3 SimplePOP3.m -framework Foundation -framework AppKit -framework Pantomime pantomime1.2-1.2.2+dfsg1/Examples/SimplePOP3/SimplePOP3.m000066400000000000000000000113111276751561200224610ustar00rootroot00000000000000// // This code is public domain. Do whatever you want with it. // // This test application shows how to check for new mail on // a POP3 server. If there are any messages on the server, // it downloads the first ones and dumps it on stdout. // // *** PLEASE READ Pantomime/Documentation/README *** // // Author: Ludovic Marcotte // #import // // You can safely either #include or #import Pantomime headers. // Include/import Pantomime.h to have access to every class // or include/import them individually. // #import // // Modify those defines to reflect your environment. // #define SERVER_NAME @"pop.gmail.com" #define SERVER_PORT 995 #define USE_SSL NO #define USERNAME @"german@xelalug.org" #define PASSWORD @"cranfork725" #define MECHANISM @"none" // use "none" for normal POP3 authentication // // Our class interface. // @interface SimplePOP3 : NSObject { @private CWPOP3Store *_pop3; } @end // // Our class implementation. // @implementation SimplePOP3 - (void) applicationDidFinishLaunching: (NSNotification *) theNotification { // We initialize our POP3Store instance _pop3 = [[CWPOP3Store alloc] initWithName: SERVER_NAME port: SERVER_PORT]; [_pop3 setDelegate: self]; // We connect to the server _in background_. That means, this call // is non-blocking and methods will be invoked on the delegate // (or notifications will be posted) for further dialog with // the remote POP3server. NSLog(@"Connecting to the %@ server...", SERVER_NAME); [_pop3 connectInBackgroundAndNotify]; } // // This method is automatically called once the POP3 authentication // has completed. If it has failed, -authenticationFailed: will // be invoked. // - (void) authenticationCompleted: (NSNotification *) theNotification { NSLog(@"Authentication completed! Checking for messages.."); [[_pop3 defaultFolder] prefetch]; } // // This method is automatically called once the POP3 authentication // has failed. If it has succeeded, -authenticationCompleted: will // be invoked. // - (void) authenticationFailed: (NSNotification *) theNotification { NSLog(@"Authentication failed! Closing the connection..."); [_pop3 close]; } // // This method is automatically called when the connection to // the POP3 server was established. // - (void) connectionEstablished: (NSNotification *) theNotification { NSLog(@"Connected!"); if (USE_SSL) { NSLog(@"Now starting SSL..."); [(CWTCPConnection *)[_pop3 connection] startSSL]; } } // // This method is automatically called when the connection to // the POP3 server was terminated avec invoking -close on the // POP3Store instance. // - (void) connectionTerminated: (NSNotification *) theNotification { NSLog(@"Connection closed."); RELEASE(_pop3); [NSApp terminate: self]; } // // This method is automatically invoked when the folder information // was fully prefetched from the POP3 server. Once it has been // prefetched, one can prefetch specific messages. // - (void) folderPrefetchCompleted: (NSNotification *) theNotification { int count; count = [(CWPOP3Folder *)[_pop3 defaultFolder] count]; NSLog(@"There are %d messages on the server.", count); if (count > 0) { NSLog(@"Prefetching and initializing the first one..."); [[[[_pop3 defaultFolder] allMessages] objectAtIndex: 0] setInitialized: YES]; } else { NSLog(@"Closing the connection..."); [_pop3 close]; } } // // This method is automatically invoked when a message was // fully prefetched from the POP3 server. // - (void) messagePrefetchCompleted: (NSNotification *) theNotification { CWMessage *aMessage; aMessage = [[theNotification userInfo] objectForKey: @"Message"]; NSLog(@"Got the message! The subject is: %@", [aMessage subject]); NSLog(@"The full content is:\n\n------------------------\n%s------------------------", [[aMessage rawSource] cString]); NSLog(@"Closing the connection..."); [_pop3 close]; } // // This method is automatically invoked once the POP3Store service // is fully initialized. // - (void) serviceInitialized: (NSNotification *) theNotification { if (USE_SSL) { NSLog(@"SSL handshaking completed."); } NSLog(@"Available authentication mechanisms: %@", [_pop3 supportedMechanisms]); [_pop3 authenticate: USERNAME password: PASSWORD mechanism: MECHANISM]; } @end // // Main entry point for the test application. // int main(int argc, const char *argv[], char *env[]) { NSAutoreleasePool *pool; SimplePOP3 *o; pool = [[NSAutoreleasePool alloc] init]; o = [[SimplePOP3 alloc] init]; [NSApplication sharedApplication]; [NSApp setDelegate: o]; [NSApp run]; RELEASE(o); RELEASE(pool); return 0; } pantomime1.2-1.2.2+dfsg1/Examples/SimpleSMTP/000077500000000000000000000000001276751561200204555ustar00rootroot00000000000000pantomime1.2-1.2.2+dfsg1/Examples/SimpleSMTP/GNUmakefile000066400000000000000000000015511276751561200225310ustar00rootroot00000000000000# # This GNUmakefile is public domain. # Do whatever you want with it. # # Author: Ludovic Marcotte # -include $(GNUSTEP_MAKEFILES)/common.make APP_NAME = SimpleSMTP SimpleSMTP_OBJC_FILES = SimpleSMTP.m SimpleSMTP_LIB_DIRS = -L../$(GNUSTEP_LIBRARIES_ROOT) ADDITIONAL_OBJCFLAGS = -Wall -Wno-import ifeq ($(GNUSTEP_TARGET_OS),mingw32) ADDITIONAL_GUI_LIBS = -lPantomime else ADDITIONAL_LDFLAGS = -lPantomime endif -include $(GNUSTEP_MAKEFILES)/application.make # # If GNUstep Make isn't installed, as it is # often the case on Mac OS X, we compile # things 'manually'. To compile and run it: # a) Copy Pantomime.framework in /Library/Frameworks # b) Type "make" # c) Type "SimpleSMTP.app/SimpleSMTP" # example: mkdir -p SimpleSMTP.app gcc -DMACOSX -o SimpleSMTP.app/SimpleSMTP SimpleSMTP.m -framework Foundation -framework AppKit -framework Pantomime pantomime1.2-1.2.2+dfsg1/Examples/SimpleSMTP/SimpleSMTP.m000066400000000000000000000151721276751561200225760ustar00rootroot00000000000000// // This code is public domain. Do whatever you want with it. // // This test application shows how to send a simple message // using the SMTP protocol. See the "define section" below // for various settings you can activate. // // *** PLEASE READ Pantomime/Documentation/README *** // // Author: Ludovic Marcotte // #import // // You can safely either #include or #import Pantomime headers. // Include/import Pantomime.h to have access to every class // or include/import them individually. // #import // // Modify those defines to reflect your environment. // #define FROM_ADDRESS @"Ludovic Marcotte " #define TO_ADDRESS @"Ludovic Marcotte " #define SERVER_NAME @"smtp.gmail.com" #define SERVER_PORT 587 #define USE_SECURE 2 // 0 -> NO, 1 -> SSL (usually port 465), 2 -> TLS (usually port 25 or 587) #define USERNAME @"foo@gmail.com" #define PASSWORD @"foobarbaz" #define MECHANISM @"PLAIN" // use "none" for no SMTP authentication // "PLAIN", "LOGIN" and "CRAM-MD5" are supported. // // How many messages would you like to send over the same connection? // static int number_of_messages = 3; // // Our class interface. // @interface SimpleSMTP : NSObject { @private CWSMTP *_smtp; } @end // // Our class implementation. // @implementation SimpleSMTP - (void) applicationDidFinishLaunching: (NSNotification *) theNotification { CWInternetAddress *address; CWMessage *message; // We create a simple message object. message = [[CWMessage alloc] init]; [message setSubject: @"Pantomime Test!"]; // We set the "From:" header address = [[CWInternetAddress alloc] initWithString: FROM_ADDRESS]; [message setFrom: address]; RELEASE(address); // We set the "To: header address = [[CWInternetAddress alloc] initWithString: TO_ADDRESS]; [address setType: PantomimeToRecipient]; [message addRecipient: address]; RELEASE(address); // We set the Message's Content-Type, encoding and charset [message setContentType: @"text/plain"]; [message setContentTransferEncoding: PantomimeEncodingNone]; [message setCharset: @"us-ascii"]; // We set the Message's content [message setContent: [@"This is a simple content." dataUsingEncoding: NSASCIIStringEncoding]]; // We initialize our SMTP instance _smtp = [[CWSMTP alloc] initWithName: SERVER_NAME port: SERVER_PORT]; [_smtp setDelegate: self]; [_smtp setMessage: message]; RELEASE(message); // We connect to the server _in background_. That means, this call // is non-blocking and methods will be invoked on the delegate // (or notifications will be posted) for further dialog with // the remote SMTP server. NSLog(@"Connecting to the %@ server...", SERVER_NAME); [_smtp connectInBackgroundAndNotify]; } // // This method is automatically called once the SMTP authentication // has completed. If it has failed, -authenticationFailed: will // be invoked. // - (void) authenticationCompleted: (NSNotification *) theNotification { NSLog(@"Authentication completed! Sending the message..."); [_smtp sendMessage]; } // // This method is automatically called once the SMTP authentication // has failed. If it has succeeded, -authenticationCompleted: will // be invoked. // - (void) authenticationFailed: (NSNotification *) theNotification { NSLog(@"Authentication failed! Closing the connection..."); [_smtp close]; } // // This method is automatically called when the connection to // the SMTP server was established. // - (void) connectionEstablished: (NSNotification *) theNotification { NSLog(@"Connected!"); if (USE_SECURE == 1) { NSLog(@"Now starting SSL..."); [(CWTCPConnection *)[_smtp connection] startSSL]; } } // // This method is automatically called when the connection to the // server is abruptly closed by the server. GMail does that for example // when you call close. You should make sure your message is sent // in this delegate and not assume it only happens when after you // invoke -close. // - (void) connectionLost: (NSNotification *) theNotification { NSLog(@"Connection lost to the server!"); RELEASE(_smtp); [NSApp terminate: self]; } // // This method is automatically called when the connection to // the SMTP server was terminated avec invoking -close on the // SMTP instance. // - (void) connectionTerminated: (NSNotification *) theNotification { NSLog(@"Connection closed."); RELEASE(_smtp); [NSApp terminate: self]; } // // This method is automatically called when the message has been // successfully sent. // - (void) messageSent: (NSNotification *) theNotification { NSLog(@"Sent!\nClosing the connection."); number_of_messages--; if (number_of_messages == 0) { [_smtp close]; } else { // If you wish to either change the recipients, message or // the message data, you should do so in -transactionResetCompleted: // before calling again -sendMessage. The -reset method will NOT // change either the previously used recipients, message or // message data. [_smtp reset]; } } // // This method is automatically invoked once the SMTP service // is fully initialized. One can send a message directly (if no // SMTP authentication is required to relay the mail) or proceed // with the authentication if needed. // - (void) serviceInitialized: (NSNotification *) theNotification { if (![(CWTCPConnection *)[[theNotification object] connection] isSSL] && USE_SECURE == 2) { [[theNotification object] startTLS]; return; } if (USE_SECURE == 1) { NSLog(@"SSL handshaking completed."); } if ([MECHANISM isEqualToString: @"none"]) { NSLog(@"Sending the message..."); [_smtp sendMessage]; } else { NSLog(@"Available authentication mechanisms: %@", [_smtp supportedMechanisms]); [_smtp authenticate: USERNAME password: PASSWORD mechanism: MECHANISM]; } } // // This method is invoked once the transaction has been reset. This // can be useful if one when to send more than one message over // the same SMTP connection. // - (void) transactionResetCompleted: (NSNotification *) theNotification { NSLog(@"Sending the message over the same connection..."); [_smtp sendMessage]; } @end // // Main entry point for the test application. // int main(int argc, const char *argv[], char *env[]) { NSAutoreleasePool *pool; SimpleSMTP *o; pool = [[NSAutoreleasePool alloc] init]; o = [[SimpleSMTP alloc] init]; [NSApplication sharedApplication]; [NSApp setDelegate: o]; [NSApp run]; RELEASE(o); RELEASE(pool); return 0; } pantomime1.2-1.2.2+dfsg1/Framework/000077500000000000000000000000001276751561200166775ustar00rootroot00000000000000pantomime1.2-1.2.2+dfsg1/Framework/Pantomime/000077500000000000000000000000001276751561200206305ustar00rootroot00000000000000pantomime1.2-1.2.2+dfsg1/Framework/Pantomime/CWCacheManager.h000066400000000000000000000073531276751561200235410ustar00rootroot00000000000000/* ** CWCacheManager.h ** ** Copyright (c) 2004-2007 Ludovic Marcotte ** 2013 The GNUstep team ** ** Author: Ludovic Marcotte ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** You should have received a copy of the GNU Lesser General Public ** License along with this library; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef _Pantomime_H_CWCacheManager #define _Pantomime_H_CWCacheManager #import #import #import #if defined(__APPLE__) && (MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_4) #ifndef NSUInteger #define NSUInteger unsigned int #endif #endif // // // typedef struct { unsigned int date; unsigned int flags; unsigned int position; // For mbox based cache files unsigned int size; unsigned int imap_uid; // For IMAP char *filename; // For maildir base cache files NSString *pop3_uid; // For POP3 NSData *from; NSData *in_reply_to; NSData *message_id; NSData *references; NSData *subject; NSData *to; NSData *cc; } cache_record; // // Simple macro used to initialize a record to some // default values. Faster than a memset(). // #define CLEAR_CACHE_RECORD(r) \ r.date = 0; \ r.flags = 0; \ r.position = 0; \ r.size = 0; \ r.imap_uid = 0; \ r.pop3_uid = nil;\ r.from = nil; \ r.in_reply_to = nil; \ r.message_id = nil; \ r.references = nil; \ r.subject = nil; \ r.to = nil; \ r.cc = nil; /*! @class CWCacheManager @discussion This class is used to provide a generic superclass for cache management with regard to various CWFolder sub-classes. CWIMAPFolder, CWLocalFolder and CWPOP3Folder can make use of a cache in order to speedup lots of operations. */ @interface CWCacheManager : NSObject { @protected NSMutableArray *_cache; NSString *_path; NSUInteger _count; int _fd; } /*! @method initWithPath: @discussion This method is the designated initializer for the CWCacheManager class. @param thePath The complete path where the cache will be eventually saved to. @result A CWCacheManager subclass instance, nil on error. */ - (id) initWithPath: (NSString *) thePath; /*! @method path @discussion This method is used to obtain the path where the cache has been loaded for or where it'll be saved to. @result The path. */ - (NSString *) path; /*! @method setPath: @discussion This method is used to set the path where the cache will be loaded from or where it'll be saved to. @param thePath The complete path. */ - (void) setPath: (NSString *) thePath; /*! @method invalidate @discussion This method is used to invalide all cache entries. */ - (void) invalidate; /*! @method synchronize @discussion This method is used to save the cache on disk. If the cache is empty, this method does not write it on disk and returns YES. @result YES on success, NO otherwise. */ - (BOOL) synchronize; /*! @method count @discussion This method returns the number of cache_record entries present in the cache. @result The count; */ - (NSUInteger) count; @end #endif // _Pantomime_H_CWCacheManager pantomime1.2-1.2.2+dfsg1/Framework/Pantomime/CWCacheManager.m000066400000000000000000000031271276751561200235410ustar00rootroot00000000000000/* ** CWCacheManager.m ** ** Copyright (c) 2004-2007 ** 2013 Free Software Foundation ** ** Author: Ludovic Marcotte ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** You should have received a copy of the GNU Lesser General Public ** License along with this library; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include #include #include #include @implementation CWCacheManager - (id) initWithPath: (NSString *) thePath { if ((self = [super init])) { ASSIGN(_path, thePath); } return self; } // // // - (void) dealloc { RELEASE(_path); [super dealloc]; } // // // - (NSString *) path { return _path; } - (void) setPath: (NSString *) thePath { ASSIGN(_path, thePath); } // // // - (void) invalidate { //[_cache removeAllObjects]; } // // // - (BOOL) synchronize { [self subclassResponsibility: _cmd]; return NO; } // // // - (NSUInteger) count { return _count; } @end pantomime1.2-1.2.2+dfsg1/Framework/Pantomime/CWCharset.h000066400000000000000000000066571276751561200226420ustar00rootroot00000000000000/* ** CWCharset.h ** ** Copyright (c) 2001-2007 ** ** Author: Ludovic Marcotte ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** You should have received a copy of the GNU Lesser General Public ** License along with this library; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef _Pantomime_H_CWCharset #define _Pantomime_H_CWCharset #import #import struct charset_code { int code; unichar value; }; /*! @class CWCharset @discussion This class provides a useful interface for dealing with Internet message character sets. */ @interface CWCharset : NSObject { @private const struct charset_code *_codes; int _num_codes; int _identity_map; } /*! @method initWithCodeCharTable: length: @discussion This method is used to initialize a CWCharset instance based on the charset code table. You should never call this initializer directly. You should rather invoke directly -init on CWCharset's subclasses. @param codes The charset code table which must be sorted by code. @param num_codes The size of the table. */ - (id) initWithCodeCharTable: (const struct charset_code *) codes length: (int) num_codes; /*! @method codeForCharacter: @discussion This method is used to obtain the right code from a Unicode character, in the code table. @param theCharacter The Unicode character to use. @result The code from the code table. */ - (int) codeForCharacter: (unichar) theCharacter; /*! @method characterIsInCharset: @discussion This method is used to verify if theCharacter is present in the receiver. @param theCharacter The Unicode character to verify the availability. @result YES if it is present, NO otherwise. */ - (BOOL) characterIsInCharset: (unichar) theCharacter; /*! @method name @discussion This method is used to get the name of the receiver. Values returned are like "iso-8859-1", "koi8-r" and so on. @result The Internet name of the charset. */ - (NSString *) name; /*! @method allCharsets @discussion This method is used to obtain a dictionary of all supported charsets by Pantomime. The keys are the name of the charsets (NSString instances) and the values are a description of the charset (NSString instances). @result The dictionary of all supported character sets. */ + (NSDictionary *) allCharsets; /*! @method charsetForName: @discussion This method is used to obtain a CWCharset subclass instance from the Internet name of a charset. @param theName The Internet name of a charset, like "iso-8859-1". @result The CWCharset instance. If a non-supported name was specified, an instance of CWISO8859_1 is returned. */ + (CWCharset *) charsetForName: (NSString *) theName; @end #endif // _Pantomime_H_CWCharset pantomime1.2-1.2.2+dfsg1/Framework/Pantomime/CWCharset.m000066400000000000000000000230211276751561200226270ustar00rootroot00000000000000/* ** CWCharset.m ** ** Copyright (c) 2001-2004 ** ** Author: Ludovic Marcotte ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** You should have received a copy of the GNU Lesser General Public ** License along with this library; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include static NSMutableDictionary *charset_name_description = nil; static NSMutableDictionary *charset_instance_cache = nil; // // // @implementation CWCharset + (void) initialize { if (!charset_instance_cache) { charset_instance_cache = [[NSMutableDictionary alloc] init]; } if (!charset_name_description) { charset_name_description = [[NSMutableDictionary alloc] init]; } } // // // - (id) initWithCodeCharTable: (const struct charset_code *) c length: (int) n { self = [super init]; _codes = c; _num_codes = n; _identity_map = 0x20; if (n > 0 && _codes[0].code == 0x20) { int i = 1; for (_identity_map=0x20; i < _num_codes && _codes[i].code == _identity_map + 1 && _codes[i].value == _identity_map + 1; _identity_map++,i++) ; } return self; } // // TODO: what should this return for eg. \t and \n? // - (int) codeForCharacter: (unichar) theCharacter { int i; if (theCharacter <= _identity_map) { return theCharacter; } for (i = 0; i < _num_codes; i++) { if (_codes[i].value == theCharacter) { return _codes[i].code; } } return -1; } // // // - (BOOL) characterIsInCharset: (unichar) theCharacter { if (theCharacter <= _identity_map) { return YES; } if ([self codeForCharacter: theCharacter] != -1) { return YES; } return NO; } // // Returns the name of the Charset. Like: // "iso-8859-1" // - (NSString *) name { [self subclassResponsibility: _cmd]; return nil; } // // // + (NSDictionary *) allCharsets { if (![charset_name_description count]) { [charset_name_description setObject: _(@"Western European (ISO Latin 1)") forKey: @"iso-8859-1"]; [charset_name_description setObject: _(@"Western European (ISO Latin 9)") forKey: @"iso-8859-15"]; [charset_name_description setObject: _(@"Western European (Windows Latin 1)") forKey: @"windows-1252"]; [charset_name_description setObject: _(@"Japanese (ISO 2022-JP)") forKey: @"iso-2022-jp"]; [charset_name_description setObject: _(@"Japanese (EUC-JP)") forKey: @"euc-jp"]; [charset_name_description setObject: _(@"Traditional Chinese (BIG5)") forKey: @"big5"]; [charset_name_description setObject: _(@"Arabic (ISO 8859-6)") forKey: @"iso-8859-6"]; [charset_name_description setObject: _(@"Greek (ISO 8859-7)") forKey: @"iso-8859-7"]; [charset_name_description setObject: _(@"Greek (Windows)") forKey: @"windows-1253"]; [charset_name_description setObject: _(@"Hebrew (ISO 8859-8)") forKey: @"iso-8859-8"]; [charset_name_description setObject: _(@"Cyrillic (ISO 8859-5)") forKey: @"iso-8859-5"]; [charset_name_description setObject: _(@"Cyrillic (KOI8-R)") forKey: @"koi8-r"]; [charset_name_description setObject: _(@"Cyrillic (Windows)") forKey: @"windows-1251"]; [charset_name_description setObject: _(@"Thai (ISO 8859-11)") forKey: @"iso-8859-11"]; [charset_name_description setObject: _(@"Central European (ISO Latin 2)") forKey: @"iso-8859-2"]; [charset_name_description setObject: _(@"Central European (Windows Latin 2)") forKey: @"windows-1250"]; [charset_name_description setObject: _(@"Turkish (Latin 5)") forKey: @"iso-8859-9"]; [charset_name_description setObject: _(@"Turkish (Windows)") forKey: @"windows-1254"]; [charset_name_description setObject: _(@"South European (ISO Latin 3)") forKey: @"iso-8859-3"]; [charset_name_description setObject: _(@"North European (ISO Latin 4)") forKey: @"iso-8859-4"]; [charset_name_description setObject: _(@"Nordic (ISO Latin 6)") forKey: @"iso-8859-10"]; [charset_name_description setObject: _(@"Baltic Rim (ISO Latin 7)") forKey: @"iso-8859-13"]; [charset_name_description setObject: _(@"Celtic (ISO Latin 8)") forKey: @"iso-8859-14"]; [charset_name_description setObject: _(@"Simplified Chinese (GB2312)") forKey: @"gb2312"]; [charset_name_description setObject: _(@"UTF-8") forKey: @"utf-8"]; #ifdef MACOSX [charset_name_description setObject: _(@"Korean (EUC-KR/KS C 5601)") forKey: @"euc-kr"]; [charset_name_description setObject: _(@"Japanese (Win/Mac)") forKey: @"shift_jis"]; #endif } return charset_name_description; } // // This method is used to obtain a charset from the name // of this charset. It caches this charset for future // usage when it's found. // + (CWCharset *) charsetForName: (NSString *) theName { CWCharset *theCharset; theCharset = [charset_instance_cache objectForKey: [theName lowercaseString]]; if (!theCharset) { CWCharset *aCharset; if ([[theName lowercaseString] isEqualToString: @"iso-8859-2"]) { aCharset = (CWCharset *)[[CWISO8859_2 alloc] init]; } else if ([[theName lowercaseString] isEqualToString: @"iso-8859-3"]) { aCharset = (CWCharset *)[[CWISO8859_3 alloc] init]; } else if ([[theName lowercaseString] isEqualToString: @"iso-8859-4"]) { aCharset = (CWCharset *)[[CWISO8859_4 alloc] init]; } else if ([[theName lowercaseString] isEqualToString: @"iso-8859-5"]) { aCharset = (CWCharset *)[[CWISO8859_5 alloc] init]; } else if ([[theName lowercaseString] isEqualToString: @"iso-8859-6"]) { aCharset = (CWCharset *)[[CWISO8859_6 alloc] init]; } else if ([[theName lowercaseString] isEqualToString: @"iso-8859-7"]) { aCharset = (CWCharset *)[[CWISO8859_7 alloc] init]; } else if ([[theName lowercaseString] isEqualToString: @"iso-8859-8"]) { aCharset = (CWCharset *)[[CWISO8859_8 alloc] init]; } else if ([[theName lowercaseString] isEqualToString: @"iso-8859-9"]) { aCharset = (CWCharset *)[[CWISO8859_9 alloc] init]; } else if ([[theName lowercaseString] isEqualToString: @"iso-8859-10"]) { aCharset = (CWCharset *)[[CWISO8859_10 alloc] init]; } else if ([[theName lowercaseString] isEqualToString: @"iso-8859-11"]) { aCharset = (CWCharset *)[[CWISO8859_11 alloc] init]; } else if ([[theName lowercaseString] isEqualToString: @"iso-8859-13"]) { aCharset = (CWCharset *)[[CWISO8859_13 alloc] init]; } else if ([[theName lowercaseString] isEqualToString: @"iso-8859-14"]) { aCharset = (CWCharset *)[[CWISO8859_14 alloc] init]; } else if ([[theName lowercaseString] isEqualToString: @"iso-8859-15"]) { aCharset = (CWCharset *)[[CWISO8859_15 alloc] init]; } else if ([[theName lowercaseString] isEqualToString: @"koi8-r"]) { aCharset = (CWCharset *)[[CWKOI8_R alloc] init]; } else if ([[theName lowercaseString] isEqualToString: @"koi8-u"]) { aCharset = (CWCharset *)[[CWKOI8_U alloc] init]; } else if ([[theName lowercaseString] isEqualToString: @"windows-1250"]) { aCharset = (CWCharset *)[[CWWINDOWS_1250 alloc] init]; } else if ([[theName lowercaseString] isEqualToString: @"windows-1251"]) { aCharset = (CWCharset *)[[CWWINDOWS_1251 alloc] init]; } else if ([[theName lowercaseString] isEqualToString: @"windows-1252"]) { aCharset = (CWCharset *)[[CWWINDOWS_1252 alloc] init]; } else if ([[theName lowercaseString] isEqualToString: @"windows-1253"]) { aCharset = (CWCharset *)[[CWWINDOWS_1253 alloc] init]; } else if ([[theName lowercaseString] isEqualToString: @"windows-1254"]) { aCharset = (CWCharset *)[[CWWINDOWS_1254 alloc] init]; } else { aCharset = (CWCharset *)[[CWISO8859_1 alloc] init]; } [charset_instance_cache setObject: aCharset forKey: [theName lowercaseString]]; RELEASE(aCharset); return aCharset; } return theCharset; } @end pantomime1.2-1.2.2+dfsg1/Framework/Pantomime/CWConnection.h000066400000000000000000000107021276751561200233320ustar00rootroot00000000000000/* ** CWConnection.h ** ** Copyright (c) 2001-2007 ** ** Author: Ludovic Marcotte ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** You should have received a copy of the GNU Lesser General Public ** License along with this library; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef _Pantomime_H_CWConnection #define _Pantomime_H_CWConnection #import #import /*! @protocol CWConnection @discussion This protocol defines a basic set of methods that classes should implement. CWTCPConnection implements the protocol to offer TCP connections support. An UDP implementation will likely be added in a near future (for DNS requests). */ @protocol CWConnection /*! @method initWithName: port: background: @discussion This method is use to initialize a new connection instance at the specified port. It can connect in background if needed and use the default timeout (60 seconds) when connecting. @param theName The host name to connect to. @param thePort The port to connect to. @param theBOOL YES if we want to connect in background (non-blocking way), NO if we want this call to be blocking until we successfully connected to the host. @result An instance implementing the CWConnection protocol, nil if an error occurred, like DNS resolution. */ - (id) initWithName: (NSString *) theName port: (unsigned int) thePort background: (BOOL) theBOOL; /*! @method initWithName: port: connectionTimeout: readTimeout: writeTimeout: background: @discussion Same as -initWithName: port: background but it allows you to specifed the proper connection / read / write timeout values to use. @param theName The host name to connect to. @param thePort The port to connect to. @param theConnectionTimeout The timeout to use when connecting to the host. @param theReadTimeout The timeout to use when reading on the socket. @param theWriteTimeout The timeout to use when writing on the socket. @param theBOOL YES if we want to connect in background (non-blocking way), NO if we want this call to be blocking until we successfully connected to the host. @result An instance implementing the CWConnection protocol, nil if an error occurred, like DNS resolution. */ - (id) initWithName: (NSString *) theName port: (unsigned int) thePort connectionTimeout: (unsigned int) theConnectionTimeout readTimeout: (unsigned int) theReadTimeout writeTimeout: (unsigned int) theWriteTimeout background: (BOOL) theBOOL; /*! @method fd @discussion This method is used to obtain the file descriptor which is associated to our connection. @result The file descriptor, -1 if the socket isn't yet connected. */ - (int) fd; /*! @method isConnected @discussion This method is used to verify if the socket is in a connected state. @result YES if the socket is in a connected state, NO otherwise. */ - (BOOL) isConnected; /*! @method close @discussion This method is used to close the connection to the host. */ - (void) close; /*! @method read: length: @discussion This method is used to read len bytes from the socket and store them in buf @param buf The buffer in which read bytes will be stored in. @param len The number of bytes we want to try to read. @result The number of bytes successfully read. */ - (int) read: (char *) buf length: (int) len; /*! @method write: length: @discussion This method is used to write len bytes from buf to the socket. @param buf The bytes that we want to write to the socket. @param len The number of bytes we want to try to write. @result The number of bytes successfully written. */ - (int) write: (char *) buf length: (int) len; @end #endif // _Pantomime_H_CWConnection pantomime1.2-1.2.2+dfsg1/Framework/Pantomime/CWConstants.h000066400000000000000000000277161276751561200232240ustar00rootroot00000000000000/* ** CWConstants.h ** ** Copyright (c) 2001-2007 ** 2013 Free Software Foundation ** ** Author: Ludovic Marcotte ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** You should have received a copy of the GNU Lesser General Public ** License along with this library; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef _Pantomime_H_CWConstants #define _Pantomime_H_CWConstants @class NSString; // // The current version of Pantomime. // #define PANTOMIME_VERSION @"1.2.0" // // Useful macros that we must define ourself on OS X. // #ifdef MACOSX #define RETAIN(object) [object retain] #define RELEASE(object) [object release] #define AUTORELEASE(object) [object autorelease] #define TEST_RELEASE(object) ({ if (object) [object release]; }) #define ASSIGN(object,value) ({\ id __value = (id)(value); \ id __object = (id)(object); \ if (__value != __object) \ { \ if (__value != nil) \ { \ [__value retain]; \ } \ object = __value; \ if (__object != nil) \ { \ [__object release]; \ } \ } \ }) #define DESTROY(object) ({ \ if (object) \ { \ id __o = object; \ object = nil; \ [__o release]; \ } \ }) #define NSLocalizedString(key, comment) \ [[NSBundle mainBundle] localizedStringForKey:(key) value:@"" table:nil] #define _(X) NSLocalizedString (X, @"") #endif // // Only for older Mac versions // #if defined(__APPLE__) && (MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_4) #ifndef NSUInteger #define NSUInteger unsigned int #endif #ifndef NSInteger #define NSInteger int #endif #endif // // We must define NSObject: -subclassResponsibility: on OS X. // #ifdef MACOSX #include #endif // // Some macros, to minimize the code. // #define PERFORM_SELECTOR_1(del, sel, name) ({ \ \ BOOL zBOOL; \ \ zBOOL = NO; \ \ if (del && [del respondsToSelector: sel]) \ { \ [del performSelector: sel \ withObject: [NSNotification notificationWithName: name \ object: self]]; \ zBOOL = YES; \ } \ \ zBOOL; \ }) #define PERFORM_SELECTOR_2(del, sel, name, obj, key) \ if (del && [del respondsToSelector: sel]) \ { \ [del performSelector: sel \ withObject: [NSNotification notificationWithName: name \ object: self \ userInfo: [NSDictionary dictionaryWithObject: obj forKey: key]]]; \ } #define PERFORM_SELECTOR_3(del, sel, name, info) \ if (del && [del respondsToSelector: sel]) \ { \ [del performSelector: sel \ withObject: [NSNotification notificationWithName: name \ object: self \ userInfo: info]]; \ } #define AUTHENTICATION_COMPLETED(del, s) \ POST_NOTIFICATION(PantomimeAuthenticationCompleted, self, [NSDictionary dictionaryWithObject: ((id)s?(id)s:(id)@"") forKey: @"Mechanism"]); \ PERFORM_SELECTOR_2(del, @selector(authenticationCompleted:), PantomimeAuthenticationCompleted, ((id)s?(id)s:(id)@""), @"Mechanism"); #define AUTHENTICATION_FAILED(del, s) \ POST_NOTIFICATION(PantomimeAuthenticationFailed, self, [NSDictionary dictionaryWithObject: ((id)s?(id)s:(id)@"") forKey: @"Mechanism"]); \ PERFORM_SELECTOR_2(del, @selector(authenticationFailed:), PantomimeAuthenticationFailed, ((id)s?(id)s:(id)@""), @"Mechanism"); #define POST_NOTIFICATION(name, obj, info) \ [[NSNotificationCenter defaultCenter] postNotificationName: name \ object: obj \ userInfo: info] /*! @typedef PantomimeEncoding @abstract Supported encodings. @discussion This enum lists the supported Content-Transfer-Encoding values. See RFC 2045 - 6. Content-Transfer-Encoding Header Field (all all sub-sections) for a detailed description of the possible values. @constant PantomimeEncodingNone No encoding. @constant PantomimeEncoding7bit No encoding, same value as PantomimeEncodingNone. @constant PantomimeEncodingQuotedPrintable The quoted-printable encoding. @constant PantomimeEncodingBase64 The base64 encoding. @constant PantomimeEncoding8bit Identity encoding. @constant PantomimeEncodingBinary Identity encoding. */ typedef enum { PantomimeEncodingNone = 0, PantomimeEncoding7bit = 0, PantomimeEncodingQuotedPrintable = 1, PantomimeEncodingBase64 = 2, PantomimeEncoding8bit = 3, PantomimeEncodingBinary = 4 } PantomimeEncoding; /*! @typedef PantomimeFolderFormat @abstract The supported folder formats. @discussion Pantomime supports various local folder formats. Currently, the mbox and maildir formats are supported. Also, a custom format is defined to represent folder which holds folders (ie., not messages). @constant PantomimeFormatMbox The mbox format. @constant PantomimeFormatMaildir The maildir format. @constant PantomimeFormatMailSpoolFile The mail spool file, in mbox format but without cache synchronization. @constant PantomimeFormatFolder Custom format. */ typedef enum { PantomimeFormatMbox = 0, PantomimeFormatMaildir = 1, PantomimeFormatMailSpoolFile = 2, PantomimeFormatFolder = 3 } PantomimeFolderFormat; /*! @typedef PantomimeMessageFormat @abstract The format of a message. @discussion Pantomime supports two formats when encoding plain/text parts. The formats are described in RFC 2646. @constant PantomimeFormatUnknown Unknown format. @constant PantomimeFormatFlowed The "format=flowed" is used. */ typedef enum { PantomimeFormatUnknown = 0, PantomimeFormatFlowed = 1 } PantomimeMessageFormat; /*! @typedef PantomimeFlag @abstract Valid message flags. @discussion This enum lists valid message flags. Flags can be combined using a bitwise OR. @constant PantomimeAnswered The message has been answered. @constant PantomimeDraft The message is an unsent, draft message. @constant PantomimeFlagged The message is flagged. @constant PantomimeRecent The message has been recently received. @constant PantomimeSeen The message has been read. @constant PantomimeDeleted The message is marked as deleted. */ typedef enum { PantomimeAnswered = 1, PantomimeDraft = 2, PantomimeFlagged = 4, PantomimeRecent = 8, PantomimeSeen = 16, PantomimeDeleted = 32 } PantomimeFlag; /*! @typedef PantomimeFolderType @abstract Flags/name attributes for mailboxes/folders. @discussion This enum lists the potential mailbox / folder flags which some IMAP servers can enforce. Those flags have few meaning for POP3 and Local mailboxes. Flags can be combined using a bitwise OR. @constant PantomimeHoldsFolders The folder holds folders. @constant PantomimeHoldsMessages The folder holds messages. @constant PantomimeNoInferiors The folder has no sub-folders. @constant PantomimeNoSelect The folder can't be opened. @constant PantomimeMarked The folder is marked as "interesting". @constant PantomimeUnmarked The folder does not contain any new messages since the last time it has been open. */ typedef enum { PantomimeHoldsFolders = 1, PantomimeHoldsMessages = 2, PantomimeNoInferiors = 4, PantomimeNoSelect = 8, PantomimeMarked = 16, PantomimeUnmarked = 32 } PantomimeFolderType; /*! @typedef PantomimeSearchMask @abstract Mask for Folder: -search: mask: options: @discussion This enum lists the possible values of the search mask. Values can be combined using a bitwise OR. @constant PantomimeFrom Search in the "From:" header value. @constant PantomimeTo Search in the "To:" header value. @constant PantomimeSubject Search in the "Subject:" header value. @constant PantomimeContent Search in the message content. */ typedef enum { PantomimeFrom = 1, PantomimeTo = 2, PantomimeSubject = 4, PantomimeContent = 8 } PantomimeSearchMask; /*! @typedef PantomimSearchOption @abstract Options for Folder: -search: mask: options: @discussion This enum lists the possible options when performing a search. @constant PantomimeCaseInsensitiveSearch Don't consider the case when performing a search operation. @constant PantomimeRegularExpression The search criteria represents a regular expression. */ typedef enum { PantomimeCaseInsensitiveSearch = 1, PantomimeRegularExpression = 2 } PantomimeSearchOption; /*! @typedef PantomimeFolderMode @abstract Valid modes for folder. @discussion This enum lists the valid mode to be used when opening a folder. @constant PantomimeUnknownMode Unknown mode. @constant PantomimeReadOnlyMode The folder will be open in read-only. @constant PantomimeReadWriteMode The folder will be open in read-write. */ typedef enum { PantomimeUnknownMode = 1, PantomimeReadOnlyMode = 2, PantomimeReadWriteMode = 3 } PantomimeFolderMode; /*! @typedef PantomimeForwardMode @abstract Valid modes when forwarding a message. @discussion This enum lists the valid mode to be used when forwarding a message. @constant PantomimeAttachmentForwardMode The message will be attached. @constant PantomimeInlineForwardMode The text parts of the message will be extracted and included inline in the forwarded response. */ typedef enum { PantomimeAttachmentForwardMode = 1, PantomimeInlineForwardMode = 2 } PantomimeForwardMode; /*! @typedef PantomimeContentDisposition @abstract Valid modes when setting a Content-Disposition. @discussion This enum lists the valid Content-Disposition as stated in the RFC2183 standard. @constant PantomimeAttachmentDisposition The part is separated from the mail body. @constant PantomimeInlineDisposition The part is part of the mail body. */ typedef enum { PantomimeAttachmentDisposition = 1, PantomimeInlineDisposition = 2 } PantomimeContentDisposition; /*! @typedef PantomimeReplyMode @abstract Valid modes when replying to a message. @discussion This enum lists the valid modes to be used when replying to a message. Those modes are to be used with CWMessage: -reply: PantomimeSimpleReplyMode and PantomimeNormalReplyMode can NOT be combined but can be individually combined with PantomimeReplyAllMode. @constant PantomimeSimpleReplyMode Reply to the sender, without a message content @constant PantomimeNormalReplyMode Reply to the sender, with a properly build message content. @constant PantomimeReplyAllMode Reply to all recipients. */ typedef enum { PantomimeSimpleReplyMode = 1, PantomimeNormalReplyMode = 2, PantomimeReplyAllMode = 4 } PantomimeReplyMode; /*! @typedef PantomimeRecipientType @abstract Valid recipient types. @discussion This enum lists the valid kind of recipients a message can have. @constant PantomimeToRecipient Recipient which will appear in the "To:" header value. @constant PantomimeCcRecipient Recipient which will appear in the "Cc:" header value. @constant PantomimeBccRecipient Recipient which will obtain a black carbon copy of the message. @constant PantomimeResentToRecipient Recipient which will appear in the "Resent-To:" header value. @constant PantomimeResentCcRecipient Recipient which will appear in the "Resent-Cc:" header value. @constant PantomimeResentBccRecipient Recipient which will obtain a black carbon copy of the message being redirected. */ typedef enum { PantomimeToRecipient = 1, PantomimeCcRecipient = 2, PantomimeBccRecipient = 3, PantomimeResentToRecipient = 4, PantomimeResentCcRecipient = 5, PantomimeResentBccRecipient = 6 } PantomimeRecipientType; #endif // _Pantomime_H_CWConstants pantomime1.2-1.2.2+dfsg1/Framework/Pantomime/CWConstants.m000066400000000000000000000127411276751561200232210ustar00rootroot00000000000000/* ** CWConstants.m ** ** Copyright (c) 2001-2007 ** ** Author: Ludovic Marcotte ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** You should have received a copy of the GNU Lesser General Public ** License along with this library; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #import // CWDNSManager notifications NSString* PantomimeDNSResolutionCompleted = @"PantomimeDNSResolutionCompleted"; NSString* PantomimeDNSResolutionFailed = @"PantomimeDNSResolutionFailed"; // CWFolder notifications NSString* PantomimeFolderAppendCompleted = @"PantomimeFolderAppendCompleted"; NSString* PantomimeFolderAppendFailed = @"PantomimeFolderCloseFailed"; NSString* PantomimeFolderCloseCompleted = @"PantomimeFolderCloseCompleted"; NSString* PantomimeFolderCloseFailed = @"PantomimeFolderAppendFailed"; NSString* PantomimeFolderExpungeCompleted = @"PantomimeFolderExpungeCompleted"; NSString* PantomimeFolderExpungeFailed = @"PantomimeFolderExpungeFailed"; NSString* PantomimeFolderListCompleted = @"PantomimeFolderListCompleted"; NSString* PantomimeFolderListFailed = @"PantomimeFolderListFailed"; NSString* PantomimeFolderListSubscribedCompleted = @"PantomimeFolderListSubscribedCompleted"; NSString* PantomimeFolderListSubscribedFailed = @"PantomimeFolderListSubscribedFailed"; NSString* PantomimeFolderOpenCompleted = @"PantomimeFolderOpenCompleted"; NSString* PantomimeFolderOpenFailed = @"PantomimeFolderOpenFailed"; NSString* PantomimeFolderPrefetchCompleted = @"PantomimeFolderPrefetchCompleted"; NSString* PantomimeFolderPrefetchFailed = @"PantomimeFolderPrefetchFailed"; NSString* PantomimeFolderSearchCompleted = @"PantomimeFolderSearchCompleted"; NSString* PantomimeFolderSearchFailed = @"PantomimeFolderSearchFailed"; // CWIMAPFolder notifications NSString* PantomimeMessagesCopyCompleted = @"PantomimeMessagesCopyCompleted"; NSString* PantomimeMessagesCopyFailed = @"PantomimeMessagesCopyFailed"; NSString* PantomimeMessageStoreCompleted = @"PantomimeMessageStoreCompleted"; NSString* PantomimeMessageStoreFailed = @"PantomimeMessageStoreFailed"; // CWIMAPStore notifications NSString* PantomimeFolderStatusCompleted = @"PantomimeFolderStatusCompleted"; NSString* PantomimeFolderStatusFailed = @"PantomimeFolderStatusFailed"; NSString* PantomimeFolderSubscribeCompleted = @"PantomimeFolderSubscribeCompleted"; NSString* PantomimeFolderSubscribeFailed = @"PantomimeFolderSubscribeFailed"; NSString* PantomimeFolderUnsubscribeCompleted = @"PantomimeFolderUnsubscribeCompleted"; NSString* PantomimeFolderUnsubscribeFailed = @"PantomimeFolderUnsubscribeFailed"; // CWMessage notifications NSString* PantomimeMessageChanged = @"PantomimeMessageChanged"; NSString* PantomimeMessageExpunged = @"PantomimeMessageExpunged"; NSString* PantomimeMessageFetchCompleted = @"PantomimeMessageFetchCompleted"; NSString* PantomimeMessageFetchFailed = @"PantomimeMessageFetchFailed"; NSString* PantomimeMessagePrefetchCompleted = @"PantomimeMessagePrefetchCompleted"; NSString* PantomimeMessagePrefetchFailed = @"PantomimeMessagePrefetchFailed"; // CWService notifications NSString* PantomimeProtocolException = @"PantomimeProtocolException"; NSString* PantomimeAuthenticationCompleted = @"PantomimeAuthenticationCompleted"; NSString* PantomimeAuthenticationFailed = @"PantomimeAuthenticationCompleted"; NSString* PantomimeConnectionEstablished = @"PantomimeConnectionEstablished"; NSString* PantomimeConnectionLost = @"PantomimeConnectionLost"; NSString* PantomimeConnectionTerminated = @"PantomimeConnectionTerminated"; NSString* PantomimeConnectionTimedOut = @"PantomimeConnectionTimedOut"; NSString* PantomimeRequestCancelled = @"PantomimeRequestCancelled"; NSString* PantomimeServiceInitialized = @"PantomimeServiceInitialized"; NSString* PantomimeServiceReconnected = @"PantomimeServiceReconnected"; // CWSMTP notifications NSString* PantomimeRecipientIdentificationCompleted = @"PantomimeRecipientIdentificationCompleted"; NSString* PantomimeRecipientIdentificationFailed = @"PantomimeRecipientIdentificationFailed"; NSString* PantomimeTransactionInitiationCompleted = @"PantomimeTransactionInitiationCompleted"; NSString* PantomimeTransactionInitiationFailed = @"PantomimeTransactionInitiationFailed"; NSString* PantomimeTransactionResetCompleted = @"PantomimeTransactionResetCompleted"; NSString* PantomimeTransactionResetFailed = @"PantomimeTransactionResetFailed"; // CWStore notifications NSString* PantomimeFolderCreateCompleted = @"PantomimeFolderCreateCompleted"; NSString* PantomimeFolderCreateFailed = @"PantomimeFolderCreateFailed"; NSString* PantomimeFolderDeleteCompleted = @"PantomimeFolderDeleteCompleted"; NSString* PantomimeFolderDeleteFailed = @"PantomimeFolderDeleteFailed"; NSString* PantomimeFolderRenameCompleted = @"PantomimeFolderRenameCompleted"; NSString* PantomimeFolderRenameFailed = @"PantomimeFolderRenameFailed"; // CWTransport notifications NSString* PantomimeMessageNotSent = @"PantomimeMessageNotSent"; NSString* PantomimeMessageSent = @"PantomimeMessageSent"; pantomime1.2-1.2.2+dfsg1/Framework/Pantomime/CWContainer.h000066400000000000000000000057761276751561200231740ustar00rootroot00000000000000/* ** CWContainer.h ** ** Copyright (c) 2002-2007 ** ** Author: Ludovic Marcotte ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** You should have received a copy of the GNU Lesser General Public ** License along with this library; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef _Pantomime_H_CWContainer #define _Pantomime_H_CWContainer #import #import @class CWMessage; /*! @class CWContainer @discussion This class is a simple placeholder used when doing message threading. A container is composed of a CWMessage instance which might be nil, a parent, child and next CWContainer instances. For a full description of the implemented algorithm, see message threading. Instance variables of this class must be accessed directly (ie., without an accessor) - for performance reasons. */ @interface CWContainer : NSObject { @public CWContainer *parent, *child, *next; CWMessage *message; } /*! @method setParent: @discussion This method is used to set the parent CWContainer of the receiver. @param theParent The parent CWContainer, which might be nil if the receiver is part of the root set. */ - (void) setParent: (CWContainer *) theParent; /*! @method setChild: @discussion This method is used to add the specified child to the list of children. @param theChild The child to add which can be nil to remove the first child. */ - (void) setChild: (CWContainer *) theChild; /*! @method childAtIndex: @discussion This method is used to get the child at the specified index. @param theIndex The index of the child, which is 0 based. @result The CWContainer instance. */ - (CWContainer *) childAtIndex: (unsigned int) theIndex; /*! @method count @discussion This method is used to obtain the number of children of the receiver. @result The number of children. */ - (unsigned int) count; /*! @method setNext: @discussion This method is used to set the next element in sibling list. @param theNext The next element, or nil if there's none. */ - (void) setNext: (CWContainer *) theNext; /*! @method childrenEnumerator @discussion This method is used to obtain all children of the receiver. @result All children, as a NSEnumerator instance. */ - (NSEnumerator *) childrenEnumerator; @end #endif // _Pantomime_H_CWContainer pantomime1.2-1.2.2+dfsg1/Framework/Pantomime/CWContainer.m000066400000000000000000000100231276751561200231560ustar00rootroot00000000000000/* ** CWContainer.m ** ** Copyright (c) 2002-2004 ** ** Author: Ludovic Marcotte ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** You should have received a copy of the GNU Lesser General Public ** License along with this library; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include #include #include #include // // // @implementation CWContainer - (id) init { self = [super init]; message = nil; parent = nil; child = nil; next = nil; return self; } // // // - (void) dealloc { TEST_RELEASE(parent); TEST_RELEASE(child); TEST_RELEASE(next); [super dealloc]; } // // access / mutation methods // - (void) setParent: (CWContainer *) theParent { if (theParent && theParent != self) { ASSIGN(parent, theParent); } else { DESTROY(parent); } } // // // #warning Fix mem leaks - (void) setChild: (CWContainer *) theChild { if (!theChild || theChild == self || theChild->next == self || theChild == child) { return; } if (theChild) { CWContainer *aChild; // We search down in the children of theChild to be sure that // self IS NOT reachable // FIXME - we should use childrenEnumerator since we are NOT looping // in all children with this code aChild = theChild->child; while (aChild) { if (aChild == self) { return; } aChild = aChild->next; } RETAIN(theChild); //RELEASE(child); //child = theChild; // We finally add it! if (!child) { child = theChild; } else { aChild = child; // We go at the end of our list of children //while ( aChild->next != nil && aChild->next != aChild ) while (aChild->next != nil) { if (aChild->next == aChild) { aChild->next = theChild; return; } // We don't add the child if it's already there if (aChild == theChild) { return; } aChild = aChild->next; } aChild->next = theChild; } } else { DESTROY(child); } } // // // - (CWContainer *) childAtIndex: (unsigned int) theIndex { CWContainer *aChild; unsigned int i; aChild = child; for (i = 0; i < theIndex && aChild; i++) { aChild = aChild->next; } return aChild; } // // // - (unsigned int) count { if (child) { CWContainer *aChild; unsigned int count; aChild = child; count = 0; while (aChild) { //if ( aChild == self || aChild->next == aChild ) if (aChild == self) { count = 1; break; } aChild = aChild->next; count++; } return count; } return 0; } // // // - (void) setNext: (CWContainer *) theNext { if (theNext) { ASSIGN(next, theNext); } else { DESTROY(next); } } // // // - (NSEnumerator *) childrenEnumerator { NSMutableArray *aMutableArray; CWContainer *aContainer; aMutableArray = [[NSMutableArray alloc] init]; AUTORELEASE(aMutableArray); aContainer = child; while (aContainer) { [aMutableArray addObject: aContainer]; // We add, recursively, all its children [aMutableArray addObjectsFromArray: [[aContainer childrenEnumerator] allObjects]]; // We get our next container aContainer = aContainer->next; } return [aMutableArray objectEnumerator]; } @end pantomime1.2-1.2.2+dfsg1/Framework/Pantomime/CWDNSManager.h000066400000000000000000000070751276751561200231630ustar00rootroot00000000000000/* ** CWDNSManager.h ** ** Copyright (c) 2004-2007 ** 2013 Free Software Foundation ** ** Author: Ludovic Marcotte ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** You should have received a copy of the GNU Lesser General Public ** License along with this library; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef _Pantomime_H_CWDNSManager #define _Pantomime_H_CWDNSManager #include #import #import #import #import #import #import #ifdef MACOSX #import #include #endif #if defined(__APPLE__) && (MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_4) #ifndef NSUInteger #define NSUInteger unsigned int #endif #ifndef NSInteger #define NSInteger int #endif #endif /*! @const PantomimeDNSResolutionCompleted @discussion This notification is automatically posted when the DNS resolution has completed successfully. */ extern NSString* PantomimeDNSResolutionCompleted; /*! @const PantomimeDNSResolutionFailed @discussion This notification is automatically posted when the DNS resolution has failed. */ extern NSString* PantomimeDNSResolutionFailed; #ifdef MACOSX typedef enum {ET_RDESC, ET_WDESC, ET_EDESC} RunLoopEventType; /*! @class CWDNSManager @discussion This class is used in Pantomime to perform DNS resolution. Currently, it does not do asynchronous lookups but implements a simple cache to speedup repetitive requets. */ @interface CWDNSManager : NSObject #else @interface CWDNSManager : NSObject #endif { @private NSMutableArray *_servers, *_queue; NSMutableDictionary *_cache; NSTimer *_timer; id _delegate; #ifdef MACOSX CFRunLoopSourceRef _runLoopSource; CFSocketContext *_context; CFSocketRef _cf_socket; #endif unsigned short _packet_id; BOOL _is_asynchronous; NSInteger _socket; } /*! @method addressesForName:background: @discussion This method is used to obtain an array of IP addresses from a fully qualified domain name. @param theName The fully qualified domain name. @param theBOOL If YES, the call is non-blocking and returns nil. Otherwise, the call is block and returns an array of addresses, if any. @result The array of addresses encoded as NSData instances. */ - (NSArray *) addressesForName: (NSString *) theName background: (BOOL) theBOOL; /*! @method singleInstance @discussion This method is used to obtain the shared CWDNSManager instance for DNS resolution. @result The shared instance. */ + (id) singleInstance; #ifdef MACOSX - (void) receivedEvent: (void *) theData type: (RunLoopEventType) theType extra: (void *) theExtra forMode: (NSString *) theMode; #endif @end #endif // _Pantomime_H_CWDNSManager pantomime1.2-1.2.2+dfsg1/Framework/Pantomime/CWDNSManager.m000066400000000000000000000414271276751561200231670ustar00rootroot00000000000000/* ** CWDNSManager.m ** ** Copyright (c) 2004-2007 ** 2012 Riccardo Mottola ** ** Author: Ludovic Marcotte ** Riccardo Mottola ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** You should have received a copy of the GNU Lesser General Public ** License along with this library; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include #include #include #import #import #import #ifdef __MINGW32__ #include #elif defined (__NetBSD__) #include #include #include #include //#include #include #include #if __NetBSD_Version__ >= 300000000 #define HAS_RES_NINIT 1 #endif #else #include // For u_char on Mac OS X #include #include #include #include #include #endif #include #define MAX_PACKET_SIZE 512 #define MAX_TIMEOUT 2 static CWDNSManager *singleInstance = nil; typedef struct _dns_packet_header { unsigned short packet_id; unsigned short flags; unsigned short qdcount; unsigned short ancount; unsigned short nscount; unsigned short arcount; } dns_packet_header; typedef struct _dns_packet_question { unsigned short qtype; unsigned short qclass; } dns_packet_question; typedef struct _dns_resource_record { unsigned short type; unsigned short class; unsigned int ttl; unsigned short rdlength; } dns_resource_record; #ifdef MACOSX void dns_socket_callback(CFSocketRef s, CFSocketCallBackType type, CFDataRef address, const void* data, void* info) { if (type&kCFSocketReadCallBack) { [(CWDNSManager *)info receivedEvent: (void*)CFSocketGetNative(s) type: ET_RDESC extra: 0 forMode: nil]; } } #endif // // // @interface CWDNSRequest : NSObject { @public NSMutableArray *servers; NSData *name; unsigned short packet_id, count; } - (id) initWithName: (NSString *) theName; @end @implementation CWDNSRequest - (id) initWithName: (NSString *) theName { self = [super init]; servers = [[NSMutableArray alloc] init]; name = RETAIN([theName dataUsingEncoding: NSASCIIStringEncoding]); count = 0; return self; } - (void) dealloc { RELEASE(servers); RELEASE(name); [super dealloc]; } @end // // // @interface CWDNSManager (Private) - (void) _parseHostsFile; - (void) _parseResolvFile; - (void) _processResponse; - (void) _sendRequest: (CWDNSRequest *) theRequest; - (void) _tick: (id) sender; @end // // // @implementation CWDNSManager - (id) init { self = [super init]; _cache = [[NSMutableDictionary alloc] init]; _servers = [[NSMutableArray alloc] init]; _queue = [[NSMutableArray alloc] init]; _is_asynchronous = NO; #ifdef MACOSX _runLoopSource = nil; _context = nil; _cf_socket = nil; #endif [self _parseResolvFile]; [self _parseHostsFile]; if ([_servers count] && (_socket = socket(PF_INET, SOCK_DGRAM, 0)) >= 0) { _is_asynchronous = YES; _packet_id = 1; #ifdef MACOSX _context = (CFSocketContext *)malloc(sizeof(CFSocketContext)); memset(_context, 0, sizeof(CFSocketContext)); _context->info = self; _cf_socket = CFSocketCreateWithNative(NULL, _socket, kCFSocketReadCallBack|kCFSocketWriteCallBack, dns_socket_callback, _context); CFSocketDisableCallBacks(_cf_socket, kCFSocketReadCallBack|kCFSocketWriteCallBack); if (!_cf_socket) { _is_asynchronous = NO; return self; } _runLoopSource = CFSocketCreateRunLoopSource(NULL, _cf_socket, 1); if (!_runLoopSource) { CFSocketInvalidate(_cf_socket); _is_asynchronous = NO; return self; } CFRunLoopAddSource(CFRunLoopGetCurrent(), _runLoopSource, kCFRunLoopCommonModes); #else [[NSRunLoop currentRunLoop] addEvent: (void *)_socket #ifdef __MINGW32__ type: ET_HANDLE #else type: ET_RDESC #endif watcher: self forMode: NSDefaultRunLoopMode]; #endif _timer = [NSTimer scheduledTimerWithTimeInterval: 1 target: self selector: @selector(_tick:) userInfo: nil repeats: YES]; RETAIN(_timer); [_timer fire]; } return self; } // // // - (void) dealloc { [_timer invalidate]; RELEASE(_timer); #ifdef MACOSX if (CFRunLoopSourceIsValid(_runLoopSource)) { CFRunLoopSourceInvalidate(_runLoopSource); CFRelease(_runLoopSource); } if (CFSocketIsValid(_cf_socket)) { CFSocketInvalidate(_cf_socket); } CFRelease(_cf_socket); free(_context); #endif RELEASE(_cache); RELEASE(_servers); RELEASE(_queue); [super dealloc]; } // // // - (NSArray *) addressesForName: (NSString *) theName background: (BOOL) theBOOL { id o; o = [_cache objectForKey: theName]; if (theBOOL) { if (o) { POST_NOTIFICATION(PantomimeDNSResolutionCompleted, self, ([NSDictionary dictionaryWithObjectsAndKeys: theName, @"Name", [o objectAtIndex: 0], @"Address", nil])); } else { CWDNSRequest *aRequest; aRequest = AUTORELEASE([[CWDNSRequest alloc] initWithName: theName]); aRequest->packet_id = _packet_id++; aRequest->servers = [[NSMutableArray alloc] initWithArray: _servers]; aRequest->count = 0; if ([_servers count]) { [self _sendRequest: aRequest]; } } return nil; } if (!o) { struct hostent *host_info; // // We don't compare with _servers as it might have more // magic to obtain IP addresses from DNS names. // host_info = gethostbyname([theName cString]); if (host_info) { int i; o = [NSMutableArray array]; for (i = 0;; i++) { if (host_info->h_addr_list[i] == NULL) { break; } else { unsigned char c0, c1, c2, c3; char *buf; int r; buf = host_info->h_addr_list[i]; c0 = *(buf); c1 = *(buf+1); c2 = *(buf+2); c3 = *(buf+3); r = ntohl((c0<<24)|(c1<<16)|(c2<<8)|c3); [o addObject: [NSNumber numberWithInt: r]]; } } // We only cache if we have at least one address for the DNS name. if ([o count]) { [_cache setObject: o forKey: theName]; } } else { o = nil; } } return o; } // // // - (void) receivedEvent: (void *) theData type: (RunLoopEventType) theType extra: (void *) theExtra forMode: (NSString *) theMode { switch (theType) { #ifdef __MINGW32__ case ET_HANDLE: case ET_TRIGGER: #else case ET_RDESC: #endif [self _processResponse]; break; default: break; } } // // // + (id) singleInstance { if (!singleInstance) { singleInstance = [[CWDNSManager alloc] init]; } return singleInstance; } @end @implementation CWDNSManager (Private) // // See man 5 hosts for all details // on the format of the /etc/hosts file. // - (void) _parseHostsFile { NSData *aData; aData = [NSData dataWithContentsOfFile: @"/etc/hosts"]; if (aData) { NSArray *allLines; NSString *aString; BOOL b; int i; allLines = [aData componentsSeparatedByCString: "\n"]; for (i = 0; i < [allLines count]; i++) { aData = [allLines objectAtIndex: i]; if ([aData hasCPrefix: "#"]) continue; aString = [[NSString alloc] initWithData: aData encoding: NSASCIIStringEncoding]; b = YES; if (aString) { NSString *aWord; NSString *theIP; NSScanner *aScanner; aScanner = [NSScanner scannerWithString: aString]; theIP = nil; [aScanner scanCharactersFromSet: [NSCharacterSet whitespaceAndNewlineCharacterSet] intoString: NULL]; while ([aScanner scanUpToCharactersFromSet: [NSCharacterSet whitespaceAndNewlineCharacterSet] intoString: &aWord] == YES) { if (b) { theIP = aWord; b = NO; continue; } [_cache setObject: [NSArray arrayWithObject: [NSNumber numberWithInt: inet_addr([theIP UTF8String])]] forKey: aWord]; [aScanner scanCharactersFromSet: [NSCharacterSet whitespaceAndNewlineCharacterSet] intoString: NULL]; } RELEASE(aString); } } } } // // See man 5 resolv.conf for all details // on the format of the /etc/resolv.conf file. // - (void) _parseResolvFile { int i; #ifdef HAS_RES_NINIT struct __res_state cw_res; #else #define cw_res _res #endif #ifdef HAS_RES_NINIT memset(&cw_res, 0, sizeof(cw_res)); if (res_ninit(&cw_res) == -1) return; #else if (res_init() == -1) return; #endif if ((cw_res.options & RES_INIT) == 0) return; for (i = 0 ; i < cw_res.nscount; i++ ) { [_servers addObject: [NSNumber numberWithInt: cw_res.nsaddr_list[i].sin_addr.s_addr]]; } #ifdef HAS_RES_NINIT res_ndestroy(&cw_res); #endif } // // // - (void) _processResponse { CWDNSRequest *aRequest; NSString *aString; NSNumber *aNumber; dns_resource_record *resource_record; dns_packet_header *header; char *buf, qr, ra, rcode, *start; unsigned short flags, i, type; unsigned char c0, c1, c2, c3; int r; start = buf = (char *)malloc(MAX_PACKET_SIZE); if (recvfrom(_socket, buf, MAX_PACKET_SIZE, 0, NULL, NULL) == -1) { free(buf); return; } // We build our packet header. We should get (~118 bytes in total): // // - packet identifier // - flags (0x8180) // - qdcount // - ancount // - nscount // - arcount header = (dns_packet_header *)buf; // We get the right DNSRequest object from the queue // based on our packet ID. aRequest = nil; for (i = 0; i < [_queue count]; i++) { aRequest = [_queue objectAtIndex: i]; if (aRequest->packet_id == ntohs(header->packet_id)) break; } if (!aRequest) { free(buf); return; } flags = ntohs(header->flags); qr = (char)((flags & 0x8000) >> 15); // We check if we got a response from the server. If not, // we try the next server, if any. if (!qr) return; ra = (char)((flags & 0x0080) >> 7); // We check if recursive queries are supported by // the server. If not, we try the next server, if any. if (!ra) return; rcode = (char)((flags & 0x000F) >> 0); // We check if we got any errors... // 2 - server failure // 3 - domain does not exist // 5 - the server refused to serve our query if (rcode) { return; } // We check if we got a response from the server. If not, // we try the next server, if any. if (!htons(header->ancount)) return; buf += sizeof(dns_packet_header); // // We skip over the Question section. // while (*buf) { buf += (int)(*buf)+1; } buf += sizeof(dns_packet_question)+1; // // We now read the Answer section of our packet // // 1 1 1 1 1 1 // 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 // +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ // | | // / / // / NAME / // | | // +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ // | TYPE | // +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ // | CLASS | // +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ // | TTL | // | | // +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ // | RDLENGTH | // +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--| // / RDATA / // / / // +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ type = 0; while (type != 1) { if (!((*buf) & 0xC0)) { while (*buf) { buf+=(int)(*buf)+1; } buf-=1; } resource_record = (dns_resource_record *)(buf+=2); type = ntohs(resource_record->type); buf += (sizeof(dns_resource_record)-2)+ntohs(resource_record->rdlength); } buf -= ntohs(resource_record->rdlength); c0 = *(buf); c1 = *(buf+1); c2 = *(buf+2); c3 = *(buf+3); // We store our value in network byte order. #if BYTE_ORDER == BIG_ENDIAN r = (c0<<24)|(c1<<16)|(c2<<8)|c3; #else r = (c3<<24)|(c2<<16)|(c1<<8)|c0; #endif aString = AUTORELEASE([[NSString alloc] initWithData: aRequest->name encoding: NSASCIIStringEncoding]); aNumber = [NSNumber numberWithInt: r]; POST_NOTIFICATION(PantomimeDNSResolutionCompleted, self, ([NSDictionary dictionaryWithObjectsAndKeys: aString, @"Name", aNumber, @"Address", nil])); [_cache setObject: [NSArray arrayWithObject: aNumber] forKey: aString]; // We remove our request from the queue [_queue removeObject: aRequest]; free(start); } // // // - (void) _sendRequest: (CWDNSRequest *) theRequest { NSArray *subdomains; struct sockaddr_in peer_address; dns_packet_question *question; dns_packet_header *header; unsigned short len, i; char *packet, *start; peer_address.sin_family = PF_INET; peer_address.sin_port = htons(53); peer_address.sin_addr.s_addr = [[theRequest->servers objectAtIndex: 0] intValue]; start = packet = (char *)malloc(MAX_PACKET_SIZE); // We build our packet header. We have to set: // // - packet identifier // - flags, we have something like this to fill: // |QR| Opcode |AA|TC|RD|RA| Z | RCODE | // 0 0000 0 0 1 0 000 0000 // - qdcount: 1 entry in the question section. // - ancount: 0 resource record in the answer section // - nscount: 0 name server resource record in the authority records section // - arcount: 0 resource record in the additional records section // //NSLog(@"(0x0100:\t%d to %d\n1:\t\t%d to %d\n", 0x0100, htons(0x0100), 1, htons(1)); header = (dns_packet_header *)packet; header->packet_id = htons(theRequest->packet_id); header->flags = htons(0x0100); header->qdcount = htons(1); header->ancount = header->nscount = header->arcount = 0; // We build our packet question. packet += sizeof(dns_packet_header); // QNAME // a domain name represented as a sequence of labels, where // each label consists of a length octet followed by that // number of octets. The domain name terminates with the // zero length octet for the null label of the root. Note // that this field may be an odd number of octets; no // padding is used. // subdomains = [theRequest->name componentsSeparatedByCString: "."]; for (i = 0; i < [subdomains count]; i++) { *packet = len = [[subdomains objectAtIndex: i] length]; memcpy(++packet, [[subdomains objectAtIndex: i] bytes], len); packet += len; } *(packet++) = '\0'; question = (dns_packet_question *)packet; question->qtype = htons(1); // Type A: 1 a host address question->qclass = htons(1); // IN: 1 the Internet packet += sizeof(dns_packet_question); len = packet-(char *)header; // We queue our DNS request if (![_queue containsObject: theRequest]) [_queue addObject: theRequest]; // We send our packet. If we failed to send it, we don't care since // we'll try to send it to an other server shortly after. sendto(_socket, start, len, 0, (struct sockaddr *)&peer_address, sizeof(struct sockaddr)); free(start); } // // // - (void) _tick: (id) sender { int c; if ((c = [_queue count])) { CWDNSRequest *aRequest; while (c--) { aRequest = [_queue objectAtIndex: c]; if (aRequest->count == MAX_TIMEOUT) { if ([aRequest->servers count] > 1) { [aRequest->servers removeObjectAtIndex: 0]; aRequest->count = 0; [self _sendRequest: aRequest]; } else { NSDictionary *aDictionary; aDictionary = [NSDictionary dictionaryWithObject: AUTORELEASE([[NSString alloc] initWithData: aRequest->name encoding: NSASCIIStringEncoding]) forKey: @"Name"]; POST_NOTIFICATION(PantomimeDNSResolutionFailed, self, aDictionary); [_queue removeObject: aRequest]; } } aRequest->count++; } } } @end pantomime1.2-1.2.2+dfsg1/Framework/Pantomime/CWFlags.h000066400000000000000000000111031276751561200222630ustar00rootroot00000000000000/* ** CWFlags.h ** ** Copyright (c) 2001-2006 ** ** Author: Ludovic Marcotte ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** You should have received a copy of the GNU Lesser General Public ** License along with this library; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef _Pantomime_H_CWFlags #define _Pantomime_H_CWFlags #import #import #import #import #include /*! @class CWFlags @abstract This class provides an interface to message flags. @discussion This class provides methods to deal with message flags. Each message has a set of flags, like answered, deleted, seen, unread, etc. See the PantomimeFlag enum for the list of possible values. */ @interface CWFlags : NSObject { @public PantomimeFlag flags; } /*! @method initWithFlags: @discussion This is the designed initializer for the CWFlags class. @param theFlags The initial set of flags the CWFlags instance will hold. Flags are part of the PantomimeFlag enum and can be combined with a bitwise OR. @result A Flags instance. */ - (id) initWithFlags: (PantomimeFlag) theFlags; /*! @method add: @discussion This method is used to add (combine) an additional flag to an existing set of flags. @param theFlag The flag to add. This value is one of the values of the PantomimeFlag enum. */ - (void) add: (PantomimeFlag) theFlag; /*! @method addFlagsFromData: @discussion This method is used to add flags contained in a NSData instance. Such flags are come normally from parsing a mailbox that contains Status or X-Status headers or from the maildir's info. @param theData The NSData instance from which to parse the flags. @param theFormat The format we are parsing. */ - (void) addFlagsFromData: (NSData *) theData format: (PantomimeFolderFormat) theFormat; /*! @method contain: @discussion This method is used to verify if a specific file is present in the flags set. @param theFlag The flag to verify the presence in the set. Possible values are part of the PantomimeFlag enum. @result YES if the flag is present, NO otherwise. */ - (BOOL) contain: (PantomimeFlag) theFlag; /*! @method replaceWithFlags: @discussion This method is used to replace all flags from the receiver with the ones specified in theFlags. @param theFlags The CWFlags instance which holds the new set of flags. */ - (void) replaceWithFlags: (CWFlags *) theFlags; /*! @method remove: @discussion This method is used to remove a flag from the receicer's set of flags. The possibile values are part of the PantomimeFlag enum. @param theFlag The flag to remove from the set of flags. */ - (void) remove: (PantomimeFlag) theFlag; /*! @method removeAll @discussion This method is used to remove all flags from the receiver. */ - (void) removeAll; /*! @method statusString @discussion This method is used to return a string value of the flags. This representation is commonly used by MUA:s like Pine and belongs to the "Status:" header. @result A string value of the flags. */ - (NSString *) statusString; /*! @method xstatusString @discussion This method is used to return a string value of the flags. This representation is commonly used by MUA:s like Pine and belongs to the "X-Status:" header. @result A string value of the flags. */ - (NSString *) xstatusString; /*! @method maildirString @discussion This method is used to return a string value of the flags. This representation is used by the maildir format. It corresponds to the info semantics and is equivalent to the Status field of the mbox format. The returned string always begins with "2,". @result A string value of the flags. */ - (NSString *) maildirString; @end #endif // _Pantomime_H_CWFlags pantomime1.2-1.2.2+dfsg1/Framework/Pantomime/CWFlags.m000066400000000000000000000103411276751561200222730ustar00rootroot00000000000000/* ** CWFlags.m ** ** Copyright (c) 2001-2004 ** ** Author: Ludovic Marcotte ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** You should have received a copy of the GNU Lesser General Public ** License along with this library; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include #include #define CHECK_FLAG(c, value) \ theRange = [theData rangeOfCString: c]; \ if (theRange.length) { [self add: value]; } // // // @implementation CWFlags - (id) initWithFlags: (PantomimeFlag) theFlags { self = [super init]; flags = theFlags; return self; } // // NSCoding protocol // - (void) encodeWithCoder: (NSCoder *) theCoder { [theCoder encodeObject: [NSNumber numberWithInt: flags]]; } - (id) initWithCoder: (NSCoder *) theCoder { self = [super init]; flags = [[theCoder decodeObject] intValue]; return self; } // // NSCopying protocol // - (id) copyWithZone: (NSZone *) zone { CWFlags *theFlags; theFlags = [[CWFlags alloc] initWithFlags: flags]; return theFlags; } // // // - (void) add: (PantomimeFlag) theFlag { flags = flags|theFlag; } // // // - (void) addFlagsFromData: (NSData *) theData format: (PantomimeFolderFormat) theFormat { NSRange theRange; if (theData) { if (theFormat == PantomimeFormatMbox) { CHECK_FLAG("R", PantomimeSeen); CHECK_FLAG("D", PantomimeDeleted); CHECK_FLAG("A", PantomimeAnswered); CHECK_FLAG("F", PantomimeFlagged); } else if (theFormat == PantomimeFormatMaildir) { CHECK_FLAG("S", PantomimeSeen); CHECK_FLAG("R", PantomimeAnswered); CHECK_FLAG("F", PantomimeFlagged); CHECK_FLAG("D", PantomimeDraft); CHECK_FLAG("T", PantomimeDeleted); } } } // // // - (BOOL) contain: (PantomimeFlag) theFlag { if ((flags&theFlag) == theFlag) { return YES; } else { return NO; } } // // // - (void) replaceWithFlags: (CWFlags *) theFlags { flags = theFlags->flags; } // // // - (void) remove: (PantomimeFlag) theFlag { flags = flags&(flags^theFlag); } // // // - (void) removeAll { flags = 0; } // // // - (NSString *) statusString { return [NSString stringWithFormat: @"%cO", ([self contain: PantomimeSeen] ? 'R' : ' ')]; } // // This is useful if we want to store the flags in the mbox file // when expunging messages from it. We might write in the headers: // // X-Status: FA // // If the message had the "Flagged" and "Answered" flags. // // Note: We store the same value as pine does in order to ease // using mbox files between the two MUAs. // - (NSString *) xstatusString { NSMutableString *aMutableString; aMutableString = [[NSMutableString alloc] init]; if ([self contain: PantomimeDeleted]) { [aMutableString appendFormat: @"%c", 'D']; } if ([self contain: PantomimeFlagged]) { [aMutableString appendFormat: @"%c", 'F']; } if ([self contain: PantomimeAnswered]) { [aMutableString appendFormat: @"%c", 'A']; } return AUTORELEASE(aMutableString); } // // // - (NSString *) maildirString { NSMutableString *aMutableString; aMutableString = [[NSMutableString alloc] initWithString: @"2,"]; if ([self contain: PantomimeDraft]) { [aMutableString appendString: @"D"]; } if ([self contain: PantomimeFlagged]) { [aMutableString appendString: @"F"]; } if ([self contain: PantomimeAnswered]) { [aMutableString appendString: @"R"]; } if ([self contain: PantomimeSeen]) { [aMutableString appendString: @"S"]; } if ([self contain: PantomimeDeleted]) { [aMutableString appendString: @"T"]; } return AUTORELEASE(aMutableString); } @end pantomime1.2-1.2.2+dfsg1/Framework/Pantomime/CWFolder.h000066400000000000000000000516121276751561200224530ustar00rootroot00000000000000/* ** CWFolder.h ** ** Copyright (c) 2001-2006 ** 2013 Free Software Foundation ** ** Author: Ludovic Marcotte ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** You should have received a copy of the GNU Lesser General Public ** License along with this library; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef _Pantomime_H_CWFolder #define _Pantomime_H_CWFolder #import #import #import #import #import #import #include @class CWFlags; @class CWMessage; /*! @const PantomimeFolderAppendCompleted */ extern NSString* PantomimeFolderAppendCompleted; /*! @const PantomimeFolderAppendFailed */ extern NSString* PantomimeFolderAppendFailed; /*! @const PantomimeFolderCloseCompleted */ extern NSString* PantomimeFolderCloseCompleted; /*! @const PantomimeFolderCloseFailed */ extern NSString* PantomimeFolderCloseFailed; /*! @const PantomimeFolderExpungeCompleted */ extern NSString* PantomimeFolderExpungeCompleted; /*! @const PantomimeFolderExpungeFailed */ extern NSString* PantomimeFolderExpungeFailed; /*! @const PantomimeFolderListCompleted */ extern NSString* PantomimeFolderListCompleted; /*! @const PantomimeFolderListFailed */ extern NSString* PantomimeFolderListFailed; /*! @const PantomimeFolderListSubscribedCompleted */ extern NSString* PantomimeFolderListSubscribedCompleted; /*! @const PantomimeFolderListSubscribedFailed */ extern NSString* PantomimeFolderListSubscribedFailed; /*! @const PantomimeFolderOpenCompleted */ extern NSString* PantomimeFolderOpenCompleted; /*! @const PantomimeFolderOpenFailed */ extern NSString* PantomimeFolderOpenFailed; /*! @const PantomimeFolderPrefetchCompleted */ extern NSString* PantomimeFolderPrefetchCompleted; /*! @const PantomimeFolderPrefetchFailed */ extern NSString* PantomimeFolderPrefetchFailed; /*! @const PantomimeFolderSearchCompleted */ extern NSString* PantomimeFolderSearchCompleted; /*! @const PantomimeFolderSearchFailed */ extern NSString* PantomimeFolderSearchFailed; /*! @category NSObject (PantomimeFolderDelegate) @discussion This informal protocol defines methods that can implemented in CWFolder's delegate to control the behavior of the class or to obtain status information. */ @interface NSObject (PantomimeFolderDelegate) /*! @method folderAppendCompleted: @discussion This method is automatically invoked on the store's delegate in order to indicate that the last message append operation was sucessful. A PantomimeFolderAppendCompleted notification is also posted. @param theNotification The notification holding the information. */ - (void) folderAppendCompleted: (NSNotification *) theNotification; /*! @method folderAppendFailed: @discussion This method is automatically invoked on the store's delegate in order to indicate that the last message append operation failed. A PantomimeFolderAppendCompleted notification is also posted. @param theNotification The notification holding the information. */ - (void) folderAppendFailed: (NSNotification *) theNotification; /*! @method folderCloseCompleted @discussion This method is automatically invoked on the store's delegate in order to indicate that the close operation completed. @param theNotification The notification holding the information. */ - (void) folderCloseCompleted: (NSNotification *) theNotification; /*! @method folderCloseFailed @discussion This method is automatically invoked on the store's delegate in order to indicate that the close operation failed. @param theNotification The notification holding the information. */ - (void) folderCloseFailed: (NSNotification *) theNotification; /*! @method folderExpungeCompleted @discussion This method is automatically invoked on the store's delegate in order to indicate that the expunge operation completed. @param theNotification The notification holding the information. */ - (void) folderExpungeCompleted: (NSNotification *) theNotification; /*! @method folderExpungeFailed @discussion This method is automatically invoked on the store's delegate in order to indicate that the expunge operation failed. @param theNotification The notification holding the information. */ - (void) folderExpungeFailed: (NSNotification *) theNotification; /*! @method folderListCompleted @discussion This method is automatically invoked on the store's delegate in order to indicate that the mailbox listing operation completed. @param theNotification The notification holding the information. */ - (void) folderListCompleted: (NSNotification *) theNotification; /*! @method folderListFailed @discussion This method is automatically invoked on the store's delegate in order to indicate that the mailbox listing operation failed. @param theNotification The notification holding the information. */ - (void) folderListFailed: (NSNotification *) theNotification; /*! @method folderListSubscribedCompleted @discussion This method is automatically invoked on the store's delegate in order to indicate that the listing operation of subscribed mailboxes completed. @param theNotification The notification holding the information. */ - (void) folderListSubscribedCompleted: (NSNotification *) theNotification; /*! @method folderListSuscribedFailed @discussion This method is automatically invoked on the store's delegate in order to indicate that the listing operation of subscribed mailboxes failed. @param theNotification The notification holding the information. */ - (void) folderListSubscribedFailed: (NSNotification *) theNotification; /*! @method folderOpenCompleted @discussion This method is automatically invoked on the store's delegate in order to indicate that the open operation completed. @param theNotification The notification holding the information. */ - (void) folderOpenCompleted: (NSNotification *) theNotification; /*! @method folderOpenFailed @discussion This method is automatically invoked on the store's delegate in order to indicate that the open operation failed. @param theNotification The notification holding the information. */ - (void) folderOpenFailed: (NSNotification *) theNotification; /*! @method folderPrefetchCompleted @discussion This method is automatically invoked on the store's delegate in order to indicate that the prefetch operation completed. @param theNotification The notification holding the information. */ - (void) folderPrefetchCompleted: (NSNotification *) theNotification; /*! @method folderPrefetchFailed @discussion This method is automatically invoked on the store's delegate in order to indicate that the prefetch operation failed. @param theNotification The notification holding the information. */ - (void) folderPrefetchFailed: (NSNotification *) theNotification; /*! @method folderSearchCompleted @discussion This method is automatically invoked on the store's delegate in order to indicate that the search operation completed. @param theNotification The notification holding the information. */ - (void) folderSearchCompleted: (NSNotification *) theNotification; /*! @method folderSearchFailed @discussion This method is automatically invoked on the store's delegate in order to indicate that the search operation failed. @param theNotification The notification holding the information. */ - (void) folderSearchFailed: (NSNotification *) theNotification; @end /*! @class CWFolder @abstract A CWFolder object holds CWMessage instances. @discussion This abstract class is used to represent a folder which holds messages. A folder is a synonym for mailbox. Normally, you should never create an instance of CWFolder directly but rather use the subclasses which are CWIMAPFolder, CWLocalFolder and CWPOP3Folder. Futhermore, the corresponding CWStore classes will instanciate the CWFolder subclasses for you. */ @interface CWFolder : NSObject { @public NSMutableArray *allMessages; @protected NSMutableDictionary *_properties; NSString *_name; id _cacheManager; id _store; NSMutableArray *_allVisibleMessages; NSMutableArray *_allContainers; BOOL _show_deleted; BOOL _show_read; PantomimeFolderMode _mode; } /*! @method initWithName: @discussion This method initialize a folder with the specified name. The name can contain folder separators in order to create subfolders. The separator can be obtained from a class that implements the CWStore protocol. @param theName The full path of the folder. @result The folder, nil in case of an error. */ - (id) initWithName: (NSString *) theName; /*! @method name @discussion This method returns the name of the folder. @result The full name of the folder. */ - (NSString *) name; /*! @method setName: @discussion Sets the name of a folder. @param theName The name of the folder. */ - (void) setName: (NSString *) theName; /*! @method appendMessage: @discussion This method is used to add a message to a CWFolder instance. This method will NOT add the message to the underlying store. You MUST use -appendMessageFromRawSource: flags: if you want the message to be saved to the underlying store. Generally, you should not use this method directly. If the folder was threaded, this method will NOT thread the appended message. @param theMessage The message to append to the folder. */ - (void) appendMessage: (CWMessage *) theMessage; /*! @method appendMessageFromRawSource:flags: @discussion This method is used to append a message from its raw source representation (RFC2822 compliant) to the underlying store. This method will raise an exception if it's invoked on an instance of CWFolder or CWPOP3Folder instead of an instance of CWIMAPFolder and CWLocalFolder. If the folder was threaded, this method will NOT thread the appended message. Methods will be invoked on the delegate and notifications will be posted. See the PantomimeFolderDelegate informal protocol for more details. @param theData The raw representation of the message to append. @param theFlags The flags of the message, nil if no flags need to be kept. */ - (void) appendMessageFromRawSource: (NSData *) theData flags: (CWFlags *) theFlags; /*! @method allMessages @discussion This method is used to obtain all visible messages in the CWFolder instance. It hides messages marked as Deleted if -setShowDeleted: was invoked with NO as the parameter and the the same for messages marked as read (see -setShowRead:). Note that the messages MIGHT NOT been all completely initialized. @result An array of all visible messages. */ - (NSArray *) allMessages; /*! @method setMessages: @discussion This method is used to replace all messages in the CWFolder instance by the ones specified in the array. Normally, you shouldn't use this method directly. @param theMessages The array of messages. */ - (void) setMessages: (NSArray *) theMessages; /*! @method messageAtIndex: @discussion This method is used to obtain the message at the specified index (which is zero-based). If the index is out of bounds, nil is returned. @param theIndex The index of the message. @result The message at the specified index, nil otherwise. */ - (CWMessage *) messageAtIndex: (int) theIndex; /*! @method count @discussion This method is used to obtain the number of messages present in the folder. Hidden messages will NOT be part of the value returned. So, for example, if a folder has 10 messages, 2 of them have the PantomimeDeleted flag set and -setShowDeleted: NO was invoked on the folder, this method will return 8 as the messages count. @result The number of messages in the folder. */ - (NSUInteger) count; /*! @method close @discussion This method is used to close the folder. The subclasses of CWFolder MUST this method. */ - (void) close; /*! @method expunge: @discussion This method is used to permanently remove messages marked as deleted in the folder. */ - (void) expunge; /*! @method store @discussion This method returns the associated store to this folder. This will generally be an instance of CWIMAPStore, CWLocalStore or CWPOP3Store. @result The associated store. */ - (id) store; /*! @method setStore: @discussion This method is used to set the associated store to this folder. The store will NOT be retained since it is the store which holds and retains the CWFolder instances. @param theStore The associated store. */ - (void) setStore: (id) theStore; /*! @method removeMessage: @discussion This method removes permenantly a message from the folder. It is used when transferring message between folders in order to update the view or when expunge deletes messages from a view. If the folder is threaded, this method will rethread the folder before returning. @param theMessage The CWMessage instance to remove from the folder. */ - (void) removeMessage: (CWMessage *) theMessage; /*! @method showDeleted @discussion This method returns YES if messages marked as deleted are shown in this folder, NO otherwise. @result A BOOL corresponding to the value. */ - (BOOL) showDeleted; /*! @method setShowDeleted: @discussion This method is used to specify if we want to show or hide messages marked as deleted in this folder. @param theBOOL YES if we want to hide messages marked as deleted, NO otherwise. */ - (void) setShowDeleted: (BOOL) theBOOL; /*! @method showRead @discussion This method returns YES if messages marked as read are shown in this folder, NO otherwise. @result A BOOL corresponding to the value. */ - (BOOL) showRead; /*! @method setShowRead: @discussion This method is used to specify if we want to show or hide messages marked as read in this folder. @param theBOOL YES if we want to hide messages marked as read, NO otherwise. */ - (void) setShowRead: (BOOL) theBOOL; /*! @method numberOfDeletedMessages @discussion This method returns the number of messages in this folder that have the PantomimeDeleted flag set. @result The number of message marked has deleted, 0 if none. */ - (NSUInteger) numberOfDeletedMessages; /*! @method numberOfUnreadMessages @discussion This method returns the number of messages in this folder that do not have the PantomimeSeen flag set. @result The number of unread messages, 0 if none. */ - (NSUInteger) numberOfUnreadMessages; /*! @method size @discussion This method returns the size of the folder. That is, it returns the sum of the size of all visible messages in the folder. @result The size of the folder. */ - (long) size; /*! @method updateCache @discussion This method is used to update our cache (_allVisibleMessages). Applications can call this method if they set the PantomimeDeleted flags to messages inside this folder. If not called, the cache won't be updated the messages having the flag PantomimeDeleted will still be visible. */ - (void) updateCache; /*! @method allContainers @discussion This method returns the list of root containers when using message threading. @result Root containers if using message threading, nil otherwise. */ - (NSArray *) allContainers; /*! @method thread @discussion This method implements Jamie Zawinski's message threading algorithm. The full algorithm is available here: http://www.jwz.org/doc/threading.html After calling this method, -allContainers can be called to obtain the root set of CWContainer instances. */ - (void) thread; /*! @method unthread @discussion This method is used to release all resources taken by the message threading code. After calling this method, -allContainers will return nil. */ - (void) unthread; /*! @method search: mask: options: @discussion This method is used to search this folder using a criteria, mask and options. This method will post a PantomimeFolderSearchCompleted (or invoked -folderSearchCompleted: on the delegate) once it has completed its execution (or post PantomimeFolderSearchFailed or invoke -folderSearchFailed on the delegate if it failed). This method will do absolutely nothing on CWPOP3Folder instances as search operations are not supported in POP3. @param theString The string to search for. This can be a regex for LocalFolder instances. @param theMask The mask to use. The values can be either one of the PantomimeSearchMask enum. This parameter is ignored for IMAPFolder instances. @param theOptions The search options. Can be either PantomimeRegularExpression or PantomimeCaseInsensitiveSearch. This parameter is ignored for CWIMAPFolder instances. */ - (void) search: (NSString *) theString mask: (PantomimeSearchMask) theMask options: (PantomimeSearchOption) theOptions; /*! @method cacheManager @discussion This method returns the associated cache manager for this folder. For a CWIMAPFolder, a CWIMAPCacheManager instance will be returned. For a CWLocalFolder, a CWLocalFolderCacheManager instance will be returned. For a CWPOP3Folder, a CWPOP3CacheManager instance will be returned. @result The associated cache manager instance, nil otherwise. */ - (id) cacheManager; /*! @method setCacheManager: @discussion This method is used to set the respective cache manager instance for this folder. Instance of CWIMAPCacheManager, CWLocalFolderCacheManager or CWPOP3CacheManager will generally be used. @param theCacheManager The cache manager instance for this folder. */ - (void) setCacheManager: (id) theCacheManager; /*! @method mode @discussion This method is used to get the mode of the folders. The returned values can be either PantomimeUnknownMode, PantomimeReadOnlyMode or PantomimeReadWriteMode. Calling this method on an instance of Folder (ie., not a subclass) will raise an exception. @result The mode of the folder. */ - (PantomimeFolderMode) mode; /*! @method setMode: @discussion This method is used to adjust the mode on the specified folder. If has no impact on how the mailbox was open. For example, if a mailbox was open as read-only, the mailbox will not be re-opened as read-write after this method call. @param theMode The new mode. */ - (void) setMode: (PantomimeFolderMode) theMode; /*! @method setFlags: messages: @discussion This method is used to set the same flags to a set of messages. This can be useful, especially when dealing with CWIMAPFolder instances in order to NOT send many IMAP commands to the server but rather send just one. @param theFlags The flags to set to all messages. @param theMessages The array of messages to which flags will be applied. */ - (void) setFlags: (CWFlags *) theFlags messages: (NSArray *) theMessages; /*! @method propertyForKey: @discussion This method is used to get an extra property for the specified key. @result The property for the specified key, nil if key isn't found. */ - (id) propertyForKey: (id) theKey; /*! @method setProperty: forKey: @discussion This method is used to set an extra property for the specified key on this folder. If nil is passed for theProperty parameter, the value will actually be REMOVED for theKey. @param theProperty The value of the property. @param theKey The key of the property. */ - (void) setProperty: (id) theProperty forKey: (id) theKey; @end #endif // _Pantomime_H_CWFolder pantomime1.2-1.2.2+dfsg1/Framework/Pantomime/CWFolder.m000066400000000000000000000521531276751561200224610ustar00rootroot00000000000000/* ** CWFolder.m ** ** Copyright (c) 2001-2007 ** 2013 Free Software Foundation ** ** Author: Ludovic Marcotte ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** You should have received a copy of the GNU Lesser General Public ** License along with this library; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include #include #include #include #include #include #include #include // // // @implementation CWFolder - (id) initWithName: (NSString *) theName { self = [super init]; _properties = [[NSMutableDictionary alloc] init]; _allVisibleMessages = nil; allMessages = [[NSMutableArray alloc] init]; // // By default, we don't do message threading so we don't // initialize this ivar for no reasons // _allContainers = nil; _cacheManager = nil; _mode = PantomimeUnknownMode; [self setName: theName]; [self setShowDeleted: NO]; [self setShowRead: YES]; return self; } // // // - (void) dealloc { //NSLog(@"Folder: -dealloc"); RELEASE(_properties); RELEASE(_name); TEST_RELEASE(_allContainers); // // To be safe, we set the value of the _folder ivar of all CWMessage // instances to nil value in case something is retaining them. // [allMessages makeObjectsPerformSelector: @selector(setFolder:) withObject: nil]; RELEASE(allMessages); TEST_RELEASE(_allVisibleMessages); TEST_RELEASE(_cacheManager); [super dealloc]; } // // NSCopying protocol (FIXME) // - (id) copyWithZone: (NSZone *) zone { return RETAIN(self); } // // // - (NSString *) name { return _name; } // // // - (void) setName: (NSString *) theName { ASSIGN(_name, theName); } // // // - (void) appendMessage: (CWMessage *) theMessage { if (theMessage) { [allMessages addObject: theMessage]; if (_allVisibleMessages) { [_allVisibleMessages addObject: theMessage]; } // FIXME // If we've done message threading, we simply append the message // to the end of our containers array. We might want to place // it in the right thread in the future. if (_allContainers) { CWContainer *aContainer; aContainer = [[CWContainer alloc] init]; aContainer->message = theMessage; [theMessage setProperty: aContainer forKey: @"Container"]; [_allContainers addObject: aContainer]; RELEASE(aContainer); } } } // // // - (void) appendMessageFromRawSource: (NSData *) theData flags: (CWFlags *) theFlags { [self subclassResponsibility: _cmd]; } // // // - (NSArray *) allContainers { return _allContainers; } // // // - (NSArray *) allMessages { if (_allVisibleMessages == nil) { int i, count; count = [allMessages count]; _allVisibleMessages = [[NSMutableArray alloc] initWithCapacity: count]; // quick if (_show_deleted && _show_read) { [_allVisibleMessages addObjectsFromArray: allMessages]; return _allVisibleMessages; } for (i = 0; i < count; i++) { CWMessage *aMessage; aMessage = [allMessages objectAtIndex: i]; // We show or hide deleted messages if (_show_deleted) { [_allVisibleMessages addObject: aMessage]; } else { if ([[aMessage flags] contain: PantomimeDeleted]) { // Do nothing continue; } else { [_allVisibleMessages addObject: aMessage]; } } // We show or hide read messages if (_show_read) { if (![_allVisibleMessages containsObject: aMessage]) { [_allVisibleMessages addObject: aMessage]; } } else { if ([[aMessage flags] contain: PantomimeSeen]) { if (![[aMessage flags] contain: PantomimeDeleted]) { [_allVisibleMessages removeObject: aMessage]; } } else if (![_allVisibleMessages containsObject: aMessage]) { [_allVisibleMessages addObject: aMessage]; } } } } return _allVisibleMessages; } // // // - (void) setMessages: (NSArray *) theMessages { if (theMessages) { RELEASE(allMessages); allMessages = [[NSMutableArray alloc] initWithArray: theMessages]; if (_allContainers) { [self thread]; } } else { DESTROY(allMessages); } DESTROY(_allVisibleMessages); } // // // - (CWMessage *) messageAtIndex: (int) theIndex { if (theIndex < 0 || theIndex >= [self count]) { return nil; } return [[self allMessages] objectAtIndex: theIndex]; } // // // - (NSUInteger) count { return [[self allMessages] count]; } // // // - (void) close { [self subclassResponsibility: _cmd]; return; } // // // - (void) expunge { [self subclassResponsibility: _cmd]; } // // // - (id) store { return _store; } // // No need to retain the store here since our store object // retains our folder object. // - (void) setStore: (id) theStore { _store = theStore; } // // // - (void) removeMessage: (CWMessage *) theMessage { if (theMessage) { [allMessages removeObject: theMessage]; if (_allVisibleMessages) { [_allVisibleMessages removeObject: theMessage]; } // FIXME - We must go through our _allContainers ivar in order // to find the message that has just been removed from // this folder. We must go through all levels. // Right now, we simply do again our message threading algo if (_allContainers) { [self thread]; } } } // // // - (BOOL) showDeleted { return _show_deleted; } // // // - (void) setShowDeleted: (BOOL) theBOOL { if (theBOOL != _show_deleted) { _show_deleted = theBOOL; DESTROY(_allVisibleMessages); } } // // // - (BOOL) showRead { return _show_read; } // // // - (void) setShowRead: (BOOL) theBOOL { if (theBOOL != _show_read) { _show_read = theBOOL; DESTROY(_allVisibleMessages); } } // // // - (NSUInteger) numberOfDeletedMessages { int c, i, count; c = [allMessages count]; count = 0; for (i = 0; i < c; i++) { if ([[[allMessages objectAtIndex: i] flags] contain: PantomimeDeleted]) { count++; } } return count; } // // // - (NSUInteger) numberOfUnreadMessages { NSUInteger i, c, count; c = [allMessages count]; count = 0; for (i = 0; i < c; i++) { if (![[[allMessages objectAtIndex: i] flags] contain: PantomimeSeen]) { count++; } } return count; } // // // - (long) size; { long size; int c, i; c = [allMessages count]; size = 0; for (i = 0; i < c; i++) { size += [(CWMessage *)[allMessages objectAtIndex: i] size]; } return size; } // // // - (void) updateCache { DESTROY(_allVisibleMessages); } // // // - (void) thread { NSMapTable *id_table, *subject_table; NSAutoreleasePool *pool; int i, count; // We clean up ... TEST_RELEASE(_allContainers); // We create our local autorelease pool pool = [[NSAutoreleasePool alloc] init]; // Build id_table and our containers mutable array id_table = NSCreateMapTable(NSObjectMapKeyCallBacks, NSObjectMapValueCallBacks, 16); _allContainers = [[NSMutableArray alloc] init]; // // 1. A., B. and C. // count = [allMessages count]; for (i = 0; i < count; i++) { CWContainer *aContainer; CWMessage *aMessage; NSString *aReference; int j; // So that gcc shutup aMessage = nil; aReference = nil; aMessage = [allMessages objectAtIndex: i]; // We skip messages that don't have a valid Message-ID if (![aMessage messageID]) { aContainer = [[CWContainer alloc] init]; aContainer->message = aMessage; [aMessage setProperty: aContainer forKey: @"Container"]; [_allContainers addObject: aContainer]; RELEASE(aContainer); continue; } // // A. // aContainer = NSMapGet(id_table, [aMessage messageID]); if (aContainer) { //aContainer->message = aMessage; if (aContainer->message != aMessage) { aContainer = [[CWContainer alloc] init]; aContainer->message = aMessage; [aMessage setProperty: aContainer forKey: @"Container"]; NSMapInsert(id_table, [aMessage messageID], aContainer); DESTROY(aContainer); } } else { aContainer = [[CWContainer alloc] init]; aContainer->message = aMessage; [aMessage setProperty: aContainer forKey: @"Container"]; NSMapInsert(id_table, [aMessage messageID], aContainer); DESTROY(aContainer); } // // B. For each element in the message's References field: // for (j = 0; j < [[aMessage allReferences] count]; j++) { // We get a Message-ID aReference = [[aMessage allReferences] objectAtIndex: j]; // Find a container object for the given Message-ID aContainer = NSMapGet(id_table, aReference); if (aContainer) { // We found it. We use that. } // Otherwise, make (and index) one (new Container) with a null Message else { aContainer = [[CWContainer alloc] init]; NSMapInsert(id_table, aReference, aContainer); RELEASE(aContainer); } // NOTE: // aContainer is valid here. It points to the message (could be a nil message) // that has a Message-ID equals to the current aReference value. // If we are currently using the last References's entry of our list, // we simply break the loop since we are gonna set it in C. //if ( j == ([[aMessage allReferences] count] - 1) ) // { // break; // } // Link the References field's Containers together in the order implied by the References header. // The last references if (j == ([[aMessage allReferences] count] - 1) && aContainer->parent == nil) { // We grab the container of our current message [((CWContainer *)NSMapGet(id_table, [aMessage messageID])) setParent: aContainer]; } // We set the child //if ( aContainer->message != aMessage && // aContainer->child == nil ) // { // [aContainer setChild: NSMapGet(id_table, [aMessage messageID])]; // } } // for (j = 0; ... // NOTE: The loop is over here. It was an ascending loop so // aReference points to the LAST reference in our References list // // C. Set the parent of this message to be the last element in References. // // NOTE: Again, aReference points to the last Message-ID in the References list // We get the container for the CURRENT message aContainer = (CWContainer *)NSMapGet(id_table, [aMessage messageID]); // If we have no References and no In-Reply-To fields, we simply set a // the parent to nil since it can be the message that started the thread. if ([[aMessage allReferences] count] == 0 && [aMessage headerValueForName: @"In-Reply-To"] == nil) { [aContainer setParent: nil]; } // If we have no References but an In-Reply-To field, that becomes our parent. else if ([[aMessage allReferences] count] == 0 && [aMessage headerValueForName: @"In-Reply-To"]) { [aContainer setParent: (CWContainer *)NSMapGet(id_table, [aMessage headerValueForName: @"In-Reply-To"])]; // FIXME, should we really do that? or should we do it in B? [(CWContainer *)NSMapGet(id_table, [aMessage headerValueForName: @"In-Reply-To"]) setChild: aContainer]; } else { [aContainer setParent: (CWContainer *)NSMapGet(id_table, aReference)]; [(CWContainer *)NSMapGet(id_table, aReference) setChild: aContainer]; } } // for (i = 0; ... // // 2. Find the root set. // [_allContainers addObjectsFromArray: NSAllMapTableValues(id_table)]; //while (NO) for (i = ([_allContainers count] - 1); i >= 0; i--) { CWContainer *aContainer; aContainer = [_allContainers objectAtIndex: i]; if (aContainer->parent != nil) { [_allContainers removeObjectAtIndex: i]; } } // // 3. Discard id_table. // NSFreeMapTable(id_table); // // 4. Prune empty containers. // //while (NO) for (i = ([_allContainers count] - 1); i >= 0; i--) { CWContainer *aContainer; aContainer = [_allContainers objectAtIndex: i]; // Recursively walk all containers under the root set. while (aContainer) { // A. If it is an empty container with no children, nuke it if (aContainer->message == nil && aContainer->child == nil) { // We nuke it // FIXME: Won't work for non-root containers. [_allContainers removeObject: aContainer]; } // B. If the Container has no Message, but does have children, remove this container but // promote its children to this level (that is, splice them in to the current child list.) // Do not promote the children if doing so would promote them to the root set // -- unless there is only one child, in which case, do. // FIXME: We promote to the root no matter what :) if (aContainer->message == nil && aContainer->child) { CWContainer *c; c = aContainer; RETAIN(c); [c->child setParent: nil]; [_allContainers removeObject: c]; [_allContainers addObject: c->child]; // We promote the the root for now // We go to our child and we continue to loop //aContainer = aContainer->child; aContainer = [aContainer childAtIndex: ([aContainer count]-1)]; RELEASE(c); continue; } //aContainer = aContainer->child; aContainer = [aContainer childAtIndex: ([aContainer count]-1)]; } } // // 5. Group root set by subject. // // A. Construct a new hash table, subject_table, which associates subject // strings with Container objects. subject_table = NSCreateMapTable(NSObjectMapKeyCallBacks, NSObjectMapValueCallBacks, 16); // // B. For each Container in the root set: // //while (NO) for (i = 0; i < [_allContainers count]; i++) { CWContainer *aContainer; CWMessage *aMessage; NSString *aString; aContainer = [_allContainers objectAtIndex: i]; aMessage = aContainer->message; aString = [aMessage subject]; if (aString) { aString = [aMessage baseSubject]; // If the subject is now "", give up on this Container. if ([aString length] == 0) { //aContainer = aContainer->child; continue; } // We set the new subject //[aMessage setSubject: aString]; // Add this Container to the subject_table if: // o There is no container in the table with this subject, or // o This one is an empty container and the old one is not: // the empty one is more interesting as a root, so put it in the table instead. // o The container in the table has a ``Re:'' version of this subject, // and this container has a non-``Re:'' version of this subject. // The non-re version is the more interesting of the two. if (!NSMapGet(subject_table, aString)) { NSMapInsert(subject_table, aString, aContainer); } else { NSString *aSubject; // We obtain the subject of the message of our container. aSubject = [((CWContainer *)NSMapGet(subject_table, aString))->message subject]; if ([aSubject hasREPrefix] && ![[aMessage subject] hasREPrefix]) { // We replace the container NSMapRemove(subject_table, aString); NSMapInsert(subject_table, [aMessage subject], aContainer); } } } // if ( aString ) } // // C. Now the subject_table is populated with one entry for each subject which occurs in // the root set. Now iterate over the root set, and gather together the difference. // //while (NO) for (i = ([_allContainers count]-1); i >= 0; i--) { CWContainer *aContainer, *containerFromTable; NSString *aSubject, *aString; aContainer = [_allContainers objectAtIndex: i]; // Find the subject of this Container (as above.) aSubject = [aContainer->message subject]; aString = [aContainer->message baseSubject]; // Look up the Container of that subject in the table. // If it is null, or if it is this container, continue. containerFromTable = NSMapGet(subject_table, aString); if (!containerFromTable || containerFromTable == aContainer) { continue; } // If that container is a non-empty, and that message's subject does // not begin with ``Re:'', but this message's subject does, then make this be a child of the other. if (![[containerFromTable->message subject] hasREPrefix] && [aSubject hasREPrefix]) { [aContainer setParent: containerFromTable]; [containerFromTable setChild: aContainer]; [_allContainers removeObject: aContainer]; } // If that container is a non-empty, and that message's subject begins with ``Re:'', // but this message's subject does not, then make that be a child of this one -- // they were misordered. (This happens somewhat implicitly, since if there are two // messages, one with Re: and one without, the one without will be in the hash table, // regardless of the order in which they were seen.) else if ([[containerFromTable->message subject] hasREPrefix] && ![aSubject hasREPrefix]) { [containerFromTable setParent: aContainer]; [aContainer setChild: containerFromTable]; [_allContainers removeObject: containerFromTable]; } // Otherwise, make a new empty container and make both msgs be a child of it. // This catches the both-are-replies and neither-are-replies cases, and makes them // be siblings instead of asserting a hierarchical relationship which might not be true. else { #if 0 // FIXME - not so sure about that step. CWContainer *aNewContainer; aNewContainer = [[CWContainer alloc] init]; [aContainer setParent: aNewContainer]; [containerFromTable setParent: aNewContainer]; [aNewContainer setChild: aContainer]; [aNewContainer setChild: containerFromTable]; [_allContainers addObject: aNewContainer]; RELEASE(aNewContainer); // We remove .. [_allContainers removeObject: aContainer]; [_allContainers removeObject: containerFromTable]; #endif } } NSFreeMapTable(subject_table); // // 6. Now you're done threading! // // Specifically, you no longer need the ``parent'' slot of the Container object, // so if you wanted to flush the data out into a smaller, longer-lived structure, you // could reclaim some storage as a result. // // GNUMail.app DOES USE the parent slot so we keep it. // // 7. Now, sort the siblings. // // At this point, the parent-child relationships are set. However, the sibling ordering // has not been adjusted, so now is the time to walk the tree one last time and order the siblings // by date, sender, subject, or whatever. This step could also be merged in to the end of step 4, // above, but it's probably clearer to make it be a final pass. If you were careful, you could // also sort the messages first and take care in the above algorithm to not perturb the ordering, // but that doesn't really save anything. // // By default we at least sort everything by number. //[_allContainers sortUsingSelector: @selector(compareAccordingToNumber:)]; RELEASE(pool); } // // // - (void) unthread { int count; count = [allMessages count]; while (count--) { [[allMessages objectAtIndex: count] setProperty: nil forKey: @"Container"]; } DESTROY(_allContainers); } // // // - (void) search: (NSString *) theString mask: (PantomimeSearchMask) theMask options: (PantomimeSearchOption) theOptions { [self subclassResponsibility: _cmd]; } // // // - (id) cacheManager { return _cacheManager; } - (void) setCacheManager: (id) theCacheManager { ASSIGN(_cacheManager, theCacheManager); } // // // - (PantomimeFolderMode) mode { return _mode; } // // // - (void) setMode: (PantomimeFolderMode) theMode { _mode = theMode; } // // // - (void) setFlags: (CWFlags *) theFlags messages: (NSArray *) theMessages { int c, i; c = [theMessages count]; for (i = 0; i < c; i++) { [[theMessages objectAtIndex: i] setFlags: theFlags]; } } // // // - (id) propertyForKey: (id) theKey { return [_properties objectForKey: theKey]; } // // // - (void) setProperty: (id) theProperty forKey: (id) theKey { if (theProperty) { [_properties setObject: theProperty forKey: theKey]; } else { [_properties removeObjectForKey: theKey]; } } @end pantomime1.2-1.2.2+dfsg1/Framework/Pantomime/CWFolderInformation.h000066400000000000000000000055041276751561200246600ustar00rootroot00000000000000/* ** CWFolderInformation.h ** ** Copyright (c) 2002-2004 ** ** Author: Ludovic Marcotte ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** You should have received a copy of the GNU Lesser General Public ** License along with this library; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef _Pantomime_H_CWFolderInformation #define _Pantomime_H_CWFolderInformation #import /*! @class CWFolderInformation @discussion This class provides a container to cache folder information like the number of messages and unread messages the folder holds, and its total size. Normally you won't use this class directly but CWFolder's subclasses return instances of this class, when calling -folderStatus on a CWFolder instance. */ @interface CWFolderInformation : NSObject { @private unsigned int _nb_of_messages; unsigned int _nb_of_unread_messages; unsigned int _size; } /*! @method nbOfMessages @discussion This method is used to get the total number of messages value from this container object. @result The total number of messages. */ - (unsigned int) nbOfMessages; /*! @method setNbOfMessages: @discussion This method is used to set the total number of messages of this container object. @param theValue The number of messages. */ - (void) setNbOfMessages: (unsigned int) theValue; /*! @method nbOfUnreadMessages @discussion This method is used to get the total number of unread messages value from this container object. @result The total number of unread messages. */ - (unsigned int) nbOfUnreadMessages; /*! @method setNbOfUnreadMessages: @discussion This method is used to set the total number of unread messages of this container object. @param theValue The number of unread messages. */ - (void) setNbOfUnreadMessages: (unsigned int) theValue; /*! @method size @discussion This method is used to get the total size of this container object. @result The total size. */ - (unsigned int) size; /*! @method setSize: @discussion This method is used to set the total size of this container object. @param theSize The total size. */ - (void) setSize: (unsigned int) theSize; @end #endif // _Pantomime_H_CWFolderInformation pantomime1.2-1.2.2+dfsg1/Framework/Pantomime/CWFolderInformation.m000066400000000000000000000030311276751561200246560ustar00rootroot00000000000000/* ** CWFolderInformation.m ** ** Copyright (c) 2002-2004 ** ** Author: Ludovic Marcotte ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** You should have received a copy of the GNU Lesser General Public ** License along with this library; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include // // // @implementation CWFolderInformation - (id) init { self = [super init]; _nb_of_messages = _nb_of_unread_messages = _size = 0; return self; } // // // - (unsigned int) nbOfMessages { return _nb_of_messages; } // // // - (void) setNbOfMessages: (unsigned int) theValue { _nb_of_messages = theValue; } // // // - (unsigned int) nbOfUnreadMessages { return _nb_of_unread_messages; } // // // - (void) setNbOfUnreadMessages: (unsigned int) theValue { _nb_of_unread_messages = theValue; } // // // - (unsigned int) size { return _size; } // // // - (void) setSize: (unsigned int) theSize { _size = theSize; } @end pantomime1.2-1.2.2+dfsg1/Framework/Pantomime/CWIMAPCacheManager.h000066400000000000000000000055531276751561200242100ustar00rootroot00000000000000/* ** CWIMAPCacheManager.h ** ** Copyright (c) 2001-2007 ** ** Author: Ludovic Marcotte ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** You should have received a copy of the GNU Lesser General Public ** License along with this library; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef _Pantomime_H_CWIMAPCacheManager #define _Pantomime_H_CWIMAPCacheManager #import #include @class CWFolder; @class CWIMAPMessage; /*! @class CWIMAPCacheManager @discussion This class provides trivial extensions to the CWCacheManager superclass for CWIMAPFolder instances. */ @interface CWIMAPCacheManager: CWCacheManager { @private NSMapTable *_table; unsigned int _UIDValidity; CWFolder *_folder; } - (void) initInRange: (NSRange) theRange; /*! @method messageWithUID: @discussion This method is used to obtain the CWIMAPMessage instance from the receiver's cache. @param theUID The UID of the message to obtain from the cache. @result The instance, nil if not present in the receiver's cache. */ - (CWIMAPMessage *) messageWithUID: (NSUInteger) theUID; /*! @method removeMessageWithUID: @discussion This method is used to remove the associated message from the cache based on the supplied UID. @param theUID The UID of the message to remove from the cache. */ - (void) removeMessageWithUID: (NSUInteger) theUID; /*! @method UIDValidity @discussion This method is used to obtain the UID validity value of the receiver's cache. If it doesn't match the UID validity of its associated CWIMAPFolder instance, you should invalidate the cache. @result The UID validity. */ - (unsigned int) UIDValidity; /*! @method setUIDValidity: @discussion This method is used to set the UID validity value of the receiver's cache. @param theUIDValidity The value to set. */ - (void) setUIDValidity: (unsigned int) theUIDValidity; /*! @method writeRecord:message: @discussion This method is used to write a cache record to disk. @param theRecord The record to write. @param theMessage The message associated to the record theRecord. */ - (void) writeRecord: (cache_record *) theRecord message: (id) theMessage; @end #endif // _Pantomime_H_CWIMAPCacheManager pantomime1.2-1.2.2+dfsg1/Framework/Pantomime/CWIMAPCacheManager.m000066400000000000000000000270471276751561200242170ustar00rootroot00000000000000/* ** CWIMAPCacheManager.m ** ** Copyright (c) 2001-2007 Ludovic Marcotte ** 2013-2014 ** ** Author: Ludovic Marcotte ** Riccardo Mottola ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** You should have received a copy of the GNU Lesser General Public ** License along with this library; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #import #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include static unsigned short version = 1; // // // @implementation CWIMAPCacheManager - (id) initWithPath: (NSString *) thePath folder: (id) theFolder { NSDictionary *attributes; unsigned short int v; self = [super initWithPath: thePath]; _table = NSCreateMapTable(NSIntMapKeyCallBacks, NSObjectMapValueCallBacks, 128); _count = _UIDValidity = 0; _folder = theFolder; if ((_fd = open([thePath UTF8String], O_RDWR|O_CREAT, S_IRUSR|S_IWUSR)) < 0) { NSLog(@"CANNOT CREATE OR OPEN THE CACHE!)"); abort(); } if (lseek(_fd, 0L, SEEK_SET) < 0) { close(_fd); NSLog(@"UNABLE TO LSEEK INITIAL"); abort(); } attributes = [[NSFileManager defaultManager] fileAttributesAtPath: thePath traverseLink: NO]; // If the cache exists, lets parse it. if ([[attributes objectForKey: NSFileSize] intValue]) { v = read_unsigned_short(_fd); if (v != version) { if (ftruncate(_fd, 0) == -1) { if (errno == EACCES || errno == EROFS) NSLog(@"UNABLE TO TRUNCATE CACHE FILE WITH OLD VERSION, NOT WRITABLE"); else NSLog(@"UNABLE TO TRUNCATE CACHE FILE WITH OLD VERSION"); close(_fd); abort(); } [self synchronize]; return self; } _count = read_unsigned_int(_fd); _UIDValidity = read_unsigned_int(_fd); } else { [self synchronize]; } return self; } // // // - (void) dealloc { //NSLog(@"CWIMAPCacheManager: -dealloc"); NSFreeMapTable(_table); if (_fd >= 0) close(_fd); [super dealloc]; } // // // - (void) initInRange: (NSRange) theRange { NSAutoreleasePool *pool; CWIMAPMessage *aMessage; unsigned short int len, tot; int begin, end, i; unsigned char *r, *s; if (lseek(_fd, 10L, SEEK_SET) < 0) { NSLog(@"lseek failed in initInRange:"); abort(); } begin = theRange.location; end = (NSMaxRange(theRange) <= _count ? NSMaxRange(theRange) : _count); //NSLog(@"init from %d to %d, count = %d, size of char %d UID validity = %d", begin, end, _count, sizeof(char), _UIDValidity); pool = [[NSAutoreleasePool alloc] init]; s = (unsigned char *)malloc(65536); // We MUST skip the last few bytes... for (i = begin; i < end ; i++) { aMessage = [[CWIMAPMessage alloc] init]; [aMessage setMessageNumber: i+1]; // We parse the record length, date, flags, position in file and the size. len = read_unsigned_int(_fd); //NSLog(@"i = %d, len = %d", i, len); r = (unsigned char *)malloc(len-4); if (r == NULL) // may be in case len was 4 { RELEASE(aMessage); continue; } if (read(_fd, r, len-4) < 0) { NSLog(@"read failed"); abort(); } ((CWFlags *)[aMessage flags])->flags = read_unsigned_int_memory(r); // FASTER and _RIGHT_ since we can't call -setFlags: on CWIMAPMessage [aMessage setReceivedDate: [NSCalendarDate dateWithTimeIntervalSince1970: read_unsigned_int_memory(r+4)]]; [aMessage setUID: read_unsigned_int_memory(r+8)]; [aMessage setSize: read_unsigned_int_memory(r+12)]; tot = 16; read_string_memory(r+tot, s, &len); [CWParser parseFrom: [NSData dataWithBytes: s length: len] inMessage: aMessage quick: YES]; tot += len+2; read_string_memory(r+tot, s, &len); [CWParser parseInReplyTo: [NSData dataWithBytes: s length: len] inMessage: aMessage quick: YES]; tot += len+2; read_string_memory(r+tot, s, &len); [CWParser parseMessageID: [NSData dataWithBytes: s length: len] inMessage: aMessage quick: YES]; tot += len+2; read_string_memory(r+tot, s, &len); [CWParser parseReferences: [NSData dataWithBytes: s length: len] inMessage: aMessage quick: YES]; tot += len+2; read_string_memory(r+tot, s, &len); [CWParser parseSubject: [NSData dataWithBytes: s length: len] inMessage: aMessage quick: YES]; tot += len+2; read_string_memory(r+tot, s, &len); [CWParser parseDestination: [NSData dataWithBytes: s length: len] forType: PantomimeToRecipient inMessage: aMessage quick: YES]; tot += len+2; read_string_memory(r+tot, s, &len); [CWParser parseDestination: [NSData dataWithBytes: s length: len] forType: PantomimeCcRecipient inMessage: aMessage quick: YES]; [((CWFolder *)_folder)->allMessages addObject: aMessage]; NSMapInsert(_table, (void *)[aMessage UID], aMessage); //[self addObject: aMessage]; // MOVE TO CWFIMAPOLDER //[((CWFolder *)_folder)->allMessages replaceObjectAtIndex: i withObject: aMessage]; RELEASE(aMessage); free(r); } free(s); RELEASE(pool); } // // // - (void) removeMessageWithUID: (NSUInteger) theUID { NSMapRemove(_table, (void *)theUID); } // // // - (CWIMAPMessage *) messageWithUID: (NSUInteger) theUID { return NSMapGet(_table, (void *)theUID); } // // // - (unsigned int) UIDValidity { return _UIDValidity; } // // // - (void) setUIDValidity: (unsigned int) theUIDValidity { _UIDValidity = theUIDValidity; } // // // - (void) invalidate { //NSLog(@"IMAPCacheManager - INVALIDATING the cache..."); [super invalidate]; _UIDValidity = 0; [self synchronize]; } // // // - (BOOL) synchronize { unsigned int len, flags; int i; _count = [_folder->allMessages count]; //NSLog(@"CWIMAPCacheManager: -synchronize with folder count = %d", _count); if (lseek(_fd, 0L, SEEK_SET) < 0) { NSLog(@"fseek failed"); abort(); } // We write our cache version, count and UID validity. write_unsigned_short(_fd, version); write_unsigned_int(_fd, _count); write_unsigned_int(_fd, _UIDValidity); //NSLog(@"Synching flags"); for (i = 0; i < _count; i++) { len = read_unsigned_int(_fd); flags = ((CWFlags *)[[_folder->allMessages objectAtIndex: i] flags])->flags; write_unsigned_int(_fd, flags); lseek(_fd, (len-8), SEEK_CUR); } //NSLog(@"Done!"); return (fsync(_fd) == 0); } // // // - (void) writeRecord: (cache_record *) theRecord message: (id) theMessage { unsigned int len; if (lseek(_fd, 0L, SEEK_END) < 0) { NSLog(@"COULD NOT LSEEK TO END OF FILE"); abort(); } // We calculate the length of this record (including the // first five fields, which is 20 bytes long and is added // at the very end) len = 0; len += [theRecord->from length]+2; len += [theRecord->in_reply_to length]+2; len += [theRecord->message_id length]+2; len += [theRecord->references length]+2; len += [theRecord->subject length]+2; len += [theRecord->to length]+2; len += [theRecord->cc length]+22; write_unsigned_int(_fd, len); // We write the flags, date, position and the size of the message. write_unsigned_int(_fd, theRecord->flags); write_unsigned_int(_fd, theRecord->date); write_unsigned_int(_fd, theRecord->imap_uid); write_unsigned_int(_fd, theRecord->size); // We write the read of our cached headers (From, In-Reply-To, Message-ID, References, // Subject, To and Cc) write_string(_fd, (unsigned char *)[theRecord->from bytes], [theRecord->from length]); write_string(_fd, (unsigned char *)[theRecord->in_reply_to bytes], [theRecord->in_reply_to length]); write_string(_fd, (unsigned char *)[theRecord->message_id bytes], [theRecord->message_id length]); write_string(_fd, (unsigned char *)[theRecord->references bytes], [theRecord->references length]); write_string(_fd, (unsigned char *)[theRecord->subject bytes], [theRecord->subject length]); write_string(_fd, (unsigned char *)[theRecord->to bytes], [theRecord->to length]); write_string(_fd, (unsigned char *)[theRecord->cc bytes], [theRecord->cc length]); NSMapInsert(_table, (void *)theRecord->imap_uid, theMessage); _count++; } // // // - (void) expunge { NSDictionary *attributes; unsigned int i, len, size, total_length, v; unsigned char *buf; //NSLog(@"expunge: rewriting cache"); if (lseek(_fd, 10L, SEEK_SET) < 0) { NSLog(@"fseek failed"); abort(); } attributes = [[NSFileManager defaultManager] fileAttributesAtPath: [self path] traverseLink: NO]; buf = (unsigned char *)malloc([[attributes objectForKey: NSFileSize] intValue]); if (buf == NULL) // nothing to do for us here return; total_length = 0; for (i = 0; i < _count; i++) { //NSLog(@"==========="); len = read_unsigned_int(_fd); if (len <= 4) // sanity check, we read len-4 bytes later on continue; //NSLog(@"i = %d len = %d", i, len); v = htonl(len); memcpy((buf+total_length), (char *)&v, 4); // We write the rest of the record into the memory if (read(_fd, (buf+total_length+4), len-4) < 0) { NSLog(@"read failed"); abort(); } unsigned int uid = read_unsigned_int_memory(buf+total_length+12); if ([self messageWithUID: uid]) { total_length += len; } else { //NSLog(@"Message not found! uid = %d table count = %d", // uid, NSCountMapTable(_table)); } } if (lseek(_fd, 0L, SEEK_SET) < 0) { NSLog(@"fseek failed"); abort(); } // We write our cache version, count, modification date our new size _count = [_folder->allMessages count]; size = total_length+10; write_unsigned_short(_fd, version); write_unsigned_int(_fd, _count); write_unsigned_int(_fd, _UIDValidity); // We write our memory cache if (write(_fd, buf, total_length) != total_length) { if (errno == EAGAIN) { // Perhaps we could handle this more gracefully? NSLog(@"EXPUNGE CACHE: WRITE OUT ERROR, EAGAIN"); } else { NSLog(@"EXPUNGE CACHE: WRITE OUT INCOMPLETE"); } abort(); } if (ftruncate(_fd, size) == -1) { if (errno == EACCES || errno == EROFS) NSLog(@"UNABLE TO EXPUNGE CACHE, NOT WRITABLE"); else if (errno == EFBIG) NSLog(@"UNABLE TO EXPUNGE CACHE, EFBIG"); else NSLog(@"UNABLE TO EXPUNGE CACHE"); abort(); } free(buf); //NSLog(@"Done! New size = %d", size); } @end pantomime1.2-1.2.2+dfsg1/Framework/Pantomime/CWIMAPFolder.h000066400000000000000000000147661276751561200231330ustar00rootroot00000000000000/* ** CWIMAPFolder.h ** ** Copyright (c) 2001-2006 ** ** Author: Ludovic Marcotte ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** You should have received a copy of the GNU Lesser General Public ** License along with this library; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef _Pantomime_H_CWIMAPFolder #define _Pantomime_H_CWIMAPFolder #include #import #import #import #import #include /*! @const PantomimeMessagesCopyCompleted @discussion This notification is posted when CWIMAPFolder: -copyMessages: toFolder: has successfully completed. -messagesCopyCompleted: is also called on the delegate, if any. */ extern NSString* PantomimeMessagesCopyCompleted; /*! @const PantomimeMessagesCopyFailed @discussion This notification is posted when CWIMAPFolder: -copyMessages: toFolder: has failed to complete. -messagesCopyFailed: is also called on the delegate, if any. */ extern NSString* PantomimeMessagesCopyFailed; /*! @const PantomimeMessageStoreCompleted @discussion This notification is posted when CWIMAPFolder: -setFlags: messages: has successfully completed. -messageStoreCompleted: is also called on the delegate, if any. */ extern NSString* PantomimeMessageStoreCompleted; /*! @const PantomimeMessageStoreFailed @discussion This notification is posted when CWIMAPFolder: -setFlags: messages: has failed to completed. -messageStoreFailed: is also called on the delegate, if any. */ extern NSString* PantomimeMessageStoreFailed; /*! @class CWIMAPFolder @discussion This class, which extends the CWFolder class, is used to implement IMAP-specific features such as server-side operations for copying messages between mailboxes. */ @interface CWIMAPFolder : CWFolder { @private unsigned int _uid_validity; BOOL _selected; } /*! @method initWithName: mode: @discussion This method is used to initialize the receiver with theName using theMode. Normally, you should not invoke this method directly. You must rather use one of CWIMAPStore's folderForName: ... method. @param theName The name of the folder. @param theMode The mode to use. Accepted values are part of the PantomimeFolderMode enum. @result An CWIMAPFolder instance, nil on error. */ - (id) initWithName: (NSString *) theName mode: (PantomimeFolderMode) theMode; /*! @method appendMessageFromRawSource:flags:internalDate @discussion This method is used to append a message from its raw source representation (RFC2822 compliant) to the underlying store. It differs from -appendMessageFromRawSource:flags: in that this method supplies the given date to the server to use as the INTERNALDATE. Not supplying this date will cause some servers and clients to report the date of the message as the current date and time, rather than that specified in the Received header. @param theData The raw representation of the message to append. @param theFlags The flags of the message, nil if no flags need to be kept. @param theDate The INTERNALDATE of the message, or nil to use the current date. */ - (void) appendMessageFromRawSource: (NSData *) theData flags:(CWFlags *) theFlags internalDate: (NSCalendarDate *) theDate; /*! @method copyMessages: toFolder: @discussion This method copies the messages in theMessages array from the receiver to the destination folder's name, theFolder. On success, this method posts a PantomimeMessagesCopyCompleted notification (and calls -messagesCopyCompleted: on the delegate, if any). On failure, it posts a PantomimeMessagesCopyFailed notification (and calls -messagesCopyFailed: on the delegate, if any). This method is fully asynchronous. @param theMessages The messages to copy. @param theFolder The name of the target folder. The name must include hierarchy separators if the target folder is a subfolder. */ - (void) copyMessages: (NSArray *) theMessages toFolder: (NSString *) theFolder; /*! @method prefetch @discussion This method is used to cache part of the message headers from the IMAP server. On completion, it posts the PantomimeFolderPrefetchCompleted notification (and calls -folderPrefetchCompleted: on the delegate, if any). This method is fully asynchronous. */ - (void) prefetch; /*! @method UIDValidity @discussion This method is used to obtain the UID validity of an IMAP folder. Refer to "2.3.1.1. Unique Identifier (UID) Message Attribute" of RFC 3501 for a detailed description of this parameter. @result The UID validity of the folder. */ - (unsigned int) UIDValidity; /*! @method setUIDValidity: @discussion This method is used to set the UID validity of the receiver. If the receiver has a cache (instance of CWIMAPCacheManager) and the UID validity of its cache differs from theUIDValidity, all cache entries are invalidated. @param theUIDValidity The UID validity value. */ - (void) setUIDValidity: (unsigned int) theUIDValidity; /*! @method selected @discussion This method is used to verify if the folder is in a selected state. @result YES if it is in a selected state, NO otherwise. */ - (BOOL) selected; /*! @method setSelected: @discussion This method is used to specify if the folder is in a selected state or not. You should never call this method directly. Instead, call IMAPStore: -folderForName: select:. @param theBOOL YES if it is in a selected state, NO otherwise. */ - (void) setSelected: (BOOL) theBOOL; @end #endif // _Pantomime_H_CWIMAPFolder pantomime1.2-1.2.2+dfsg1/Framework/Pantomime/CWIMAPFolder.m000066400000000000000000000307751276751561200231360ustar00rootroot00000000000000/* ** CWIMAPFolder.m ** ** Copyright (c) 2001-2007 ** ** Author: Ludovic Marcotte ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** You should have received a copy of the GNU Lesser General Public ** License along with this library; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include #include #include #include #include #include #include #include #include #include // // Private methods // @interface CWIMAPFolder (Private) - (NSString *) _flagsAsStringFromFlags: (CWFlags *) theFlags; - (NSData *) _removeInvalidHeadersFromMessage: (NSData *) theMessage; @end // // // @implementation CWIMAPFolder - (id) initWithName: (NSString *) theName { if ((self = [super initWithName: theName]) == nil) return nil; [self setSelected: NO]; return self; } // // // - (id) initWithName: (NSString *) theName mode: (PantomimeFolderMode) theMode { if ((self = [self initWithName: theName]) == nil) return nil; _mode = theMode; return self; } // // // - (void) appendMessageFromRawSource: (NSData *) theData flags: (CWFlags *) theFlags { [self appendMessageFromRawSource: theData flags: theFlags internalDate: nil]; } // // // - (void) appendMessageFromRawSource: (NSData *) theData flags: (CWFlags *) theFlags internalDate: (NSCalendarDate *) theDate { NSDictionary *aDictionary; NSString *flagsAsString; NSData *aData; if (theFlags) { flagsAsString = [self _flagsAsStringFromFlags: theFlags]; } else { flagsAsString = @""; } // We remove any invalid headers from our message aData = [self _removeInvalidHeadersFromMessage: theData]; if (theFlags) { aDictionary = [NSDictionary dictionaryWithObjectsAndKeys: aData, @"NSDataToAppend", theData, @"NSData", self, @"Folder", theFlags, @"Flags", nil]; } else { aDictionary = [NSDictionary dictionaryWithObjectsAndKeys: aData, @"NSDataToAppend", theData, @"NSData", self, @"Folder", nil]; } if (theDate) { [_store sendCommand: IMAP_APPEND info: aDictionary arguments: @"APPEND \"%@\" (%@) \"%@\" {%d}", // IMAP command [_name modifiedUTF7String], // folder name flagsAsString, // flags [theDate descriptionWithCalendarFormat:@"%d-%b-%Y %H:%M:%S %z"], // internal date [aData length]]; // length of the data to write } else { [_store sendCommand: IMAP_APPEND info: aDictionary arguments: @"APPEND \"%@\" (%@) {%d}", // IMAP command [_name modifiedUTF7String], // folder name flagsAsString, // flags [aData length]]; // length of the data to write } } // // // - (void) copyMessages: (NSArray *) theMessages toFolder: (NSString *) theFolder { NSMutableString *aMutableString; int i, count; // We create our message's UID set aMutableString = [[NSMutableString alloc] init]; count = [theMessages count]; for (i = 0; i < count; i++) { if (i == count-1) { [aMutableString appendFormat: @"%lu", (unsigned long)[[theMessages objectAtIndex: i] UID]]; } else { [aMutableString appendFormat: @"%lu,", (unsigned long)[[theMessages objectAtIndex: i] UID]]; } } // We send our IMAP command [_store sendCommand: IMAP_UID_COPY info: [NSDictionary dictionaryWithObjectsAndKeys: theMessages, @"Messages", theFolder, @"Name", self, @"Folder", nil] arguments: @"UID COPY %@ \"%@\"", aMutableString, [theFolder modifiedUTF7String]]; RELEASE(aMutableString); } // // // - (void) prefetch { // We first update the messages in our cache, if we need to. if (_cacheManager && [self count]) { [_store sendCommand: IMAP_UID_SEARCH info: nil arguments: @"UID SEARCH 1:*"]; } else { // // We must send this command since our IMAP cache might be empty (or have been removed). // In that case, we much fetch again all messages, starting at UID 1. // [_store sendCommand: IMAP_UID_FETCH_HEADER_FIELDS info: nil arguments: @"UID FETCH %u:* (UID FLAGS RFC822.SIZE BODY.PEEK[HEADER.FIELDS (From To Cc Subject Date Message-ID References In-Reply-To)])", 1]; } } // // This method simply close the selected mailbox (ie. folder) // - (void) close { IMAPCommand theCommand; if (![self selected]) { [_store removeFolderFromOpenFolders: self]; return; } // If we are opening a mailbox but -close was called before we // finished opening it, we close the connection immediately. theCommand = [[self store] lastCommand]; if (theCommand == IMAP_SELECT || theCommand == IMAP_UID_SEARCH || theCommand == IMAP_UID_SEARCH_ANSWERED || theCommand == IMAP_UID_SEARCH_FLAGGED || theCommand == IMAP_UID_SEARCH_UNSEEN) { [_store removeFolderFromOpenFolders: self]; [[self store] cancelRequest]; [[self store] reconnect]; return; } if (_cacheManager) { [_cacheManager synchronize]; } // We set the _folder ivar to nil for all messages. This is required in case // an IMAPMessage instance was retained and we invoke -setFlags: on it, which // will try to access the _folder ivar in order to communicate with the IMAP server. [allMessages makeObjectsPerformSelector: @selector(setFolder:) withObject: nil]; // We close the selected IMAP folder to _expunge_ messages marked as \Deleted // if and only we are NOT showing DELETED messages. We also don't send the command // if we are NOT connected since a MUA using Pantomime needs to call -close // on IMAPFolder to clean-up the "open" folder. if ([_store isConnected] && ![self showDeleted]) { [_store sendCommand: IMAP_CLOSE info: [NSDictionary dictionaryWithObject: self forKey: @"Folder"] arguments: @"CLOSE"]; } else { PERFORM_SELECTOR_2([_store delegate], @selector(folderCloseCompleted:), PantomimeFolderCloseCompleted, self, @"Folder"); POST_NOTIFICATION(PantomimeFolderCloseCompleted, _store, [NSDictionary dictionaryWithObject: self forKey: @"Folder"]); } [_store removeFolderFromOpenFolders: self]; } // // This method returns all messages that have the flag PantomimeDeleted. // - (void) expunge { // // We send our EXPUNGE command. The responses will be processed in IMAPStore and // the MSN will be updated in IMAPStore: -_parseExpunge. // [_store sendCommand: IMAP_EXPUNGE info: nil arguments: @"EXPUNGE"]; } // // // - (unsigned int) UIDValidity { return _uid_validity; } // // // - (void) setUIDValidity: (unsigned int) theUIDValidity { _uid_validity = theUIDValidity; if (_cacheManager) { if ([_cacheManager UIDValidity] == 0 || [_cacheManager UIDValidity] != _uid_validity) { [_cacheManager invalidate]; [_cacheManager setUIDValidity: _uid_validity]; } } } // // // - (BOOL) selected { return _selected; } // // // - (void) setSelected: (BOOL) theBOOL { _selected = theBOOL; } // // // - (void) setFlags: (CWFlags *) theFlags messages: (NSArray *) theMessages { NSMutableString *aMutableString, *aSequenceSet; CWIMAPMessage *aMessage; if ([theMessages count] == 1) { aMessage = [theMessages lastObject]; // We set the flags right away, just in case someone asks for them // just after invoking this method. Nevertheless, they WILL be set // in IMAPStore: -_parseOK:. // We do the same below, when the count > 1 [[aMessage flags] replaceWithFlags: theFlags]; aSequenceSet = [NSMutableString stringWithFormat: @"%lu:%lu", (unsigned long)[aMessage UID], (unsigned long)[aMessage UID]]; } else { int i, count; aSequenceSet = AUTORELEASE([[NSMutableString alloc] init]); count = [theMessages count]; for (i = 0; i < count; i++) { aMessage = [theMessages objectAtIndex: i]; [[aMessage flags] replaceWithFlags: theFlags]; if (aMessage == [theMessages lastObject]) { [aSequenceSet appendFormat: @"%lu", (unsigned long)[aMessage UID]]; } else { [aSequenceSet appendFormat: @"%lu,", (unsigned long)[aMessage UID]]; } } } aMutableString = [[NSMutableString alloc] init]; // // If we're removing all flags, we rather send a STORE -FLAGS () // than a STORE FLAGS () since some broken servers might not // support it (like Cyrus v1.5.19 and v1.6.24). // if (theFlags->flags == 0) { [aMutableString appendFormat: @"UID STORE %@ -FLAGS.SILENT (", aSequenceSet]; [aMutableString appendString: [self _flagsAsStringFromFlags: theFlags]]; [aMutableString appendString: @")"]; } else { [aMutableString appendFormat: @"UID STORE %@ FLAGS.SILENT (", aSequenceSet]; [aMutableString appendString: [self _flagsAsStringFromFlags: theFlags]]; [aMutableString appendString: @")"]; } [_store sendCommand: IMAP_UID_STORE info: [NSDictionary dictionaryWithObjectsAndKeys: theMessages, @"Messages", theFlags, @"Flags", nil] arguments: aMutableString]; RELEASE(aMutableString); } // // Using IMAP, we ignore most parameters. // - (void) search: (NSString *) theString mask: (PantomimeSearchMask) theMask options: (PantomimeSearchOption) theOptions { NSString *aString; switch (theMask) { case PantomimeFrom: aString = [NSString stringWithFormat: @"UID SEARCH ALL FROM \"%@\"", theString]; break; case PantomimeTo: aString = [NSString stringWithFormat: @"UID SEARCH ALL TO \"%@\"", theString]; break; case PantomimeContent: aString = [NSString stringWithFormat: @"UID SEARCH ALL BODY \"%@\"", theString]; break; case PantomimeSubject: default: aString = [NSString stringWithFormat: @"UID SEARCH ALL SUBJECT \"%@\"", theString]; } // We send our SEARCH command. Store->searchResponse will have the result. [_store sendCommand: IMAP_UID_SEARCH_ALL info: [NSDictionary dictionaryWithObject: self forKey: @"Folder"] arguments: aString]; } @end // // Private methods // @implementation CWIMAPFolder (Private) - (NSString *) _flagsAsStringFromFlags: (CWFlags *) theFlags { NSMutableString *aMutableString; aMutableString = [[NSMutableString alloc] init]; AUTORELEASE(aMutableString); if ([theFlags contain: PantomimeAnswered]) { [aMutableString appendString: @"\\Answered "]; } if ([theFlags contain: PantomimeDraft] ) { [aMutableString appendString: @"\\Draft "]; } if ([theFlags contain: PantomimeFlagged]) { [aMutableString appendString: @"\\Flagged "]; } if ([theFlags contain: PantomimeSeen]) { [aMutableString appendString: @"\\Seen "]; } if ([theFlags contain: PantomimeDeleted]) { [aMutableString appendString: @"\\Deleted "]; } return [aMutableString stringByTrimmingWhiteSpaces]; } // // // - (NSData *) _removeInvalidHeadersFromMessage: (NSData *) theMessage { NSMutableData *aMutableData; NSArray *allLines; int i, count; // We allocate our mutable data object aMutableData = [[NSMutableData alloc] initWithCapacity: [theMessage length]]; // We now replace all \n by \r\n allLines = [theMessage componentsSeparatedByCString: "\n"]; count = [allLines count]; for (i = 0; i < count; i++) { NSData *aLine; // We get a line... aLine = [allLines objectAtIndex: i]; // We skip dumb headers if ([aLine hasCPrefix: "From "]) { continue; } [aMutableData appendData: aLine]; [aMutableData appendCString: "\r\n"]; } return AUTORELEASE(aMutableData); } @end pantomime1.2-1.2.2+dfsg1/Framework/Pantomime/CWIMAPMessage.h000066400000000000000000000051201276751561200232640ustar00rootroot00000000000000/* ** CWIMAPMessage.h ** ** Copyright (c) 2001-2006 ** ** Author: Ludovic Marcotte ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** You should have received a copy of the GNU Lesser General Public ** License along with this library; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef _Pantomime_H_CWIMAPMessage #define _Pantomime_H_CWIMAPMessage #import #import /*! @class CWIMAPMessage @discussion This class, which extends CWMessage, adds IMAP specific information and redefines the behavior of some methods from its superclass. */ @interface CWIMAPMessage : CWMessage { @private BOOL _headers_were_prefetched; NSUInteger _UID; } /*! @method UID @discussion This method is used to obtain the UID of a message. See 2.3.1.1. Unique Identifier (UID) Message Attribute of RFC 3501 for a detailed description of the UID attribute of a message. @result The UID, 0 if the receiver has no UID. */ - (NSUInteger) UID; /*! @method setUID: @discussion This method is used to set the UID of the receiver. Normally, you shouldn't invoke this method directly. @param theUID The UID of the message. */ - (void) setUID: (NSUInteger) theUID; /*! @method rawSource @discussion IMAP specific implementation of the rawSource method. This method is always non-blocking. It might return nil if the raw source of the message hasn't yet been fetched from the IMAP server. The IMAPStore notifies the delegate when the fetch has been completed. @result The raw source of the message, nil if not yet fully fetched. */ - (NSData *) rawSource; /*! @method setFlags: @discussion This method overrides the one found in CWMessage. It will replace all the flags on the server for this message with the flags specified in the argument. @param theFlags The new flags for the receiver. */ - (void) setFlags: (CWFlags *) theFlags; @end #endif // _Pantomime_H_CWIMAPMessage pantomime1.2-1.2.2+dfsg1/Framework/Pantomime/CWIMAPMessage.m000066400000000000000000000075621276751561200233050ustar00rootroot00000000000000/* ** CWIMAPMessage.m ** ** Copyright (c) 2001-2007 ** 2014 ** ** Author: Ludovic Marcotte ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** You should have received a copy of the GNU Lesser General Public ** License along with this library; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #import #import #import #import #import #import #import #import // // // @implementation CWIMAPMessage - (id) init { self = [super init]; _headers_were_prefetched = NO; _UID = 0; return self; } // // NSCoding protocol // - (void) encodeWithCoder: (NSCoder *) theCoder { // Must also encode Message's superclass [super encodeWithCoder: theCoder]; [theCoder encodeObject: [NSNumber numberWithUnsignedInt: _UID]]; } // // // - (id) initWithCoder: (NSCoder *) theCoder { // Must also decode Message's superclass self = [super initWithCoder: theCoder]; _UID = (NSUInteger)[[theCoder decodeObject] unsignedIntValue]; return self; } // // // - (NSUInteger) UID { return _UID; } - (void) setUID: (NSUInteger) theUID { _UID = theUID; } // // This method is called to initialize the message if it wasn't. // If we set it to NO and we HAD a content, we release the content. // - (void) setInitialized: (BOOL) theBOOL { [super setInitialized: theBOOL]; if (!theBOOL) { DESTROY(_content); return; } else if (![(CWIMAPFolder *)[self folder] selected]) { [super setInitialized: NO]; [NSException raise: PantomimeProtocolException format: @"Unable to fetch message content from unselected mailbox."]; return; } if (!_content) { id aStore; aStore = [(CWIMAPFolder *)[self folder] store]; if (!_headers_were_prefetched) { [aStore sendCommand: IMAP_UID_FETCH_HEADER_FIELDS_NOT info: nil arguments: @"UID FETCH %u:%u BODY.PEEK[HEADER.FIELDS.NOT (From To Cc Subject Date Message-ID References In-Reply-To)]", _UID, _UID]; } // If we are no longer connected to the IMAP server, we don't send the 2nd command. // This will prevent us from calling the delegate method twice (the one that handles // the disconnection from the IMAP server). if ([aStore isConnected]) { [aStore sendCommand: IMAP_UID_FETCH_BODY_TEXT info: nil arguments: @"UID FETCH %u:%u BODY[TEXT]", _UID, _UID]; } // Since we are loading asynchronously our message, it's not yet initialized. It'll be set as an initialized one // in CWIMAPStore once the body is fully loaded. [super setInitialized: NO]; } _headers_were_prefetched = YES; } // // // - (NSData *) rawSource { if (![(CWIMAPFolder *)[self folder] selected]) { [NSException raise: PantomimeProtocolException format: @"Unable to fetch message data from unselected mailbox."]; return _rawSource; } if (!_rawSource) { [(CWIMAPStore *)[[self folder] store] sendCommand: IMAP_UID_FETCH_RFC822 info: nil arguments: @"UID FETCH %u:%u RFC822", _UID, _UID]; } return _rawSource; } // // // - (void) setFlags: (CWFlags *) theFlags { [[self folder] setFlags: theFlags messages: [NSArray arrayWithObject: self]]; } @end pantomime1.2-1.2.2+dfsg1/Framework/Pantomime/CWIMAPStore.h000066400000000000000000000245571276751561200230130ustar00rootroot00000000000000/* ** CWIMAPStore.h ** ** Copyright (c) 2001-2007 ** ** Author: Ludovic Marcotte ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** You should have received a copy of the GNU Lesser General Public ** License along with this library; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef _Pantomime_H_CWIMAPStore #define _Pantomime_H_CWIMAPStore #include #include #include #include #import #import #import #import /*! @typedef IMAPCommand @abstract Supported IMAP commands. @discussion This enum lists the supported IMAP commands available in Pantomime's IMAP client code. @constant IMAP_APPEND The IMAP APPEND command - see 6.3.11. APPEND Command of RFC 3501. @constant IMAP_AUTHENTICATE_CRAM_MD5 CRAM-MD5 authentication. @constant IMAP_AUTHENTICATE_LOGIN LOGIN authentication @constant IMAP_AUTHORIZATION Special command so that we know we are in the authorization state. @constant IMAP_CAPABILITY The IMAP CAPABILITY command - see 6.1.1. CAPABILITY Command of RFC 3501. @constant IMAP_CLOSE The IMAP CLOSE command - see 6.4.2. CLOSE Command of RFC 3501. @constant IMAP_CREATE The IMAP CREATE command - see 6.3.3. CREATE Command of RFC 3501. @constant IMAP_DELETE The IMAP DELETE command - see 6.3.4. DELETE Command of RFC 3501. @constant IMAP_EXAMINE The IMAP EXAMINE command - see 6.3.2. EXAMINE Command of RFC 3501. @constant IMAP_EXPUNGE The IMAP EXPUNGE command - see 6.4.3. EXPUNGE Command of RFC 3501. @constant IMAP_LIST The IMAP LIST command - see 6.3.8. LIST Command of RFC 3501. @constant IMAP_LOGIN The IMAP LOGIN command - see 6.2.3. LOGIN Command of RFC 3501. @constant IMAP_LOGOUT The IMAP LOGOUT command - see 6.1.3. LOGOUT Command of RFC 3501. @constant IMAP_LSUB The IMAP LSUB command - see 6.3.9. LSUB Command of RFC 3501. @constant IMAP_NOOP The IMAP NOOP command - see 6.1.2. NOOP Command of RFC 3501. @constant IMAP_RENAME The IMAP RENAME command - see 6.3.5. RENAME Command of RFC 3501. @constant IMAP_SELECT The IMAP SELECT command - see 6.3.1. SELECT Command of RFC 3501. @constant IMAP_STARTTLS The STARTTLS IMAP command - see RFC2595. @constant IMAP_STATUS The IMAP STATUS command - see 6.3.10. STATUS Command of RFC 3501. @constant IMAP_SUBSCRIBE The IMAP SUBSCRIBE command - see 6.3.6. SUBSCRIBE Command of RFC 3501. @constant IMAP_UID_COPY The IMAP COPY command - see 6.4.7. COPY Command of RFC 3501. @constant IMAP_UID_FETCH_BODY_TEXT The IMAP FETCH command - see 6.4.5. FETCH Command of RFC 3501. @constant IMAP_UID_FETCH_HEADER_FIELDS The IMAP FETCH command - see 6.4.5. FETCH Command of RFC 3501. @constant IMAP_UID_FETCH_HEADER_FIELDS_NOT The IMAP FETCH command - see 6.4.5. FETCH Command of RFC 3501. @constant IMAP_UID_FETCH_RFC822 The IMAP FETCH command - see 6.4.5. FETCH Command of RFC 3501. @constant IMAP_UID_SEARCH The IMAP SEARCH command - see 6.4.4. SEARCH Command of RFC 3501. Used to update the IMAP Folder cache. @constant IMAP_UID_SEARCH_ALL The IMAP SEARCH command - see 6.4.4. SEARCH Command of RFC 3501. @constant IMAP_UID_SEARCH_ANSWERED Special command used to update the IMAP Folder cache. @constant IMAP_UID_SEARCH_FLAGGED Special command used to update the IMAP Folder cache. @constant IMAP_UID_SEARCH_UNSEEN Special command used to update the IMAP Folder cache. @constant IMAP_UID_STORE The IMAP STORE command - see 6.4.6. STORE Command of RFC 3501. @constant IMAP_UNSUBSCRIBE The IMAP UNSUBSCRIBE command - see 6.3.7. UNSUBSCRIBE Command of RFC 3501. @constant IMAP_EMPTY_QUEUE Special command to empty the command queue. */ typedef enum { IMAP_APPEND = 0x1, IMAP_AUTHENTICATE_CRAM_MD5, IMAP_AUTHENTICATE_LOGIN, IMAP_AUTHORIZATION, IMAP_CAPABILITY, IMAP_CLOSE, IMAP_CREATE, IMAP_DELETE, IMAP_EXAMINE, IMAP_EXPUNGE, IMAP_LIST, IMAP_LOGIN, IMAP_LOGOUT, IMAP_LSUB, IMAP_NOOP, IMAP_RENAME, IMAP_SELECT, IMAP_STARTTLS, IMAP_STATUS, IMAP_SUBSCRIBE, IMAP_UID_COPY, IMAP_UID_FETCH_BODY_TEXT, IMAP_UID_FETCH_HEADER_FIELDS, IMAP_UID_FETCH_HEADER_FIELDS_NOT, IMAP_UID_FETCH_RFC822, IMAP_UID_SEARCH, IMAP_UID_SEARCH_ALL, IMAP_UID_SEARCH_ANSWERED, IMAP_UID_SEARCH_FLAGGED, IMAP_UID_SEARCH_UNSEEN, IMAP_UID_STORE, IMAP_UNSUBSCRIBE, IMAP_EMPTY_QUEUE } IMAPCommand; /*! @const PantomimeFolderSubscribeCompleted */ extern NSString *PantomimeFolderSubscribeCompleted; /*! @const PantomimeFolderSubscribeFailed */ extern NSString *PantomimeFolderSubscribeFailed; /*! @const PantomimeFolderUnsubscribeCompleted */ extern NSString *PantomimeFolderUnsubscribeCompleted; /*! @const PantomimeFolderUnsubscribeFailed */ extern NSString *PantomimeFolderUnsubscribeFailed; /*! @const PantomimeFolderStatusCompleted */ extern NSString *PantomimeFolderStatusCompleted; /*! @const PantomimeFolderStatusFailed */ extern NSString *PantomimeFolderStatusFailed; @class CWConnection; @class CWFlags; @class CWIMAPCacheManager; @class CWIMAPFolder; @class CWIMAPMessage; @class CWIMAPQueueObject; @class CWTCPConnection; /*! @class CWIMAPStore @abstract Pantomime IMAP client code. @discussion This class, which extends the CWService class and implements the CWStore protocol, is Pantomime's IMAP client code. */ @interface CWIMAPStore : CWService { @private CWIMAPQueueObject *_currentQueueObject; NSMutableDictionary *_folders; NSMutableDictionary *_openFolders; NSMutableDictionary *_folderStatus; NSMutableArray *_subscribedFolders; CWIMAPFolder *_selectedFolder; unsigned char _folderSeparator; int _tag; } /*! @method folderForName:mode:prefetch: @discussion This method is used to get the folder with the specified name and mode. @param theName The name of the folder to obtain. @param theMode The mode to use. The value is one of the PantomimeFolderMode enum. @param aBOOL YES if prefetch should be done on the folder, NO otherwise. @result A CWIMAPFolder instance. */ - (CWIMAPFolder *) folderForName: (NSString *) theName mode: (PantomimeFolderMode) theMode prefetch: (BOOL) aBOOL; /*! @method folderForName:select: @discussion This method is used to obtain the folder with the specified name. If aBOOL is YES, the folder will be selected. Otherwise, a non-selected folder will be returned which is used to proceed with an append operation. Note that when aBOOL is equal to NO, the returned folder is NOT part of the list of opened folders. @param theName The name of the folder to obtain. @param aBOOL YES to select the folder, NO otherwise. @result A CWIMAPFolder instance. */ - (CWIMAPFolder *) folderForName: (NSString *) theName select: (BOOL) aBOOL; /*! @method nextTag @discussion This method is used to obtain the next IMAP tag that will be sent to the IMAP server. Normally you shouldn't call this method directly. @result The tag as a NSData instance. */ - (NSData *) nextTag; /*! @method lastTag @discussion This method is used to obtain the last IMAP tag sent to the IMAP server. @result The tag as a NSData instance. */ - (NSData *) lastTag; /*! @method subscribeToFolderWithName: @discussion This method is used to subscribe to the specified folder. The method will post a PantomimeFolderSubscribeCompleted notification (and call -folderSubscribeCompleted: on the delegate, if any) if it succeeded. If not, it will post a PantomimeFolderSubscribeFailed notification (and call -folderSubscribeFailed: on the delegate, if any) @param theName The name of the folder to subscribe to. */ - (void) subscribeToFolderWithName: (NSString *) theName; /*! @method unsubscribeToFolderWithName: @discussion This method is used to unsubscribe to the specified folder. The method will post a PantomimeFolderUnsubscribeCompleted notification (and call -folderUnsubscribeCompleted: on the delegate, if any) if it succeeded. If not, it will post a PantomimeFolderUnsubscribeFailed notification (and call -folderUnsubscribeFailed: on the delegate, if any) @param theName The name of the folder to subscribe to. */ - (void) unsubscribeToFolderWithName: (NSString *) theName; /*! @method folderStatus: @discussion This method is used to obtain the status of the specified folder names in theArray. It is fully asynchronous. The first time it is invoked, it'll perform its work asynchronously and post a PantomimeFolderStatusCompleted notification (and call -folderStatusCompleted on the delegate, if any) if succeeded. If not, it will post a PantomimeFolderStatusFailed notification (and call -folderStatusFailed: on the delegate, if any). Further calls of this method on the same set of folders will immediately return the status information. @param theArray The array of folder names. @result A NSDictionary instance for which the keys are the folder names (NSString instance) and the values are CWFolderInformation instance if the information was loaded, nil otherwise. */ - (NSDictionary *) folderStatus: (NSArray *) theArray; /*! @method sendCommand:info:arguments: ... @discussion This method is used to send commands to the IMAP server. Normally, you should not call this method directly. @param theCommand The IMAP command to send. @param theInfo The addition info to pass. @param theFormat The format defining the variable arguments list. */ - (void) sendCommand: (IMAPCommand) theCommand info: (NSDictionary *) theInfo arguments: (NSString *) theFormat, ...; @end #endif // _Pantomime_H_IMAPStore pantomime1.2-1.2.2+dfsg1/Framework/Pantomime/CWIMAPStore.m000066400000000000000000002444411276751561200230140ustar00rootroot00000000000000/* ** CWIMAPStore.m ** ** Copyright (c) 2001-2007 ** ** Author: Ludovic Marcotte ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** You should have received a copy of the GNU Lesser General Public ** License along with this library; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #include #include // // Some static variables used to enhance the performance. // static NSStringEncoding defaultCStringEncoding; static NSData *CRLF; // // This C function is used to verify if a line (specified in // "buf", with length "c") has a literal. If it does, the // value of the literal is returned. // // "0" means no literal. // static inline int has_literal(char *buf, int c) { char *s; if (c == 0 || *buf != '*') return 0; s = buf+c-1; if (*s == '}') { int value, d; value = 0; d = 1; s--; while (isdigit((int)(unsigned char)*s)) { value += ((*s-48) * d); d *= 10; s--; } //NSLog(@"LITERAL = %d", value); return value; } return 0; } // // // @interface CWIMAPQueueObject : NSObject { @public NSMutableDictionary *info; IMAPCommand command; NSString *arguments; NSData *tag; int literal; } - (id) initWithCommand: (IMAPCommand) theCommand arguments: (NSString *) theArguments tag: (NSData *) theTag info: (NSDictionary *) theInfo; @end @implementation CWIMAPQueueObject - (id) initWithCommand: (IMAPCommand) theCommand arguments: (NSString *) theArguments tag: (NSData *) theTag info: (NSDictionary *) theInfo { self = [super init]; command = theCommand; literal = 0; ASSIGN(arguments, theArguments); ASSIGN(tag, theTag); if (theInfo) { info = [[NSMutableDictionary alloc] initWithDictionary: theInfo]; } else { info = [[NSMutableDictionary alloc] init]; } return self; } - (void) dealloc { RELEASE(arguments); RELEASE(info); RELEASE(tag); [super dealloc]; } - (NSString *) description { return [NSString stringWithFormat: @"%d %@", command, arguments]; } @end // // Private methods // @interface CWIMAPStore (Private) - (NSString *) _folderNameFromString: (NSString *) theString; - (void) _parseFlags: (NSString *) aString message: (CWIMAPMessage *) theMessage record: (cache_record *) theRecord; - (void) _renameFolder; - (NSArray *) _uniqueIdentifiersFromData: (NSData *) theData; - (void) _parseAUTHENTICATE_CRAM_MD5; - (void) _parseAUTHENTICATE_LOGIN; - (void) _parseBAD; - (void) _parseBYE; - (void) _parseCAPABILITY; - (void) _parseEXISTS; - (void) _parseEXPUNGE; - (void) _parseFETCH: (int) theMSN; - (void) _parseLIST; - (void) _parseLSUB; - (void) _parseNO; - (void) _parseNOOP; - (void) _parseOK; - (void) _parseRECENT; - (void) _parseSEARCH; - (void) _parseSEARCH_CACHE; - (void) _parseSELECT; - (void) _parseSTATUS; - (void) _parseSTARTTLS; - (void) _parseUIDVALIDITY: (const char *) theString; - (void) _restoreQueue; @end // // // @implementation CWIMAPStore + (void) initialize { defaultCStringEncoding = [NSString defaultCStringEncoding]; CRLF = [[NSData alloc] initWithBytes: "\r\n" length: 2]; } // // // - (id) initWithName: (NSString *) theName port: (unsigned int) thePort { if (thePort == 0) thePort = 143; self = [super initWithName: theName port: thePort]; _folderSeparator = 0; _selectedFolder = nil; _tag = 1; _folders = [[NSMutableDictionary alloc] init]; _openFolders = [[NSMutableDictionary alloc] init]; _subscribedFolders = [[NSMutableArray alloc] init]; _folderStatus = [[NSMutableDictionary alloc] init]; _lastCommand = IMAP_AUTHORIZATION; _currentQueueObject = nil; return self; } // // // - (id) initWithURL: (CWURLName *) theURL { return [self initWithName: [theURL host] port: 143]; } // // // - (void) dealloc { //NSLog(@"IMAPStore: -dealloc"); RELEASE(_folders); RELEASE(_folderStatus); RELEASE(_openFolders); RELEASE(_subscribedFolders); [super dealloc]; } // // When this method is called, we are receiving bytes // from the _lastCommand. // // Rationale: // // This command accumulates the responses (split into lines) // from the server in _responsesFromServer. // // It will NOT add untagged reponses but rather process them right-away. // // If it's receiving a FETCH response, it will NOT verify for // tag line ('0123 OK', '0123 BAD', '0123 NO') for the duration // of reading the literal length. For example, if we got {400}, // we will not consider a '0123 OK' response if we read less // than 400 bytes. This prevent us from reading a '0123 OK' that // could occur in a message. // - (void) updateRead { id aData; int i, count; char *buf; [super updateRead]; //NSLog(@"_rbul len == %d |%@|", [_rbuf length], [_rbuf asciiString]); if (![_rbuf length]) return; while ((aData = split_lines(_rbuf))) { //NSLog(@"aLine = |%@|", [aData asciiString]); buf = (char *)[aData bytes]; count = [aData length]; // If we are reading a literal, do so. if (_currentQueueObject && _currentQueueObject->literal) { _currentQueueObject->literal -= (count+2); //NSLog(@"literal = %d, count = %d", _currentQueueObject->literal, count); if (_currentQueueObject->literal < 0) { int x; x = -2-_currentQueueObject->literal; [[_currentQueueObject->info objectForKey: @"NSData"] appendData: [aData subdataToIndex: x]]; [_responsesFromServer addObject: [aData subdataFromIndex: x]]; //NSLog(@"orig = |%@|, chooped = |%@| |%@|", [aData asciiString], [[aData subdataToIndex: x] asciiString], [[aData subdataFromIndex: x] asciiString]); } else { [[_currentQueueObject->info objectForKey: @"NSData"] appendData: aData]; } // We are done reading a literal. Let's read again // to see if we got a full response. if (_currentQueueObject->literal <= 0) { //NSLog(@"DONE ACCUMULATING LITTERAL!\nread = |%@|", [[_currentQueueObject->info objectForKey: @"NSData"] asciiString]); // // Let's see, if we can, what does the next line contain. If we got // something, we add this to the remaining _responsesFromServer // and we are ready to parse that response (_responsesFromServer + bytes of literal). // // If it's nil, that's because we have nothing to read. In that case, just loop // and call -updateRead in order to read the rest of the response. // // We must also be careful about what we read. Microsoft Exchange sometimes send us // stuff like this: // // * 5 FETCH (BODY[TEXT] {1175} // UID 5) // 0010 OK FETCH completed. // // The " UID 5)" line will result in a _negative_ literal. Which we // handle well here and just a couple of lines above this one. // if (_currentQueueObject->literal < 0) { _currentQueueObject->literal = 0; } else { // We MUST wait until we are done reading our full // FETCH response. _rbuf could end immediately at the // end of our literal response and we need to call // [super updateRead] to get more bytes from the socket // in order to read the rest (")" or " UID 123)" for example). while (!(aData = split_lines(_rbuf))) { //SLog(@"NOTHING TO READ! WAITING..."); [super updateRead]; } [_responsesFromServer addObject: aData]; } // // Let's rollback in what are processing/read in order to // reparse our initial response. It's if it's FETCH response, // the literal will now be 0 so the parsing of this response // will occur. // aData = [_responsesFromServer objectAtIndex: 0]; buf = (char *)[aData bytes]; count = [aData length]; } else { //NSLog(@"Accumulating... %d remaining...", _currentQueueObject->literal); // // We are still accumulating bytes of the literal. Once we have appended // our CRLF, we just continue the loop since there's no need to try to // parse anything, as we don't have the complete response yet. // [[_currentQueueObject->info objectForKey: @"NSData"] appendData: CRLF]; continue; } } else { //NSLog(@"aLine = |%@|", [aData asciiString]); [_responsesFromServer addObject: aData]; if (_currentQueueObject && (_currentQueueObject->literal = has_literal(buf, count))) { //NSLog(@"literal = %d", _currentQueueObject->literal); [_currentQueueObject->info setObject: [NSMutableData dataWithCapacity: _currentQueueObject->literal] forKey: @"NSData"]; } } // Now search for the position of the first space in our response. i = 0; while (i < count && *buf != ' ') { buf++; i++; } //NSLog(@"i = %d count = %d", i, count); // // We got an untagged response or a command continuation request. // if (i == 1) { int d, j, msn, len; BOOL b; // // We verify if we received a command continuation request. // This response is used in the AUTHENTICATE command or // in any argument to the command is a literal. In the current // code, the only command which has a literal argument is // the APPEND command. We must NOT use "break;" at the very // end of this block since we could read a line in a mail // that begins with a '+'. // if (*(buf-i) == '+') { if (_currentQueueObject && _lastCommand == IMAP_APPEND) { [self writeData: [_currentQueueObject->info objectForKey: @"NSDataToAppend"]]; [self writeData: CRLF]; break; } else if (_lastCommand == IMAP_AUTHENTICATE_CRAM_MD5) { [self _parseAUTHENTICATE_CRAM_MD5]; break; } else if (_lastCommand == IMAP_AUTHENTICATE_LOGIN) { [self _parseAUTHENTICATE_LOGIN]; break; } else if (_currentQueueObject && _lastCommand == IMAP_LOGIN) { //NSLog(@"writing password |%s|", [[_currentQueueObject->info objectForKey: @"Password"] cString]); [self writeData: [_currentQueueObject->info objectForKey: @"Password"]]; [self writeData: CRLF]; break; } } msn = 0; b = YES; d = 1; j = i+1; buf++; // Let's see if we can read a MSN while (j < count && *buf != ' ') { if (!isdigit((int)(unsigned char)*buf)) b = NO; buf++; j++; } //NSLog(@"j = %d, b = %d", j, b); // // The token following our "*" is all-digit. Let's // decode the MSN and get the kind of response. // // We will also read the untagged responses we get // when SELECT'ing a mailbox ("* 4 EXISTS" for example). // // We parse those results but we ignore the "MSN" since // it bears no relation to an actual MSN. // if (b) { int k; k = j; // We compute the MSN while (k > i+1) { buf--; k--; //NSLog(@"msn c = %c", *buf); msn += ((*buf-48) * d); d *= 10; } //NSLog(@"Done computing the msn = %d k = %d", msn, k); // We now get what kind of response we read (FETCH, etc?) buf += (j-i); k = j+1; while (k < count && isalpha((int)(unsigned char)*buf)) { //NSLog(@"response after c = %c", *buf); buf++; k++; } //NSLog(@"Done reading response: i = %d j = %d k = %d", i, j, k); buf = buf-k+j+1; len = k-j-1; } // // It's NOT all-digit. // else { buf = buf-j+i+1; len = j-i-1; } //NSData *foo; //foo = [NSData dataWithBytes: buf length: len]; //NSLog(@"DONE!!! foo after * = |%@| b = %d, msn = %d", [foo asciiString], b, msn); //NSLog(@"len = %d", len); // // We got an untagged OK response. We handle only the one used in the IMAP authorization // state and ignore the ones required during a SELECT command (like OK [UNSEEN ]). // if (len && strncasecmp("OK", buf, 2) == 0 && _lastCommand == IMAP_AUTHORIZATION) { [self _parseOK]; } // // We check if we got disconnected from the IMAP server. // If it's the case, we invoke -reconnect. // else if (len && strncasecmp("BYE", buf, 3) == 0) { [self _parseBYE]; } // // // else if (len && strncasecmp("LIST", buf, 4) == 0) { [self _parseLIST]; } // // // else if (len && strncasecmp("LSUB", buf, 4) == 0) { [self _parseLSUB]; } // // We got a FETCH response and we are done reading all // bytes specified by our literal. We also handle // untagged responses coming AFTER a tagged response, // like that: // // 000c UID FETCH 3071053:3071053 BODY[TEXT] // * 1 FETCH (UID 3071053 BODY[TEXT] {859} // f00 bar zarb // .. // ) // 000c OK UID FETCH completed // * 1 FETCH (FLAGS (\Seen)) // // Responses like that must be carefully handled since // _currentQueueObject would nil after getting the // tagged response. // else if (len && strncasecmp("FETCH", buf, 5) == 0 && (!_currentQueueObject || (_currentQueueObject && _currentQueueObject->literal == 0))) { [self _parseFETCH: msn]; } // // // else if (len && strncasecmp("EXISTS", buf, 6) == 0) { [self _parseEXISTS]; [_responsesFromServer removeLastObject]; } // // // else if (len && strncasecmp("RECENT", buf, 6) == 0) { [self _parseRECENT]; [_responsesFromServer removeLastObject]; } // // // else if (len && strncasecmp("SEARCH", buf, 6) == 0) { switch (_lastCommand) { case IMAP_UID_SEARCH: case IMAP_UID_SEARCH_ANSWERED: case IMAP_UID_SEARCH_FLAGGED: case IMAP_UID_SEARCH_UNSEEN: [self _parseSEARCH_CACHE]; break; default: [self _parseSEARCH]; } } // // // else if (len && strncasecmp("STATUS", buf, 6) == 0) { [self _parseSTATUS]; } // // // else if (len && strncasecmp("EXPUNGE", buf, 7) == 0) { [self _parseEXPUNGE]; } // // // else if (len && strncasecmp("CAPABILITY", buf, 10) == 0) { [self _parseCAPABILITY]; } } // // We got a tagged response // else { int j; //NSData *foo; //foo = [NSData dataWithBytes: buf-i length: i]; //NSLog(@"tag = |%@|", [foo asciiString]); j = i+1; buf++; // We read past our tag, in order to find // the type of response (OK/NO/BAD). while (j < count && *buf != ' ') { //NSLog(@"IN OK: %c", *buf); buf++; j++; } //NSLog(@"OK/NO/BAD response = |%@|", [[NSData dataWithBytes: buf-j+i+1 length: j-i-1] asciiString]); buf = buf-j+i+1; // From RFC3501: // // The server completion result response indicates the success or // failure of the operation. It is tagged with the same tag as the // client command which began the operation. Thus, if more than one // command is in progress, the tag in a server completion response // identifies the command to which the response applies. There are // three possible server completion responses: OK (indicating success), // NO (indicating failure), or BAD (indicating a protocol error such as // unrecognized command or command syntax error). // if (strncasecmp("OK", buf, 2) == 0) { [self _parseOK]; } // // RFC3501 says: // // The NO response indicates an operational error message from the // server. When tagged, it indicates unsuccessful completion of the // associated command. The untagged form indicates a warning; the // command can still complete successfully. The human-readable text // describes the condition. // else if (strncasecmp("NO", buf, 2) == 0) { [self _parseNO]; } else { [self _parseBAD]; } } } // while ((aData = split_lines... //NSLog(@"While loop broken!"); } // // This method authenticates the Store to the IMAP server. // In case of an error, it returns NO. // // FIXME: We MUST NOT send a login command if LOGINDISABLED is // enforced by the server (6.2.3). // - (void) authenticate: (NSString*) theUsername password: (NSString*) thePassword mechanism: (NSString*) theMechanism { ASSIGN(_username, theUsername); ASSIGN(_password, thePassword); ASSIGN(_mechanism, theMechanism); if (theMechanism && [theMechanism caseInsensitiveCompare: @"CRAM-MD5"] == NSOrderedSame) { [self sendCommand: IMAP_AUTHENTICATE_CRAM_MD5 info: nil arguments: @"AUTHENTICATE CRAM-MD5"]; return; } else if (theMechanism && [theMechanism caseInsensitiveCompare: @"LOGIN"] == NSOrderedSame) { [self sendCommand: IMAP_AUTHENTICATE_LOGIN info: nil arguments: @"AUTHENTICATE LOGIN"]; return; } // We must verify if we must quote the password if ([thePassword rangeOfCharacterFromSet: [NSCharacterSet punctuationCharacterSet]].length || [thePassword rangeOfCharacterFromSet: [NSCharacterSet whitespaceCharacterSet]].length) { thePassword = [NSString stringWithFormat: @"\"%@\"", thePassword]; } else if (![thePassword is7bitSafe]) { NSData *aData; // // We support non-ASCII password by using the 8-bit ISO Latin 1 encoding. // FIXME: Is there any standard on which encoding to use? // aData = [thePassword dataUsingEncoding: NSISOLatin1StringEncoding]; [self sendCommand: IMAP_LOGIN info: [NSDictionary dictionaryWithObject: aData forKey: @"Password"] arguments: @"LOGIN %@ {%d}", _username, [aData length]]; return; } [self sendCommand: IMAP_LOGIN info: nil arguments: @"LOGIN %@ %@", _username, thePassword]; } // // // - (NSArray *) supportedMechanisms { NSMutableArray *aMutableArray; NSString *aString; int i, count;; aMutableArray = [NSMutableArray array]; count = [_capabilities count]; for (i = 0; i < count; i++) { aString = [_capabilities objectAtIndex: i]; if ([aString hasCaseInsensitivePrefix: @"AUTH="]) { [aMutableArray addObject: [aString substringFromIndex: 5]]; } } return aMutableArray; } // // The default folder in IMAP is always Inbox. This method will prefetch // the messages of an IMAP folder if they haven't been prefetched before. // - (id) defaultFolder { return [self folderForName: @"INBOX"]; } // // // - (id) folderForName: (NSString *) theName { return [self folderForName: theName mode: PantomimeReadWriteMode prefetch: YES]; } // // // - (CWIMAPFolder *) folderForName: (NSString *) theName select: (BOOL) aBOOL { if ([_openFolders objectForKey: theName]) { return [_openFolders objectForKey: theName]; } if (aBOOL) { return [self folderForName: theName]; } else { CWIMAPFolder *aFolder; aFolder = [[CWIMAPFolder alloc] initWithName: theName]; [aFolder setStore: self]; [aFolder setSelected: NO]; return AUTORELEASE(aFolder); } } // // // #warning VERIFY FOR NoSelect - (CWIMAPFolder *) folderForName: (NSString *) theName mode: (PantomimeFolderMode) theMode prefetch: (BOOL) aBOOL { CWIMAPFolder *aFolder; aFolder = [_openFolders objectForKey: theName]; // Careful here, we might return a non-selected mailbox. if (aFolder) { return aFolder; } aFolder = [[CWIMAPFolder alloc] initWithName: theName mode: theMode]; [aFolder setStore: self]; [_openFolders setObject: aFolder forKey: theName]; RELEASE(aFolder); //NSLog(@"_connection_state.opening_mailbox = %d", _connection_state.opening_mailbox); // If we are already opening a mailbox, we must interrupt the process // and open the preferred one instead. if (_connection_state.opening_mailbox) { // Safety measure - in case close (so -removeFolderFromOpenFolders) // on the selected folder wasn't called. if (_selectedFolder) { [_openFolders removeObjectForKey: [_selectedFolder name]]; } [super cancelRequest]; [self reconnect]; _selectedFolder = aFolder; return _selectedFolder; } _connection_state.opening_mailbox = YES; if (theMode == PantomimeReadOnlyMode) { [self sendCommand: IMAP_EXAMINE info: nil arguments: @"EXAMINE \"%@\"", [theName modifiedUTF7String]]; } else { [self sendCommand: IMAP_SELECT info: nil arguments: @"SELECT \"%@\"", [theName modifiedUTF7String]]; } // This folder becomes the selected one. This will have to be improved in the future. // No need to retain "aFolder" here. The "_openFolders" dictionary already retains it. _selectedFolder = aFolder; if (aBOOL) { [_selectedFolder prefetch]; } return _selectedFolder; } // // // - (id) folderForURL: (NSString *) theURL { CWURLName *theURLName; id aFolder; theURLName = [[CWURLName alloc] initWithString: theURL]; aFolder = [self folderForName: [theURLName foldername]]; RELEASE(theURLName); return aFolder; } // // When this method is invoked for the first time, it sends a LIST // command to the IMAP server and cache the results for subsequent // queries. The IMAPStore notifies the delegate once it has parsed // all server's responses. // - (NSEnumerator *) folderEnumerator { if (![_folders count]) { [self sendCommand: IMAP_LIST info: nil arguments: @"LIST \"\" \"*\""]; return nil; } return [_folders keyEnumerator]; } // // This method works the same way as the -folderEnumerator method. // - (NSEnumerator *) subscribedFolderEnumerator { if (![_subscribedFolders count]) { [self sendCommand: IMAP_LSUB info: nil arguments: @"LSUB \"\" \"*\""]; return nil; } return [_subscribedFolders objectEnumerator]; } // // // - (NSDictionary *) folderStatus: (NSArray *) theArray { int i; [_folderStatus removeAllObjects]; // C: A042 STATUS blurdybloop (UIDNEXT MESSAGES) // S: * STATUS blurdybloop (MESSAGES 231 UIDNEXT 44292) // S: A042 OK STATUS completed // // We send: MESSAGES UNSEEN for (i = 0; i < [theArray count]; i++) { // RFC3501 says we SHOULD NOT call STATUS on the selected mailbox - so we won't do it. if (_selectedFolder && [[_selectedFolder name] isEqualToString: [theArray objectAtIndex: i]]) { continue; } [self sendCommand: IMAP_STATUS info: [NSDictionary dictionaryWithObject: [theArray objectAtIndex: i] forKey: @"Name"] arguments: @"STATUS \"%@\" (MESSAGES UNSEEN)", [[theArray objectAtIndex: i] modifiedUTF7String]]; } return _folderStatus; } // // This method appends theCommand to the IMAP tag // and sends it to the server. // // It then sets the last command (w/o the tag) that has been sent. // // If the server is already processing a query, it queues it in _queue. // - (void) sendCommand: (IMAPCommand) theCommand info: (NSDictionary *) theInfo arguments: (NSString *) theFormat, ... { if (theCommand == IMAP_EMPTY_QUEUE) { if ([_queue count]) { // We dequeue the first inserted command from the queue. _currentQueueObject = [_queue lastObject]; } else { // The queue is empty, we have nothing more to do... _currentQueueObject = nil; return; } } else { CWIMAPQueueObject *aQueueObject; NSString *aString; va_list args; int i, count; //NSLog(@"sendCommand invoked, cmd = %i", theCommand); va_start(args, theFormat); aString = [[NSString alloc] initWithFormat: theFormat arguments: args]; // // We must check in the queue if we aren't trying to add a command that is already there. // This could happend if -rawSource is called in IMAPMessage multiple times before // PantomimeMessageFetchCompleted is sent. // // We skip this verification for the IMAP_APPEND command as a messages with the same size // could be quickly appended to the folder and we do NOT want to skip the second one. // count = [_queue count]; for (i = 0; i < count; i++) { aQueueObject = [_queue objectAtIndex: i]; if (aQueueObject->command == theCommand && theCommand != IMAP_APPEND && [aQueueObject->arguments isEqualToString: aString]) { RELEASE(aString); //NSLog(@"A COMMAND ALREADY EXIST!!!!"); return; } } aQueueObject = [[CWIMAPQueueObject alloc] initWithCommand: theCommand arguments: aString tag: [self nextTag] info: theInfo]; RELEASE(aString); [_queue insertObject: aQueueObject atIndex: 0]; RELEASE(aQueueObject); //NSLog(@"queue size = %d", [_queue count]); // If we had queued commands, we return since we'll eventually // dequeue them one by one. Otherwise, we run it immediately. if ([_queue count] > 1) { //NSLog(@"QUEUED |%@|", aString); return; } _currentQueueObject = aQueueObject; } //NSLog(@"Sending |%@|", _currentQueueObject->arguments); _lastCommand = _currentQueueObject->command; [self writeData: _currentQueueObject->tag]; [self writeData: [NSData dataWithBytes: " " length: 1]]; [self writeData: [_currentQueueObject->arguments dataUsingEncoding: defaultCStringEncoding]]; [self writeData: CRLF]; POST_NOTIFICATION(@"PantomimeCommandSent", self, _currentQueueObject->info); PERFORM_SELECTOR_2(_delegate, @selector(commandSent:), @"PantomimeCommandSent", [NSNumber numberWithInt: _lastCommand], @"Command"); } // // // - (NSEnumerator *) openFoldersEnumerator { return [_openFolders objectEnumerator]; } // // // - (void) removeFolderFromOpenFolders: (CWFolder *) theFolder { if (_selectedFolder == (CWIMAPFolder *)theFolder) { _selectedFolder = nil; } [_openFolders removeObjectForKey: [theFolder name]]; } // // // - (BOOL) folderForNameIsOpen: (NSString *) theName { NSEnumerator *anEnumerator; CWIMAPFolder *aFolder; anEnumerator = [self openFoldersEnumerator]; while ((aFolder = [anEnumerator nextObject])) { if ([[aFolder name] compare: theName options: NSCaseInsensitiveSearch] == NSOrderedSame) { return YES; } } return NO; } // // This method verifies in the cache if theName is present. // If so, it returns the associated value. // // If it's not present, it sends a LIST command to the server // and the delegate will eventually be notified when the LIST // command completed. It also returns 0 if it's not present. // - (PantomimeFolderType) folderTypeForFolderName: (NSString *) theName { id o; o = [_folders objectForKey: theName]; if (o) { return [o intValue]; } [self sendCommand: IMAP_LIST info: nil arguments: @"LIST \"\" \"%@\"", [theName modifiedUTF7String]]; return 0; } // // // - (unsigned char) folderSeparator { return _folderSeparator; } // // // - (NSData *) nextTag { _tag++; return [self lastTag]; } // // // - (NSData *) lastTag { char str[5]; sprintf(str, "%04x", _tag); return [NSData dataWithBytes: str length: 4]; } // // // - (void) subscribeToFolderWithName: (NSString *) theName { [self sendCommand: IMAP_SUBSCRIBE info: [NSDictionary dictionaryWithObject: theName forKey: @"Name"] arguments: @"SUBSCRIBE \"%@\"", [theName modifiedUTF7String]]; } // // // - (void) unsubscribeToFolderWithName: (NSString *) theName { [self sendCommand: IMAP_UNSUBSCRIBE info: [NSDictionary dictionaryWithObject: theName forKey: @"Name"] arguments: @"UNSUBSCRIBE \"%@\"", [theName modifiedUTF7String]]; } // // // - (void) close { [self sendCommand: IMAP_LOGOUT info: nil arguments: @"LOGOUT"]; } // // Create the mailbox and subscribe to it. The full path to the mailbox must // be provided. // // The delegate will be notified when the folder has been created (or not). // - (void) createFolderWithName: (NSString *) theName type: (PantomimeFolderFormat) theType contents: (NSData *) theContents { [self sendCommand: IMAP_CREATE info: [NSDictionary dictionaryWithObject: theName forKey: @"Name"] arguments: @"CREATE \"%@\"", [theName modifiedUTF7String]]; } // // Delete the mailbox. The full path to the mailbox must be provided. // // The delegate will be notified when the folder has been deleted (or not). // - (void) deleteFolderWithName: (NSString *) theName { [self sendCommand: IMAP_DELETE info: [NSDictionary dictionaryWithObject: theName forKey: @"Name"] arguments: @"DELETE \"%@\"", [theName modifiedUTF7String]]; } // // This method is used to rename a folder. // // theName and theNewName MUST be the full path of those mailboxes. // If they begin with the folder separator (ie., '/'), the character is // automatically stripped. // // This method supports renaming SELECT'ed mailboxes. // // The delegate will be notified when the folder has been renamed (or not). // - (void) renameFolderWithName: (NSString *) theName toName: (NSString *) theNewName { NSDictionary *info; theName = [theName stringByDeletingFirstPathSeparator: _folderSeparator]; theNewName = [theNewName stringByDeletingFirstPathSeparator: _folderSeparator]; info = [NSDictionary dictionaryWithObjectsAndKeys: theName, @"Name", theNewName, @"NewName", nil]; if ([[theName stringByTrimmingWhiteSpaces] length] == 0 || [[theNewName stringByTrimmingWhiteSpaces] length] == 0) { POST_NOTIFICATION(PantomimeFolderRenameFailed, self, info); PERFORM_SELECTOR_3(_delegate, @selector(folderRenameFailed:), PantomimeFolderRenameFailed, info); } [self sendCommand: IMAP_RENAME info: info arguments: @"RENAME \"%@\" \"%@\"", [theName modifiedUTF7String], [theNewName modifiedUTF7String]]; } // // This method NOOPs the IMAP store. // - (void) noop { [self sendCommand: IMAP_NOOP info: nil arguments: @"NOOP"]; } // // // - (int) reconnect { //NSLog(@"CWIMAPStore: -reconnect"); [_connection_state.previous_queue addObjectsFromArray: _queue]; _connection_state.reconnecting = YES; // We flush our read/write buffers. [_rbuf setLength: 0]; [_wbuf setLength: 0]; // // We first empty our queue and set again our _lastCommand ivar to // the IMAP_AUTHORIZATION command // //NSLog(@"queue count = %d", [_queue count]); //NSLog(@"%@", [_queue description]); [_queue removeAllObjects]; _lastCommand = IMAP_AUTHORIZATION; _currentQueueObject = nil; _counter = 0; [super close]; [super connectInBackgroundAndNotify]; return 0; } // // // - (void) startTLS { [self sendCommand: IMAP_STARTTLS info: nil arguments: @"STARTTLS"]; } @end // // Private methods // @implementation CWIMAPStore (Private) // // This method is used to parse the name of a mailbox. // // If the string was encoded using mUTF-7, it'll also // decode it. // - (NSString *) _folderNameFromString: (NSString *) theString { NSString *aString, *decodedString; NSRange aRange; aRange = [theString rangeOfString: @"\""]; if (aRange.length) { int mark; mark = aRange.location + 1; aRange = [theString rangeOfString: @"\"" options: 0 range: NSMakeRange(mark, [theString length] - mark)]; aString = [theString substringWithRange: NSMakeRange(mark, aRange.location - mark)]; // Check if we got "NIL" or a real separator. if ([aString length] == 1) { _folderSeparator = [aString characterAtIndex: 0]; } else { _folderSeparator = 0; } mark = aRange.location + 2; aString = [theString substringFromIndex: mark]; } else { aRange = [theString rangeOfString: @"NIL" options: NSCaseInsensitiveSearch]; if (aRange.length) { aString = [theString substringFromIndex: aRange.location + aRange.length + 1]; } else { return theString; } } aString = [aString stringFromQuotedString]; decodedString = [aString stringFromModifiedUTF7]; return (decodedString != nil ? decodedString : aString); } // // This method parses the flags received in theString and builds // a corresponding Flags object for them. // - (void) _parseFlags: (NSString *) theString message: (CWIMAPMessage *) theMessage record: (cache_record *) theRecord { CWFlags *theFlags; NSRange aRange; theFlags = [[CWFlags alloc] init]; // We check if the message has the Seen flag aRange = [theString rangeOfString: @"\\Seen" options: NSCaseInsensitiveSearch]; if (aRange.length > 0) { [theFlags add: PantomimeSeen]; } // We check if the message has the Recent flag aRange = [theString rangeOfString: @"\\Recent" options: NSCaseInsensitiveSearch]; if (aRange.length > 0) { [theFlags add: PantomimeRecent]; } // We check if the message has the Deleted flag aRange = [theString rangeOfString: @"\\Deleted" options: NSCaseInsensitiveSearch]; if (aRange.length > 0) { [theFlags add: PantomimeDeleted]; } // We check if the message has the Answered flag aRange = [theString rangeOfString: @"\\Answered" options: NSCaseInsensitiveSearch]; if (aRange.length > 0) { [theFlags add: PantomimeAnswered]; } // We check if the message has the Flagged flag aRange = [theString rangeOfString: @"\\Flagged" options: NSCaseInsensitiveSearch]; if (aRange.length > 0) { [theFlags add: PantomimeFlagged]; } // We check if the message has the Draft flag aRange = [theString rangeOfString: @"\\Draft" options: NSCaseInsensitiveSearch]; if (aRange.length > 0) { [theFlags add: PantomimeDraft]; } [[theMessage flags] replaceWithFlags: theFlags]; theRecord->flags = theFlags->flags; RELEASE(theFlags); // // If our previous command is NOT the FETCH command, we must inform our // delegate that messages flags have changed. The delegate SHOULD refresh // its view and does NOT have to issue any command to update the state // of the messages (since it has been done). // if (_lastCommand != IMAP_UID_FETCH_BODY_TEXT && _lastCommand != IMAP_UID_FETCH_HEADER_FIELDS && _lastCommand != IMAP_UID_FETCH_HEADER_FIELDS_NOT && _lastCommand != IMAP_UID_FETCH_RFC822) { POST_NOTIFICATION(PantomimeMessageChanged, self, [NSDictionary dictionaryWithObject: theMessage forKey: @"Message"]); PERFORM_SELECTOR_1(_delegate, @selector(messageChanged:), PantomimeMessageChanged); } } // // // - (void) _renameFolder { CWFolderInformation *aFolderInformation; NSString *aName, *aNewName; CWIMAPFolder *aFolder; aName = [_currentQueueObject->info objectForKey: @"Name"]; aNewName = [_currentQueueObject->info objectForKey: @"NewName"]; // If the folder was open, we change its name and recache its entry. aFolder = [_openFolders objectForKey: aName]; if (aFolder) { RETAIN(aFolder); [aFolder setName: aNewName]; [_openFolders removeObjectForKey: aName]; [_openFolders setObject: aFolder forKey: aNewName]; RELEASE(aFolder); } // We then do the same thing for our list of folders / suscribed folders aFolderInformation = RETAIN([_folders objectForKey: aName]); [_folders removeObjectForKey: aName]; if (aFolderInformation) { [_folders setObject: aFolderInformation forKey: aNewName]; RELEASE(aFolderInformation); } if ([_subscribedFolders containsObject: aName]) { [_subscribedFolders removeObject: aName]; [_subscribedFolders addObject: aNewName]; } } // // This method parses a SEARCH response in order to decode // all UIDs in the result. // // Examples of theData: // // "* SEARCH 1 4 59 81" // "* SEARCH" // - (NSArray *) _uniqueIdentifiersFromData: (NSData *) theData { NSMutableArray *aMutableArray; NSScanner *aScanner; unsigned int value; aMutableArray = [NSMutableArray array]; theData = [theData subdataFromIndex: 8]; // If we have no results, let's return right away. if (![theData length]) { return aMutableArray; } // We scan all our UIDs. aScanner = [[NSScanner alloc] initWithString: [theData asciiString]]; while (![aScanner isAtEnd]) { [aScanner scanUnsignedInt: &value]; [aMutableArray addObject: [NSNumber numberWithInt: value]]; } RELEASE(aScanner); return aMutableArray; } // // // - (void) _parseAUTHENTICATE_CRAM_MD5 { NSData *aData; aData = [_responsesFromServer lastObject]; // // We first verify if we got our challenge response from the IMAP server. // If so, we use it and send back a response to proceed with the authentication. // if ([aData hasCPrefix: "+"]) { NSString *aString; CWMD5 *aMD5; // We trim the "+ " and we keep the challenge phrase aData = [aData subdataFromIndex: 2]; //NSLog(@"Challenge phrase = |%@|", [aData asciiString]); aMD5 = [[CWMD5 alloc] initWithData: [aData decodeBase64]]; [aMD5 computeDigest]; aString = [NSString stringWithFormat: @"%@ %@", _username, [aMD5 hmacAsStringUsingPassword: _password]]; aString = [[NSString alloc] initWithData: [[aString dataUsingEncoding: NSASCIIStringEncoding] encodeBase64WithLineLength: 0] encoding: NSASCIIStringEncoding]; [self writeData: [aString dataUsingEncoding: defaultCStringEncoding]]; [self writeData: CRLF]; RELEASE(aMD5); RELEASE(aString); } } // // LOGIN is a very lame authentication method but we support it anyway. We basically // wait for a challenge, send the username (in base64), wait for an other challenge // and finally send the password (in base64). The challenges aren't even used. // - (void) _parseAUTHENTICATE_LOGIN { NSData *aData; aData = [_responsesFromServer lastObject]; // // We first verify if we got our challenge response from the IMAP server. // If so, we use it and send back a response to proceed with the authentication. // Based on what we sent before, we can either send the username or the password. // if ([aData hasCPrefix: "+"]) { NSData *aResponse; // Have we read the initial challenge? If not, we must send the username! if (_currentQueueObject && ![_currentQueueObject->info objectForKey: @"Challenge"]) { aResponse = [[_username dataUsingEncoding: NSASCIIStringEncoding] encodeBase64WithLineLength: 0]; [_currentQueueObject->info setObject: aData forKey: @"Challenge"]; } else { aResponse = [[_password dataUsingEncoding: NSASCIIStringEncoding] encodeBase64WithLineLength: 0]; } [self writeData: aResponse]; [self writeData: CRLF]; } } // // // - (void) _parseBAD { NSData *aData; aData = [_responsesFromServer lastObject]; switch (_lastCommand) { case IMAP_LOGIN: // This can happen if we got an empty username or password. AUTHENTICATION_FAILED(_delegate, _mechanism); break; default: // We got a BAD response that we could not handle. Raise an exception for now // and remove the command that caused this from the queue. [_queue removeLastObject]; [_responsesFromServer removeAllObjects]; [NSException raise: PantomimeProtocolException format: @"Unable to handle IMAP response (%@).", [aData asciiString]]; } if (![aData hasCPrefix: "*"]) { [_queue removeLastObject]; [self sendCommand: IMAP_EMPTY_QUEUE info: nil arguments: @""]; } [_responsesFromServer removeAllObjects]; } // // // - (void) _parseBYE { // // We check if we sent the IMAP_LOGOUT command. // // If we got an untagged BYE response, it means // that the server disconnected us. We will // handle that in CWService: -updateRead. // if (_lastCommand == IMAP_LOGOUT) { return; } } // // This method parses an * CAPABILITY IMAP4 IMAP4rev1 ACL AUTH=LOGIN NAMESPACE .. // untagged response (6.1.1) // // FIXME: check for OK/BAD // - (void) _parseCAPABILITY { NSString *aString; NSData *aData; aData = [_responsesFromServer objectAtIndex: 0]; aString = [[NSString alloc] initWithData: aData encoding: defaultCStringEncoding]; [_capabilities addObjectsFromArray: [[aString substringFromIndex: 13] componentsSeparatedByString: @" "]]; RELEASE(aString); if (_connection_state.reconnecting) { [self authenticate: _username password: _password mechanism: _mechanism]; } else { POST_NOTIFICATION(PantomimeServiceInitialized, self, nil); PERFORM_SELECTOR_1(_delegate, @selector(serviceInitialized:), PantomimeServiceInitialized); } } // // This method parses an * 23 EXISTS untagged response. (7.3.1) // // If we were NOT issueing a SELECT command, it fetches the // new messages (if any) and informs the folder's delegate that // new messages have arrived. // - (void) _parseEXISTS { NSData *aData; int n; aData = [_responsesFromServer lastObject]; sscanf([aData cString], "* %d EXISTS", &n); //NSLog(@"_parseExists: %d", n); if (_currentQueueObject && _currentQueueObject->command != IMAP_SELECT && _selectedFolder && n > [_selectedFolder->allMessages count]) { unsigned int uid; uid = 0; // We prefetch the new messages from the last UID+1 if ([_selectedFolder->allMessages lastObject]) { uid = [[_selectedFolder->allMessages lastObject] UID]; } [self sendCommand: IMAP_UID_FETCH_HEADER_FIELDS info: nil arguments: @"UID FETCH %u:* (FLAGS RFC822.SIZE BODY.PEEK[HEADER.FIELDS (From To Cc Subject Date Message-ID References In-Reply-To)])", (uid+1)]; } } // // Example: * 44 EXPUNGE // - (void) _parseEXPUNGE { CWIMAPMessage *aMessage; NSData *aData; int i, msn; // It looks like some servers send untagged expunge reponses // _after_ the selected folder has been closed. if (!_selectedFolder) { return; } aData = [_responsesFromServer lastObject]; sscanf([aData cString], "* %d EXPUNGE", &msn); // // Messages CAN be expunged before we really had time to FETCH them. // We simply proceed by skipping over MSN that are bigger than we // we have so far. It should be safe since the view hasn't even // had the chance to display them. // if (msn > [_selectedFolder->allMessages count]) return; aMessage = [_selectedFolder->allMessages objectAtIndex: (msn-1)]; RETAIN(aMessage); // We do NOT use [_selectedFolder removeMessage: aMessage] since it'll // thread the messages everytime we invoke it. We rather thread messages // if: // * We got an untagged EXPUNGE response but the last command was NOT // an EXPUNGE one (see below, near the end of the method) // * We sent an EXPUNGE command - we'll do the threading of the // messages in _parseOK: // [_selectedFolder->allMessages removeObject: aMessage]; [_selectedFolder updateCache]; // We remove its entry in our cache if ([_selectedFolder cacheManager]) { [(CWIMAPCacheManager *)[_selectedFolder cacheManager] removeMessageWithUID: [aMessage UID]]; } // We update all MSNs starting from the message that has been expunged. for (i = (msn-1); i < [_selectedFolder->allMessages count]; i++) { [[_selectedFolder->allMessages objectAtIndex: i] setMessageNumber: (i+1)]; } // // If our previous command is NOT the EXPUNGE command, we must inform our // delegate that messages have been expunged. The delegate SHOULD refresh // its view and does NOT have to issue any command to update the state // of the messages (since it has been done). // if (_lastCommand != IMAP_EXPUNGE) { if ([_selectedFolder allContainers]) { [_selectedFolder thread]; } if ([_selectedFolder cacheManager]) { [[_selectedFolder cacheManager] expunge]; } POST_NOTIFICATION(PantomimeMessageExpunged, self, [NSDictionary dictionaryWithObject: aMessage forKey: @"Message"]); PERFORM_SELECTOR_1(_delegate, @selector(messageExpunged:), PantomimeMessageExpunged); } RELEASE(aMessage); //NSLog(@"Expunged %d", msn); } // // // Examples of FETCH responses: // // * 50 FETCH (UID 50 RFC822 {6718} // Return-Path: <... // ) // // // * 418 FETCH (FLAGS (\Seen) UID 418 RFC822.SIZE 3565452 BODY[HEADER.FIELDS (From To Cc Subject Date Message-ID // References In-Reply-To MIME-Version)] {666} // Subject: abc // ... // ) // // // * 50 FETCH (UID 50 BODY[HEADER.FIELDS.NOT (From To Cc Subject Date Message-ID References In-Reply-To MIME-Version)] {1412} // Return-Path: <... // ) // // * 50 FETCH (BODY[TEXT] {5009} // Hi, ... // ) // // // "Twisted" response from Microsoft Exchange 2000: // // * 549 FETCH (FLAGS (\Recent) RFC822.SIZE 970 BODY[HEADER.FIELDS (From To Cc Subject Date Message-ID References In-Reply-To MIME-Version)] {196} // From: // To: aaaaaa@bbbbbbbbbbbbbbb.com // Subject: Test mail // Date: Tue, 16 Dec 2003 15:52:23 GMT // Message-Id: <200312161552.PAA07523@aaaaaaa.bbb.ccccccccccccccc.com> // // UID 29905) // // // Yet an other "twisted" response, likely coming from UW IMAP Server (2001.315rh) // // * 741 FETCH (UID 23628 BODY[TEXT] {818} // f00bar baz // ... // ) // * 741 FETCH (FLAGS (\Seen) UID 23628) // 000b OK UID FETCH completed // // // Other examples: // // * 1 FETCH (FLAGS (\Seen) UID 97 RFC822.SIZE 19123 BODY[HEADER.FIELDS (From To Cc Subject Date // Message-ID References In-Reply-To MIME-Version)] {216} // // This method can be called more than on times for a message. For example, Exchange sends // answers like this one: // // * 9 FETCH (BODY[HEADER.FIELDS.NOT (From To Cc Subject Date Message-ID References In-Reply-To MIME-Version)] {408} // Received: by nt1.inverse.qc.ca // .id <01C34ADC.D13E2A20@nt1.inverse.qc.ca>; Tue, 15 Jul 2003 09:24:36 -0500 // content-class: urn:content-classes:message // Content-Type: multipart/mixed; // .boundary="----_=_NextPart_001_01C34ADC.D13E2A20" // X-MS-Has-Attach: yes // X-MS-TNEF-Correlator: // Thread-Topic: test5 // X-MimeOLE: Produced By Microsoft Exchange V6.0.6249.0 // Thread-Index: AcNK3NDIIAS/1aRKSYC4x2N4Zj3GGg== // // UID 9) // // And we MUST parse the UID correctly. // - (void) _parseFETCH: (int) theMSN { NSMutableString *aMutableString; NSCharacterSet *aCharacterSet; CWIMAPMessage *aMessage; NSScanner *aScanner; NSMutableArray *aMutableArray; NSString *aWord, *aString; NSRange aRange; BOOL done, seen_fetch, must_flush_record; int i, j, count, len; cache_record r; // // The folder might have been closed so we must not try to // update it for no good reason. // if (!_selectedFolder) return; count = [_responsesFromServer count]-1; //NSLog(@"RESPONSES FROM SERVER: %d", count); aMutableString = [[NSMutableString alloc] init]; aMutableArray = [[NSMutableArray alloc] init]; // // Note: // // We must be careful here to NOT consider all responses from the server. For example, // UW IMAP might send us: // 1 UID SEARCH ANSWERED // * SEARCH // * 1 FETCH (FLAGS (\Recent \Seen) UID 1) // 1 OK UID SEARCH completed // // In such response, we must NOT consider the "* SEARCH" response. // must_flush_record = seen_fetch = NO; for (i = 0; i <= count; i++) { aString = [[_responsesFromServer objectAtIndex: i] asciiString]; //NSLog(@"%i: %@", i, aString); if (!seen_fetch && [aString hasCaseInsensitivePrefix: [NSString stringWithFormat: @"* %d FETCH", theMSN]]) { seen_fetch = YES; } if (seen_fetch) { [aMutableArray addObject: [_responsesFromServer objectAtIndex: i]]; [aMutableString appendString: aString]; if (i < count-1) { [aMutableString appendString: @" "]; } } } //NSLog(@"GOT TO PARSE: |%@|", aMutableString); aCharacterSet = [NSCharacterSet whitespaceAndNewlineCharacterSet]; len = [aMutableString length]; aMessage = nil; i = j = 0; aScanner = [[NSScanner alloc] initWithString: aMutableString]; [aScanner setScanLocation: i]; done = ![aScanner scanUpToCharactersFromSet: aCharacterSet intoString: NULL]; // // We tokenize our string into words // while (!done) { j = [aScanner scanLocation]; aWord = [[aMutableString substringWithRange: NSMakeRange(i,j-i)] stringByTrimmingWhiteSpaces]; //NSLog(@"WORD |%@|", aWord); if ([aWord characterAtIndex: 0] == '(') { aWord = [aWord substringFromIndex: 1]; } // // We read the MSN // if ([aWord characterAtIndex: 0] == '*') { int msn; [aScanner scanInt: &msn]; //NSLog(@"msn = %d", msn); // // If the MSN is > then the folder's count, that means it's // a new message. // // We can safely assume this since what we have in _selectedFolder->allMessages // is really the messages in our IMAP folder. That is true since we // synchronized our cache when opening the folder, in IMAPFolder: -prefetch. // if (msn > [_selectedFolder->allMessages count]) { //NSLog(@"============ NEW MESSAGE ======================"); aMessage = [[CWIMAPMessage alloc] init]; // We set some initial properties to our message; [aMessage setInitialized: NO]; [aMessage setFolder: _selectedFolder]; [aMessage setMessageNumber: msn]; [_selectedFolder appendMessage: aMessage]; // We add the new message to our cache. if ([_selectedFolder cacheManager]) { if (must_flush_record) { [[_selectedFolder cacheManager] writeRecord: &r message: aMessage]; } CLEAR_CACHE_RECORD(r); must_flush_record = YES; //[[_selectedFolder cacheManager] addObject: aMessage]; } RELEASE(aMessage); } else { aMessage = [_selectedFolder->allMessages objectAtIndex: (msn-1)]; [aMessage setMessageNumber: msn]; [aMessage setFolder: _selectedFolder]; } } if (!aMessage) { RELEASE(aMutableString); RELEASE(aMutableArray); RELEASE(aScanner); return; } // // We read our UID // if ([aWord caseInsensitiveCompare: @"UID"] == NSOrderedSame) { unsigned int uid; [aScanner scanUnsignedInt: &uid]; //NSLog(@"uid %d j = %d, scanLoc = %d", uid, j, [aScanner scanLocation]); if ([aMessage UID] == 0) { [aMessage setUID: uid]; r.imap_uid = uid; } j = [aScanner scanLocation]; } // // We read our flags. We usually get something like FLAGS (\Seen) // else if ([aWord caseInsensitiveCompare: @"FLAGS"] == NSOrderedSame) { // We get the substring inside our ( ) aRange = [aMutableString rangeOfString: @")" options: 0 range: NSMakeRange(j,len-j)]; //NSLog(@"Flags = |%@|", [aMutableString substringWithRange: NSMakeRange(j+2, aRange.location-j-2)]); [self _parseFlags: [aMutableString substringWithRange: NSMakeRange(j+2, aRange.location-j-2)] message: aMessage record: &r]; j = aRange.location + 1; [aScanner setScanLocation: j]; } // // We read the RFC822 message size // else if ([aWord caseInsensitiveCompare: @"RFC822.SIZE"] == NSOrderedSame) { int size; [aScanner scanInt: &size]; //NSLog(@"size = %d", size); [aMessage setSize: size]; r.size = size; j = [aScanner scanLocation]; } // // Note: // // Novell's IMAP server doesn't distinguish a NOT BODY.PEEK from a standard one (ie., no NOT). So we can have: // // 000b UID FETCH 3071053:3071053 BODY.PEEK[HEADER.FIELDS.NOT (From To Cc Subject Date Message-ID References In-Reply-To MIME-Version)] // * 1 FETCH (UID 3071053 BODY[HEADER.FIELDS ("From" "To" "Cc" "Subject" "Date" "Message-ID" "References" "In-Reply-To" "MIME-Version")] {1030} // else if ([aWord caseInsensitiveCompare: @"BODY[HEADER.FIELDS.NOT"] == NSOrderedSame || _lastCommand == IMAP_UID_FETCH_HEADER_FIELDS_NOT) { [[_currentQueueObject->info objectForKey: @"NSData"] replaceCRLFWithLF]; [aMessage addHeadersFromData: [_currentQueueObject->info objectForKey: @"NSData"] record: NULL]; break; } // // We must not break immediately after parsing this information. It's very important // since servers like Exchange might send us responses like: // // * 1 FETCH (FLAGS (\Seen) RFC822.SIZE 4491 BODY[HEADER.FIELDS (From To Cc Subject Date Message-ID References In-Reply-To Content-Type)] {337} UID 614348) // // If we break right away, we'll skip the size and more importantly, the UID. // else if ([aWord caseInsensitiveCompare: @"BODY[HEADER.FIELDS"] == NSOrderedSame) { [[_currentQueueObject->info objectForKey: @"NSData"] replaceCRLFWithLF]; [aMessage setHeadersFromData: [_currentQueueObject->info objectForKey: @"NSData"] record: &r]; } // // // else if ([aWord caseInsensitiveCompare: @"BODY[TEXT]"] == NSOrderedSame) { [[_currentQueueObject->info objectForKey: @"NSData"] replaceCRLFWithLF]; if (![aMessage content]) { NSData *aData; // // We do an initial check for the message body. If we haven't read a literal, // [_currentQueueObject->info objectForKey: @"NSData"] returns nil. This can // happen with messages having a totally emtpy body. For those messages, // we simply set a default content, being an empty NSData instance. // aData = [_currentQueueObject->info objectForKey: @"NSData"]; if (!aData) aData = [NSData data]; [CWMIMEUtility setContentFromRawSource: aData inPart: aMessage]; [aMessage setInitialized: YES]; [_currentQueueObject->info setObject: aMessage forKey: @"Message"]; POST_NOTIFICATION(PantomimeMessagePrefetchCompleted, self, [NSDictionary dictionaryWithObject: aMessage forKey: @"Message"]); PERFORM_SELECTOR_2(_delegate, @selector(messagePrefetchCompleted:), PantomimeMessagePrefetchCompleted, aMessage, @"Message"); } break; } // // // else if ([aWord caseInsensitiveCompare: @"RFC822"] == NSOrderedSame) { [[_currentQueueObject->info objectForKey: @"NSData"] replaceCRLFWithLF]; [aMessage setRawSource: [_currentQueueObject->info objectForKey: @"NSData"]]; POST_NOTIFICATION(PantomimeMessageFetchCompleted, self, [NSDictionary dictionaryWithObject: aMessage forKey: @"Message"]); PERFORM_SELECTOR_2(_delegate, @selector(messageFetchCompleted:), PantomimeMessageFetchCompleted, aMessage, @"Message"); break; } i = j; done = ![aScanner scanUpToCharactersFromSet: aCharacterSet intoString: NULL]; if (done && must_flush_record) { [[_selectedFolder cacheManager] writeRecord: &r message: aMessage]; } } RELEASE(aScanner); RELEASE(aMutableString); // // It is important that we remove the responses we have processed. This is particularly // useful if we are caching an IMAP mailbox. We could receive thousands of untagged // FETCH responses and we don't want to go over them again and again everytime // this method is invoked. // [_responsesFromServer removeObjectsInArray: aMutableArray]; RELEASE(aMutableArray); } // // This command parses the result of a LIST command. See 7.2.2 for the complete // description of the LIST response. // // Rationale: // // In IMAP, all mailboxes can hold messages and folders. Thus, the HOLDS_MESSAGES // flag is ALWAYS set for a mailbox that has been parsed. // // We also support RFC3348 \HasChildren and \HasNoChildren flags. In fact, we // directly map \HasChildren to HOLDS_FOLDERS. // // We support the following standard flags (from RFC3501): // // \Noinferiors // It is not possible for any child levels of hierarchy to exist // under this name; no child levels exist now and none can be // created in the future. // // \Noselect // It is not possible to use this name as a selectable mailbox. // // \Marked // The mailbox has been marked "interesting" by the server; the // mailbox probably contains messages that have been added since // the last time the mailbox was selected. // // \Unmarked // The mailbox does not contain any additional messages since the // last time the mailbox was selected. // - (void) _parseLIST { NSString *aFolderName, *aString, *theString; NSRange r1, r2; int flags, len; theString = [[_responsesFromServer lastObject] asciiString]; // // We verify if we got the number of bytes to read instead of the real mailbox name. // That happens if we couldn't get the ASCII string of what we read. // // Some servers seem to send that when the mailbox name is 8-bit. Those 8-bit mailbox // names were undefined in earlier versions of the IMAP protocol (now deprecated). // See section 5.1. (Mailbox Naming) of RFC3051. // // The RFC says we SHOULD interpret that as UTF-8. // // If we got a 8-bit string, we rollback to get the previous answer in order // to also decode the mailbox attribute. // if (!theString) { aFolderName = AUTORELEASE([[NSString alloc] initWithData: [_responsesFromServer lastObject] encoding: NSUTF8StringEncoding]); // We get the "previous" line which contains our mailbox attributes theString = [[_responsesFromServer objectAtIndex: [_responsesFromServer count]-2] asciiString]; } else { // We get the folder name and the mailbox name attributes aFolderName = [self _folderNameFromString: theString]; } // // If the folder name starts/ends with {}, that means it was "wrongly" encoded using // 8-bit characters which are not allowed. We just return since we'll re-enter in // _parseLIST whenever the real mailbox name will be read. // len = [aFolderName length]; if (len > 0 && [aFolderName characterAtIndex: 0] == '{' && [aFolderName characterAtIndex: len-1] == '}') { return; } // We try to get our name attributes. r1 = [theString rangeOfString: @"("]; if (r1.location == NSNotFound) { return; } r2 = [theString rangeOfString: @")" options: 0 range: NSMakeRange(r1.location+1, [theString length]-r1.location-1)]; if (r2.location == NSNotFound) { return; } aString = [theString substringWithRange: NSMakeRange(r1.location+1, r2.location-r1.location-1)]; // We get all the supported flags, starting with the flags of RFC3348 flags = PantomimeHoldsMessages; if ([aString length]) { if ([aString rangeOfString: @"\\HasChildren" options: NSCaseInsensitiveSearch].length) { flags = flags|PantomimeHoldsFolders; } if ([aString rangeOfString: @"\\NoInferiors" options: NSCaseInsensitiveSearch].length) { flags = flags|PantomimeNoInferiors; } if ([aString rangeOfString: @"\\NoSelect" options: NSCaseInsensitiveSearch].length) { flags = flags|PantomimeNoSelect; } if ([aString rangeOfString: @"\\Marked" options: NSCaseInsensitiveSearch].length) { flags = flags|PantomimeMarked; } if ([aString rangeOfString: @"\\Unmarked" options: NSCaseInsensitiveSearch].length) { flags = flags|PantomimeUnmarked; } } [_folders setObject: [NSNumber numberWithInt: flags] forKey: aFolderName]; } // // // - (void) _parseLSUB { NSString *aString, *aFolderName; int len; aString = [[NSString alloc] initWithData: [_responsesFromServer lastObject] encoding: defaultCStringEncoding]; if (!aString) { aFolderName = AUTORELEASE([[NSString alloc] initWithData: [_responsesFromServer lastObject] encoding: NSUTF8StringEncoding]); } else { aFolderName = [self _folderNameFromString: [aString retain]]; RELEASE(aString); } // Check the rationale in _parseLIST. len = [aFolderName length]; if (len > 0 && [aFolderName characterAtIndex: 0] == '{' && [aFolderName characterAtIndex: len-1] == '}') { RELEASE(aString); return; } [_subscribedFolders addObject: aFolderName]; RELEASE(aString); } // // // - (void) _parseNO { NSData *aData; aData = [_responsesFromServer lastObject]; //NSLog(@"IN _parseNO: |%@| %d", [aData asciiString], _lastCommand); switch (_lastCommand) { case IMAP_APPEND: POST_NOTIFICATION(PantomimeFolderAppendFailed, self, _currentQueueObject->info); PERFORM_SELECTOR_3(_delegate, @selector(folderAppendFailed:), PantomimeFolderAppendFailed, _currentQueueObject->info); break; case IMAP_AUTHENTICATE_CRAM_MD5: case IMAP_AUTHENTICATE_LOGIN: case IMAP_LOGIN: AUTHENTICATION_FAILED(_delegate, _mechanism); break; case IMAP_CREATE: POST_NOTIFICATION(PantomimeFolderCreateFailed, self, _currentQueueObject->info); PERFORM_SELECTOR_1(_delegate, @selector(folderCreateFailed:), PantomimeFolderCreateFailed); break; case IMAP_DELETE: POST_NOTIFICATION(PantomimeFolderDeleteFailed, self, _currentQueueObject->info); PERFORM_SELECTOR_1(_delegate, @selector(folderDeleteFailed:), PantomimeFolderDeleteFailed); break; case IMAP_EXPUNGE: POST_NOTIFICATION(PantomimeFolderExpungeFailed, self, _currentQueueObject->info); PERFORM_SELECTOR_2(_delegate, @selector(folderExpungeFailed:), PantomimeFolderExpungeFailed, _selectedFolder, @"Folder"); break; case IMAP_RENAME: POST_NOTIFICATION(PantomimeFolderRenameFailed, self, _currentQueueObject->info); PERFORM_SELECTOR_1(_delegate, @selector(folderRenameFailed:), PantomimeFolderRenameFailed); break; case IMAP_SELECT: _connection_state.opening_mailbox = NO; POST_NOTIFICATION(PantomimeFolderOpenFailed, self, [NSDictionary dictionaryWithObject: _selectedFolder forKey: @"Folder"]); PERFORM_SELECTOR_2(_delegate, @selector(folderOpenFailed:), PantomimeFolderOpenFailed, _selectedFolder, @"Folder"); [_openFolders removeObjectForKey: [_selectedFolder name]]; _selectedFolder = nil; break; case IMAP_SUBSCRIBE: POST_NOTIFICATION(PantomimeFolderSubscribeFailed, self, _currentQueueObject->info); PERFORM_SELECTOR_2(_delegate, @selector(folderSubscribeFailed:), PantomimeFolderSubscribeFailed, [_currentQueueObject->info objectForKey: @"Name"], @"Name"); break; case IMAP_UID_COPY: POST_NOTIFICATION(PantomimeMessagesCopyFailed, self, _currentQueueObject->info); PERFORM_SELECTOR_3(_delegate, @selector(messagesCopyFailed:), PantomimeMessagesCopyFailed, _currentQueueObject->info); break; case IMAP_UID_SEARCH_ALL: POST_NOTIFICATION(PantomimeFolderSearchFailed, self, _currentQueueObject->info); PERFORM_SELECTOR_1(_delegate, @selector(folderSearchFailed:), PantomimeFolderSearchFailed); break; case IMAP_STATUS: POST_NOTIFICATION(PantomimeFolderStatusFailed, self, _currentQueueObject->info); PERFORM_SELECTOR_2(_delegate, @selector(folderStatusFailed:), PantomimeFolderStatusFailed, [_currentQueueObject->info objectForKey: @"Name"], @"Name"); break; case IMAP_UID_STORE: POST_NOTIFICATION(PantomimeMessageStoreFailed, self, _currentQueueObject->info); PERFORM_SELECTOR_3(_delegate, @selector(messageStoreFailed:), PantomimeMessageStoreFailed, _currentQueueObject->info); break; case IMAP_UNSUBSCRIBE: POST_NOTIFICATION(PantomimeFolderUnsubscribeFailed, self, _currentQueueObject->info); PERFORM_SELECTOR_2(_delegate, @selector(folderUnsubscribeFailed:), PantomimeFolderUnsubscribeFailed, [_currentQueueObject->info objectForKey: @"Name"], @"Name"); break; default: break; } // // If the NO response is tagged response, we remove the current // queued object from the queue since it reached completion. // if (![aData hasCPrefix: "*"])//|| _lastCommand == IMAP_AUTHORIZATION) { //NSLog(@"REMOVING QUEUE OBJECT"); [_currentQueueObject->info setObject: [NSNumber numberWithInt: _lastCommand] forKey: @"Command"]; POST_NOTIFICATION(@"PantomimeCommandCompleted", self, _currentQueueObject->info); PERFORM_SELECTOR_3(_delegate, @selector(commandCompleted:), @"PantomimeCommandCompleted", _currentQueueObject->info); [_queue removeLastObject]; [self sendCommand: IMAP_EMPTY_QUEUE info: nil arguments: @""]; } [_responsesFromServer removeAllObjects]; } // // After sending a NOOP to the IMAP server, we might read untagged // responses like * 5 RECENT that will eventually be processed. // - (void) _parseNOOP { //NSLog(@"Parsing noop responses..."); // FIXME } // // // - (void) _parseOK { NSData *aData; aData = [_responsesFromServer lastObject]; //NSLog(@"IN _parseOK: |%@|", [aData asciiString]); switch (_lastCommand) { case IMAP_APPEND: // // No need to do add the newly append messages to our internal messages holder as // we will get an untagged * EXISTS response that will trigger the new FETCH // RFC3501 says: // // If the mailbox is currently selected, the normal new message // actions SHOULD occur. Specifically, the server SHOULD notify the // client immediately via an untagged EXISTS response. If the server // does not do so, the client MAY issue a NOOP command (or failing // that, a CHECK command) after one or more APPEND commands. // POST_NOTIFICATION(PantomimeFolderAppendCompleted, self, _currentQueueObject->info); PERFORM_SELECTOR_3(_delegate, @selector(folderAppendCompleted:), PantomimeFolderAppendCompleted, _currentQueueObject->info); break; case IMAP_AUTHENTICATE_CRAM_MD5: case IMAP_AUTHENTICATE_LOGIN: case IMAP_LOGIN: if (_connection_state.reconnecting) { if (_selectedFolder) { if ([_selectedFolder mode] == PantomimeReadOnlyMode) { [self sendCommand: IMAP_EXAMINE info: nil arguments: @"EXAMINE \"%@\"", [[_selectedFolder name] modifiedUTF7String]]; } else { [self sendCommand: IMAP_SELECT info: nil arguments: @"SELECT \"%@\"", [[_selectedFolder name] modifiedUTF7String]]; } if (_connection_state.opening_mailbox) [_selectedFolder prefetch]; } else { [self _restoreQueue]; } } else { AUTHENTICATION_COMPLETED(_delegate, _mechanism); } break; case IMAP_AUTHORIZATION: if ([aData hasCPrefix: "* OK"]) { [self sendCommand: IMAP_CAPABILITY info: nil arguments: @"CAPABILITY"]; } else { // FIXME // connectionLost? or should we call [self close]? } break; case IMAP_CLOSE: POST_NOTIFICATION(PantomimeFolderCloseCompleted, self, _currentQueueObject->info); PERFORM_SELECTOR_3(_delegate, @selector(folderCloseCompleted:), PantomimeFolderCloseCompleted, _currentQueueObject->info); break; case IMAP_CREATE: [_folders setObject: [NSNumber numberWithInt: 0] forKey: [_currentQueueObject->info objectForKey: @"Name"]]; POST_NOTIFICATION(PantomimeFolderCreateCompleted, self, _currentQueueObject->info); PERFORM_SELECTOR_1(_delegate, @selector(folderCreateCompleted:), PantomimeFolderCreateCompleted); break; case IMAP_DELETE: [_folders removeObjectForKey: [_currentQueueObject->info objectForKey: @"Name"]]; POST_NOTIFICATION(PantomimeFolderDeleteCompleted, self, _currentQueueObject->info); PERFORM_SELECTOR_1(_delegate, @selector(folderDeleteCompleted:), PantomimeFolderDeleteCompleted); break; case IMAP_EXPUNGE: // // No need to synchronize our IMAP cache here since, at worst, the // expunged messages will get removed once we reopen the mailbox. // if ([_selectedFolder allContainers]) { [_selectedFolder thread]; } if ([_selectedFolder cacheManager]) { [[_selectedFolder cacheManager] expunge]; } POST_NOTIFICATION(PantomimeFolderExpungeCompleted, self, _currentQueueObject->info); PERFORM_SELECTOR_2(_delegate, @selector(folderExpungeCompleted:), PantomimeFolderExpungeCompleted, _selectedFolder, @"Folder"); break; case IMAP_LIST: POST_NOTIFICATION(PantomimeFolderListCompleted, self, [NSDictionary dictionaryWithObject: [_folders keyEnumerator] forKey: @"NSEnumerator"]); PERFORM_SELECTOR_2(_delegate, @selector(folderListCompleted:), PantomimeFolderListCompleted, [_folders keyEnumerator], @"NSEnumerator"); break; case IMAP_LOGOUT: // FIXME: What should we do here? [super close]; break; case IMAP_LSUB: POST_NOTIFICATION(PantomimeFolderListSubscribedCompleted, self, [NSDictionary dictionaryWithObject: [_subscribedFolders objectEnumerator] forKey: @"NSEnumerator"]); PERFORM_SELECTOR_2(_delegate, @selector(folderListSubscribedCompleted:), PantomimeFolderListSubscribedCompleted, [_subscribedFolders objectEnumerator], @"NSEnumerator"); break; case IMAP_RENAME: [self _renameFolder]; POST_NOTIFICATION(PantomimeFolderRenameCompleted, self, _currentQueueObject->info); PERFORM_SELECTOR_1(_delegate, @selector(folderRenameCompleted:), PantomimeFolderRenameCompleted); break; case IMAP_SELECT: [self _parseSELECT]; break; case IMAP_STARTTLS: [self _parseSTARTTLS]; break; case IMAP_SUBSCRIBE: // We must add the folder to our list of subscribed folders. [_subscribedFolders addObject: [_currentQueueObject->info objectForKey: @"Name"]]; POST_NOTIFICATION(PantomimeFolderSubscribeCompleted, self, _currentQueueObject->info); PERFORM_SELECTOR_2(_delegate, @selector(folderSubscribeCompleted:), PantomimeFolderSubscribeCompleted, [_currentQueueObject->info objectForKey: @"Name"], @"Name"); break; case IMAP_UID_COPY: POST_NOTIFICATION(PantomimeMessagesCopyCompleted, self, _currentQueueObject->info); PERFORM_SELECTOR_3(_delegate, @selector(messagesCopyCompleted:), PantomimeMessagesCopyCompleted, _currentQueueObject->info); break; case IMAP_UID_FETCH_HEADER_FIELDS: { _connection_state.opening_mailbox = NO; if ([_selectedFolder cacheManager]) { [[_selectedFolder cacheManager] synchronize]; } //NSLog(@"DONE PREFETCHING FOLDER"); POST_NOTIFICATION(PantomimeFolderPrefetchCompleted, self, [NSDictionary dictionaryWithObject: _selectedFolder forKey: @"Folder"]); PERFORM_SELECTOR_2(_delegate, @selector(folderPrefetchCompleted:), PantomimeFolderPrefetchCompleted, _selectedFolder, @"Folder"); } break; case IMAP_UID_SEARCH_ALL: // // Before assuming we got a result and initialized everything in _parseSEARCH, // we do a basic check. This is to prevent a rather weird behavior from // UW IMAP Server, like this: // // . UID SEARCH ALL FROM "collaboration-world" // * OK [PARSE] Unexpected characters at end of address: <>, Aix.p4@itii-paca.net... // * SEARCH // 000d OK UID SEARCH completed^ // if ([_currentQueueObject->info objectForKey: @"Results"]) { NSDictionary *userInfo; userInfo = [NSDictionary dictionaryWithObjectsAndKeys: _selectedFolder, @"Folder", [_currentQueueObject->info objectForKey: @"Results"], @"Results", nil]; POST_NOTIFICATION(PantomimeFolderSearchCompleted, self, userInfo); PERFORM_SELECTOR_3(_delegate, @selector(folderSearchCompleted:), PantomimeFolderSearchCompleted, userInfo); } break; case IMAP_UID_STORE: { // Once the STORE has completed, we update the messages. NSArray *theMessages; CWFlags *theFlags; int i, count; theMessages = [_currentQueueObject->info objectForKey: @"Messages"]; theFlags = [_currentQueueObject->info objectForKey: @"Flags"]; count = [theMessages count]; for (i = 0; i < count; i++) { [[[theMessages objectAtIndex: i] flags] replaceWithFlags: theFlags]; } POST_NOTIFICATION(PantomimeMessageStoreCompleted, self, _currentQueueObject->info); PERFORM_SELECTOR_3(_delegate, @selector(messageStoreCompleted:), PantomimeMessageStoreCompleted, _currentQueueObject->info); } break; case IMAP_UNSUBSCRIBE: // We must remove the folder from our list of subscribed folders. [_subscribedFolders removeObject: [_currentQueueObject->info objectForKey: @"Name"]]; POST_NOTIFICATION(PantomimeFolderUnsubscribeCompleted, self, _currentQueueObject->info); PERFORM_SELECTOR_2(_delegate, @selector(folderUnsubscribeCompleted:), PantomimeFolderUnsubscribeCompleted, [_currentQueueObject->info objectForKey: @"Name"], @"Name"); break; default: break; } // // If the OK response is tagged response, we remove the current // queued object from the queue since it reached completion. // if (![aData hasCPrefix: "*"])// || _lastCommand == IMAP_AUTHORIZATION) { //NSLog(@"REMOVING QUEUE OBJECT"); [_currentQueueObject->info setObject: [NSNumber numberWithInt: _lastCommand] forKey: @"Command"]; POST_NOTIFICATION(@"PantomimeCommandCompleted", self, _currentQueueObject->info); PERFORM_SELECTOR_3(_delegate, @selector(commandCompleted:), @"PantomimeCommandCompleted", _currentQueueObject->info); [_queue removeLastObject]; [self sendCommand: IMAP_EMPTY_QUEUE info: nil arguments: @""]; } [_responsesFromServer removeAllObjects]; } // // This method receives a * 5 RECENT parameter and parses it. // - (void) _parseRECENT { // Do nothing for now. This breaks 7.3.2 since the response // is not recorded. } // // // - (void) _parseSEARCH { NSMutableArray *aMutableArray; CWIMAPMessage *aMessage; NSArray *allResults; NSUInteger i, count; allResults = [self _uniqueIdentifiersFromData: [_responsesFromServer lastObject]]; count = [allResults count]; aMutableArray = [NSMutableArray array]; for (i = 0; i < count; i++) { aMessage = [[_selectedFolder cacheManager] messageWithUID: [[allResults objectAtIndex: i] unsignedIntValue]]; if (aMessage) { [aMutableArray addObject: aMessage]; } else { //NSLog(@"Message with UID = %u not found in cache.", // [[allResults objectAtIndex: i] unsignedIntValue]); } } // We store the results in our command queue (ie., in the current queue object). // aMutableArray may be empty if no result was found if (_currentQueueObject) [_currentQueueObject->info setObject: aMutableArray forKey: @"Results"]; } // // This methods updates all FLAGS and MSNs for messages in the cache. // // It also purges the messages that have been deleted on the IMAP server // but that are still present in the folder cache. // // Nota bene: We can safely assume our cacheManager exists since this method // wouldn't otherwise have been invoked. // // - (void) _parseSEARCH_CACHE { CWIMAPMessage *aMessage; NSArray *allResults; int i, count; BOOL b; allResults = [self _uniqueIdentifiersFromData: [_responsesFromServer objectAtIndex: 0]]; count = [allResults count]; switch (_lastCommand) { case IMAP_UID_SEARCH: // // We can now read our SEARCH results from our IMAP store. The result contains // all MSN->UID mappings. New messages weren't added to the search result as // we couldn't find them in IMAPStore: -_parseSearch:. // for (i = 0; i < count; i++) { aMessage = [[_selectedFolder cacheManager] messageWithUID: [[allResults objectAtIndex: i] unsignedIntValue]]; if (aMessage) { [aMessage setFolder: _selectedFolder]; [aMessage setMessageNumber: (i+1)]; } } // // We purge our cache from all deleted messages and we keep the // good ones to our folder. // //for (i = ([theCache count]-1); i >= 0; i--) //NSLog(@"Folder count (to remove UID) = %d", [_selectedFolder->allMessages count]); b = NO; for (i = ([_selectedFolder->allMessages count]-1); i >= 0; i--) { aMessage = [_selectedFolder->allMessages objectAtIndex: i]; //aMessage = [theCache objectAtIndex: i]; if ([aMessage folder] == nil) { [[_selectedFolder cacheManager] removeMessageWithUID: [aMessage UID]]; //NSLog(@"Removed message |%@| UID = %d", [aMessage subject], [aMessage UID]); [_selectedFolder->allMessages removeObject: aMessage]; b = YES; } } // We check to see if we must expunge deleted messages from our cache. // It's important to do this here. Otherwise, calling -synchronize on // our cache manager could lead to offset problems as the number of // records in our cache would be greater than the amount of entries // in our _selectedFolder->allMessages ivar. if (b && [_selectedFolder cacheManager]) { [[_selectedFolder cacheManager] expunge]; } [_selectedFolder updateCache]; [self sendCommand: IMAP_UID_SEARCH_ANSWERED info: nil arguments: @"UID SEARCH ANSWERED"]; break; case IMAP_UID_SEARCH_ANSWERED: // // We now update our \Answered flag, for all messages. // for (i = 0; i < count; i++) { [[[[_selectedFolder cacheManager] messageWithUID: [[allResults objectAtIndex: i] unsignedIntValue]] flags] add: PantomimeAnswered]; } [self sendCommand: IMAP_UID_SEARCH_FLAGGED info: nil arguments: @"UID SEARCH FLAGGED"]; break; case IMAP_UID_SEARCH_FLAGGED: // // We now update our \Flagged flag, for all messages. // for (i = 0; i < count; i++) { [[[[_selectedFolder cacheManager] messageWithUID: [[allResults objectAtIndex: i] unsignedIntValue]] flags] add: PantomimeFlagged]; } [self sendCommand: IMAP_UID_SEARCH_UNSEEN info: nil arguments: @"UID SEARCH UNSEEN"]; break; case IMAP_UID_SEARCH_UNSEEN: // // We now update our \Seen flag, for all messages. // for (i = 0; i < count; i++) { //NSLog(@"removing for UID %d", [[allResults objectAtIndex: i] unsignedIntValue]); [[[[_selectedFolder cacheManager] messageWithUID: [[allResults objectAtIndex: i] unsignedIntValue]] flags] remove: PantomimeSeen]; } // // We obtain the last UID of our cache. // Messages will be fetched starting from that UID + 1. // //NSLog(@"LAST UID IN CACHE: %u", [[_selectedFolder->allMessages lastObject] UID]); [self sendCommand: IMAP_UID_FETCH_HEADER_FIELDS info: nil arguments: @"UID FETCH %u:* (UID FLAGS RFC822.SIZE BODY.PEEK[HEADER.FIELDS (From To Cc Subject Date Message-ID References In-Reply-To)])", ([[_selectedFolder->allMessages lastObject] UID]+1)]; break; default: //NSLog(@"Unknown command for updating the cache file. Ignored."); break; } } // // // - (void) _parseSELECT { NSData *aData; int i, count; // The last object in _responsesFromServer is a tagged OK response. // We need to parse it here. count = [_responsesFromServer count]; for (i = 0; i < count; i++) { aData = [[_responsesFromServer objectAtIndex: i] dataByTrimmingWhiteSpaces]; //NSLog(@"|%@|", [aData asciiString]); // * OK [UIDVALIDITY 1052146864] if ([aData hasCPrefix: "* OK [UIDVALIDITY"] && [aData hasCSuffix: "]"]) { [self _parseUIDVALIDITY: [aData cString]]; } // 3c4d OK [READ-ONLY] Completed if ([aData rangeOfCString: "OK [READ-ONLY]"].length) { [_selectedFolder setMode: PantomimeReadOnlyMode]; } // 1a2b OK [READ-WRITE] Completed if ([aData rangeOfCString: "OK [READ-WRITE]"].length) { [_selectedFolder setMode: PantomimeReadWriteMode]; } } if (_connection_state.reconnecting) { [self _restoreQueue]; } else { [_selectedFolder setSelected: YES]; POST_NOTIFICATION(PantomimeFolderOpenCompleted, self, [NSDictionary dictionaryWithObject: _selectedFolder forKey: @"Folder"]); PERFORM_SELECTOR_2(_delegate, @selector(folderOpenCompleted:), PantomimeFolderOpenCompleted, _selectedFolder, @"Folder"); } } // // // - (void) _parseSTARTTLS { [(CWTCPConnection *)_connection startSSL]; POST_NOTIFICATION(PantomimeServiceInitialized, self, nil); PERFORM_SELECTOR_1(_delegate, @selector(serviceInitialized:), PantomimeServiceInitialized); } // // // This method receives a * STATUS blurdybloop (MESSAGES 231 UIDNEXT 44292) // parameter and parses it. It then put the decoded values in the // folderStatus dictionary. // // - (void) _parseSTATUS { CWFolderInformation *aFolderInformation; NSString *aFolderName; NSDictionary *info; NSData *aData; NSRange aRange; int messages, unseen; aData = [_responsesFromServer lastObject]; aRange = [aData rangeOfCString: "(" options: NSBackwardsSearch]; aFolderName = [[[aData subdataToIndex: (aRange.location-1)] subdataFromIndex: 9] asciiString]; sscanf([[aData subdataFromIndex: aRange.location] cString], "(MESSAGES %d UNSEEN %d)", &messages, &unseen); aFolderInformation = [[CWFolderInformation alloc] init]; [aFolderInformation setNbOfMessages: messages]; [aFolderInformation setNbOfUnreadMessages: unseen]; // Before putting the folder in our dictionary, we unquote it. aFolderName = [aFolderName stringFromQuotedString]; [_folderStatus setObject: aFolderInformation forKey: aFolderName]; info = [NSDictionary dictionaryWithObjectsAndKeys: aFolderInformation, @"FolderInformation", aFolderName, @"FolderName", nil]; POST_NOTIFICATION(PantomimeFolderStatusCompleted, self, info); if (_delegate && [_delegate respondsToSelector: @selector(folderStatusCompleted:)]) { [_delegate performSelector: @selector(folderStatusCompleted:) withObject: [NSNotification notificationWithName: PantomimeFolderStatusCompleted object: self userInfo: info]]; } RELEASE(aFolderInformation); } // // Example: * OK [UIDVALIDITY 948394385] // - (void) _parseUIDVALIDITY: (const char *) theString { unsigned int n; sscanf(theString, "* OK [UIDVALIDITY %u]", &n); [_selectedFolder setUIDValidity: n]; } // // // - (void) _restoreQueue { // We restore our list of pending commands [_queue addObjectsFromArray: _connection_state.previous_queue]; // We clean the state [_connection_state.previous_queue removeAllObjects]; _connection_state.reconnecting = NO; POST_NOTIFICATION(PantomimeServiceReconnected, self, nil); PERFORM_SELECTOR_1(_delegate, @selector(serviceReconnected:), PantomimeServiceReconnected); } @end pantomime1.2-1.2.2+dfsg1/Framework/Pantomime/CWISO8859_1.h000066400000000000000000000020151276751561200224410ustar00rootroot00000000000000/* ** CWISO8859_1.h ** ** Copyright (c) 2001-2004 ** ** Author: Ludovic Marcotte ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** You should have received a copy of the GNU Lesser General Public ** License along with this library; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef _Pantomime_H_CWISO8859_1 #define _Pantomime_H_CWISO8859_1 #include @interface CWISO8859_1 : CWCharset @end #endif // _Pantomime_H_CWISO8859_1 pantomime1.2-1.2.2+dfsg1/Framework/Pantomime/CWISO8859_1.m000066400000000000000000000061621276751561200224550ustar00rootroot00000000000000#include static struct charset_code code_table[]={ {0x20,0x0020}, {0x21,0x0021}, {0x22,0x0022}, {0x23,0x0023}, {0x24,0x0024}, {0x25,0x0025}, {0x26,0x0026}, {0x27,0x0027}, {0x28,0x0028}, {0x29,0x0029}, {0x2a,0x002a}, {0x2b,0x002b}, {0x2c,0x002c}, {0x2d,0x002d}, {0x2e,0x002e}, {0x2f,0x002f}, {0x30,0x0030}, {0x31,0x0031}, {0x32,0x0032}, {0x33,0x0033}, {0x34,0x0034}, {0x35,0x0035}, {0x36,0x0036}, {0x37,0x0037}, {0x38,0x0038}, {0x39,0x0039}, {0x3a,0x003a}, {0x3b,0x003b}, {0x3c,0x003c}, {0x3d,0x003d}, {0x3e,0x003e}, {0x3f,0x003f}, {0x40,0x0040}, {0x41,0x0041}, {0x42,0x0042}, {0x43,0x0043}, {0x44,0x0044}, {0x45,0x0045}, {0x46,0x0046}, {0x47,0x0047}, {0x48,0x0048}, {0x49,0x0049}, {0x4a,0x004a}, {0x4b,0x004b}, {0x4c,0x004c}, {0x4d,0x004d}, {0x4e,0x004e}, {0x4f,0x004f}, {0x50,0x0050}, {0x51,0x0051}, {0x52,0x0052}, {0x53,0x0053}, {0x54,0x0054}, {0x55,0x0055}, {0x56,0x0056}, {0x57,0x0057}, {0x58,0x0058}, {0x59,0x0059}, {0x5a,0x005a}, {0x5b,0x005b}, {0x5c,0x005c}, {0x5d,0x005d}, {0x5e,0x005e}, {0x5f,0x005f}, {0x60,0x0060}, {0x61,0x0061}, {0x62,0x0062}, {0x63,0x0063}, {0x64,0x0064}, {0x65,0x0065}, {0x66,0x0066}, {0x67,0x0067}, {0x68,0x0068}, {0x69,0x0069}, {0x6a,0x006a}, {0x6b,0x006b}, {0x6c,0x006c}, {0x6d,0x006d}, {0x6e,0x006e}, {0x6f,0x006f}, {0x70,0x0070}, {0x71,0x0071}, {0x72,0x0072}, {0x73,0x0073}, {0x74,0x0074}, {0x75,0x0075}, {0x76,0x0076}, {0x77,0x0077}, {0x78,0x0078}, {0x79,0x0079}, {0x7a,0x007a}, {0x7b,0x007b}, {0x7c,0x007c}, {0x7d,0x007d}, {0x7e,0x007e}, {0xa0,0x00a0}, {0xa1,0x00a1}, {0xa2,0x00a2}, {0xa3,0x00a3}, {0xa4,0x00a4}, {0xa5,0x00a5}, {0xa6,0x00a6}, {0xa7,0x00a7}, {0xa8,0x00a8}, {0xa9,0x00a9}, {0xaa,0x00aa}, {0xab,0x00ab}, {0xac,0x00ac}, {0xad,0x00ad}, {0xae,0x00ae}, {0xaf,0x00af}, {0xb0,0x00b0}, {0xb1,0x00b1}, {0xb2,0x00b2}, {0xb3,0x00b3}, {0xb4,0x00b4}, {0xb5,0x00b5}, {0xb6,0x00b6}, {0xb7,0x00b7}, {0xb8,0x00b8}, {0xb9,0x00b9}, {0xba,0x00ba}, {0xbb,0x00bb}, {0xbc,0x00bc}, {0xbd,0x00bd}, {0xbe,0x00be}, {0xbf,0x00bf}, {0xc0,0x00c0}, {0xc1,0x00c1}, {0xc2,0x00c2}, {0xc3,0x00c3}, {0xc4,0x00c4}, {0xc5,0x00c5}, {0xc6,0x00c6}, {0xc7,0x00c7}, {0xc8,0x00c8}, {0xc9,0x00c9}, {0xca,0x00ca}, {0xcb,0x00cb}, {0xcc,0x00cc}, {0xcd,0x00cd}, {0xce,0x00ce}, {0xcf,0x00cf}, {0xd0,0x00d0}, {0xd1,0x00d1}, {0xd2,0x00d2}, {0xd3,0x00d3}, {0xd4,0x00d4}, {0xd5,0x00d5}, {0xd6,0x00d6}, {0xd7,0x00d7}, {0xd8,0x00d8}, {0xd9,0x00d9}, {0xda,0x00da}, {0xdb,0x00db}, {0xdc,0x00dc}, {0xdd,0x00dd}, {0xde,0x00de}, {0xdf,0x00df}, {0xe0,0x00e0}, {0xe1,0x00e1}, {0xe2,0x00e2}, {0xe3,0x00e3}, {0xe4,0x00e4}, {0xe5,0x00e5}, {0xe6,0x00e6}, {0xe7,0x00e7}, {0xe8,0x00e8}, {0xe9,0x00e9}, {0xea,0x00ea}, {0xeb,0x00eb}, {0xec,0x00ec}, {0xed,0x00ed}, {0xee,0x00ee}, {0xef,0x00ef}, {0xf0,0x00f0}, {0xf1,0x00f1}, {0xf2,0x00f2}, {0xf3,0x00f3}, {0xf4,0x00f4}, {0xf5,0x00f5}, {0xf6,0x00f6}, {0xf7,0x00f7}, {0xf8,0x00f8}, {0xf9,0x00f9}, {0xfa,0x00fa}, {0xfb,0x00fb}, {0xfc,0x00fc}, {0xfd,0x00fd}, {0xfe,0x00fe}, {0xff,0x00ff}, }; @implementation CWISO8859_1 - (id) init { return [super initWithCodeCharTable: code_table length: sizeof(code_table)/sizeof(code_table[0])]; } - (NSString *) name { return @"iso-8859-1"; } @end pantomime1.2-1.2.2+dfsg1/Framework/Pantomime/CWISO8859_10.h000066400000000000000000000020221276751561200225170ustar00rootroot00000000000000/* ** CWISO8859_10.h ** ** Copyright (c) 2001-2004 ** ** Author: Ludovic Marcotte ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** You should have received a copy of the GNU Lesser General Public ** License along with this library; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef _Pantomime_H_CWISO8859_10 #define _Pantomime_H_CWISO8859_10 #include @interface CWISO8859_10 : CWCharset @end #endif // _Pantomime_H_CWISO8859_10 pantomime1.2-1.2.2+dfsg1/Framework/Pantomime/CWISO8859_10.m000066400000000000000000000061651276751561200225400ustar00rootroot00000000000000#include static struct charset_code code_table[]={ {0x20,0x0020}, {0x21,0x0021}, {0x22,0x0022}, {0x23,0x0023}, {0x24,0x0024}, {0x25,0x0025}, {0x26,0x0026}, {0x27,0x0027}, {0x28,0x0028}, {0x29,0x0029}, {0x2a,0x002a}, {0x2b,0x002b}, {0x2c,0x002c}, {0x2d,0x002d}, {0x2e,0x002e}, {0x2f,0x002f}, {0x30,0x0030}, {0x31,0x0031}, {0x32,0x0032}, {0x33,0x0033}, {0x34,0x0034}, {0x35,0x0035}, {0x36,0x0036}, {0x37,0x0037}, {0x38,0x0038}, {0x39,0x0039}, {0x3a,0x003a}, {0x3b,0x003b}, {0x3c,0x003c}, {0x3d,0x003d}, {0x3e,0x003e}, {0x3f,0x003f}, {0x40,0x0040}, {0x41,0x0041}, {0x42,0x0042}, {0x43,0x0043}, {0x44,0x0044}, {0x45,0x0045}, {0x46,0x0046}, {0x47,0x0047}, {0x48,0x0048}, {0x49,0x0049}, {0x4a,0x004a}, {0x4b,0x004b}, {0x4c,0x004c}, {0x4d,0x004d}, {0x4e,0x004e}, {0x4f,0x004f}, {0x50,0x0050}, {0x51,0x0051}, {0x52,0x0052}, {0x53,0x0053}, {0x54,0x0054}, {0x55,0x0055}, {0x56,0x0056}, {0x57,0x0057}, {0x58,0x0058}, {0x59,0x0059}, {0x5a,0x005a}, {0x5b,0x005b}, {0x5c,0x005c}, {0x5d,0x005d}, {0x5e,0x005e}, {0x5f,0x005f}, {0x60,0x0060}, {0x61,0x0061}, {0x62,0x0062}, {0x63,0x0063}, {0x64,0x0064}, {0x65,0x0065}, {0x66,0x0066}, {0x67,0x0067}, {0x68,0x0068}, {0x69,0x0069}, {0x6a,0x006a}, {0x6b,0x006b}, {0x6c,0x006c}, {0x6d,0x006d}, {0x6e,0x006e}, {0x6f,0x006f}, {0x70,0x0070}, {0x71,0x0071}, {0x72,0x0072}, {0x73,0x0073}, {0x74,0x0074}, {0x75,0x0075}, {0x76,0x0076}, {0x77,0x0077}, {0x78,0x0078}, {0x79,0x0079}, {0x7a,0x007a}, {0x7b,0x007b}, {0x7c,0x007c}, {0x7d,0x007d}, {0x7e,0x007e}, {0xa0,0x00a0}, {0xa1,0x0104}, {0xa2,0x0112}, {0xa3,0x0122}, {0xa4,0x012a}, {0xa5,0x0128}, {0xa6,0x0136}, {0xa7,0x00a7}, {0xa8,0x013b}, {0xa9,0x0110}, {0xaa,0x0160}, {0xab,0x0166}, {0xac,0x017d}, {0xad,0x00ad}, {0xae,0x016a}, {0xaf,0x014a}, {0xb0,0x00b0}, {0xb1,0x0105}, {0xb2,0x0113}, {0xb3,0x0123}, {0xb4,0x012b}, {0xb5,0x0129}, {0xb6,0x0137}, {0xb7,0x00b7}, {0xb8,0x013c}, {0xb9,0x0111}, {0xba,0x0161}, {0xbb,0x0167}, {0xbc,0x017e}, {0xbd,0x2015}, {0xbe,0x016b}, {0xbf,0x014b}, {0xc0,0x0100}, {0xc1,0x00c1}, {0xc2,0x00c2}, {0xc3,0x00c3}, {0xc4,0x00c4}, {0xc5,0x00c5}, {0xc6,0x00c6}, {0xc7,0x012e}, {0xc8,0x010c}, {0xc9,0x00c9}, {0xca,0x0118}, {0xcb,0x00cb}, {0xcc,0x0116}, {0xcd,0x00cd}, {0xce,0x00ce}, {0xcf,0x00cf}, {0xd0,0x00d0}, {0xd1,0x0145}, {0xd2,0x014c}, {0xd3,0x00d3}, {0xd4,0x00d4}, {0xd5,0x00d5}, {0xd6,0x00d6}, {0xd7,0x0168}, {0xd8,0x00d8}, {0xd9,0x0172}, {0xda,0x00da}, {0xdb,0x00db}, {0xdc,0x00dc}, {0xdd,0x00dd}, {0xde,0x00de}, {0xdf,0x00df}, {0xe0,0x0101}, {0xe1,0x00e1}, {0xe2,0x00e2}, {0xe3,0x00e3}, {0xe4,0x00e4}, {0xe5,0x00e5}, {0xe6,0x00e6}, {0xe7,0x012f}, {0xe8,0x010d}, {0xe9,0x00e9}, {0xea,0x0119}, {0xeb,0x00eb}, {0xec,0x0117}, {0xed,0x00ed}, {0xee,0x00ee}, {0xef,0x00ef}, {0xf0,0x00f0}, {0xf1,0x0146}, {0xf2,0x014d}, {0xf3,0x00f3}, {0xf4,0x00f4}, {0xf5,0x00f5}, {0xf6,0x00f6}, {0xf7,0x0169}, {0xf8,0x00f8}, {0xf9,0x0173}, {0xfa,0x00fa}, {0xfb,0x00fb}, {0xfc,0x00fc}, {0xfd,0x00fd}, {0xfe,0x00fe}, {0xff,0x0138}, }; @implementation CWISO8859_10 - (id) init { return [super initWithCodeCharTable: code_table length: sizeof(code_table)/sizeof(code_table[0])]; } - (NSString *) name { return @"iso-8859-10"; } @end pantomime1.2-1.2.2+dfsg1/Framework/Pantomime/CWISO8859_11.h000066400000000000000000000020221276751561200225200ustar00rootroot00000000000000/* ** CWISO8859_11.h ** ** Copyright (c) 2001-2004 ** ** Author: Ludovic Marcotte ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** You should have received a copy of the GNU Lesser General Public ** License along with this library; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef _Pantomime_H_CWISO8859_11 #define _Pantomime_H_CWISO8859_11 #include @interface CWISO8859_11 : CWCharset @end #endif // _Pantomime_H_CWISO8859_11 pantomime1.2-1.2.2+dfsg1/Framework/Pantomime/CWISO8859_11.m000066400000000000000000000057541276751561200225440ustar00rootroot00000000000000#include static struct charset_code code_table[]={ {0x20,0x0020}, {0x21,0x0021}, {0x22,0x0022}, {0x23,0x0023}, {0x24,0x0024}, {0x25,0x0025}, {0x26,0x0026}, {0x27,0x0027}, {0x28,0x0028}, {0x29,0x0029}, {0x2a,0x002a}, {0x2b,0x002b}, {0x2c,0x002c}, {0x2d,0x002d}, {0x2e,0x002e}, {0x2f,0x002f}, {0x30,0x0030}, {0x31,0x0031}, {0x32,0x0032}, {0x33,0x0033}, {0x34,0x0034}, {0x35,0x0035}, {0x36,0x0036}, {0x37,0x0037}, {0x38,0x0038}, {0x39,0x0039}, {0x3a,0x003a}, {0x3b,0x003b}, {0x3c,0x003c}, {0x3d,0x003d}, {0x3e,0x003e}, {0x3f,0x003f}, {0x40,0x0040}, {0x41,0x0041}, {0x42,0x0042}, {0x43,0x0043}, {0x44,0x0044}, {0x45,0x0045}, {0x46,0x0046}, {0x47,0x0047}, {0x48,0x0048}, {0x49,0x0049}, {0x4a,0x004a}, {0x4b,0x004b}, {0x4c,0x004c}, {0x4d,0x004d}, {0x4e,0x004e}, {0x4f,0x004f}, {0x50,0x0050}, {0x51,0x0051}, {0x52,0x0052}, {0x53,0x0053}, {0x54,0x0054}, {0x55,0x0055}, {0x56,0x0056}, {0x57,0x0057}, {0x58,0x0058}, {0x59,0x0059}, {0x5a,0x005a}, {0x5b,0x005b}, {0x5c,0x005c}, {0x5d,0x005d}, {0x5e,0x005e}, {0x5f,0x005f}, {0x60,0x0060}, {0x61,0x0061}, {0x62,0x0062}, {0x63,0x0063}, {0x64,0x0064}, {0x65,0x0065}, {0x66,0x0066}, {0x67,0x0067}, {0x68,0x0068}, {0x69,0x0069}, {0x6a,0x006a}, {0x6b,0x006b}, {0x6c,0x006c}, {0x6d,0x006d}, {0x6e,0x006e}, {0x6f,0x006f}, {0x70,0x0070}, {0x71,0x0071}, {0x72,0x0072}, {0x73,0x0073}, {0x74,0x0074}, {0x75,0x0075}, {0x76,0x0076}, {0x77,0x0077}, {0x78,0x0078}, {0x79,0x0079}, {0x7a,0x007a}, {0x7b,0x007b}, {0x7c,0x007c}, {0x7d,0x007d}, {0x7e,0x007e}, {0xa1,0x0e01}, {0xa2,0x0e02}, {0xa3,0x0e03}, {0xa4,0x0e04}, {0xa5,0x0e05}, {0xa6,0x0e06}, {0xa7,0x0e07}, {0xa8,0x0e08}, {0xa9,0x0e09}, {0xaa,0x0e0a}, {0xab,0x0e0b}, {0xac,0x0e0c}, {0xad,0x0e0d}, {0xae,0x0e0e}, {0xaf,0x0e0f}, {0xb0,0x0e10}, {0xb1,0x0e11}, {0xb2,0x0e12}, {0xb3,0x0e13}, {0xb4,0x0e14}, {0xb5,0x0e15}, {0xb6,0x0e16}, {0xb7,0x0e17}, {0xb8,0x0e18}, {0xb9,0x0e19}, {0xba,0x0e1a}, {0xbb,0x0e1b}, {0xbc,0x0e1c}, {0xbd,0x0e1d}, {0xbe,0x0e1e}, {0xbf,0x0e1f}, {0xc0,0x0e20}, {0xc1,0x0e21}, {0xc2,0x0e22}, {0xc3,0x0e23}, {0xc4,0x0e24}, {0xc5,0x0e25}, {0xc6,0x0e26}, {0xc7,0x0e27}, {0xc8,0x0e28}, {0xc9,0x0e29}, {0xca,0x0e2a}, {0xcb,0x0e2b}, {0xcc,0x0e2c}, {0xcd,0x0e2d}, {0xce,0x0e2e}, {0xcf,0x0e2f}, {0xd0,0x0e30}, {0xd1,0x0e31}, {0xd2,0x0e32}, {0xd3,0x0e33}, {0xd4,0x0e34}, {0xd5,0x0e35}, {0xd6,0x0e36}, {0xd7,0x0e37}, {0xd8,0x0e38}, {0xd9,0x0e39}, {0xda,0x0e3a}, {0xdf,0x0e3f}, {0xe0,0x0e40}, {0xe1,0x0e41}, {0xe2,0x0e42}, {0xe3,0x0e43}, {0xe4,0x0e44}, {0xe5,0x0e45}, {0xe6,0x0e46}, {0xe7,0x0e47}, {0xe8,0x0e48}, {0xe9,0x0e49}, {0xea,0x0e4a}, {0xeb,0x0e4b}, {0xec,0x0e4c}, {0xed,0x0e4d}, {0xee,0x0e4e}, {0xef,0x0e4f}, {0xf0,0x0e50}, {0xf1,0x0e51}, {0xf2,0x0e52}, {0xf3,0x0e53}, {0xf4,0x0e54}, {0xf5,0x0e55}, {0xf6,0x0e56}, {0xf7,0x0e57}, {0xf8,0x0e58}, {0xf9,0x0e59}, {0xfa,0x0e5a}, {0xfb,0x0e5b}, }; @implementation CWISO8859_11 - (id) init { return [super initWithCodeCharTable: code_table length: sizeof(code_table)/sizeof(code_table[0])]; } - (NSString *) name { return @"iso-8859-11"; } @end pantomime1.2-1.2.2+dfsg1/Framework/Pantomime/CWISO8859_13.h000066400000000000000000000020221276751561200225220ustar00rootroot00000000000000/* ** CWISO8859_13.h ** ** Copyright (c) 2001-2004 ** ** Author: Ludovic Marcotte ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** You should have received a copy of the GNU Lesser General Public ** License along with this library; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef _Pantomime_H_CWISO8859_13 #define _Pantomime_H_CWISO8859_13 #include @interface CWISO8859_13 : CWCharset @end #endif // _Pantomime_H_CWISO8859_13 pantomime1.2-1.2.2+dfsg1/Framework/Pantomime/CWISO8859_13.m000066400000000000000000000061651276751561200225430ustar00rootroot00000000000000#include static struct charset_code code_table[]={ {0x20,0x0020}, {0x21,0x0021}, {0x22,0x0022}, {0x23,0x0023}, {0x24,0x0024}, {0x25,0x0025}, {0x26,0x0026}, {0x27,0x0027}, {0x28,0x0028}, {0x29,0x0029}, {0x2a,0x002a}, {0x2b,0x002b}, {0x2c,0x002c}, {0x2d,0x002d}, {0x2e,0x002e}, {0x2f,0x002f}, {0x30,0x0030}, {0x31,0x0031}, {0x32,0x0032}, {0x33,0x0033}, {0x34,0x0034}, {0x35,0x0035}, {0x36,0x0036}, {0x37,0x0037}, {0x38,0x0038}, {0x39,0x0039}, {0x3a,0x003a}, {0x3b,0x003b}, {0x3c,0x003c}, {0x3d,0x003d}, {0x3e,0x003e}, {0x3f,0x003f}, {0x40,0x0040}, {0x41,0x0041}, {0x42,0x0042}, {0x43,0x0043}, {0x44,0x0044}, {0x45,0x0045}, {0x46,0x0046}, {0x47,0x0047}, {0x48,0x0048}, {0x49,0x0049}, {0x4a,0x004a}, {0x4b,0x004b}, {0x4c,0x004c}, {0x4d,0x004d}, {0x4e,0x004e}, {0x4f,0x004f}, {0x50,0x0050}, {0x51,0x0051}, {0x52,0x0052}, {0x53,0x0053}, {0x54,0x0054}, {0x55,0x0055}, {0x56,0x0056}, {0x57,0x0057}, {0x58,0x0058}, {0x59,0x0059}, {0x5a,0x005a}, {0x5b,0x005b}, {0x5c,0x005c}, {0x5d,0x005d}, {0x5e,0x005e}, {0x5f,0x005f}, {0x60,0x0060}, {0x61,0x0061}, {0x62,0x0062}, {0x63,0x0063}, {0x64,0x0064}, {0x65,0x0065}, {0x66,0x0066}, {0x67,0x0067}, {0x68,0x0068}, {0x69,0x0069}, {0x6a,0x006a}, {0x6b,0x006b}, {0x6c,0x006c}, {0x6d,0x006d}, {0x6e,0x006e}, {0x6f,0x006f}, {0x70,0x0070}, {0x71,0x0071}, {0x72,0x0072}, {0x73,0x0073}, {0x74,0x0074}, {0x75,0x0075}, {0x76,0x0076}, {0x77,0x0077}, {0x78,0x0078}, {0x79,0x0079}, {0x7a,0x007a}, {0x7b,0x007b}, {0x7c,0x007c}, {0x7d,0x007d}, {0x7e,0x007e}, {0xa0,0x00a0}, {0xa1,0x201d}, {0xa2,0x00a2}, {0xa3,0x00a3}, {0xa4,0x00a4}, {0xa5,0x201e}, {0xa6,0x00a6}, {0xa7,0x00a7}, {0xa8,0x00d8}, {0xa9,0x00a9}, {0xaa,0x0156}, {0xab,0x00ab}, {0xac,0x00ac}, {0xad,0x00ad}, {0xae,0x00ae}, {0xaf,0x00c6}, {0xb0,0x00b0}, {0xb1,0x00b1}, {0xb2,0x00b2}, {0xb3,0x00b3}, {0xb4,0x201c}, {0xb5,0x00b5}, {0xb6,0x00b6}, {0xb7,0x00b7}, {0xb8,0x00f8}, {0xb9,0x00b9}, {0xba,0x0157}, {0xbb,0x00bb}, {0xbc,0x00bc}, {0xbd,0x00bd}, {0xbe,0x00be}, {0xbf,0x00e6}, {0xc0,0x0104}, {0xc1,0x012e}, {0xc2,0x0100}, {0xc3,0x0106}, {0xc4,0x00c4}, {0xc5,0x00c5}, {0xc6,0x0118}, {0xc7,0x0112}, {0xc8,0x010c}, {0xc9,0x00c9}, {0xca,0x0179}, {0xcb,0x0116}, {0xcc,0x0122}, {0xcd,0x0136}, {0xce,0x012a}, {0xcf,0x013b}, {0xd0,0x0160}, {0xd1,0x0143}, {0xd2,0x0145}, {0xd3,0x00d3}, {0xd4,0x014c}, {0xd5,0x00d5}, {0xd6,0x00d6}, {0xd7,0x00d7}, {0xd8,0x0172}, {0xd9,0x0141}, {0xda,0x015a}, {0xdb,0x016a}, {0xdc,0x00dc}, {0xdd,0x017b}, {0xde,0x017d}, {0xdf,0x00df}, {0xe0,0x0105}, {0xe1,0x012f}, {0xe2,0x0101}, {0xe3,0x0107}, {0xe4,0x00e4}, {0xe5,0x00e5}, {0xe6,0x0119}, {0xe7,0x0113}, {0xe8,0x010d}, {0xe9,0x00e9}, {0xea,0x017a}, {0xeb,0x0117}, {0xec,0x0123}, {0xed,0x0137}, {0xee,0x012b}, {0xef,0x013c}, {0xf0,0x0161}, {0xf1,0x0144}, {0xf2,0x0146}, {0xf3,0x00f3}, {0xf4,0x014d}, {0xf5,0x00f5}, {0xf6,0x00f6}, {0xf7,0x00f7}, {0xf8,0x0173}, {0xf9,0x0142}, {0xfa,0x015b}, {0xfb,0x016b}, {0xfc,0x00fc}, {0xfd,0x017c}, {0xfe,0x017e}, {0xff,0x2019}, }; @implementation CWISO8859_13 - (id) init { return [super initWithCodeCharTable: code_table length: sizeof(code_table)/sizeof(code_table[0])]; } - (NSString *) name { return @"iso-8859-13"; } @end pantomime1.2-1.2.2+dfsg1/Framework/Pantomime/CWISO8859_14.h000066400000000000000000000020221276751561200225230ustar00rootroot00000000000000/* ** CWISO8859_14.h ** ** Copyright (c) 2001-2004 ** ** Author: Ludovic Marcotte ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** You should have received a copy of the GNU Lesser General Public ** License along with this library; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef _Pantomime_H_CWISO8859_14 #define _Pantomime_H_CWISO8859_14 #include @interface CWISO8859_14 : CWCharset @end #endif // _Pantomime_H_CWISO8859_14 pantomime1.2-1.2.2+dfsg1/Framework/Pantomime/CWISO8859_14.m000066400000000000000000000061651276751561200225440ustar00rootroot00000000000000#include static struct charset_code code_table[]={ {0x20,0x0020}, {0x21,0x0021}, {0x22,0x0022}, {0x23,0x0023}, {0x24,0x0024}, {0x25,0x0025}, {0x26,0x0026}, {0x27,0x0027}, {0x28,0x0028}, {0x29,0x0029}, {0x2a,0x002a}, {0x2b,0x002b}, {0x2c,0x002c}, {0x2d,0x002d}, {0x2e,0x002e}, {0x2f,0x002f}, {0x30,0x0030}, {0x31,0x0031}, {0x32,0x0032}, {0x33,0x0033}, {0x34,0x0034}, {0x35,0x0035}, {0x36,0x0036}, {0x37,0x0037}, {0x38,0x0038}, {0x39,0x0039}, {0x3a,0x003a}, {0x3b,0x003b}, {0x3c,0x003c}, {0x3d,0x003d}, {0x3e,0x003e}, {0x3f,0x003f}, {0x40,0x0040}, {0x41,0x0041}, {0x42,0x0042}, {0x43,0x0043}, {0x44,0x0044}, {0x45,0x0045}, {0x46,0x0046}, {0x47,0x0047}, {0x48,0x0048}, {0x49,0x0049}, {0x4a,0x004a}, {0x4b,0x004b}, {0x4c,0x004c}, {0x4d,0x004d}, {0x4e,0x004e}, {0x4f,0x004f}, {0x50,0x0050}, {0x51,0x0051}, {0x52,0x0052}, {0x53,0x0053}, {0x54,0x0054}, {0x55,0x0055}, {0x56,0x0056}, {0x57,0x0057}, {0x58,0x0058}, {0x59,0x0059}, {0x5a,0x005a}, {0x5b,0x005b}, {0x5c,0x005c}, {0x5d,0x005d}, {0x5e,0x005e}, {0x5f,0x005f}, {0x60,0x0060}, {0x61,0x0061}, {0x62,0x0062}, {0x63,0x0063}, {0x64,0x0064}, {0x65,0x0065}, {0x66,0x0066}, {0x67,0x0067}, {0x68,0x0068}, {0x69,0x0069}, {0x6a,0x006a}, {0x6b,0x006b}, {0x6c,0x006c}, {0x6d,0x006d}, {0x6e,0x006e}, {0x6f,0x006f}, {0x70,0x0070}, {0x71,0x0071}, {0x72,0x0072}, {0x73,0x0073}, {0x74,0x0074}, {0x75,0x0075}, {0x76,0x0076}, {0x77,0x0077}, {0x78,0x0078}, {0x79,0x0079}, {0x7a,0x007a}, {0x7b,0x007b}, {0x7c,0x007c}, {0x7d,0x007d}, {0x7e,0x007e}, {0xa0,0x00a0}, {0xa1,0x1e02}, {0xa2,0x1e03}, {0xa3,0x00a3}, {0xa4,0x010a}, {0xa5,0x010b}, {0xa6,0x1e0a}, {0xa7,0x00a7}, {0xa8,0x1e80}, {0xa9,0x00a9}, {0xaa,0x1e82}, {0xab,0x1e0b}, {0xac,0x1ef2}, {0xad,0x00ad}, {0xae,0x00ae}, {0xaf,0x0178}, {0xb0,0x1e1e}, {0xb1,0x1e1f}, {0xb2,0x0120}, {0xb3,0x0121}, {0xb4,0x1e40}, {0xb5,0x1e41}, {0xb6,0x00b6}, {0xb7,0x1e56}, {0xb8,0x1e81}, {0xb9,0x1e57}, {0xba,0x1e83}, {0xbb,0x1e60}, {0xbc,0x1ef3}, {0xbd,0x1e84}, {0xbe,0x1e85}, {0xbf,0x1e61}, {0xc0,0x00c0}, {0xc1,0x00c1}, {0xc2,0x00c2}, {0xc3,0x00c3}, {0xc4,0x00c4}, {0xc5,0x00c5}, {0xc6,0x00c6}, {0xc7,0x00c7}, {0xc8,0x00c8}, {0xc9,0x00c9}, {0xca,0x00ca}, {0xcb,0x00cb}, {0xcc,0x00cc}, {0xcd,0x00cd}, {0xce,0x00ce}, {0xcf,0x00cf}, {0xd0,0x0174}, {0xd1,0x00d1}, {0xd2,0x00d2}, {0xd3,0x00d3}, {0xd4,0x00d4}, {0xd5,0x00d5}, {0xd6,0x00d6}, {0xd7,0x1e6a}, {0xd8,0x00d8}, {0xd9,0x00d9}, {0xda,0x00da}, {0xdb,0x00db}, {0xdc,0x00dc}, {0xdd,0x00dd}, {0xde,0x0176}, {0xdf,0x00df}, {0xe0,0x00e0}, {0xe1,0x00e1}, {0xe2,0x00e2}, {0xe3,0x00e3}, {0xe4,0x00e4}, {0xe5,0x00e5}, {0xe6,0x00e6}, {0xe7,0x00e7}, {0xe8,0x00e8}, {0xe9,0x00e9}, {0xea,0x00ea}, {0xeb,0x00eb}, {0xec,0x00ec}, {0xed,0x00ed}, {0xee,0x00ee}, {0xef,0x00ef}, {0xf0,0x0175}, {0xf1,0x00f1}, {0xf2,0x00f2}, {0xf3,0x00f3}, {0xf4,0x00f4}, {0xf5,0x00f5}, {0xf6,0x00f6}, {0xf7,0x1e6b}, {0xf8,0x00f8}, {0xf9,0x00f9}, {0xfa,0x00fa}, {0xfb,0x00fb}, {0xfc,0x00fc}, {0xfd,0x00fd}, {0xfe,0x0177}, {0xff,0x00ff}, }; @implementation CWISO8859_14 - (id) init { return [super initWithCodeCharTable: code_table length: sizeof(code_table)/sizeof(code_table[0])]; } - (NSString *) name { return @"iso-8859-14"; } @end pantomime1.2-1.2.2+dfsg1/Framework/Pantomime/CWISO8859_15.h000066400000000000000000000020221276751561200225240ustar00rootroot00000000000000/* ** CWISO8859_15.h ** ** Copyright (c) 2001-2004 ** ** Author: Ludovic Marcotte ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** You should have received a copy of the GNU Lesser General Public ** License along with this library; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef _Pantomime_H_CWISO8859_15 #define _Pantomime_H_CWISO8859_15 #include @interface CWISO8859_15 : CWCharset @end #endif // _Pantomime_H_CWISO8859_15 pantomime1.2-1.2.2+dfsg1/Framework/Pantomime/CWISO8859_15.m000066400000000000000000000061651276751561200225450ustar00rootroot00000000000000#include static struct charset_code code_table[]={ {0x20,0x0020}, {0x21,0x0021}, {0x22,0x0022}, {0x23,0x0023}, {0x24,0x0024}, {0x25,0x0025}, {0x26,0x0026}, {0x27,0x0027}, {0x28,0x0028}, {0x29,0x0029}, {0x2a,0x002a}, {0x2b,0x002b}, {0x2c,0x002c}, {0x2d,0x002d}, {0x2e,0x002e}, {0x2f,0x002f}, {0x30,0x0030}, {0x31,0x0031}, {0x32,0x0032}, {0x33,0x0033}, {0x34,0x0034}, {0x35,0x0035}, {0x36,0x0036}, {0x37,0x0037}, {0x38,0x0038}, {0x39,0x0039}, {0x3a,0x003a}, {0x3b,0x003b}, {0x3c,0x003c}, {0x3d,0x003d}, {0x3e,0x003e}, {0x3f,0x003f}, {0x40,0x0040}, {0x41,0x0041}, {0x42,0x0042}, {0x43,0x0043}, {0x44,0x0044}, {0x45,0x0045}, {0x46,0x0046}, {0x47,0x0047}, {0x48,0x0048}, {0x49,0x0049}, {0x4a,0x004a}, {0x4b,0x004b}, {0x4c,0x004c}, {0x4d,0x004d}, {0x4e,0x004e}, {0x4f,0x004f}, {0x50,0x0050}, {0x51,0x0051}, {0x52,0x0052}, {0x53,0x0053}, {0x54,0x0054}, {0x55,0x0055}, {0x56,0x0056}, {0x57,0x0057}, {0x58,0x0058}, {0x59,0x0059}, {0x5a,0x005a}, {0x5b,0x005b}, {0x5c,0x005c}, {0x5d,0x005d}, {0x5e,0x005e}, {0x5f,0x005f}, {0x60,0x0060}, {0x61,0x0061}, {0x62,0x0062}, {0x63,0x0063}, {0x64,0x0064}, {0x65,0x0065}, {0x66,0x0066}, {0x67,0x0067}, {0x68,0x0068}, {0x69,0x0069}, {0x6a,0x006a}, {0x6b,0x006b}, {0x6c,0x006c}, {0x6d,0x006d}, {0x6e,0x006e}, {0x6f,0x006f}, {0x70,0x0070}, {0x71,0x0071}, {0x72,0x0072}, {0x73,0x0073}, {0x74,0x0074}, {0x75,0x0075}, {0x76,0x0076}, {0x77,0x0077}, {0x78,0x0078}, {0x79,0x0079}, {0x7a,0x007a}, {0x7b,0x007b}, {0x7c,0x007c}, {0x7d,0x007d}, {0x7e,0x007e}, {0xa0,0x00a0}, {0xa1,0x00a1}, {0xa2,0x00a2}, {0xa3,0x00a3}, {0xa4,0x20ac}, {0xa5,0x00a5}, {0xa6,0x0160}, {0xa7,0x00a7}, {0xa8,0x0161}, {0xa9,0x00a9}, {0xaa,0x00aa}, {0xab,0x00ab}, {0xac,0x00ac}, {0xad,0x00ad}, {0xae,0x00ae}, {0xaf,0x00af}, {0xb0,0x00b0}, {0xb1,0x00b1}, {0xb2,0x00b2}, {0xb3,0x00b3}, {0xb4,0x017d}, {0xb5,0x00b5}, {0xb6,0x00b6}, {0xb7,0x00b7}, {0xb8,0x017e}, {0xb9,0x00b9}, {0xba,0x00ba}, {0xbb,0x00bb}, {0xbc,0x0152}, {0xbd,0x0153}, {0xbe,0x0178}, {0xbf,0x00bf}, {0xc0,0x00c0}, {0xc1,0x00c1}, {0xc2,0x00c2}, {0xc3,0x00c3}, {0xc4,0x00c4}, {0xc5,0x00c5}, {0xc6,0x00c6}, {0xc7,0x00c7}, {0xc8,0x00c8}, {0xc9,0x00c9}, {0xca,0x00ca}, {0xcb,0x00cb}, {0xcc,0x00cc}, {0xcd,0x00cd}, {0xce,0x00ce}, {0xcf,0x00cf}, {0xd0,0x00d0}, {0xd1,0x00d1}, {0xd2,0x00d2}, {0xd3,0x00d3}, {0xd4,0x00d4}, {0xd5,0x00d5}, {0xd6,0x00d6}, {0xd7,0x00d7}, {0xd8,0x00d8}, {0xd9,0x00d9}, {0xda,0x00da}, {0xdb,0x00db}, {0xdc,0x00dc}, {0xdd,0x00dd}, {0xde,0x00de}, {0xdf,0x00df}, {0xe0,0x00e0}, {0xe1,0x00e1}, {0xe2,0x00e2}, {0xe3,0x00e3}, {0xe4,0x00e4}, {0xe5,0x00e5}, {0xe6,0x00e6}, {0xe7,0x00e7}, {0xe8,0x00e8}, {0xe9,0x00e9}, {0xea,0x00ea}, {0xeb,0x00eb}, {0xec,0x00ec}, {0xed,0x00ed}, {0xee,0x00ee}, {0xef,0x00ef}, {0xf0,0x00f0}, {0xf1,0x00f1}, {0xf2,0x00f2}, {0xf3,0x00f3}, {0xf4,0x00f4}, {0xf5,0x00f5}, {0xf6,0x00f6}, {0xf7,0x00f7}, {0xf8,0x00f8}, {0xf9,0x00f9}, {0xfa,0x00fa}, {0xfb,0x00fb}, {0xfc,0x00fc}, {0xfd,0x00fd}, {0xfe,0x00fe}, {0xff,0x00ff}, }; @implementation CWISO8859_15 - (id) init { return [super initWithCodeCharTable: code_table length: sizeof(code_table)/sizeof(code_table[0])]; } - (NSString *) name { return @"iso-8859-15"; } @end pantomime1.2-1.2.2+dfsg1/Framework/Pantomime/CWISO8859_2.h000066400000000000000000000020151276751561200224420ustar00rootroot00000000000000/* ** CWISO8859_2.h ** ** Copyright (c) 2001-2004 ** ** Author: Ludovic Marcotte ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** You should have received a copy of the GNU Lesser General Public ** License along with this library; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef _Pantomime_H_CWISO8859_2 #define _Pantomime_H_CWISO8859_2 #include @interface CWISO8859_2 : CWCharset @end #endif // _Pantomime_H_CWISO8859_2 pantomime1.2-1.2.2+dfsg1/Framework/Pantomime/CWISO8859_2.m000066400000000000000000000061621276751561200224560ustar00rootroot00000000000000#include static struct charset_code code_table[]={ {0x20,0x0020}, {0x21,0x0021}, {0x22,0x0022}, {0x23,0x0023}, {0x24,0x0024}, {0x25,0x0025}, {0x26,0x0026}, {0x27,0x0027}, {0x28,0x0028}, {0x29,0x0029}, {0x2a,0x002a}, {0x2b,0x002b}, {0x2c,0x002c}, {0x2d,0x002d}, {0x2e,0x002e}, {0x2f,0x002f}, {0x30,0x0030}, {0x31,0x0031}, {0x32,0x0032}, {0x33,0x0033}, {0x34,0x0034}, {0x35,0x0035}, {0x36,0x0036}, {0x37,0x0037}, {0x38,0x0038}, {0x39,0x0039}, {0x3a,0x003a}, {0x3b,0x003b}, {0x3c,0x003c}, {0x3d,0x003d}, {0x3e,0x003e}, {0x3f,0x003f}, {0x40,0x0040}, {0x41,0x0041}, {0x42,0x0042}, {0x43,0x0043}, {0x44,0x0044}, {0x45,0x0045}, {0x46,0x0046}, {0x47,0x0047}, {0x48,0x0048}, {0x49,0x0049}, {0x4a,0x004a}, {0x4b,0x004b}, {0x4c,0x004c}, {0x4d,0x004d}, {0x4e,0x004e}, {0x4f,0x004f}, {0x50,0x0050}, {0x51,0x0051}, {0x52,0x0052}, {0x53,0x0053}, {0x54,0x0054}, {0x55,0x0055}, {0x56,0x0056}, {0x57,0x0057}, {0x58,0x0058}, {0x59,0x0059}, {0x5a,0x005a}, {0x5b,0x005b}, {0x5c,0x005c}, {0x5d,0x005d}, {0x5e,0x005e}, {0x5f,0x005f}, {0x60,0x0060}, {0x61,0x0061}, {0x62,0x0062}, {0x63,0x0063}, {0x64,0x0064}, {0x65,0x0065}, {0x66,0x0066}, {0x67,0x0067}, {0x68,0x0068}, {0x69,0x0069}, {0x6a,0x006a}, {0x6b,0x006b}, {0x6c,0x006c}, {0x6d,0x006d}, {0x6e,0x006e}, {0x6f,0x006f}, {0x70,0x0070}, {0x71,0x0071}, {0x72,0x0072}, {0x73,0x0073}, {0x74,0x0074}, {0x75,0x0075}, {0x76,0x0076}, {0x77,0x0077}, {0x78,0x0078}, {0x79,0x0079}, {0x7a,0x007a}, {0x7b,0x007b}, {0x7c,0x007c}, {0x7d,0x007d}, {0x7e,0x007e}, {0xa0,0x00a0}, {0xa1,0x0104}, {0xa2,0x02d8}, {0xa3,0x0141}, {0xa4,0x00a4}, {0xa5,0x013d}, {0xa6,0x015a}, {0xa7,0x00a7}, {0xa8,0x00a8}, {0xa9,0x0160}, {0xaa,0x015e}, {0xab,0x0164}, {0xac,0x0179}, {0xad,0x00ad}, {0xae,0x017d}, {0xaf,0x017b}, {0xb0,0x00b0}, {0xb1,0x0105}, {0xb2,0x02db}, {0xb3,0x0142}, {0xb4,0x00b4}, {0xb5,0x013e}, {0xb6,0x015b}, {0xb7,0x02c7}, {0xb8,0x00b8}, {0xb9,0x0161}, {0xba,0x015f}, {0xbb,0x0165}, {0xbc,0x017a}, {0xbd,0x02dd}, {0xbe,0x017e}, {0xbf,0x017c}, {0xc0,0x0154}, {0xc1,0x00c1}, {0xc2,0x00c2}, {0xc3,0x0102}, {0xc4,0x00c4}, {0xc5,0x0139}, {0xc6,0x0106}, {0xc7,0x00c7}, {0xc8,0x010c}, {0xc9,0x00c9}, {0xca,0x0118}, {0xcb,0x00cb}, {0xcc,0x011a}, {0xcd,0x00cd}, {0xce,0x00ce}, {0xcf,0x010e}, {0xd0,0x0110}, {0xd1,0x0143}, {0xd2,0x0147}, {0xd3,0x00d3}, {0xd4,0x00d4}, {0xd5,0x0150}, {0xd6,0x00d6}, {0xd7,0x00d7}, {0xd8,0x0158}, {0xd9,0x016e}, {0xda,0x00da}, {0xdb,0x0170}, {0xdc,0x00dc}, {0xdd,0x00dd}, {0xde,0x0162}, {0xdf,0x00df}, {0xe0,0x0155}, {0xe1,0x00e1}, {0xe2,0x00e2}, {0xe3,0x0103}, {0xe4,0x00e4}, {0xe5,0x013a}, {0xe6,0x0107}, {0xe7,0x00e7}, {0xe8,0x010d}, {0xe9,0x00e9}, {0xea,0x0119}, {0xeb,0x00eb}, {0xec,0x011b}, {0xed,0x00ed}, {0xee,0x00ee}, {0xef,0x010f}, {0xf0,0x0111}, {0xf1,0x0144}, {0xf2,0x0148}, {0xf3,0x00f3}, {0xf4,0x00f4}, {0xf5,0x0151}, {0xf6,0x00f6}, {0xf7,0x00f7}, {0xf8,0x0159}, {0xf9,0x016f}, {0xfa,0x00fa}, {0xfb,0x0171}, {0xfc,0x00fc}, {0xfd,0x00fd}, {0xfe,0x0163}, {0xff,0x02d9}, }; @implementation CWISO8859_2 - (id) init { return [super initWithCodeCharTable: code_table length: sizeof(code_table)/sizeof(code_table[0])]; } - (NSString *) name { return @"iso-8859-2"; } @end pantomime1.2-1.2.2+dfsg1/Framework/Pantomime/CWISO8859_3.h000066400000000000000000000020151276751561200224430ustar00rootroot00000000000000/* ** CWISO8859_3.h ** ** Copyright (c) 2001-2004 ** ** Author: Ludovic Marcotte ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** You should have received a copy of the GNU Lesser General Public ** License along with this library; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef _Pantomime_H_CWISO8859_3 #define _Pantomime_H_CWISO8859_3 #include @interface CWISO8859_3 : CWCharset @end #endif // _Pantomime_H_CWISO8859_3 pantomime1.2-1.2.2+dfsg1/Framework/Pantomime/CWISO8859_3.m000066400000000000000000000060071276751561200224550ustar00rootroot00000000000000#include static struct charset_code code_table[]={ {0x20,0x0020}, {0x21,0x0021}, {0x22,0x0022}, {0x23,0x0023}, {0x24,0x0024}, {0x25,0x0025}, {0x26,0x0026}, {0x27,0x0027}, {0x28,0x0028}, {0x29,0x0029}, {0x2a,0x002a}, {0x2b,0x002b}, {0x2c,0x002c}, {0x2d,0x002d}, {0x2e,0x002e}, {0x2f,0x002f}, {0x30,0x0030}, {0x31,0x0031}, {0x32,0x0032}, {0x33,0x0033}, {0x34,0x0034}, {0x35,0x0035}, {0x36,0x0036}, {0x37,0x0037}, {0x38,0x0038}, {0x39,0x0039}, {0x3a,0x003a}, {0x3b,0x003b}, {0x3c,0x003c}, {0x3d,0x003d}, {0x3e,0x003e}, {0x3f,0x003f}, {0x40,0x0040}, {0x41,0x0041}, {0x42,0x0042}, {0x43,0x0043}, {0x44,0x0044}, {0x45,0x0045}, {0x46,0x0046}, {0x47,0x0047}, {0x48,0x0048}, {0x49,0x0049}, {0x4a,0x004a}, {0x4b,0x004b}, {0x4c,0x004c}, {0x4d,0x004d}, {0x4e,0x004e}, {0x4f,0x004f}, {0x50,0x0050}, {0x51,0x0051}, {0x52,0x0052}, {0x53,0x0053}, {0x54,0x0054}, {0x55,0x0055}, {0x56,0x0056}, {0x57,0x0057}, {0x58,0x0058}, {0x59,0x0059}, {0x5a,0x005a}, {0x5b,0x005b}, {0x5c,0x005c}, {0x5d,0x005d}, {0x5e,0x005e}, {0x5f,0x005f}, {0x60,0x0060}, {0x61,0x0061}, {0x62,0x0062}, {0x63,0x0063}, {0x64,0x0064}, {0x65,0x0065}, {0x66,0x0066}, {0x67,0x0067}, {0x68,0x0068}, {0x69,0x0069}, {0x6a,0x006a}, {0x6b,0x006b}, {0x6c,0x006c}, {0x6d,0x006d}, {0x6e,0x006e}, {0x6f,0x006f}, {0x70,0x0070}, {0x71,0x0071}, {0x72,0x0072}, {0x73,0x0073}, {0x74,0x0074}, {0x75,0x0075}, {0x76,0x0076}, {0x77,0x0077}, {0x78,0x0078}, {0x79,0x0079}, {0x7a,0x007a}, {0x7b,0x007b}, {0x7c,0x007c}, {0x7d,0x007d}, {0x7e,0x007e}, {0xa0,0x00a0}, {0xa1,0x0126}, {0xa2,0x02d8}, {0xa3,0x00a3}, {0xa4,0x00a4}, {0xa6,0x0124}, {0xa7,0x00a7}, {0xa8,0x00a8}, {0xa9,0x0130}, {0xaa,0x015e}, {0xab,0x011e}, {0xac,0x0134}, {0xad,0x00ad}, {0xaf,0x017b}, {0xb0,0x00b0}, {0xb1,0x0127}, {0xb2,0x00b2}, {0xb3,0x00b3}, {0xb4,0x00b4}, {0xb5,0x00b5}, {0xb6,0x0125}, {0xb7,0x00b7}, {0xb8,0x00b8}, {0xb9,0x0131}, {0xba,0x015f}, {0xbb,0x011f}, {0xbc,0x0135}, {0xbd,0x00bd}, {0xbf,0x017c}, {0xc0,0x00c0}, {0xc1,0x00c1}, {0xc2,0x00c2}, {0xc4,0x00c4}, {0xc5,0x010a}, {0xc6,0x0108}, {0xc7,0x00c7}, {0xc8,0x00c8}, {0xc9,0x00c9}, {0xca,0x00ca}, {0xcb,0x00cb}, {0xcc,0x00cc}, {0xcd,0x00cd}, {0xce,0x00ce}, {0xcf,0x00cf}, {0xd1,0x00d1}, {0xd2,0x00d2}, {0xd3,0x00d3}, {0xd4,0x00d4}, {0xd5,0x0120}, {0xd6,0x00d6}, {0xd7,0x00d7}, {0xd8,0x011c}, {0xd9,0x00d9}, {0xda,0x00da}, {0xdb,0x00db}, {0xdc,0x00dc}, {0xdd,0x016c}, {0xde,0x015c}, {0xdf,0x00df}, {0xe0,0x00e0}, {0xe1,0x00e1}, {0xe2,0x00e2}, {0xe4,0x00e4}, {0xe5,0x010b}, {0xe6,0x0109}, {0xe7,0x00e7}, {0xe8,0x00e8}, {0xe9,0x00e9}, {0xea,0x00ea}, {0xeb,0x00eb}, {0xec,0x00ec}, {0xed,0x00ed}, {0xee,0x00ee}, {0xef,0x00ef}, {0xf1,0x00f1}, {0xf2,0x00f2}, {0xf3,0x00f3}, {0xf4,0x00f4}, {0xf5,0x0121}, {0xf6,0x00f6}, {0xf7,0x00f7}, {0xf8,0x011d}, {0xf9,0x00f9}, {0xfa,0x00fa}, {0xfb,0x00fb}, {0xfc,0x00fc}, {0xfd,0x016d}, {0xfe,0x015d}, {0xff,0x02d9}, }; @implementation CWISO8859_3 - (id) init { return [super initWithCodeCharTable: code_table length: sizeof(code_table)/sizeof(code_table[0])]; } - (NSString *) name { return @"iso-8859-3"; } @end pantomime1.2-1.2.2+dfsg1/Framework/Pantomime/CWISO8859_4.h000066400000000000000000000020151276751561200224440ustar00rootroot00000000000000/* ** CWISO8859_4.h ** ** Copyright (c) 2001-2004 ** ** Author: Ludovic Marcotte ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** You should have received a copy of the GNU Lesser General Public ** License along with this library; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef _Pantomime_H_CWISO8859_4 #define _Pantomime_H_CWISO8859_4 #include @interface CWISO8859_4 : CWCharset @end #endif // _Pantomime_H_CWISO8859_4 pantomime1.2-1.2.2+dfsg1/Framework/Pantomime/CWISO8859_4.m000066400000000000000000000061621276751561200224600ustar00rootroot00000000000000#include static struct charset_code code_table[]={ {0x20,0x0020}, {0x21,0x0021}, {0x22,0x0022}, {0x23,0x0023}, {0x24,0x0024}, {0x25,0x0025}, {0x26,0x0026}, {0x27,0x0027}, {0x28,0x0028}, {0x29,0x0029}, {0x2a,0x002a}, {0x2b,0x002b}, {0x2c,0x002c}, {0x2d,0x002d}, {0x2e,0x002e}, {0x2f,0x002f}, {0x30,0x0030}, {0x31,0x0031}, {0x32,0x0032}, {0x33,0x0033}, {0x34,0x0034}, {0x35,0x0035}, {0x36,0x0036}, {0x37,0x0037}, {0x38,0x0038}, {0x39,0x0039}, {0x3a,0x003a}, {0x3b,0x003b}, {0x3c,0x003c}, {0x3d,0x003d}, {0x3e,0x003e}, {0x3f,0x003f}, {0x40,0x0040}, {0x41,0x0041}, {0x42,0x0042}, {0x43,0x0043}, {0x44,0x0044}, {0x45,0x0045}, {0x46,0x0046}, {0x47,0x0047}, {0x48,0x0048}, {0x49,0x0049}, {0x4a,0x004a}, {0x4b,0x004b}, {0x4c,0x004c}, {0x4d,0x004d}, {0x4e,0x004e}, {0x4f,0x004f}, {0x50,0x0050}, {0x51,0x0051}, {0x52,0x0052}, {0x53,0x0053}, {0x54,0x0054}, {0x55,0x0055}, {0x56,0x0056}, {0x57,0x0057}, {0x58,0x0058}, {0x59,0x0059}, {0x5a,0x005a}, {0x5b,0x005b}, {0x5c,0x005c}, {0x5d,0x005d}, {0x5e,0x005e}, {0x5f,0x005f}, {0x60,0x0060}, {0x61,0x0061}, {0x62,0x0062}, {0x63,0x0063}, {0x64,0x0064}, {0x65,0x0065}, {0x66,0x0066}, {0x67,0x0067}, {0x68,0x0068}, {0x69,0x0069}, {0x6a,0x006a}, {0x6b,0x006b}, {0x6c,0x006c}, {0x6d,0x006d}, {0x6e,0x006e}, {0x6f,0x006f}, {0x70,0x0070}, {0x71,0x0071}, {0x72,0x0072}, {0x73,0x0073}, {0x74,0x0074}, {0x75,0x0075}, {0x76,0x0076}, {0x77,0x0077}, {0x78,0x0078}, {0x79,0x0079}, {0x7a,0x007a}, {0x7b,0x007b}, {0x7c,0x007c}, {0x7d,0x007d}, {0x7e,0x007e}, {0xa0,0x00a0}, {0xa1,0x0104}, {0xa2,0x0138}, {0xa3,0x0156}, {0xa4,0x00a4}, {0xa5,0x0128}, {0xa6,0x013b}, {0xa7,0x00a7}, {0xa8,0x00a8}, {0xa9,0x0160}, {0xaa,0x0112}, {0xab,0x0122}, {0xac,0x0166}, {0xad,0x00ad}, {0xae,0x017d}, {0xaf,0x00af}, {0xb0,0x00b0}, {0xb1,0x0105}, {0xb2,0x02db}, {0xb3,0x0157}, {0xb4,0x00b4}, {0xb5,0x0129}, {0xb6,0x013c}, {0xb7,0x02c7}, {0xb8,0x00b8}, {0xb9,0x0161}, {0xba,0x0113}, {0xbb,0x0123}, {0xbc,0x0167}, {0xbd,0x014a}, {0xbe,0x017e}, {0xbf,0x014b}, {0xc0,0x0100}, {0xc1,0x00c1}, {0xc2,0x00c2}, {0xc3,0x00c3}, {0xc4,0x00c4}, {0xc5,0x00c5}, {0xc6,0x00c6}, {0xc7,0x012e}, {0xc8,0x010c}, {0xc9,0x00c9}, {0xca,0x0118}, {0xcb,0x00cb}, {0xcc,0x0116}, {0xcd,0x00cd}, {0xce,0x00ce}, {0xcf,0x012a}, {0xd0,0x0110}, {0xd1,0x0145}, {0xd2,0x014c}, {0xd3,0x0136}, {0xd4,0x00d4}, {0xd5,0x00d5}, {0xd6,0x00d6}, {0xd7,0x00d7}, {0xd8,0x00d8}, {0xd9,0x0172}, {0xda,0x00da}, {0xdb,0x00db}, {0xdc,0x00dc}, {0xdd,0x0168}, {0xde,0x016a}, {0xdf,0x00df}, {0xe0,0x0101}, {0xe1,0x00e1}, {0xe2,0x00e2}, {0xe3,0x00e3}, {0xe4,0x00e4}, {0xe5,0x00e5}, {0xe6,0x00e6}, {0xe7,0x012f}, {0xe8,0x010d}, {0xe9,0x00e9}, {0xea,0x0119}, {0xeb,0x00eb}, {0xec,0x0117}, {0xed,0x00ed}, {0xee,0x00ee}, {0xef,0x012b}, {0xf0,0x0111}, {0xf1,0x0146}, {0xf2,0x014d}, {0xf3,0x0137}, {0xf4,0x00f4}, {0xf5,0x00f5}, {0xf6,0x00f6}, {0xf7,0x00f7}, {0xf8,0x00f8}, {0xf9,0x0173}, {0xfa,0x00fa}, {0xfb,0x00fb}, {0xfc,0x00fc}, {0xfd,0x0169}, {0xfe,0x016b}, {0xff,0x02d9}, }; @implementation CWISO8859_4 - (id) init { return [super initWithCodeCharTable: code_table length: sizeof(code_table)/sizeof(code_table[0])]; } - (NSString *) name { return @"iso-8859-4"; } @end pantomime1.2-1.2.2+dfsg1/Framework/Pantomime/CWISO8859_5.h000066400000000000000000000020151276751561200224450ustar00rootroot00000000000000/* ** CWISO8859_5.h ** ** Copyright (c) 2001-2004 ** ** Author: Ludovic Marcotte ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** You should have received a copy of the GNU Lesser General Public ** License along with this library; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef _Pantomime_H_CWISO8859_5 #define _Pantomime_H_CWISO8859_5 #include @interface CWISO8859_5 : CWCharset @end #endif // _Pantomime_H_CWISO8859_5 pantomime1.2-1.2.2+dfsg1/Framework/Pantomime/CWISO8859_5.m000066400000000000000000000061621276751561200224610ustar00rootroot00000000000000#include static struct charset_code code_table[]={ {0x20,0x0020}, {0x21,0x0021}, {0x22,0x0022}, {0x23,0x0023}, {0x24,0x0024}, {0x25,0x0025}, {0x26,0x0026}, {0x27,0x0027}, {0x28,0x0028}, {0x29,0x0029}, {0x2a,0x002a}, {0x2b,0x002b}, {0x2c,0x002c}, {0x2d,0x002d}, {0x2e,0x002e}, {0x2f,0x002f}, {0x30,0x0030}, {0x31,0x0031}, {0x32,0x0032}, {0x33,0x0033}, {0x34,0x0034}, {0x35,0x0035}, {0x36,0x0036}, {0x37,0x0037}, {0x38,0x0038}, {0x39,0x0039}, {0x3a,0x003a}, {0x3b,0x003b}, {0x3c,0x003c}, {0x3d,0x003d}, {0x3e,0x003e}, {0x3f,0x003f}, {0x40,0x0040}, {0x41,0x0041}, {0x42,0x0042}, {0x43,0x0043}, {0x44,0x0044}, {0x45,0x0045}, {0x46,0x0046}, {0x47,0x0047}, {0x48,0x0048}, {0x49,0x0049}, {0x4a,0x004a}, {0x4b,0x004b}, {0x4c,0x004c}, {0x4d,0x004d}, {0x4e,0x004e}, {0x4f,0x004f}, {0x50,0x0050}, {0x51,0x0051}, {0x52,0x0052}, {0x53,0x0053}, {0x54,0x0054}, {0x55,0x0055}, {0x56,0x0056}, {0x57,0x0057}, {0x58,0x0058}, {0x59,0x0059}, {0x5a,0x005a}, {0x5b,0x005b}, {0x5c,0x005c}, {0x5d,0x005d}, {0x5e,0x005e}, {0x5f,0x005f}, {0x60,0x0060}, {0x61,0x0061}, {0x62,0x0062}, {0x63,0x0063}, {0x64,0x0064}, {0x65,0x0065}, {0x66,0x0066}, {0x67,0x0067}, {0x68,0x0068}, {0x69,0x0069}, {0x6a,0x006a}, {0x6b,0x006b}, {0x6c,0x006c}, {0x6d,0x006d}, {0x6e,0x006e}, {0x6f,0x006f}, {0x70,0x0070}, {0x71,0x0071}, {0x72,0x0072}, {0x73,0x0073}, {0x74,0x0074}, {0x75,0x0075}, {0x76,0x0076}, {0x77,0x0077}, {0x78,0x0078}, {0x79,0x0079}, {0x7a,0x007a}, {0x7b,0x007b}, {0x7c,0x007c}, {0x7d,0x007d}, {0x7e,0x007e}, {0xa0,0x00a0}, {0xa1,0x0401}, {0xa2,0x0402}, {0xa3,0x0403}, {0xa4,0x0404}, {0xa5,0x0405}, {0xa6,0x0406}, {0xa7,0x0407}, {0xa8,0x0408}, {0xa9,0x0409}, {0xaa,0x040a}, {0xab,0x040b}, {0xac,0x040c}, {0xad,0x00ad}, {0xae,0x040e}, {0xaf,0x040f}, {0xb0,0x0410}, {0xb1,0x0411}, {0xb2,0x0412}, {0xb3,0x0413}, {0xb4,0x0414}, {0xb5,0x0415}, {0xb6,0x0416}, {0xb7,0x0417}, {0xb8,0x0418}, {0xb9,0x0419}, {0xba,0x041a}, {0xbb,0x041b}, {0xbc,0x041c}, {0xbd,0x041d}, {0xbe,0x041e}, {0xbf,0x041f}, {0xc0,0x0420}, {0xc1,0x0421}, {0xc2,0x0422}, {0xc3,0x0423}, {0xc4,0x0424}, {0xc5,0x0425}, {0xc6,0x0426}, {0xc7,0x0427}, {0xc8,0x0428}, {0xc9,0x0429}, {0xca,0x042a}, {0xcb,0x042b}, {0xcc,0x042c}, {0xcd,0x042d}, {0xce,0x042e}, {0xcf,0x042f}, {0xd0,0x0430}, {0xd1,0x0431}, {0xd2,0x0432}, {0xd3,0x0433}, {0xd4,0x0434}, {0xd5,0x0435}, {0xd6,0x0436}, {0xd7,0x0437}, {0xd8,0x0438}, {0xd9,0x0439}, {0xda,0x043a}, {0xdb,0x043b}, {0xdc,0x043c}, {0xdd,0x043d}, {0xde,0x043e}, {0xdf,0x043f}, {0xe0,0x0440}, {0xe1,0x0441}, {0xe2,0x0442}, {0xe3,0x0443}, {0xe4,0x0444}, {0xe5,0x0445}, {0xe6,0x0446}, {0xe7,0x0447}, {0xe8,0x0448}, {0xe9,0x0449}, {0xea,0x044a}, {0xeb,0x044b}, {0xec,0x044c}, {0xed,0x044d}, {0xee,0x044e}, {0xef,0x044f}, {0xf0,0x2116}, {0xf1,0x0451}, {0xf2,0x0452}, {0xf3,0x0453}, {0xf4,0x0454}, {0xf5,0x0455}, {0xf6,0x0456}, {0xf7,0x0457}, {0xf8,0x0458}, {0xf9,0x0459}, {0xfa,0x045a}, {0xfb,0x045b}, {0xfc,0x045c}, {0xfd,0x00a7}, {0xfe,0x045e}, {0xff,0x045f}, }; @implementation CWISO8859_5 - (id) init { return [super initWithCodeCharTable: code_table length: sizeof(code_table)/sizeof(code_table[0])]; } - (NSString *) name { return @"iso-8859-5"; } @end pantomime1.2-1.2.2+dfsg1/Framework/Pantomime/CWISO8859_6.h000066400000000000000000000020151276751561200224460ustar00rootroot00000000000000/* ** CWISO8859_6.h ** ** Copyright (c) 2001-2004 ** ** Author: Ludovic Marcotte ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** You should have received a copy of the GNU Lesser General Public ** License along with this library; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef _Pantomime_H_CWISO8859_6 #define _Pantomime_H_CWISO8859_6 #include @interface CWISO8859_6 : CWCharset @end #endif // _Pantomime_H_CWISO8859_6 pantomime1.2-1.2.2+dfsg1/Framework/Pantomime/CWISO8859_6.m000066400000000000000000000047061276751561200224640ustar00rootroot00000000000000#include static struct charset_code code_table[]={ {0x20,0x0020}, {0x21,0x0021}, {0x22,0x0022}, {0x23,0x0023}, {0x24,0x0024}, {0x25,0x0025}, {0x26,0x0026}, {0x27,0x0027}, {0x28,0x0028}, {0x29,0x0029}, {0x2a,0x002a}, {0x2b,0x002b}, {0x2c,0x002c}, {0x2d,0x002d}, {0x2e,0x002e}, {0x2f,0x002f}, {0x30,0x0030}, {0x31,0x0031}, {0x32,0x0032}, {0x33,0x0033}, {0x34,0x0034}, {0x35,0x0035}, {0x36,0x0036}, {0x37,0x0037}, {0x38,0x0038}, {0x39,0x0039}, {0x3a,0x003a}, {0x3b,0x003b}, {0x3c,0x003c}, {0x3d,0x003d}, {0x3e,0x003e}, {0x3f,0x003f}, {0x40,0x0040}, {0x41,0x0041}, {0x42,0x0042}, {0x43,0x0043}, {0x44,0x0044}, {0x45,0x0045}, {0x46,0x0046}, {0x47,0x0047}, {0x48,0x0048}, {0x49,0x0049}, {0x4a,0x004a}, {0x4b,0x004b}, {0x4c,0x004c}, {0x4d,0x004d}, {0x4e,0x004e}, {0x4f,0x004f}, {0x50,0x0050}, {0x51,0x0051}, {0x52,0x0052}, {0x53,0x0053}, {0x54,0x0054}, {0x55,0x0055}, {0x56,0x0056}, {0x57,0x0057}, {0x58,0x0058}, {0x59,0x0059}, {0x5a,0x005a}, {0x5b,0x005b}, {0x5c,0x005c}, {0x5d,0x005d}, {0x5e,0x005e}, {0x5f,0x005f}, {0x60,0x0060}, {0x61,0x0061}, {0x62,0x0062}, {0x63,0x0063}, {0x64,0x0064}, {0x65,0x0065}, {0x66,0x0066}, {0x67,0x0067}, {0x68,0x0068}, {0x69,0x0069}, {0x6a,0x006a}, {0x6b,0x006b}, {0x6c,0x006c}, {0x6d,0x006d}, {0x6e,0x006e}, {0x6f,0x006f}, {0x70,0x0070}, {0x71,0x0071}, {0x72,0x0072}, {0x73,0x0073}, {0x74,0x0074}, {0x75,0x0075}, {0x76,0x0076}, {0x77,0x0077}, {0x78,0x0078}, {0x79,0x0079}, {0x7a,0x007a}, {0x7b,0x007b}, {0x7c,0x007c}, {0x7d,0x007d}, {0x7e,0x007e}, {0xa0,0x00a0}, {0xa4,0x00a4}, {0xac,0x060c}, {0xad,0x00ad}, {0xbb,0x061b}, {0xbf,0x061f}, {0xc1,0x0621}, {0xc2,0x0622}, {0xc3,0x0623}, {0xc4,0x0624}, {0xc5,0x0625}, {0xc6,0x0626}, {0xc7,0x0627}, {0xc8,0x0628}, {0xc9,0x0629}, {0xca,0x062a}, {0xcb,0x062b}, {0xcc,0x062c}, {0xcd,0x062d}, {0xce,0x062e}, {0xcf,0x062f}, {0xd0,0x0630}, {0xd1,0x0631}, {0xd2,0x0632}, {0xd3,0x0633}, {0xd4,0x0634}, {0xd5,0x0635}, {0xd6,0x0636}, {0xd7,0x0637}, {0xd8,0x0638}, {0xd9,0x0639}, {0xda,0x063a}, {0xe0,0x0640}, {0xe1,0x0641}, {0xe2,0x0642}, {0xe3,0x0643}, {0xe4,0x0644}, {0xe5,0x0645}, {0xe6,0x0646}, {0xe7,0x0647}, {0xe8,0x0648}, {0xe9,0x0649}, {0xea,0x064a}, {0xeb,0x064b}, {0xec,0x064c}, {0xed,0x064d}, {0xee,0x064e}, {0xef,0x064f}, {0xf0,0x0650}, {0xf1,0x0651}, {0xf2,0x0652}, }; @implementation CWISO8859_6 - (id) init { return [super initWithCodeCharTable: code_table length: sizeof(code_table)/sizeof(code_table[0])]; } - (NSString *) name { return @"iso-8859-6"; } @end pantomime1.2-1.2.2+dfsg1/Framework/Pantomime/CWISO8859_7.h000066400000000000000000000020151276751561200224470ustar00rootroot00000000000000/* ** CWISO8859_7.h ** ** Copyright (c) 2001-2004 ** ** Author: Ludovic Marcotte ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** You should have received a copy of the GNU Lesser General Public ** License along with this library; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef _Pantomime_H_CWISO8859_7 #define _Pantomime_H_CWISO8859_7 #include @interface CWISO8859_7 : CWCharset @end #endif // _Pantomime_H_CWISO8859_7 pantomime1.2-1.2.2+dfsg1/Framework/Pantomime/CWISO8859_7.m000066400000000000000000000060261276751561200224620ustar00rootroot00000000000000#include static struct charset_code code_table[]={ {0x20,0x0020}, {0x21,0x0021}, {0x22,0x0022}, {0x23,0x0023}, {0x24,0x0024}, {0x25,0x0025}, {0x26,0x0026}, {0x27,0x0027}, {0x28,0x0028}, {0x29,0x0029}, {0x2a,0x002a}, {0x2b,0x002b}, {0x2c,0x002c}, {0x2d,0x002d}, {0x2e,0x002e}, {0x2f,0x002f}, {0x30,0x0030}, {0x31,0x0031}, {0x32,0x0032}, {0x33,0x0033}, {0x34,0x0034}, {0x35,0x0035}, {0x36,0x0036}, {0x37,0x0037}, {0x38,0x0038}, {0x39,0x0039}, {0x3a,0x003a}, {0x3b,0x003b}, {0x3c,0x003c}, {0x3d,0x003d}, {0x3e,0x003e}, {0x3f,0x003f}, {0x40,0x0040}, {0x41,0x0041}, {0x42,0x0042}, {0x43,0x0043}, {0x44,0x0044}, {0x45,0x0045}, {0x46,0x0046}, {0x47,0x0047}, {0x48,0x0048}, {0x49,0x0049}, {0x4a,0x004a}, {0x4b,0x004b}, {0x4c,0x004c}, {0x4d,0x004d}, {0x4e,0x004e}, {0x4f,0x004f}, {0x50,0x0050}, {0x51,0x0051}, {0x52,0x0052}, {0x53,0x0053}, {0x54,0x0054}, {0x55,0x0055}, {0x56,0x0056}, {0x57,0x0057}, {0x58,0x0058}, {0x59,0x0059}, {0x5a,0x005a}, {0x5b,0x005b}, {0x5c,0x005c}, {0x5d,0x005d}, {0x5e,0x005e}, {0x5f,0x005f}, {0x60,0x0060}, {0x61,0x0061}, {0x62,0x0062}, {0x63,0x0063}, {0x64,0x0064}, {0x65,0x0065}, {0x66,0x0066}, {0x67,0x0067}, {0x68,0x0068}, {0x69,0x0069}, {0x6a,0x006a}, {0x6b,0x006b}, {0x6c,0x006c}, {0x6d,0x006d}, {0x6e,0x006e}, {0x6f,0x006f}, {0x70,0x0070}, {0x71,0x0071}, {0x72,0x0072}, {0x73,0x0073}, {0x74,0x0074}, {0x75,0x0075}, {0x76,0x0076}, {0x77,0x0077}, {0x78,0x0078}, {0x79,0x0079}, {0x7a,0x007a}, {0x7b,0x007b}, {0x7c,0x007c}, {0x7d,0x007d}, {0x7e,0x007e}, {0xa0,0x00a0}, {0xa1,0x02bd}, {0xa2,0x02bc}, {0xa3,0x00a3}, {0xa6,0x00a6}, {0xa7,0x00a7}, {0xa8,0x00a8}, {0xa9,0x00a9}, {0xab,0x00ab}, {0xac,0x00ac}, {0xad,0x00ad}, {0xaf,0x2015}, {0xb0,0x00b0}, {0xb1,0x00b1}, {0xb2,0x00b2}, {0xb3,0x00b3}, {0xb4,0x0384}, {0xb5,0x0385}, {0xb6,0x0386}, {0xb7,0x00b7}, {0xb8,0x0388}, {0xb9,0x0389}, {0xba,0x038a}, {0xbb,0x00bb}, {0xbc,0x038c}, {0xbd,0x00bd}, {0xbe,0x038e}, {0xbf,0x038f}, {0xc0,0x0390}, {0xc1,0x0391}, {0xc2,0x0392}, {0xc3,0x0393}, {0xc4,0x0394}, {0xc5,0x0395}, {0xc6,0x0396}, {0xc7,0x0397}, {0xc8,0x0398}, {0xc9,0x0399}, {0xca,0x039a}, {0xcb,0x039b}, {0xcc,0x039c}, {0xcd,0x039d}, {0xce,0x039e}, {0xcf,0x039f}, {0xd0,0x03a0}, {0xd1,0x03a1}, {0xd3,0x03a3}, {0xd4,0x03a4}, {0xd5,0x03a5}, {0xd6,0x03a6}, {0xd7,0x03a7}, {0xd8,0x03a8}, {0xd9,0x03a9}, {0xda,0x03aa}, {0xdb,0x03ab}, {0xdc,0x03ac}, {0xdd,0x03ad}, {0xde,0x03ae}, {0xdf,0x03af}, {0xe0,0x03b0}, {0xe1,0x03b1}, {0xe2,0x03b2}, {0xe3,0x03b3}, {0xe4,0x03b4}, {0xe5,0x03b5}, {0xe6,0x03b6}, {0xe7,0x03b7}, {0xe8,0x03b8}, {0xe9,0x03b9}, {0xea,0x03ba}, {0xeb,0x03bb}, {0xec,0x03bc}, {0xed,0x03bd}, {0xee,0x03be}, {0xef,0x03bf}, {0xf0,0x03c0}, {0xf1,0x03c1}, {0xf2,0x03c2}, {0xf3,0x03c3}, {0xf4,0x03c4}, {0xf5,0x03c5}, {0xf6,0x03c6}, {0xf7,0x03c7}, {0xf8,0x03c8}, {0xf9,0x03c9}, {0xfa,0x03ca}, {0xfb,0x03cb}, {0xfc,0x03cc}, {0xfd,0x03cd}, {0xfe,0x03ce}, }; @implementation CWISO8859_7 - (id) init { return [super initWithCodeCharTable: code_table length: sizeof(code_table)/sizeof(code_table[0])]; } - (NSString *) name { return @"iso-8859-7"; } @end pantomime1.2-1.2.2+dfsg1/Framework/Pantomime/CWISO8859_8.h000066400000000000000000000020151276751561200224500ustar00rootroot00000000000000/* ** CWISO8859_8.h ** ** Copyright (c) 2001-2004 ** ** Author: Ludovic Marcotte ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** You should have received a copy of the GNU Lesser General Public ** License along with this library; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef _Pantomime_H_CWISO8859_8 #define _Pantomime_H_CWISO8859_8 #include @interface CWISO8859_8 : CWCharset @end #endif // _Pantomime_H_CWISO8859_8 pantomime1.2-1.2.2+dfsg1/Framework/Pantomime/CWISO8859_8.m000066400000000000000000000050601276751561200224600ustar00rootroot00000000000000#include static struct charset_code code_table[]={ {0x20,0x0020}, {0x21,0x0021}, {0x22,0x0022}, {0x23,0x0023}, {0x24,0x0024}, {0x25,0x0025}, {0x26,0x0026}, {0x27,0x0027}, {0x28,0x0028}, {0x29,0x0029}, {0x2a,0x002a}, {0x2b,0x002b}, {0x2c,0x002c}, {0x2d,0x002d}, {0x2e,0x002e}, {0x2f,0x002f}, {0x30,0x0030}, {0x31,0x0031}, {0x32,0x0032}, {0x33,0x0033}, {0x34,0x0034}, {0x35,0x0035}, {0x36,0x0036}, {0x37,0x0037}, {0x38,0x0038}, {0x39,0x0039}, {0x3a,0x003a}, {0x3b,0x003b}, {0x3c,0x003c}, {0x3d,0x003d}, {0x3e,0x003e}, {0x3f,0x003f}, {0x40,0x0040}, {0x41,0x0041}, {0x42,0x0042}, {0x43,0x0043}, {0x44,0x0044}, {0x45,0x0045}, {0x46,0x0046}, {0x47,0x0047}, {0x48,0x0048}, {0x49,0x0049}, {0x4a,0x004a}, {0x4b,0x004b}, {0x4c,0x004c}, {0x4d,0x004d}, {0x4e,0x004e}, {0x4f,0x004f}, {0x50,0x0050}, {0x51,0x0051}, {0x52,0x0052}, {0x53,0x0053}, {0x54,0x0054}, {0x55,0x0055}, {0x56,0x0056}, {0x57,0x0057}, {0x58,0x0058}, {0x59,0x0059}, {0x5a,0x005a}, {0x5b,0x005b}, {0x5c,0x005c}, {0x5d,0x005d}, {0x5e,0x005e}, {0x5f,0x005f}, {0x60,0x0060}, {0x61,0x0061}, {0x62,0x0062}, {0x63,0x0063}, {0x64,0x0064}, {0x65,0x0065}, {0x66,0x0066}, {0x67,0x0067}, {0x68,0x0068}, {0x69,0x0069}, {0x6a,0x006a}, {0x6b,0x006b}, {0x6c,0x006c}, {0x6d,0x006d}, {0x6e,0x006e}, {0x6f,0x006f}, {0x70,0x0070}, {0x71,0x0071}, {0x72,0x0072}, {0x73,0x0073}, {0x74,0x0074}, {0x75,0x0075}, {0x76,0x0076}, {0x77,0x0077}, {0x78,0x0078}, {0x79,0x0079}, {0x7a,0x007a}, {0x7b,0x007b}, {0x7c,0x007c}, {0x7d,0x007d}, {0x7e,0x007e}, {0xa0,0x00a0}, {0xa2,0x00a2}, {0xa3,0x00a3}, {0xa4,0x00a4}, {0xa5,0x00a5}, {0xa6,0x00a6}, {0xa7,0x00a7}, {0xa8,0x00a8}, {0xa9,0x00a9}, {0xaa,0x00d7}, {0xab,0x00ab}, {0xac,0x00ac}, {0xad,0x00ad}, {0xae,0x00ae}, {0xaf,0x203e}, {0xb0,0x00b0}, {0xb1,0x00b1}, {0xb2,0x00b2}, {0xb3,0x00b3}, {0xb4,0x00b4}, {0xb5,0x00b5}, {0xb6,0x00b6}, {0xb7,0x00b7}, {0xb8,0x00b8}, {0xb9,0x00b9}, {0xba,0x00f7}, {0xbb,0x00bb}, {0xbc,0x00bc}, {0xbd,0x00bd}, {0xbe,0x00be}, {0xdf,0x2017}, {0xe0,0x05d0}, {0xe1,0x05d1}, {0xe2,0x05d2}, {0xe3,0x05d3}, {0xe4,0x05d4}, {0xe5,0x05d5}, {0xe6,0x05d6}, {0xe7,0x05d7}, {0xe8,0x05d8}, {0xe9,0x05d9}, {0xea,0x05da}, {0xeb,0x05db}, {0xec,0x05dc}, {0xed,0x05dd}, {0xee,0x05de}, {0xef,0x05df}, {0xf0,0x05e0}, {0xf1,0x05e1}, {0xf2,0x05e2}, {0xf3,0x05e3}, {0xf4,0x05e4}, {0xf5,0x05e5}, {0xf6,0x05e6}, {0xf7,0x05e7}, {0xf8,0x05e8}, {0xf9,0x05e9}, {0xfa,0x05ea}, }; @implementation CWISO8859_8 - (id) init { return [super initWithCodeCharTable: code_table length: sizeof(code_table)/sizeof(code_table[0])]; } - (NSString *) name { return @"iso-8859-8"; } @end pantomime1.2-1.2.2+dfsg1/Framework/Pantomime/CWISO8859_9.h000066400000000000000000000020151276751561200224510ustar00rootroot00000000000000/* ** CWISO8859_9.h ** ** Copyright (c) 2001-2004 ** ** Author: Ludovic Marcotte ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** You should have received a copy of the GNU Lesser General Public ** License along with this library; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef _Pantomime_H_CWISO8859_9 #define _Pantomime_H_CWISO8859_9 #include @interface CWISO8859_9 : CWCharset @end #endif // _Pantomime_H_CWISO8859_9 pantomime1.2-1.2.2+dfsg1/Framework/Pantomime/CWISO8859_9.m000066400000000000000000000061621276751561200224650ustar00rootroot00000000000000#include static struct charset_code code_table[]={ {0x20,0x0020}, {0x21,0x0021}, {0x22,0x0022}, {0x23,0x0023}, {0x24,0x0024}, {0x25,0x0025}, {0x26,0x0026}, {0x27,0x0027}, {0x28,0x0028}, {0x29,0x0029}, {0x2a,0x002a}, {0x2b,0x002b}, {0x2c,0x002c}, {0x2d,0x002d}, {0x2e,0x002e}, {0x2f,0x002f}, {0x30,0x0030}, {0x31,0x0031}, {0x32,0x0032}, {0x33,0x0033}, {0x34,0x0034}, {0x35,0x0035}, {0x36,0x0036}, {0x37,0x0037}, {0x38,0x0038}, {0x39,0x0039}, {0x3a,0x003a}, {0x3b,0x003b}, {0x3c,0x003c}, {0x3d,0x003d}, {0x3e,0x003e}, {0x3f,0x003f}, {0x40,0x0040}, {0x41,0x0041}, {0x42,0x0042}, {0x43,0x0043}, {0x44,0x0044}, {0x45,0x0045}, {0x46,0x0046}, {0x47,0x0047}, {0x48,0x0048}, {0x49,0x0049}, {0x4a,0x004a}, {0x4b,0x004b}, {0x4c,0x004c}, {0x4d,0x004d}, {0x4e,0x004e}, {0x4f,0x004f}, {0x50,0x0050}, {0x51,0x0051}, {0x52,0x0052}, {0x53,0x0053}, {0x54,0x0054}, {0x55,0x0055}, {0x56,0x0056}, {0x57,0x0057}, {0x58,0x0058}, {0x59,0x0059}, {0x5a,0x005a}, {0x5b,0x005b}, {0x5c,0x005c}, {0x5d,0x005d}, {0x5e,0x005e}, {0x5f,0x005f}, {0x60,0x0060}, {0x61,0x0061}, {0x62,0x0062}, {0x63,0x0063}, {0x64,0x0064}, {0x65,0x0065}, {0x66,0x0066}, {0x67,0x0067}, {0x68,0x0068}, {0x69,0x0069}, {0x6a,0x006a}, {0x6b,0x006b}, {0x6c,0x006c}, {0x6d,0x006d}, {0x6e,0x006e}, {0x6f,0x006f}, {0x70,0x0070}, {0x71,0x0071}, {0x72,0x0072}, {0x73,0x0073}, {0x74,0x0074}, {0x75,0x0075}, {0x76,0x0076}, {0x77,0x0077}, {0x78,0x0078}, {0x79,0x0079}, {0x7a,0x007a}, {0x7b,0x007b}, {0x7c,0x007c}, {0x7d,0x007d}, {0x7e,0x007e}, {0xa0,0x00a0}, {0xa1,0x00a1}, {0xa2,0x00a2}, {0xa3,0x00a3}, {0xa4,0x00a4}, {0xa5,0x00a5}, {0xa6,0x00a6}, {0xa7,0x00a7}, {0xa8,0x00a8}, {0xa9,0x00a9}, {0xaa,0x00aa}, {0xab,0x00ab}, {0xac,0x00ac}, {0xad,0x00ad}, {0xae,0x00ae}, {0xaf,0x00af}, {0xb0,0x00b0}, {0xb1,0x00b1}, {0xb2,0x00b2}, {0xb3,0x00b3}, {0xb4,0x00b4}, {0xb5,0x00b5}, {0xb6,0x00b6}, {0xb7,0x00b7}, {0xb8,0x00b8}, {0xb9,0x00b9}, {0xba,0x00ba}, {0xbb,0x00bb}, {0xbc,0x00bc}, {0xbd,0x00bd}, {0xbe,0x00be}, {0xbf,0x00bf}, {0xc0,0x00c0}, {0xc1,0x00c1}, {0xc2,0x00c2}, {0xc3,0x00c3}, {0xc4,0x00c4}, {0xc5,0x00c5}, {0xc6,0x00c6}, {0xc7,0x00c7}, {0xc8,0x00c8}, {0xc9,0x00c9}, {0xca,0x00ca}, {0xcb,0x00cb}, {0xcc,0x00cc}, {0xcd,0x00cd}, {0xce,0x00ce}, {0xcf,0x00cf}, {0xd0,0x011e}, {0xd1,0x00d1}, {0xd2,0x00d2}, {0xd3,0x00d3}, {0xd4,0x00d4}, {0xd5,0x00d5}, {0xd6,0x00d6}, {0xd7,0x00d7}, {0xd8,0x00d8}, {0xd9,0x00d9}, {0xda,0x00da}, {0xdb,0x00db}, {0xdc,0x00dc}, {0xdd,0x0130}, {0xde,0x015e}, {0xdf,0x00df}, {0xe0,0x00e0}, {0xe1,0x00e1}, {0xe2,0x00e2}, {0xe3,0x00e3}, {0xe4,0x00e4}, {0xe5,0x00e5}, {0xe6,0x00e6}, {0xe7,0x00e7}, {0xe8,0x00e8}, {0xe9,0x00e9}, {0xea,0x00ea}, {0xeb,0x00eb}, {0xec,0x00ec}, {0xed,0x00ed}, {0xee,0x00ee}, {0xef,0x00ef}, {0xf0,0x011f}, {0xf1,0x00f1}, {0xf2,0x00f2}, {0xf3,0x00f3}, {0xf4,0x00f4}, {0xf5,0x00f5}, {0xf6,0x00f6}, {0xf7,0x00f7}, {0xf8,0x00f8}, {0xf9,0x00f9}, {0xfa,0x00fa}, {0xfb,0x00fb}, {0xfc,0x00fc}, {0xfd,0x0131}, {0xfe,0x015f}, {0xff,0x00ff}, }; @implementation CWISO8859_9 - (id) init { return [super initWithCodeCharTable: code_table length: sizeof(code_table)/sizeof(code_table[0])]; } - (NSString *) name { return @"iso-8859-9"; } @end pantomime1.2-1.2.2+dfsg1/Framework/Pantomime/CWInternetAddress.h000066400000000000000000000136571276751561200243450ustar00rootroot00000000000000/* ** CWInternetAddress.h ** ** Copyright (c) 2001-2007 ** ** Author: Ludovic Marcotte ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** You should have received a copy of the GNU Lesser General Public ** License along with this library; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef _Pantomime_H_CWInternetAddress #define _Pantomime_H_CWInternetAddress #import #import #import #import #include /*! @class CWInternetAddress @abstract Class that wraps support around email addresses. @discussion This class is used to decode an email address, as described in RFC2821, and to hold the information with regard to it. */ @interface CWInternetAddress : NSObject { @private PantomimeRecipientType _type; NSString *_address; NSString *_personal; // Needed for scripting. id _container; } /*! @method initWithString: @discussion This method initializes a CWInternetAddress instance using theString and decodes from it the personal and address parts of an Internet address. @param theString The string from which to decode the information. If nil is passed, the instance is autoreleased and nil will be returned. @result The CWInternetAddress instance, nil on error. */ - (id) initWithString: (NSString *) theString; /*! @method initWithPersonal: address: @discussion This method is used to initialize a CWInternetAddress instance using the specified personal and address part of an Internet address. @param thePersonal The personal part of the Internet address. @param theAddress The address part of the Internet address. @result The CWInternetAddress instance, nil on error. */ - (id) initWithPersonal: (NSString *) thePersonal address: (NSString *) theAddress; /*! @method address @discussion This method is used to obtain the address part of the receiver. @result The address part, as a NSString instance. */ - (NSString *) address; /*! @method setAddress: @discussion This method is used to set the address part of the receiver, replacing the previous value, if any. @param theAddress The new address part. */ - (void) setAddress: (NSString *) theAddress; /*! @method personal @discussion This method is used to obtain the personal part of the receiver. The personal part is generally the name of a person, like John Doe. @result The personal part, as a NSString instance. */ - (NSString *) personal; /*! @method setPersonal: @discussion This method is used to set the personal part of the receiver, replacing the previous value, if any. The personal part is generally the name of a person, like John Doe. @param thePersonal The new personal part. */ - (void) setPersonal: (NSString *) thePersonal; /*! @method type @discussion This method is used to obtain the type of the receiver. Values can be one of the PantomimeRecipientType enum. @result The type. */ - (PantomimeRecipientType) type; /*! @method setType: @discussion This method is used to set the receiver's type. The accepted values are the one of the PantomimeRecipientType enum. @param theType The new type, which replaces the previous value. */ - (void) setType: (PantomimeRecipientType) theType; /*! @method stringValue @discussion This method is used to return the receiver's personal and address parts in a correctly (ie., RFC2821 safe) formatted way. No encoding (ie., using quoted-printable) will be performed on the receiver's personal part). @result The formatted object. */ - (NSString *) stringValue; /*! @method dataValue @discussion This method is used to return the receiver's personal and address parts in a correctly (ie., RFC2821 safe) formatted way. Encoding (ie., using quoted-printable) will be performed on the receiver's personal part). @result The formatted object. */ - (NSData *) dataValue; /*! @method compare: @discussion This method is used to compare anAddress with the receiver (using -stringValue). @result The NSComparisonResult value. */ - (NSComparisonResult) compare: (id) theAddress; /*! @method isEqualToAddress: @discussion This method is used to compare anAddress with the receiver's address only. @result A boolean value */ - (BOOL) isEqualToAddress: (CWInternetAddress *) theAddress; /*! @method container @discussion This method is used to get the container for scripting. @result The container. */ - (id) container; /*! @method setContainer: @discussion This method is used to set the container for scripting. @param theContainer The container for scripting. */ - (void) setContainer: (id) theContainer; @end /*! @class ToRecipient @discussion This class is used to ease scripting in Pantomime. */ @interface ToRecipient: CWInternetAddress @end /*! @class CcRecipient @discussion This class is used to ease scripting in Pantomime. */ @interface CcRecipient: CWInternetAddress @end /*! @class BccRecipient @discussion This class is used to ease scripting in Pantomime. */ @interface BccRecipient: CWInternetAddress @end #endif // _Pantomime_H_CWInternetAddress pantomime1.2-1.2.2+dfsg1/Framework/Pantomime/CWInternetAddress.m000066400000000000000000000150201276751561200243340ustar00rootroot00000000000000/* ** CWInternetAddress.m ** ** Copyright (c) 2001-2007 ** ** Author: Ludovic Marcotte ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** You should have received a copy of the GNU Lesser General Public ** License along with this library; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include #include #include #include //#include #import // // // @implementation CWInternetAddress : NSObject - (id) initWithString: (NSString *) theString { int a, b; self = [super init]; if (!theString) { AUTORELEASE(self); return nil; } // Some potential addresses: // // Ludovic Marcotte // ludovic@Sophos.ca // // "Marcotte, Ludovic" // "Joe" User // #warning also support "joe@acme.com (Joe User)" a = [theString indexOfCharacter: '<']; if (a >= 0) { b = [theString indexOfCharacter: '>' fromIndex: a+1]; // If the trailing '>' is missing, then just take the rest of the string if (b < 0) { b = [theString length]; } [self setAddress: [theString substringWithRange: NSMakeRange(a+1,b-a-1)]]; if (a > 0) { int c, d; c = [theString indexOfCharacter: '"']; if (c >= 0) { d = [theString indexOfCharacter: '"' fromIndex: c+1]; // // We make sure we check this. We could get something like: // Joe" User // if (d > c) { BOOL b; b = YES; // // Check if between d and a there is only whitespace, this covers // cases like: "Joe" User " // if (d < a) { unichar buf[[theString length]]; unsigned idx; [theString getCharacters: buf range: NSMakeRange(d+1, a-d)]; idx = 0; while (b && idx < a-d) { b = isspace(buf[idx]); idx++; } } if (b) { [self setPersonal: [theString substringWithRange: NSMakeRange(c+1,d-c-1)]]; } else { [self setPersonal: [[theString substringWithRange: NSMakeRange(0,a)] stringByTrimmingWhiteSpaces]]; } } } else { [self setPersonal: [[theString substringWithRange: NSMakeRange(0,a)] stringByTrimmingWhiteSpaces]]; } } } else { [self setAddress: theString]; } return self; } // // // - (id) initWithPersonal: (NSString *) thePersonal address: (NSString *) theAddress { self = [super init]; [self setPersonal: thePersonal]; [self setAddress: theAddress]; return self; } // // // - (void) dealloc { RELEASE(_address); RELEASE(_personal); [super dealloc]; } // // NSCoding protocol // - (void) encodeWithCoder: (NSCoder *) theCoder { [theCoder encodeObject: [NSNumber numberWithInt: _type]]; [theCoder encodeObject: _address]; [theCoder encodeObject: [self personal]]; } - (id) initWithCoder: (NSCoder *) theCoder { self = [super init]; [self setType: [[theCoder decodeObject] intValue]]; [self setAddress: [theCoder decodeObject]]; [self setPersonal: [theCoder decodeObject]]; return self; } // // // - (NSString *) address { return _address; } - (void) setAddress: (NSString *) theAddress { ASSIGN(_address, theAddress); } // // // - (NSString *) personal { return _personal; } - (void) setPersonal: (NSString *) thePersonal { // We verify if we need to quote the name if ([thePersonal indexOfCharacter: ','] > 0 && ![thePersonal hasPrefix: @"\""] && ![thePersonal hasSuffix: @"\""]) { thePersonal = [NSString stringWithFormat: @"\"%@\"", thePersonal]; } ASSIGN(_personal, thePersonal); } // // // - (PantomimeRecipientType) type { return _type; } - (void) setType: (PantomimeRecipientType) theType { _type = theType; } // // // - (NSData *) dataValue { if ([self personal] && [[self personal] length] > 0) { NSMutableData *aMutableData; aMutableData = [[NSMutableData alloc] init]; [aMutableData appendData: [CWMIMEUtility encodeWordUsingQuotedPrintable: [self personal] prefixLength: 0]]; if (_address) { [aMutableData appendBytes: " <" length: 2]; [aMutableData appendData: [_address dataUsingEncoding: NSASCIIStringEncoding]]; [aMutableData appendBytes: ">" length: 1]; } return AUTORELEASE(aMutableData); } else { return [_address dataUsingEncoding: NSASCIIStringEncoding]; } } // // // - (NSString *) stringValue { if ([self personal] && [[self personal] length] > 0) { if (_address) { return [NSString stringWithFormat: @"%@ <%@>", [self personal], _address]; } else { return [NSString stringWithFormat: @"%@", [self personal]]; } } else { return _address; } } // // // - (NSComparisonResult) compare: (id) theAddress { return [[self stringValue] compare: [(NSObject *)theAddress valueForKey: @"stringValue"]]; } // // // - (BOOL) isEqualToAddress: (CWInternetAddress *) theAddress { if (![theAddress isMemberOfClass: [self class]]) { return NO; } return [_address isEqualToString: [theAddress address]]; } // // For debugging support // - (NSString *) description { return [self stringValue]; } // // For scripting support // - (id) container { return _container; } - (void) setContainer: (id) theContainer { _container = theContainer; } @end // // For scripting support // @implementation ToRecipient - (id) init { self = [super init]; [self setType: PantomimeToRecipient]; return self; } @end // // For scripting support // @implementation CcRecipient - (id) init { self = [super init]; [self setType: PantomimeCcRecipient]; return self; } @end // // For scripting support // @implementation BccRecipient - (id) init { self = [super init]; [self setType: PantomimeBccRecipient]; return self; } @end pantomime1.2-1.2.2+dfsg1/Framework/Pantomime/CWKOI8_R.h000066400000000000000000000017761276751561200222410ustar00rootroot00000000000000/* ** CWKOI8_R.h ** ** Copyright (c) 2001-2004 ** ** Author: Ludovic Marcotte ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** You should have received a copy of the GNU Lesser General Public ** License along with this library; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef _Pantomime_H_CWKOI8_R #define _Pantomime_H_CWKOI8_R #include @interface CWKOI8_R : CWCharset @end #endif // _Pantomime_H_CWKOI8_R pantomime1.2-1.2.2+dfsg1/Framework/Pantomime/CWKOI8_R.m000066400000000000000000000071351276751561200222410ustar00rootroot00000000000000#include static struct charset_code code_table[]={ {0x20,0x0020}, {0x21,0x0021}, {0x22,0x0022}, {0x23,0x0023}, {0x24,0x0024}, {0x25,0x0025}, {0x26,0x0026}, {0x27,0x0027}, {0x28,0x0028}, {0x29,0x0029}, {0x2a,0x002a}, {0x2b,0x002b}, {0x2c,0x002c}, {0x2d,0x002d}, {0x2e,0x002e}, {0x2f,0x002f}, {0x30,0x0030}, {0x31,0x0031}, {0x32,0x0032}, {0x33,0x0033}, {0x34,0x0034}, {0x35,0x0035}, {0x36,0x0036}, {0x37,0x0037}, {0x38,0x0038}, {0x39,0x0039}, {0x3a,0x003a}, {0x3b,0x003b}, {0x3c,0x003c}, {0x3d,0x003d}, {0x3e,0x003e}, {0x3f,0x003f}, {0x40,0x0040}, {0x41,0x0041}, {0x42,0x0042}, {0x43,0x0043}, {0x44,0x0044}, {0x45,0x0045}, {0x46,0x0046}, {0x47,0x0047}, {0x48,0x0048}, {0x49,0x0049}, {0x4a,0x004a}, {0x4b,0x004b}, {0x4c,0x004c}, {0x4d,0x004d}, {0x4e,0x004e}, {0x4f,0x004f}, {0x50,0x0050}, {0x51,0x0051}, {0x52,0x0052}, {0x53,0x0053}, {0x54,0x0054}, {0x55,0x0055}, {0x56,0x0056}, {0x57,0x0057}, {0x58,0x0058}, {0x59,0x0059}, {0x5a,0x005a}, {0x5b,0x005b}, {0x5c,0x005c}, {0x5d,0x005d}, {0x5e,0x005e}, {0x5f,0x005f}, {0x60,0x0060}, {0x61,0x0061}, {0x62,0x0062}, {0x63,0x0063}, {0x64,0x0064}, {0x65,0x0065}, {0x66,0x0066}, {0x67,0x0067}, {0x68,0x0068}, {0x69,0x0069}, {0x6a,0x006a}, {0x6b,0x006b}, {0x6c,0x006c}, {0x6d,0x006d}, {0x6e,0x006e}, {0x6f,0x006f}, {0x70,0x0070}, {0x71,0x0071}, {0x72,0x0072}, {0x73,0x0073}, {0x74,0x0074}, {0x75,0x0075}, {0x76,0x0076}, {0x77,0x0077}, {0x78,0x0078}, {0x79,0x0079}, {0x7a,0x007a}, {0x7b,0x007b}, {0x7c,0x007c}, {0x7d,0x007d}, {0x7e,0x007e}, {0x7f,0x007f}, {0x80,0x2500}, {0x81,0x2502}, {0x82,0x250c}, {0x83,0x2510}, {0x84,0x2514}, {0x85,0x2518}, {0x86,0x251c}, {0x87,0x2524}, {0x88,0x252c}, {0x89,0x2534}, {0x8a,0x253c}, {0x8b,0x2580}, {0x8c,0x2584}, {0x8d,0x2588}, {0x8e,0x258c}, {0x8f,0x2590}, {0x90,0x2591}, {0x91,0x2592}, {0x92,0x2593}, {0x93,0x2320}, {0x94,0x25a0}, {0x95,0x2219}, {0x96,0x221a}, {0x97,0x2248}, {0x98,0x2264}, {0x99,0x2265}, {0x9a,0x00a0}, {0x9b,0x2321}, {0x9c,0x00b0}, {0x9d,0x00b2}, {0x9e,0x00b7}, {0x9f,0x00f7}, {0xa0,0x2550}, {0xa1,0x2551}, {0xa2,0x2552}, {0xa3,0x0451}, {0xa4,0x2553}, {0xa5,0x2554}, {0xa6,0x2555}, {0xa7,0x2556}, {0xa8,0x2557}, {0xa9,0x2558}, {0xaa,0x2559}, {0xab,0x255a}, {0xac,0x255b}, {0xad,0x255c}, {0xae,0x255d}, {0xaf,0x255e}, {0xb0,0x255f}, {0xb1,0x2560}, {0xb2,0x2561}, {0xb3,0x0401}, {0xb4,0x2562}, {0xb5,0x2563}, {0xb6,0x2564}, {0xb7,0x2565}, {0xb8,0x2566}, {0xb9,0x2567}, {0xba,0x2568}, {0xbb,0x2569}, {0xbc,0x256a}, {0xbd,0x256b}, {0xbe,0x256c}, {0xbf,0x00a9}, {0xc0,0x044e}, {0xc1,0x0430}, {0xc2,0x0431}, {0xc3,0x0446}, {0xc4,0x0434}, {0xc5,0x0435}, {0xc6,0x0444}, {0xc7,0x0433}, {0xc8,0x0445}, {0xc9,0x0438}, {0xca,0x0439}, {0xcb,0x043a}, {0xcc,0x043b}, {0xcd,0x043c}, {0xce,0x043d}, {0xcf,0x043e}, {0xd0,0x043f}, {0xd1,0x044f}, {0xd2,0x0440}, {0xd3,0x0441}, {0xd4,0x0442}, {0xd5,0x0443}, {0xd6,0x0436}, {0xd7,0x0432}, {0xd8,0x044c}, {0xd9,0x044b}, {0xda,0x0437}, {0xdb,0x0448}, {0xdc,0x044d}, {0xdd,0x0449}, {0xde,0x0447}, {0xdf,0x044a}, {0xe0,0x042e}, {0xe1,0x0410}, {0xe2,0x0411}, {0xe3,0x0426}, {0xe4,0x0414}, {0xe5,0x0415}, {0xe6,0x0424}, {0xe7,0x0413}, {0xe8,0x0425}, {0xe9,0x0418}, {0xea,0x0419}, {0xeb,0x041a}, {0xec,0x041b}, {0xed,0x041c}, {0xee,0x041d}, {0xef,0x041e}, {0xf0,0x041f}, {0xf1,0x042f}, {0xf2,0x0420}, {0xf3,0x0421}, {0xf4,0x0422}, {0xf5,0x0423}, {0xf6,0x0416}, {0xf7,0x0412}, {0xf8,0x042c}, {0xf9,0x042b}, {0xfa,0x0417}, {0xfb,0x0428}, {0xfc,0x042d}, {0xfd,0x0429}, {0xfe,0x0427}, {0xff,0x042a}, }; @implementation CWKOI8_R - (id) init { return [super initWithCodeCharTable: code_table length: sizeof(code_table)/sizeof(code_table[0])]; } - (NSString *) name { return @"koi8-r"; } @end pantomime1.2-1.2.2+dfsg1/Framework/Pantomime/CWKOI8_U.h000066400000000000000000000017761276751561200222440ustar00rootroot00000000000000/* ** CWKOI8_U.h ** ** Copyright (c) 2001-2004 ** ** Author: Ludovic Marcotte ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** You should have received a copy of the GNU Lesser General Public ** License along with this library; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef _Pantomime_H_CWKOI8_U #define _Pantomime_H_CWKOI8_U #include @interface CWKOI8_U : CWCharset @end #endif // _Pantomime_H_CWKOI8_U pantomime1.2-1.2.2+dfsg1/Framework/Pantomime/CWKOI8_U.m000066400000000000000000000071351276751561200222440ustar00rootroot00000000000000#include static struct charset_code code_table[]={ {0x20,0x0020}, {0x21,0x0021}, {0x22,0x0022}, {0x23,0x0023}, {0x24,0x0024}, {0x25,0x0025}, {0x26,0x0026}, {0x27,0x0027}, {0x28,0x0028}, {0x29,0x0029}, {0x2a,0x002a}, {0x2b,0x002b}, {0x2c,0x002c}, {0x2d,0x002d}, {0x2e,0x002e}, {0x2f,0x002f}, {0x30,0x0030}, {0x31,0x0031}, {0x32,0x0032}, {0x33,0x0033}, {0x34,0x0034}, {0x35,0x0035}, {0x36,0x0036}, {0x37,0x0037}, {0x38,0x0038}, {0x39,0x0039}, {0x3a,0x003a}, {0x3b,0x003b}, {0x3c,0x003c}, {0x3d,0x003d}, {0x3e,0x003e}, {0x3f,0x003f}, {0x40,0x0040}, {0x41,0x0041}, {0x42,0x0042}, {0x43,0x0043}, {0x44,0x0044}, {0x45,0x0045}, {0x46,0x0046}, {0x47,0x0047}, {0x48,0x0048}, {0x49,0x0049}, {0x4a,0x004a}, {0x4b,0x004b}, {0x4c,0x004c}, {0x4d,0x004d}, {0x4e,0x004e}, {0x4f,0x004f}, {0x50,0x0050}, {0x51,0x0051}, {0x52,0x0052}, {0x53,0x0053}, {0x54,0x0054}, {0x55,0x0055}, {0x56,0x0056}, {0x57,0x0057}, {0x58,0x0058}, {0x59,0x0059}, {0x5a,0x005a}, {0x5b,0x005b}, {0x5c,0x005c}, {0x5d,0x005d}, {0x5e,0x005e}, {0x5f,0x005f}, {0x60,0x0060}, {0x61,0x0061}, {0x62,0x0062}, {0x63,0x0063}, {0x64,0x0064}, {0x65,0x0065}, {0x66,0x0066}, {0x67,0x0067}, {0x68,0x0068}, {0x69,0x0069}, {0x6a,0x006a}, {0x6b,0x006b}, {0x6c,0x006c}, {0x6d,0x006d}, {0x6e,0x006e}, {0x6f,0x006f}, {0x70,0x0070}, {0x71,0x0071}, {0x72,0x0072}, {0x73,0x0073}, {0x74,0x0074}, {0x75,0x0075}, {0x76,0x0076}, {0x77,0x0077}, {0x78,0x0078}, {0x79,0x0079}, {0x7a,0x007a}, {0x7b,0x007b}, {0x7c,0x007c}, {0x7d,0x007d}, {0x7e,0x007e}, {0x7f,0x007f}, {0x80,0x2500}, {0x81,0x2502}, {0x82,0x250c}, {0x83,0x2510}, {0x84,0x2514}, {0x85,0x2518}, {0x86,0x251c}, {0x87,0x2524}, {0x88,0x252c}, {0x89,0x2534}, {0x8a,0x253c}, {0x8b,0x2580}, {0x8c,0x2584}, {0x8d,0x2588}, {0x8e,0x258c}, {0x8f,0x2590}, {0x90,0x2591}, {0x91,0x2592}, {0x92,0x2593}, {0x93,0x2320}, {0x94,0x25a0}, {0x95,0x2219}, {0x96,0x221a}, {0x97,0x2248}, {0x98,0x2264}, {0x99,0x2265}, {0x9a,0x00a0}, {0x9b,0x2321}, {0x9c,0x00b0}, {0x9d,0x00b2}, {0x9e,0x00b7}, {0x9f,0x00f7}, {0xa0,0x2550}, {0xa1,0x2551}, {0xa2,0x2552}, {0xa3,0x0451}, {0xa4,0x0454}, {0xa5,0x2554}, {0xa6,0x0456}, {0xa7,0x0457}, {0xa8,0x2557}, {0xa9,0x2558}, {0xaa,0x2559}, {0xab,0x255a}, {0xac,0x255b}, {0xad,0x0491}, {0xae,0x255d}, {0xaf,0x255e}, {0xb0,0x255f}, {0xb1,0x2560}, {0xb2,0x2561}, {0xb3,0x0401}, {0xb4,0x0404}, {0xb5,0x2563}, {0xb6,0x0406}, {0xb7,0x0407}, {0xb8,0x2566}, {0xb9,0x2567}, {0xba,0x2568}, {0xbb,0x2569}, {0xbc,0x256a}, {0xbd,0x0490}, {0xbe,0x256c}, {0xbf,0x00a9}, {0xc0,0x044e}, {0xc1,0x0430}, {0xc2,0x0431}, {0xc3,0x0446}, {0xc4,0x0434}, {0xc5,0x0435}, {0xc6,0x0444}, {0xc7,0x0433}, {0xc8,0x0445}, {0xc9,0x0438}, {0xca,0x0439}, {0xcb,0x043a}, {0xcc,0x043b}, {0xcd,0x043c}, {0xce,0x043d}, {0xcf,0x043e}, {0xd0,0x043f}, {0xd1,0x044f}, {0xd2,0x0440}, {0xd3,0x0441}, {0xd4,0x0442}, {0xd5,0x0443}, {0xd6,0x0436}, {0xd7,0x0432}, {0xd8,0x044c}, {0xd9,0x044b}, {0xda,0x0437}, {0xdb,0x0448}, {0xdc,0x044d}, {0xdd,0x0449}, {0xde,0x0447}, {0xdf,0x044a}, {0xe0,0x042e}, {0xe1,0x0410}, {0xe2,0x0411}, {0xe3,0x0426}, {0xe4,0x0414}, {0xe5,0x0415}, {0xe6,0x0424}, {0xe7,0x0413}, {0xe8,0x0425}, {0xe9,0x0418}, {0xea,0x0419}, {0xeb,0x041a}, {0xec,0x041b}, {0xed,0x041c}, {0xee,0x041d}, {0xef,0x041e}, {0xf0,0x041f}, {0xf1,0x042f}, {0xf2,0x0420}, {0xf3,0x0421}, {0xf4,0x0422}, {0xf5,0x0423}, {0xf6,0x0416}, {0xf7,0x0412}, {0xf8,0x042c}, {0xf9,0x042b}, {0xfa,0x0417}, {0xfb,0x0428}, {0xfc,0x042d}, {0xfd,0x0429}, {0xfe,0x0427}, {0xff,0x042a}, }; @implementation CWKOI8_U - (id) init { return [super initWithCodeCharTable: code_table length: sizeof(code_table)/sizeof(code_table[0])]; } - (NSString *) name { return @"koi8-u"; } @end pantomime1.2-1.2.2+dfsg1/Framework/Pantomime/CWLocalCacheManager.h000066400000000000000000000060261276751561200245100ustar00rootroot00000000000000/* ** CWLocalCacheManager.h ** ** Copyright (c) 2001-2007 ** ** Author: Ludovic Marcotte ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** You should have received a copy of the GNU Lesser General Public ** License along with this library; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef _Pantomime_H_CWLocalCacheManager #define _Pantomime_H_CWLocalCacheManager #include @class CWFolder; @class CWLocalMessage; @class NSDate; /*! @class CWLocalCacheManager @discussion This class provides trivial extensions to the CWCacheManager superclass for CWLocalFolder instances. */ @interface CWLocalCacheManager: CWCacheManager { @private NSString *_pathToFolder; CWFolder *_folder; unsigned int _modification_date; unsigned int _size; } - (void) initInRange: (NSRange) theRange; /*! @method initWithPath:folder: @discussion This is the designated initialization method for the local cache manager. @param thePath The path where the cache file is. @param theFolder The CWLocalFolder instance to be used together with the cache file. @result A CWLocalCacheManager instance, nil otherwise. */ - (id) initWithPath: (NSString *) thePath folder: (id) theFolder; /*! @method modificationDate @discussion This method is used to obtain the modification date of the receiver. That is, the last time the cache was written to disk. @result The date. */ - (NSDate *) modificationDate; /*! @method setModificationDate: @discussion This method is used to set the modification date of the receiver. Normally you should not invoke this method directly. @param theDate The new date value. */ - (void) setModificationDate: (NSDate *) theDate; /*! @method fileSize @discussion This method is used to obtain the size of the associated CWLocalFolder's mailbox. @result The size. */ - (unsigned int) fileSize; /*! @method setFileSize: @discussion This method is used to set the size of the associated LocalFolder's mailbox. Normally you should not invoke this method directly. @param theSize The new size value. */ - (void) setFileSize: (unsigned int) theSize; /*! @method writeRecord: @discussion This method is used to write a cache record to disk. @param theRecord The record to write. */ - (void) writeRecord: (cache_record *) theRecord; @end #endif // _Pantomime_H_LocalCacheManager pantomime1.2-1.2.2+dfsg1/Framework/Pantomime/CWLocalCacheManager.m000066400000000000000000000467331276751561200245260ustar00rootroot00000000000000/* ** CWLocalCacheManager.m ** ** Copyright (c) 2001-2007 ** ** Author: Ludovic Marcotte ** Riccardo Mottola ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** You should have received a copy of the GNU Lesser General Public ** License along with this library; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #import #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include // For open() and friends. #include #include #include #include // For lseek() #include // For ntohl() static unsigned short version = 1; // // Cache structure: // // Start length Description // // 0 2 Cache version // 2 4 Number of cache entries // 6 4 Modification date of the underlying mbox file // Modification of the underlying cur/ directory for maildir // [10] 4 File size of the underlying mbox file. This entry does NOT exist for maildir cache. // 14+/10+ Beginning of the first cache entry // // 0 4 Record length, including this field. The record consist of cached message headers / attributes. // 4 4 Flags // 8 4 Date // 12 4+ Position for mbox / Filename for maildir // 16+ 4 Size // // @implementation CWLocalCacheManager // // // - (id) initWithPath: (NSString *) thePath folder: (id) theFolder { NSDictionary *attributes; unsigned int d, s, c; unsigned short int v; BOOL broken; self = [super initWithPath: thePath]; // We get the attributes of the mailbox if ([theFolder type] == PantomimeFormatMbox) { attributes = [[NSFileManager defaultManager] fileAttributesAtPath: [theFolder path] traverseLink: NO]; } else { attributes = [[NSFileManager defaultManager] fileAttributesAtPath: [NSString stringWithFormat: @"%@/cur", [theFolder path]] traverseLink: NO]; } d = [[attributes objectForKey: NSFileModificationDate] timeIntervalSince1970]; s = [[attributes objectForKey: NSFileSize] intValue]; broken = NO; // We get the attribtes of the cache attributes = [[NSFileManager defaultManager] fileAttributesAtPath: thePath traverseLink: NO]; _folder = theFolder; _count = _modification_date = 0; if ((_fd = open([thePath UTF8String], O_RDWR|O_CREAT, S_IRUSR|S_IWUSR)) < 0) { AUTORELEASE(self); return nil; } if (lseek(_fd, 0L, SEEK_SET) < 0) { AUTORELEASE(self); return nil; } // If the cache exists, lets parse it. if ([[attributes objectForKey: NSFileSize] intValue]) { unsigned int i; v = read_unsigned_short(_fd); // HACK: We IGNORE all the previous cache. if (v != version) { //NSLog(@"Ignoring the old cache format."); if (ftruncate(_fd, 0) == -1) { if (errno == EACCES || errno == EROFS) NSLog(@"UNABLE TO TRUNCATE CACHE FILE WITH OLD VERSION, NOT WRITABLE"); else NSLog(@"UNABLE TO TRUNCATE CACHE FILE WITH OLD VERSION"); close(_fd); abort(); } [self synchronize]; return self; } _count = read_unsigned_int(_fd); _modification_date = read_unsigned_int(_fd); if ([(CWLocalFolder *)_folder type] == PantomimeFormatMbox) { _size = read_unsigned_int(_fd); if (s != _size || d != _modification_date) broken = YES; } else { //NSLog(@"Asking enumerator..."); c = [[[[NSFileManager defaultManager] enumeratorAtPath: [NSString stringWithFormat: @"%@/cur/", [theFolder path]]] allObjects] count]; //NSLog(@"Done! count = %d", c); if (c != _count || d != _modification_date) broken = YES; } if (broken) { //NSLog(@"Broken cache, we must invalidate."); _count = _size = 0; if (ftruncate(_fd, 0) == -1) { if (errno == EACCES || errno == EROFS) NSLog(@"UNABLE TO TRUNCATE BROKEN CACHE FILE, NOT WRITABLE"); else NSLog(@"UNABLE TO TRUNCATE BROKEN CACHE FILE"); close(_fd); abort(); } [self synchronize]; return self; } //NSLog(@"Version = %i date = %d size = %d count = %d", v, d, _size, _count); for (i = 0; i < _count; i++) { [((CWFolder *)_folder)->allMessages addObject: AUTORELEASE([[CWLocalMessage alloc] init])]; } } else { [self synchronize]; } return self; } // // // - (void) dealloc { //NSLog(@"CWLocalCacheManager: -dealloc"); if (_fd >= 0) close(_fd); [super dealloc]; } // // If this method is invoked on already initialized messages, we use // the file position or filename field in order to determine if we already // initialized or not the message. // - (void) initInRange: (NSRange) theRange { CWLocalMessage *aMessage; CWFlags *theFlags; unsigned short int len, tot; unsigned char *r, *s; int begin, end, i; BOOL b; begin = theRange.location; end = (NSMaxRange(theRange) <= _count ? NSMaxRange(theRange) : _count); if (lseek(_fd, ([(CWLocalFolder *)_folder type] == PantomimeFormatMbox) ? 14L : 10L, SEEK_SET) < 0) { NSLog(@"lseek failed in initInRange:"); abort(); } //NSLog(@"init from %d to %d, count = %d, size of char %d", begin, end, _count, sizeof(char)); s = (unsigned char *)malloc(65536); // We MUST skip the last few bytes... for (i = begin; i < end ; i++) { // aMessage = [[CWLocalMessage alloc] init]; aMessage = [((CWFolder *)_folder)->allMessages objectAtIndex: i]; [aMessage setFolder: _folder]; [aMessage setMessageNumber: i+1]; b = NO; // With read: 1.157 // With read+malloc+free: 1.201 // Without read, malloc, free + in-memory parsing: .847 // Inline: .892 (not worth it) // With 'static' buffer: .839 (not worth it) // We parse the record length, date, flags, position in file and the size. len = read_unsigned_int(_fd); r = (unsigned char *)malloc(len-4); if (read(_fd, r, len-4) < 0) { NSLog(@"read failed"); abort(); } theFlags = AUTORELEASE([[CWFlags alloc] initWithFlags: read_unsigned_int_memory(r)]); [aMessage setReceivedDate: [NSCalendarDate dateWithTimeIntervalSince1970: read_unsigned_int_memory(r+4)]]; if ([(CWLocalFolder *)_folder type] == PantomimeFormatMbox) { if ([aMessage filePosition] == 0) { [aMessage setFilePosition: read_unsigned_int_memory(r+8)]; [aMessage setSize: read_unsigned_int_memory(r+12)]; b = YES; } tot = 16; } else { read_string_memory(r+8, s, &len); if (![aMessage filename]) { [aMessage setMailFilename: [NSString stringWithUTF8String: (const char *)s]]; [aMessage setSize: read_unsigned_int_memory(r+len+10)]; b = YES; } tot = len+14; } if (!b) { free(r); continue; } // We set the flags, only if we need to as they might have // changed since the last time this method was called. [aMessage setFlags: theFlags]; // .209ms read_string_memory(r+tot, s, &len); [CWParser parseFrom: [NSData dataWithBytes: s length: len] inMessage: aMessage quick: YES]; tot += len+2; // .462ms (+253ms), .217ms read_string_memory(r+tot, s, &len); [CWParser parseInReplyTo: [NSData dataWithBytes: s length: len] inMessage: aMessage quick: YES]; tot += len+2; // .468ms (+4ms) read_string_memory(r+tot, s, &len); [CWParser parseMessageID: [NSData dataWithBytes: s length: len] inMessage: aMessage quick: YES]; tot += len+2; // .560ms (+92ms) read_string_memory(r+tot, s, &len); [CWParser parseReferences: [NSData dataWithBytes: s length: len] inMessage: aMessage quick: YES]; tot += len+2; // .731ms (+171ms), .135ms read_string_memory(r+tot, s, &len); [CWParser parseSubject: [NSData dataWithBytes: s length: len] inMessage: aMessage quick: YES]; tot += len+2; // .823ms (+92ms), .80ms read_string_memory(r+tot, s, &len); [CWParser parseDestination: [NSData dataWithBytes: s length: len] forType: PantomimeToRecipient inMessage: aMessage quick: YES]; tot += len+2; // .948ms (+125 to +163ms) read_string_memory(r+tot, s, &len); [CWParser parseDestination: [NSData dataWithBytes: s length: len] forType: PantomimeCcRecipient inMessage: aMessage quick: YES]; free(r); } free(s); } // // access/mutation methods // - (NSDate *) modificationDate { return [NSDate dateWithTimeIntervalSince1970: _modification_date]; } - (void) setModificationDate: (NSDate *) theDate { _modification_date = [theDate timeIntervalSince1970]; } // // // - (unsigned int) fileSize { return _size; } - (void) setFileSize: (unsigned int) theSize { _size = theSize; } // // // - (BOOL) synchronize { NSDictionary *attributes; CWLocalMessage *aMessage; unsigned int len, flags; int i; if ([(CWLocalFolder *)_folder type] == PantomimeFormatMbox) { attributes = [[NSFileManager defaultManager] fileAttributesAtPath: [(CWLocalFolder *)_folder path] traverseLink: NO]; } else { attributes = [[NSFileManager defaultManager] fileAttributesAtPath: [NSString stringWithFormat: @"%@/cur", [(CWLocalFolder *)_folder path]] traverseLink: NO]; } _modification_date = [[attributes objectForKey: NSFileModificationDate] timeIntervalSince1970]; _count = [_folder->allMessages count]; if (lseek(_fd, 0L, SEEK_SET) < 0) { NSLog(@"fseek failed"); } // We write our cache version, count, modification date and size. write_unsigned_short(_fd, version); write_unsigned_int(_fd, _count); write_unsigned_int(_fd, _modification_date); if ([(CWLocalFolder *)_folder type] == PantomimeFormatMbox) { _size = [[attributes objectForKey: NSFileSize] intValue]; write_unsigned_int(_fd, _size); } // We now update the message flags //NSLog(@"Synching flags for mailbox %@, count = %d", [(CWLocalFolder *)_folder path], _count); for (i = 0; i < _count; i++) { len = read_unsigned_int(_fd); //NSLog(@"len = %d", len); if ((NSNull *)(aMessage = [_folder->allMessages objectAtIndex: i]) != [NSNull null]) { flags = ((CWFlags *)[aMessage flags])->flags; write_unsigned_int(_fd, flags); lseek(_fd, (len-8), SEEK_CUR); //NSLog(@"wrote = %d", flags); } else { lseek(_fd, (len-4), SEEK_CUR); } } //NSLog(@"Done!"); return (fsync(_fd) == 0); } // // // - (NSUInteger) count { return _count; } // // // - (void) writeRecord: (cache_record *) theRecord { unsigned int len; if (lseek(_fd, 0L, SEEK_END) < 0) { NSLog(@"COULD NOT LSEEK TO END OF FILE"); abort(); } // We calculate the length of this record (including the // first five fields, which is 20 bytes long and is added // at the very end) len = 0; len += [theRecord->from length]+2; len += [theRecord->in_reply_to length]+2; len += [theRecord->message_id length]+2; len += [theRecord->references length]+2; len += [theRecord->subject length]+2; len += [theRecord->to length]+2; len += [theRecord->cc length]+2; if ([(CWLocalFolder *)_folder type] == PantomimeFormatMaildir) { len += strlen(theRecord->filename)+2; len += 16; } else { len += 20; } // We write the length of our entry write_unsigned_int(_fd, len); // We write the flags, date, position and the size of the message. write_unsigned_int(_fd, theRecord->flags); write_unsigned_int(_fd, theRecord->date); if ([(CWLocalFolder *)_folder type] == PantomimeFormatMbox) { write_unsigned_int(_fd, theRecord->position); } else { write_string(_fd, (unsigned char *)theRecord->filename, strlen(theRecord->filename)); } write_unsigned_int(_fd, theRecord->size); // We write the read of our cached headers (From, In-Reply-To, Message-ID, References, Subject and To) write_string(_fd, (unsigned char *)[theRecord->from bytes], [theRecord->from length]); write_string(_fd, (unsigned char *)[theRecord->in_reply_to bytes], [theRecord->in_reply_to length]); write_string(_fd, (unsigned char *)[theRecord->message_id bytes], [theRecord->message_id length]); write_string(_fd, (unsigned char *)[theRecord->references bytes], [theRecord->references length]); write_string(_fd, (unsigned char *)[theRecord->subject bytes], [theRecord->subject length]); write_string(_fd, (unsigned char *)[theRecord->to bytes], [theRecord->to length]); write_string(_fd, (unsigned char *)[theRecord->cc bytes], [theRecord->cc length]); _count++; } // // For mbox-based and maildir-base cache: // // This method MUST be called after writing the new mbox // on disk but BEFORE we actually removed the deleted // messages from the allMessages ivar. // // - (void) expunge { NSDictionary *attributes; CWLocalMessage *aMessage; unsigned int cache_size, flags, i, len, total_deleted, total_length, type, v; short delta; char *buf; //NSLog(@"rewriting cache"); // We get the current cache size cache_size = lseek(_fd, 0L, SEEK_END); if (lseek(_fd, ([(CWLocalFolder *)_folder type] == PantomimeFormatMbox) ? 14L : 10L, SEEK_SET) < 0) { NSLog(@"fseek failed"); abort(); } total_deleted = total_length = 0; type = [(CWLocalFolder *)_folder type]; // // We alloc a little bit more memory that we really need in // case we have to rewrite the filename for a maildir cache // and the filename length is greater than the previous one. // buf = (char *)malloc(cache_size+[_folder count]*10); _count = [_folder->allMessages count]; for (i = 0; i < _count; i++) { len = read_unsigned_int(_fd); aMessage = [_folder->allMessages objectAtIndex: i]; flags = ((CWFlags *)[aMessage flags])->flags; delta = 0; if ((flags&PantomimeDeleted) == PantomimeDeleted) { // We skip over that record lseek(_fd, len-4, SEEK_CUR); total_deleted++; //NSLog(@"Skip %d bytes, index %d!", len, i); } else { // // For mbox-based caches, we must update the file position of // our cache entries and also the size of the message in the cache. // if (type == PantomimeFormatMbox) { // We write the rest of the record into the memory if (read(_fd, (buf+total_length+4), len-4) < 0) { NSLog(@"read failed"); abort(); } // We update the position in the mailbox file by // overwriting the current value in memory v = htonl([aMessage filePosition]); memcpy((buf+total_length+12), (char *)&v, 4); //NSLog(@"Wrote file position %d", ntohl(v)); // We update the size of the message by overwriting // the current value in memory v = htonl([aMessage size]); memcpy((buf+total_length+16), (char *)&v, 4); //NSLog(@"Wrote message size %d", ntohl(v)); } // // For maildir-based caches, we must update the filename of our // cache entries in case flags were flushed to the disk. // else { unsigned short c0, c1, old_len, r; char *filename; int s_len; // We read our Flags, Date, and the first two bytes // of our filename into memory. if (read(_fd, (buf+total_length+4), 10) < 0) { NSLog(@"read failed"); abort(); } // We read the length of our previous string c0 = *(buf+total_length+12); c1 = *(buf+total_length+13); old_len = ntohs((c1<<8)|c0); //NSLog(@"Previous length = %d Filename = |%@|", old_len, [aMessage mailFilename]); filename = (char *)[[aMessage mailFilename] UTF8String]; s_len = strlen(filename); delta = s_len-old_len; //if (delta != 0) NSLog(@"i = %d delta = %d |%@| s_len = %d", i, delta, [aMessage mailFilename], s_len); // We write back our filename r = htons(s_len); memcpy((buf+total_length+12), (char *)&r, 2); memcpy((buf+total_length+14), filename, s_len); // We read the rest in our memory. We first skip or old filename string. if (lseek(_fd, old_len, SEEK_CUR) < 0) { NSLog(@"lseek failed"); abort(); } //NSLog(@"must read back into memory %d bytes", len-old_len-14); if (read(_fd, (buf+total_length+s_len+14), len-old_len-14) < 0) { NSLog(@"read failed"); abort(); } //NSLog(@"current file pos after full read %d", lseek(_fd, 0L, SEEK_CUR)); } // We write back our record length, adjusting its size if we need // to, in the case we are handling a maildir-based cache. len += delta; v = htonl(len); memcpy((buf+total_length), (char *)&v, 4); total_length += len; //NSLog(@"_size = %d total_length = %d", _size, total_length); } } if (lseek(_fd, 0L, SEEK_SET) < 0) { NSLog(@"fseek failed"); } // We write our cache version, count, modification date our new size cache_size = total_length+([(CWLocalFolder *)_folder type] == PantomimeFormatMbox ? 14 : 10); _count -= total_deleted; write_unsigned_short(_fd, version); write_unsigned_int(_fd, _count); if ([(CWLocalFolder *)_folder type] == PantomimeFormatMbox) { attributes = [[NSFileManager defaultManager] fileAttributesAtPath: [(CWLocalFolder *)_folder path] traverseLink: NO]; _modification_date = [[attributes objectForKey: NSFileModificationDate] timeIntervalSince1970]; _size = [[attributes objectForKey: NSFileSize] intValue]; write_unsigned_int(_fd, _modification_date); write_unsigned_int(_fd, _size); } else { attributes = [[NSFileManager defaultManager] fileAttributesAtPath: [NSString stringWithFormat: @"%@/cur", [(CWLocalFolder *)_folder path]] traverseLink: NO]; _modification_date = [[attributes objectForKey: NSFileModificationDate] timeIntervalSince1970]; _size = 0; write_unsigned_int(_fd, _modification_date); } // We write our memory cache if (write(_fd, buf, total_length) != total_length) { if (errno == EAGAIN) { // Perhaps we could handle this more gracefully? NSLog(@"EXPUNGE CACHE: WRITE OUT ERROR, EAGAIN"); } else { NSLog(@"EXPUNGE CACHE: WRITE OUT INCOMPLETE"); } abort(); } //ftruncate(_fd, _size); if (ftruncate(_fd, cache_size) == -1) { if (errno == EACCES || errno == EROFS) NSLog(@"UNABLE TO EXPUNGE CACHE, NOT WRITABLE"); else if (errno == EFBIG) NSLog(@"UNABLE TO EXPUNGE CACHE, EFBIG"); else NSLog(@"UNABLE TO EXPUNGE CACHE"); abort(); } free(buf); //NSLog(@"Done!"); } @end pantomime1.2-1.2.2+dfsg1/Framework/Pantomime/CWLocalFolder+maildir.h000066400000000000000000000022351276751561200250400ustar00rootroot00000000000000/* ** CWLocalFolder+maildir.h ** ** Copyright (c) 2004-2007 ** ** Author: Ludovic Marcotte ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** You should have received a copy of the GNU Lesser General Public ** License along with this library; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef _Pantomime_H_CWLocalFolder_maildir #define _Pantomime_H_CWLocalFolder_maildir #include @interface CWLocalFolder (maildir) - (void) expunge_maildir; - (void) parse_maildir: (NSString *) theDirectory all: (BOOL) theBOOL; @end #endif // _Pantomime_H_CWLocalFolder_maildir pantomime1.2-1.2.2+dfsg1/Framework/Pantomime/CWLocalFolder+maildir.m000066400000000000000000000130111276751561200250370ustar00rootroot00000000000000/* ** CWLocalFolder+maildir.m ** ** Copyright (c) 2004-2007 ** ** Author: Ludovic Marcotte ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** You should have received a copy of the GNU Lesser General Public ** License along with this library; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include #include #include #include #include #include #include #include #include // // The maildir format is well documented here: // // http://www.qmail.org/man/man5/maildir.html // http://cr.yp.to/proto/maildir.html // @implementation CWLocalFolder (maildir) - (void) expunge_maildir { NSMutableArray *aMutableArray; CWLocalMessage *aMessage; CWFlags *theFlags; int count, i, msn; aMutableArray = AUTORELEASE([[NSMutableArray alloc] init]); count = [allMessages count]; // We assume that our write operation was successful and we initialize our msn to 1 msn = 1; for (i = 0; i < count; i++) { aMessage = [allMessages objectAtIndex: i]; theFlags = [aMessage flags]; if ([theFlags contain: PantomimeDeleted]) { [[NSFileManager defaultManager] removeFileAtPath: [NSString stringWithFormat: @"%@/cur/%@", [self path], [aMessage mailFilename]] handler: nil]; [aMutableArray addObject: aMessage]; } else { // rewrite the message to account for changes in the flags NSString *uniquePattern, *newFileName; int indexOfPatternSeparator; // We update our message's ivars (folder and size don't change) [aMessage setMessageNumber: msn]; msn++; // we rename the message according to the maildir spec by appending the status information the name // name of file will be unique_pattern:info with the status flags in the info field indexOfPatternSeparator = [[aMessage mailFilename] indexOfCharacter: ':']; if (indexOfPatternSeparator > 1) { uniquePattern = [[aMessage mailFilename] substringToIndex: indexOfPatternSeparator]; } else { uniquePattern = [aMessage mailFilename]; } // We build the new file name newFileName = [NSString stringWithFormat: @"%@:%@", uniquePattern, [theFlags maildirString]]; // We rename the message file if ([[NSFileManager defaultManager] movePath: [NSString stringWithFormat: @"%@/cur/%@", [self path], [aMessage mailFilename]] toPath: [NSString stringWithFormat: @"%@/cur/%@", [self path], newFileName] handler: nil]) { [aMessage setMailFilename: newFileName]; } } } // We sync our cache if (_cacheManager) [_cacheManager expunge]; [allMessages removeObjectsInArray: aMutableArray]; #warning also return when invoking the delegate POST_NOTIFICATION(PantomimeFolderExpungeCompleted, self, nil); PERFORM_SELECTOR_2([[self store] delegate], @selector(folderExpungeCompleted:), PantomimeFolderExpungeCompleted, self, @"Folder"); } // // This parses a local structure for messages by looking in the "cur" and "new" sub-directories. // - (void) parse_maildir: (NSString *) theDirectory all: (BOOL) theBOOL { NSString *aPath, *aNewPath, *thisMailFile; NSFileManager *aFileManager; NSMutableArray *allFiles; FILE *aStream; int i, count; BOOL b; if (!theDirectory) { return; } // We check if we must later move the file after // parsing it. b = NO; if ([theDirectory isEqualToString: @"new"] || [theDirectory isEqualToString: @"tmp"]) { b = YES; } aFileManager = [NSFileManager defaultManager]; // Read the directory aPath = [NSString stringWithFormat: @"%@/%@", _path, theDirectory]; allFiles = [[NSMutableArray alloc] initWithArray: [aFileManager directoryContentsAtPath: aPath]]; // We remove Apple Mac OS X .DS_Store file [allFiles removeObject: @".DS_Store"]; // We remove GWorkspace .gwdir file [allFiles removeObject: @".gwdir"]; count = [allFiles count]; aNewPath = nil; if (allFiles != nil && count > 0) { for (i = 0; i < count; i++) { thisMailFile = [NSString stringWithFormat: @"%@/%@", aPath, [allFiles objectAtIndex: i]]; if (b) { aNewPath = [NSString stringWithFormat: @"%@/cur/%@", _path, [allFiles objectAtIndex: i]]; } #ifdef __MINGW32__ aStream = fopen([thisMailFile UTF8String], "rb"); #else aStream = fopen([thisMailFile UTF8String], "r"); #endif if (!aStream) { continue; } [self parse_mbox: (b ? aNewPath : thisMailFile) stream: aStream flags: nil all: theBOOL]; fclose(aStream); // If we read this from the "new" or "tmp" sub-directories, // move it to the "cur" directory if (b) { [aFileManager movePath: thisMailFile toPath: aNewPath handler: nil]; } } [_cacheManager synchronize]; } RELEASE(allFiles); } @end pantomime1.2-1.2.2+dfsg1/Framework/Pantomime/CWLocalFolder+mbox.h000066400000000000000000000035271276751561200243710ustar00rootroot00000000000000/* ** CWLocalFolder+mbox.h ** ** Copyright (c) 2004-2007 ** ** Author: Ludovic Marcotte ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** You should have received a copy of the GNU Lesser General Public ** License along with this library; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef _Pantomime_H_CWLocalFolder_mbox #define _Pantomime_H_CWLocalFolder_mbox #include @interface CWLocalFolder (mbox) - (void) close_mbox; - (void) expunge_mbox; - (FILE *) open_mbox; - (void) parse_mbox: (NSString *) theFile stream: (FILE *) theStream flags: (CWFlags *) theFlags all: (BOOL) theBOOL; - (NSData *) unfoldLinesStartingWith: (char *) firstLine fileStream: (FILE *) theStream; /*! @method numberOfMessagesFromData: @discussion This method is used to get the number of RFC2822 messages from the supplied data. The returned value will always be at least 1 unless the supplied data is nil or its length is 0. @param theData The data holding RFC2822 messages @result The number of messages, 0 otherwise. */ + (unsigned) numberOfMessagesFromData: (NSData *) theData; - (NSArray *) messagesFromMailSpoolFile; @end #endif // _Pantomime_H_CWLocalFolder_mbox pantomime1.2-1.2.2+dfsg1/Framework/Pantomime/CWLocalFolder+mbox.m000066400000000000000000000537311276751561200244000ustar00rootroot00000000000000/* ** CWLocalFolder+mbox.m ** ** Copyright (c) 2004-2007 ** 2014 The GNUstep Team ** ** Author: Ludovic Marcotte ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** You should have received a copy of the GNU Lesser General Public ** License along with this library; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #import #import #import #import #import #import #import #import #import #ifdef __MINGW32__ #include #endif #include #include #include #include #include #include #include // // // @implementation CWLocalFolder (mbox) - (void) close_mbox { #ifndef __MINGW32__ struct flock lock; #ifdef __linux__ if (flock(fd, LOCK_UN) == -1) { NSLog(@"CWLocalFolder+mbox: Could not remove advisory file lock for: %@. Rationale: %s", _path, strerror(errno)); } #endif // We remove the mandatory lock lock.l_type = F_UNLCK; lock.l_whence = SEEK_SET; lock.l_start = lock.l_len = 0; lock.l_pid = getpid(); if (fcntl(fd, F_SETLK, &lock) == -1) { NSLog(@"CWLocalFolder+mbox: Could not remove mandatory file lock for: %@. Rationale: %s", _path, strerror(errno)); } #endif // // We close the stream. This will also close our file descriptor. // // fopen(3) says: // // The file descriptor is not dup'ed, and will be closed when the // stream created by fdopen is closed. // fclose(stream); stream = NULL; fd = -1; } // // // - (void) expunge_mbox { FILE *theInputStream, *theOutputStream; NSMutableArray *aMutableArray; CWLocalMessage *aMessage; CWFlags *theFlags; BOOL writeWasSuccessful, seenStatus, seenXStatus, doneWritingHeaders; NSString *pathToMailbox; int i, messageNumber, count; char aLine[1024]; aMutableArray = AUTORELEASE([[NSMutableArray alloc] init]); pathToMailbox = [NSString stringWithFormat: @"%@/%@", [_store path], _name]; // The stream is used to store (temporarily) the new local folder #ifdef __MINGW32__ theOutputStream = fopen([[NSString stringWithFormat: @"%@.tmp", pathToMailbox] UTF8String], "ab"); #else theOutputStream = fopen([[NSString stringWithFormat: @"%@.tmp", pathToMailbox] UTF8String], "a"); #endif theInputStream = [self stream]; // We assume that our write operation was successful and we initialize our messageNumber to 1 writeWasSuccessful = YES; messageNumber = 1; // We verify it the creation failed if (!theOutputStream) { POST_NOTIFICATION(PantomimeFolderExpungeFailed, self, nil); PERFORM_SELECTOR_2([[self store] delegate], @selector(folderExpungeFailed:), PantomimeFolderExpungeFailed, self, @"Folder"); return; } count = [allMessages count]; for (i = 0; i < count; i++) { aMessage = [allMessages objectAtIndex: i]; theFlags = [aMessage flags]; doneWritingHeaders = seenStatus = seenXStatus = NO; if ([theFlags contain: PantomimeDeleted]) { //[(CWLocalCacheManager *)_cacheManager removeObject: aMessage]; [aMutableArray addObject: aMessage]; } else { long delta, position, size; int headers_length; // We get our position and headers_length position = ftell(theOutputStream); // We seek to the beginning of the message fseek(theInputStream, [aMessage filePosition], SEEK_SET); size = [aMessage size]; memset(aLine, 0, 1024); while (fgets(aLine, 1024, theInputStream) != NULL && (ftell(theInputStream) < ([aMessage filePosition] + size))) { // We verify if we aren't finished reading our headers if (!doneWritingHeaders) { // We check for the "null line" (ie., end of headers) if (strlen(aLine) == 1 && strcmp("\n", aLine) == 0) { doneWritingHeaders = YES; headers_length = ftell(theOutputStream); if (!seenStatus) { fputs([[NSString stringWithFormat: @"Status: %@\n", [theFlags statusString]] cString], theOutputStream); } if (!seenXStatus) { fputs([[NSString stringWithFormat: @"X-Status: %@\n", [theFlags xstatusString]] cString], theOutputStream); } delta = ftell(theOutputStream)-headers_length; // Since we are done writing our headers, we update the headers_length variable //headers_length = ftell(theOutputStream) - position; // We adjust the size of the message since headers might have been rewritten (Status/X-Status). // We need the trailing -1 to actually remove the header/content separator (a single \n). //delta = headers_length - ([aMessage bodyFilePosition] - [aMessage filePosition] - 1); if (delta > 0) { //NSLog(@"delta = %d", delta); [aMessage setSize: (size+delta)]; } } // If we read the Status header, we replace it with the current Status header #warning we might need to adjust the size here too! if (strncasecmp(aLine,"Status:", 7) == 0) { seenStatus = YES; memset(aLine, 0, 1024); sprintf(aLine, "Status: %s\n", [[theFlags statusString] cString]); } else if (strncasecmp(aLine,"X-Status:", 9) == 0) { seenXStatus = YES; memset(aLine, 0, 1024); sprintf(aLine, "X-Status: %s\n", [[theFlags xstatusString] cString]); } } // We write our line to our new stream if (fputs(aLine, theOutputStream) < 0) { writeWasSuccessful = NO; break; } memset(aLine, 0, 1024); } // while (...) // We add our message separator if (fputs("\n", theOutputStream) < 0) { writeWasSuccessful = NO; break; } // We update our message's ivars [aMessage setFilePosition: position]; //[aMessage setBodyFilePosition: (position+headers_length+1)]; [aMessage setMessageNumber: messageNumber]; // We increment our messageNumber local variable messageNumber++; } } // for (i = 0; i < count; i++) // We close our output stream if (fclose(theOutputStream) != 0) { writeWasSuccessful = NO; } // // We verify if the last write was successful, if yes, we remove our original mailbox // and we replace it by our temporary mailbox. // if (writeWasSuccessful) { // We close the current folder [self close_mbox]; // Now that everything is alright, replace by .tmp [[NSFileManager defaultManager] removeFileAtPath: pathToMailbox handler: nil]; [[NSFileManager defaultManager] movePath: [NSString stringWithFormat: @"%@.tmp", pathToMailbox] toPath: pathToMailbox handler: nil]; // We sync our cache //[_cacheManager synchronize]; if (_cacheManager) [_cacheManager expunge]; // Now we re-open our folder and update the 'allMessages' ivar in the Folder superclass [self open_mbox]; [allMessages removeObjectsInArray: aMutableArray]; //[self setMessages: [_cacheManager cache]]; } // // The last write failed, let's remove our temporary file and keep the original mbox which, might // contains non-updated status flags or messages that have been transferred/deleted. // else { NSLog(@"Writing to %@ failed. We keep the original mailbox.", pathToMailbox); NSLog(@"This can be due to the fact that your partition containing this mailbox is full or that you don't have write permission in the directory where this mailbox is."); [[NSFileManager defaultManager] removeFileAtPath: [NSString stringWithFormat: @"%@.tmp", pathToMailbox] handler: nil]; POST_NOTIFICATION(PantomimeFolderExpungeFailed, self, nil); PERFORM_SELECTOR_2([[self store] delegate], @selector(folderExpungeFailed:), PantomimeFolderExpungeFailed, self, @"Folder"); return; } #warning also return when invoking the delegate POST_NOTIFICATION(PantomimeFolderExpungeCompleted, self, nil); PERFORM_SELECTOR_2([[self store] delegate], @selector(folderExpungeCompleted:), PantomimeFolderExpungeCompleted, self, @"Folder"); } // // We use fcntl(2) for locking the local mbox file. This provides a // mandatory, kernel-enforced lock that should work over NFS. // However, on Linux, fcntl(2) and flock(2) are implemented as to ignore // each other and if the local delivery agent uses flock(2), we won't // block appropriately. So, if we are on Linux, we lock the mbox file // with both fcntl(2) and flock(2). // - (FILE *) open_mbox { #ifndef __MINGW32__ struct flock lock; #endif FILE *aStream; if (!_path) { NSLog(@"Invalid path to the mailbox file."); return NULL; } #ifdef __MINGW32__ fd = _open([_path UTF8String], _O_BINARY|_O_RDWR); #else fd = open([_path UTF8String], O_RDWR); #endif if (fd < 0) { NSLog(@"LocalFolder: Unable to get folder descriptor at path %@.", _path); return NULL; } //NSLog(@"In open_mbox, fd = %d", fd); #ifndef __MINGW32__ lock.l_type = F_WRLCK; lock.l_whence = SEEK_SET; lock.l_start = 0; lock.l_len = 0; lock.l_pid = getpid(); if (fcntl(fd, F_SETLK, &lock) == -1) { NSLog(@"CWLocalFolder+mbox: Unable to obtain the mandatory lock on the folder descriptor at path %@.", _path); } #ifdef __linux__ if (flock(fd, LOCK_EX|LOCK_NB) < 0) { NSLog(@"CWLocalFolder+mbox: Unable to obtain the advisory lock on the folder descriptor at path %@.", _path); close(fd); return NULL; } else { flock(fd, LOCK_UN); } #endif #endif #ifdef __MINGW32__ aStream = _fdopen(fd, "r+"); #else aStream = fdopen(fd, "r+"); #endif [self setStream: aStream]; if (aStream == NULL) { NSLog(@"LocalFolder: Unable to open the specified mailbox at path %@.", _path); return NULL; } #ifdef __linux__ flock(fd, LOCK_EX|LOCK_NB); #endif return aStream; } // // // - (void) parse_mbox: (NSString *) theFile stream: (FILE *) theStream flags: (CWFlags *) theFlags all: (BOOL) theBOOL { CWLocalMessage *aMessage; long begin, end, size; cache_record record; char aLine[1024]; // We initialize our variables aMessage = [[CWLocalMessage alloc] init]; CLEAR_CACHE_RECORD(record); begin = end = 0L; if (_type == PantomimeFormatMbox) { begin = ftell(theStream); } while (fgets(aLine, 1024, theStream) != NULL) { switch (tolower((int)(unsigned char)aLine[0])) { case 'b': if (theBOOL && strncasecmp(aLine, "Bcc", 2) == 0) { [CWParser parseDestination: [self unfoldLinesStartingWith: aLine fileStream: theStream] forType: PantomimeBccRecipient inMessage: aMessage quick: NO]; } break; case 'c': if (strncasecmp(aLine, "Cc", 2) == 0) { record.cc = [CWParser parseDestination: [self unfoldLinesStartingWith: aLine fileStream: theStream] forType: PantomimeCcRecipient inMessage: aMessage quick: NO]; } else if (theBOOL && strncasecmp(aLine, "Content-Type", 12) == 0) { [CWParser parseContentType: [self unfoldLinesStartingWith: aLine fileStream: theStream] inPart: aMessage]; } break; case 'd': if (strncasecmp(aLine, "Date", 4) == 0) { [CWParser parseDate: [self unfoldLinesStartingWith: aLine fileStream: theStream] inMessage: aMessage]; if ([aMessage receivedDate]) { record.date = [[aMessage receivedDate] timeIntervalSince1970]; } } break; case 'f': if (strncasecmp(aLine, "From ", 5) == 0) { // do nothing, it's our message separator } else if (strncasecmp(aLine, "From", 4) == 0) { record.from = [CWParser parseFrom: [self unfoldLinesStartingWith: aLine fileStream: theStream] inMessage: aMessage quick: NO]; } break; case 'i': if (strncasecmp(aLine, "In-Reply-To", 11) == 0) { record.in_reply_to = [CWParser parseInReplyTo: [self unfoldLinesStartingWith: aLine fileStream: theStream] inMessage: aMessage quick: NO]; } break; case 'm': if (strncasecmp(aLine, "Message-ID", 10) == 0) { record.message_id = [CWParser parseMessageID: [self unfoldLinesStartingWith: aLine fileStream: theStream] inMessage: aMessage quick: NO]; } else if (strncasecmp(aLine, "MIME-Version", 12) == 0) { [CWParser parseMIMEVersion: [self unfoldLinesStartingWith: aLine fileStream: theStream] inMessage: aMessage]; } break; case 'o': if (theBOOL && strncasecmp(aLine, "Organization", 12) == 0) { [CWParser parseOrganization: [self unfoldLinesStartingWith: aLine fileStream: theStream] inMessage: aMessage]; } break; case 'r': if (strncasecmp(aLine, "References", 10) == 0) { record.references = [CWParser parseReferences: [self unfoldLinesStartingWith: aLine fileStream: theStream] inMessage: aMessage quick: NO]; } else if (theBOOL && strncasecmp(aLine, "Reply-To", 8) == 0) { [CWParser parseReplyTo: [self unfoldLinesStartingWith: aLine fileStream: theStream] inMessage: aMessage]; } else if (theBOOL && strncasecmp(aLine, "Resent-From", 11) == 0) { [CWParser parseResentFrom: [self unfoldLinesStartingWith: aLine fileStream: theStream] inMessage: aMessage]; } break; case 's': if (strncasecmp(aLine, "Status", 6) == 0) { [CWParser parseStatus: [self unfoldLinesStartingWith: aLine fileStream: theStream] inMessage: aMessage]; } else if (strncasecmp(aLine, "Subject", 7) == 0) { record.subject = [CWParser parseSubject: [self unfoldLinesStartingWith: aLine fileStream: theStream] inMessage: aMessage quick: NO]; } break; case 't': if (strncasecmp(aLine, "To", 2) == 0) { record.to = [CWParser parseDestination: [self unfoldLinesStartingWith: aLine fileStream: theStream] forType: PantomimeToRecipient inMessage: aMessage quick: NO]; } break; case 'x': if (strncasecmp(aLine, "X-Status", 8) == 0) { [CWParser parseXStatus: [self unfoldLinesStartingWith: aLine fileStream: theStream] inMessage: aMessage]; } break; case '\n': [aMessage setFilePosition: begin]; //[aMessage setBodyFilePosition: ftell(theStream)]; // We must set this in case the last message of our mbox is // an "empty message", i.e, a message with all the headers but // with an empty content. end = ftell(theStream); while (fgets(aLine, 1024, theStream) != NULL) { if (strncmp(aLine, "From ", 5) == 0 && _type == PantomimeFormatMbox) break; else end = ftell(theStream); } fseek(theStream, end, SEEK_SET); size = end-begin; // We set the properties of our message object and we add it to our folder. [aMessage setSize: size]; [aMessage setMessageNumber: [allMessages count]+1]; [aMessage setFolder: self]; [aMessage setType: _type]; [self appendMessage: aMessage]; record.filename = (char *)[[theFile lastPathComponent] UTF8String]; record.flags = (theFlags ? theFlags->flags : [aMessage flags]->flags); record.position = begin; record.size = size; [_cacheManager writeRecord: &record]; CLEAR_CACHE_RECORD(record); // // if we are reading a maildir message, check for flag information in the file name if (_type == PantomimeFormatMaildir) { NSString *info; int indexOfPatternSeparator; [aMessage setMailFilename: [theFile lastPathComponent]]; // The name of file will be unique_pattern:info with the status flags in the info field indexOfPatternSeparator = [theFile indexOfCharacter: ':']; if (indexOfPatternSeparator > 1) { info = [theFile substringFromIndex: indexOfPatternSeparator]; } else { info = @""; } // We remove all the flags and rebuild [[aMessage flags] removeAll]; [[aMessage flags] addFlagsFromData: [info dataUsingEncoding: NSASCIIStringEncoding] format: PantomimeFormatMaildir]; } RELEASE(aMessage); begin = ftell(theStream); // We re-init our message and our mutable string for the next message we're gonna read aMessage = [[CWLocalMessage alloc] init]; break; default: if (theBOOL) { [CWParser parseUnknownHeader: [self unfoldLinesStartingWith: aLine fileStream: theStream] inMessage: aMessage]; } break; } } // // We sync our cache if's an mbox file since we are done parsing. For // maildir, we synchronize it in -parse_maildir: // if (_type == PantomimeFormatMbox) { //NSLog(@"Sync cache."); [_cacheManager synchronize]; } RELEASE(aMessage); } // // This method is used to unfold the lines that have been folded // by starting with the first line. // - (NSData *) unfoldLinesStartingWith: (char *) firstLine fileStream: (FILE*) theStream { NSMutableData *aMutableData; char aLine[1024], buf[1024]; char space; long mark; // We initialize our buffers memset(aLine, 0, 1024); memset(buf, 0, 1024); space = ' '; mark = ftell(theStream); if (fgets(aLine, 1024, theStream) == NULL) { return [NSData dataWithBytes: firstLine length: strlen(firstLine)]; } if (aLine == NULL) { return [NSData dataWithBytes: firstLine length: strlen(firstLine)]; } // We create our mutable data aMutableData = [[NSMutableData alloc] initWithCapacity: strlen(firstLine)]; // We remove the trailing \n and we append our first line to our mutable data strncpy(buf, firstLine, strlen(firstLine) - 1); [aMutableData appendBytes: buf length: strlen(firstLine) - 1]; [aMutableData appendBytes: &space length: 1]; // We loop as long as we have a space or tab character as the first character // of the line that we just read while (aLine[0] == 9 || aLine[0] == 32) { char *ptr; // We skip the first char ptr = aLine; ptr++; // We init our buffer and we copy the data into it by trimming the trailing \n memset(buf, 0, 1024); strncpy(buf, ptr, strlen(ptr)-1); [aMutableData appendBytes: buf length: strlen(ptr)-1]; [aMutableData appendBytes: &space length: 1]; // We set our mark and get the next folded line (if there's one) mark = ftell(theStream); memset(aLine, 0, 1024); if (fgets(aLine, 1024, theStream) == NULL) { RELEASE(aMutableData); return nil; } if (aLine == NULL) { RELEASE(aMutableData); return nil; } } // We reset our file pointer position if (fseek(theStream, mark, SEEK_SET) == -1) { NSLog(@"Failed to fseek()"); } // We trim our last " " that we added to our data [aMutableData setLength: [aMutableData length]-1]; return AUTORELEASE(aMutableData); } // // // + (unsigned) numberOfMessagesFromData: (NSData *) theData { NSRange aRange; int count, len; if (!theData || (len = [theData length]) == 0) { return 0; } aRange = NSMakeRange(0,0); count = 0; do { aRange = [theData rangeOfCString: "\nFrom " options: 0 range: NSMakeRange(NSMaxRange(aRange), len-NSMaxRange(aRange))]; count++; } while (aRange.location != NSNotFound); return count; } // // // - (NSArray *) messagesFromMailSpoolFile { NSMutableArray *aMutableArray; char aLine[1024]; long begin, end; if (_type == PantomimeFormatMbox || _type == PantomimeFormatMaildir) { return nil; } aMutableArray = [[NSMutableArray alloc] init]; begin = end = 0; memset(aLine, 0, 1024); if (fseek(stream, begin, SEEK_SET) == -1) { NSLog(@"failed to fseek()"); return nil; } while (fgets(aLine, 1024, stream) != NULL) { if (strncasecmp(aLine, "From ", 5) == 0) { NSData *aData; unsigned long length; char *buf; // We always 'skip' the "From " line begin = ftell(stream); end = ftell(stream); // We read until we reach an other "From " or, the end of the stream while (fgets(aLine, 1024, stream) != NULL) { if (strncmp(aLine, "From ", 5) == 0) break; else end = ftell(stream); } // We get the length of our message length = end - begin - 1; // We allocate our buffer for the message buf = (char *)malloc(length * sizeof(char)); memset(buf, 0, length); // We move our fp to the beginning of the message if (fseek(stream, begin, SEEK_SET) == -1) { NSLog(@"failed to fseek() 2"); return nil; } if (fread(buf, sizeof(char), length, stream) != length) { NSLog(@"failed to fread()"); return nil; } aData = [[NSData alloc] initWithBytesNoCopy: buf length: length]; [aMutableArray addObject: aData]; RELEASE(aData); // We reset our fp to the right position (end of previous message) if (fseek(stream, end, SEEK_SET) == -1) { NSLog(@"failed to fseek() 3"); } memset(aLine, 0, 1024); } } // We now truncate our file to a length of 0. if (ftruncate(fd, 0) == -1) { NSLog(@"CWLocalFolder+mbox: Could not truncate file: %@", _path); } return AUTORELEASE(aMutableArray); } @end pantomime1.2-1.2.2+dfsg1/Framework/Pantomime/CWLocalFolder.h000066400000000000000000000103211276751561200234160ustar00rootroot00000000000000/* ** CWLocalFolder.h ** ** Copyright (c) 2001-2006 ** ** Author: Ludovic Marcotte ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** You should have received a copy of the GNU Lesser General Public ** License along with this library; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef _Pantomime_H_CWLocalFolder #define _Pantomime_H_CWLocalFolder #include #include #import #import #import #import #include /*! @class CWLocalFolder @discussion This class, which extends the CWFolder class, is used to implement local-mailboxes (mbox or maildir format) specific features. */ @interface CWLocalFolder : CWFolder { NSString *_path; PantomimeFolderFormat _type; int fd; FILE *stream; } /*! @method initWithPath: @discussion This method is used to initialize the receiver with the folder at the specified path. Normally, you should not invoke this method directly. You should rather use one of the -folderForName:... method found in CWLocalStore. This method will open the mailbox at the specified path. @param thePath The path of the folder. @result An instance of CWLocalFolder, nil on error. */ - (id) initWithPath: (NSString *) thePath; /*! @method parse @discussion This method is used to parse some or message headers (and only that) of the receiver. On completion, it posts a PantomimeFolderPrefetchCompleted notification (and calls -folderPrefetchCompleted: on the delegate, if any). This method call is blocking. Among the headers that are always parsed are: Cc, Date, From, In-Reply-To, Message-ID, References, Status, Subject, To and X-Status. @param theBOOL If YES, all headers are parsed. Otherwise, only some are. */ - (void) parse: (BOOL) theBOOL; /*! @method fd @discussion This method is used to get the associated file descriptor of the receiver. @result The file descriptor, -1 if none was set. */ - (int) fd; /*! @method setFD: @discussion This method is used to set the associated file descriptor of the receiver. Normally, you should never invoke this method directly. @param theFD The associated file descriptor. */ - (void) setFD: (int) theFD; /*! @method path @discussion This method is used to obtain the full path of the folder. @result The full path. */ - (NSString *) path; /*! @method setPath: @discussion This method is used to set the full path of the folder. @param thePath The full path. */ - (void) setPath: (NSString *) thePath; /*! @method stream @discussion This method is used to get the associated stream of the receiver. @result The stream, NULL if none was set. */ - (FILE *) stream; /*! @method setStream: @discussion This method is used to set the associated stream of the receiver. Normally, you should never invoke this method directly. @param theStream The associated stream. */ - (void) setStream: (FILE *) theStream; /*! @method type @discussion This method is used to get the type of folder the receiver is. Possible values are part of the PantomimeFolderFormat enum. @result The type of the folder. */ - (PantomimeFolderFormat) type; /*! @method setType: @discussion This method is used to set the type of the receiver. Accepted values are part of the PantomimeFolderFormat enum. @param theType The type of the receiver. */ - (void) setType: (PantomimeFolderFormat) theType; @end #endif // _Pantomime_H_CWLocalFolder pantomime1.2-1.2.2+dfsg1/Framework/Pantomime/CWLocalFolder.m000066400000000000000000000435261276751561200234400ustar00rootroot00000000000000/* ** CWLocalFolder.m ** ** Copyright (c) 2001-2007 ** ** Author: Ludovic Marcotte ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** You should have received a copy of the GNU Lesser General Public ** License along with this library; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include // FIXME remove #include #include // FIXME remove #import // for rand() #define FOLDER_APPEND_FAILED \ aDictionary = (theFlags ? [NSDictionary dictionaryWithObjectsAndKeys: theData, @"NSData", self, @"Folder", theFlags, @"Flags", nil] : \ [NSDictionary dictionaryWithObjectsAndKeys: theData, @"NSData", self, @"Folder", nil]); \ PERFORM_SELECTOR_3([[self store] delegate], @selector(folderAppendFailed:), PantomimeFolderAppendFailed, aDictionary); \ RELEASE(aMutableData); \ RELEASE(pool); \ return; // // Private methods // @interface CWLocalFolder (Private) - (BOOL) _findInPart: (CWPart *) thePart string: (NSString *) theString mask: (PantomimeSearchMask) theMask options: (PantomimeSearchOption) theOptions; @end // // // @implementation CWLocalFolder - (id) initWithPath: (NSString *) thePath { BOOL b; self = [super initWithName: [thePath lastPathComponent]]; // We initialize those ivars in order to make sure we don't call // the assertion handler when using a maildir-based mailbox. stream = NULL; fd = -1; [self setPath: thePath]; if ([[NSFileManager defaultManager] fileExistsAtPath: [NSString stringWithFormat: @"%@/new", _path] isDirectory: &b] && b) { [self setType: PantomimeFormatMaildir]; } else { [self setType: PantomimeFormatMbox]; // We verify if a .tmp was present. If yes, we simply remove it. if ([[NSFileManager defaultManager] fileExistsAtPath: [thePath stringByAppendingString: @".tmp"]]) { [[NSFileManager defaultManager] removeFileAtPath: [thePath stringByAppendingString: @".tmp"] handler: nil]; } } if ((_type == PantomimeFormatMbox) && ![self open_mbox]) { AUTORELEASE(self); return nil; } return self; } // // // - (void) dealloc { //NSLog(@"LocalFolder: -dealloc. fd = %d, stream is NULL? %d", fd, (stream == NULL)); NSAssert3(fd < 0 && !stream, @"-[%@ %@, path %@] must invoke -close before - dealloc'ing", NSStringFromClass([self class]), NSStringFromSelector(_cmd), _path); RELEASE(_path); [super dealloc]; } // // // - (void) parse: (BOOL) theBOOL { NSAutoreleasePool *pool; // // If we already have messages in our folder, that means parse was already invoked. // In this particular case, we do nothing. If we got no messages but we already // have invoked -parse before, that won't do any harm. // if ([allMessages count]) { // // If we are using a maildir-based mailbox, we scan the /new and /tmp directories // in order to move any messages in there to our /cur directory. // if (_type == PantomimeFormatMaildir) { NSFileManager *aFileManager; aFileManager = [NSFileManager defaultManager]; if ([[aFileManager directoryContentsAtPath: [NSString stringWithFormat: @"%@/new", _path]] count] > 0 || [[aFileManager directoryContentsAtPath: [NSString stringWithFormat: @"%@/tmp", _path]] count] > 0) { pool = [[NSAutoreleasePool alloc] init]; [self parse_maildir: @"new" all: theBOOL]; [self parse_maildir: @"tmp" all: theBOOL]; RELEASE(pool); } } PERFORM_SELECTOR_2([[self store] delegate], @selector(folderPrefetchCompleted:), PantomimeFolderPrefetchCompleted, self, @"Folder"); return; } // // We are NOT using the cache. // pool = [[NSAutoreleasePool alloc] init]; // // Parse the mail store. For mbox, it will be one file. // For maildir, there will be a file for each message // in the "cur" and "new" sub-directories. // switch (_type) { case PantomimeFormatMaildir: [self parse_maildir: @"cur" all: theBOOL]; [self parse_maildir: @"new" all: theBOOL]; break; case PantomimeFormatMbox: default: [self parse_mbox: _path stream: [self stream] flags: nil all: theBOOL]; break; } PERFORM_SELECTOR_2([[self store] delegate], @selector(folderPrefetchCompleted:), PantomimeFolderPrefetchCompleted, self, @"Folder"); RELEASE(pool); } // // This method is used to close the current folder. // It creates a temporary file where the folder is written to and // it replaces the current folder file by this one once everything is // alright. // - (void) close { //NSLog(@"LocalFolder: -close"); // We close the current folder if (_type == PantomimeFormatMbox || _type == PantomimeFormatMailSpoolFile) { [self close_mbox]; } // We synchorize our cache one last time if (_type == PantomimeFormatMbox || _type == PantomimeFormatMaildir) { [_cacheManager synchronize]; } POST_NOTIFICATION(PantomimeFolderCloseCompleted, _store, [NSDictionary dictionaryWithObject: self forKey: @"Folder"]); PERFORM_SELECTOR_2([_store delegate], @selector(folderCloseCompleted:), PantomimeFolderCloseCompleted, self, @"Folder"); // We remove our current folder from the list of open folders in the store [_store removeFolderFromOpenFolders: self]; } // // This method permanently removes messages that have the flag PantomimeDeleted. // - (void) expunge { switch (_type) { case PantomimeFormatMbox: [self expunge_mbox]; break; case PantomimeFormatMaildir: [self expunge_maildir]; break; default: { // Do nothing. } } if (_allContainers) { [self thread]; } } // // access / mutation methods // // // This method returns the file descriptor used by this local folder. // - (int) fd { return fd; } // // This method sets the file descriptor to be used by this local folder. // - (void) setFD: (int) theFD { fd = theFD; } // // // - (NSString *) path { return _path; } - (void) setPath: (NSString *) thePath { ASSIGN(_path, thePath); } // // This method returns the file stream used by this local folder. // - (FILE *) stream { return stream; } // // This method sets the file stream to be used by this local folder. // - (void) setStream: (FILE *) theStream { stream = theStream; } // // // - (PantomimeFolderFormat) type { return _type; } - (void) setType: (PantomimeFolderFormat) theType { _type = theType; } // // // - (PantomimeFolderMode) mode { return PantomimeReadWriteMode; } // // This method is used to append a message to this folder. The message // must be specified in raw source. The message is appended to the // local file and is initialized after. // - (void) appendMessageFromRawSource: (NSData *) theData flags: (CWFlags *) theFlags { NSString *aMailFile, *aMailFilePath; NSMutableData *aMutableData; NSDictionary *aDictionary; CWLocalMessage *aMessage; NSAutoreleasePool *pool; FILE *aStream; long mark, file_position; pool = [[NSAutoreleasePool alloc] init]; aMutableData = [[NSMutableData alloc] initWithData: theData]; aMailFile = nil; aStream = NULL; if (!theData || [theData length] == 0) { FOLDER_APPEND_FAILED; } // Set the appropriate stream if (_type == PantomimeFormatMaildir) { aMailFile = [NSString stringWithFormat: @"%@:%@", [NSString stringWithFormat: @"%lld.%d%d%lu.%@", (long long)time(NULL), getpid(), rand(), (unsigned long)[_cacheManager count], [[NSHost currentHost] name]], ((id)theFlags ? (id)[theFlags maildirString] : (id)@"2,")]; aMailFilePath = [NSString stringWithFormat: @"%@/cur/%@", _path, aMailFile]; #ifdef __MINGW32__ aStream = fopen([aMailFilePath UTF8String], "bw+"); #else aStream = fopen([aMailFilePath UTF8String], "w+"); #endif if (!aStream) { FOLDER_APPEND_FAILED; } } else { aStream = [self stream]; } // We keep the position where we were in the file mark = ftell(aStream); if (mark < 0) { FOLDER_APPEND_FAILED; } // // If the message doesn't contain the "From ", we add it. // // From qmail's mbox(5) man page: // // The From_ line always looks like From envsender date // moreinfo. envsender is one word, without spaces or tabs; it // is usually the envelope sender of the message. date is the // delivery date of the message. It always contains exactly 24 // characters in asctime format. moreinfo is optional; it may // contain arbitrary information. // if (![aMutableData hasCPrefix: "From "] && _type == PantomimeFormatMbox) { NSString *aString; // If there was no envelope sender, by convention the mailbox name used is MAILER-DAEMON. // Whitespace characters in the envelope sender mailbox name are by convention replaced by hyphens. aString = [NSString stringWithFormat: @"From MAILER-DAEMON %@\n", [[NSCalendarDate calendarDate] descriptionWithCalendarFormat: @"%a %b %d %H:%M:%S %Y"]]; [aMutableData insertCString: [aString cString] atIndex: 0]; } // We MUST replace every "\nFrom " in the message by "\n From ", if we have a mbox file. if (_type == PantomimeFormatMbox) { NSRange aRange; aRange = [aMutableData rangeOfCString: "\nFrom "]; while (aRange.location != NSNotFound) { [aMutableData replaceBytesInRange: aRange withBytes: "\n From "]; aRange = [aMutableData rangeOfCString: "\nFrom " options: 0 range: NSMakeRange(aRange.location + aRange.length, [aMutableData length] - aRange.location - aRange.length) ]; } // // From qmail's mbox(5) man page: // // A message encoded in mbox format begins with a From_ line, // continues with a series of non-From_ lines, and ends with a // blank line. // ... // The final line is a completely blank line (no spaces or // tabs). Notice that blank lines may also appear elsewhere in // the message. // [aMutableData appendCString: "\n\n"]; } // We go at the end of the file... if (fseek(aStream, 0L, SEEK_END) < 0) { FOLDER_APPEND_FAILED; } // We get the position of our message in the file. We need // to keep it in order to correctly seek back at the beginning // of the message to parse it. if ((file_position = ftell(aStream)) < 0) { FOLDER_APPEND_FAILED; } // We write the string to our local folder if (fwrite([aMutableData bytes], 1, [aMutableData length], aStream) <= 0) { FOLDER_APPEND_FAILED; } // We parse the message using our code, which will also update // our cache if present if (fseek(aStream, file_position, SEEK_SET) < 0) { FOLDER_APPEND_FAILED; } [self parse_mbox: aMailFile stream: aStream flags: theFlags all: NO]; // We get back our message aMessage = [allMessages objectAtIndex: [allMessages count]-1]; // We set our flags if (theFlags) { [aMessage setFlags: theFlags]; } // We finally reset our fp where the mark was set if (_type != PantomimeFormatMaildir) { if (fseek(aStream, mark, SEEK_SET) < 0) { FOLDER_APPEND_FAILED; } } else { if (fclose(aStream) != 0) { FOLDER_APPEND_FAILED; } } aDictionary = (theFlags ? [NSDictionary dictionaryWithObjectsAndKeys: theData, @"NSData", self, @"Folder", theFlags, @"Flags", nil] : [NSDictionary dictionaryWithObjectsAndKeys: theData, @"NSData", self, @"Folder", nil]); PERFORM_SELECTOR_3([[self store] delegate], @selector(folderAppendCompleted:), PantomimeFolderAppendCompleted, aDictionary); RELEASE(aMutableData); RELEASE(pool); } // // // - (void) search: (NSString *) theString mask: (PantomimeSearchMask) theMask options: (PantomimeSearchOption) theOptions { NSMutableArray *aMutableArray; NSAutoreleasePool *pool; NSDictionary *userInfo; CWLocalMessage *aMessage; int i, count; aMutableArray = [NSMutableArray array]; pool = [[NSAutoreleasePool alloc] init]; count = [allMessages count]; for (i = 0; i < count; i++) { aMessage = [allMessages objectAtIndex: i]; // // We search inside the Message's content. // if (theMask == PantomimeContent) { BOOL messageWasInitialized, messageWasMatched; messageWasInitialized = [aMessage isInitialized]; messageWasMatched = NO; if (!messageWasInitialized) { [aMessage setInitialized: YES]; } // We search recursively in all Message's parts if ([self _findInPart: (CWPart *)aMessage string: theString mask: theMask options: theOptions]) { [aMutableArray addObject: aMessage]; messageWasMatched = YES; } // We restore the message initialization status if the message doesn't match if (!messageWasInitialized && !messageWasMatched) { [aMessage setInitialized: NO]; } } // // We aren't searching in the content. For now, we search only in the Subject header value. // else { NSString *aString; aString = nil; switch (theMask) { case PantomimeFrom: if ([aMessage from]) { aString = [[aMessage from] stringValue]; } break; case PantomimeTo: aString = [NSString stringFromRecipients: [aMessage recipients] type: PantomimeToRecipient]; break; case PantomimeSubject: default: aString = [aMessage subject]; } if (aString) { if ((theOptions&PantomimeRegularExpression)) { NSArray *anArray; anArray = [CWRegEx matchString: aString withPattern : theString isCaseSensitive: (theOptions&PantomimeCaseInsensitiveSearch)]; if ([anArray count] > 0) { [aMutableArray addObject: aMessage]; } } else { NSRange aRange; if ((theOptions&PantomimeCaseInsensitiveSearch)) { aRange = [aString rangeOfString: theString options: NSCaseInsensitiveSearch]; } else { aRange = [aString rangeOfString: theString]; } if (aRange.length > 0) { [aMutableArray addObject: aMessage]; } } } } } // for (i = 0; ... RELEASE(pool); userInfo = [NSDictionary dictionaryWithObjectsAndKeys: self, @"Folder", aMutableArray, @"Results", nil]; POST_NOTIFICATION(PantomimeFolderSearchCompleted, [self store], userInfo); PERFORM_SELECTOR_3([[self store] delegate], @selector(folderSearchCompleted:), PantomimeFolderSearchCompleted, userInfo); } @end // // Private methods // @implementation CWLocalFolder (Private) - (BOOL) _findInPart: (CWPart *) thePart string: (NSString *) theString mask: (PantomimeSearchMask) theMask options: (PantomimeSearchOption) theOptions { if ([[thePart content] isKindOfClass:[NSString class]]) { // The part content is text; we perform the search if ((theOptions&PantomimeRegularExpression)) { // The search pattern is a regexp NSArray *anArray; anArray = [CWRegEx matchString: (NSString *)[thePart content] withPattern : theString isCaseSensitive: (theOptions&PantomimeCaseInsensitiveSearch)]; if ([anArray count] > 0) { return YES; } } else { NSRange range; if (theOptions&PantomimeCaseInsensitiveSearch) { range = [(NSString *)[thePart content] rangeOfString: theString options: NSCaseInsensitiveSearch]; } else { range = [(NSString *)[thePart content] rangeOfString: theString]; } if (range.length > 0) { return YES; } } } else if ([[thePart content] isKindOfClass: [CWMessage class]]) { // The part content is a message; we parse it recursively return [self _findInPart: (CWPart *)[thePart content] string: theString mask: theMask options: theOptions]; } else if ([[thePart content] isKindOfClass: [CWMIMEMultipart class]]) { // The part content contains many part; we parse each part CWMIMEMultipart *aMimeMultipart; CWPart *aPart; int i, count; aMimeMultipart = (CWMIMEMultipart*)[thePart content]; count = [aMimeMultipart count]; for (i = 0; i < count; i++) { // We get our part aPart = [aMimeMultipart partAtIndex: i]; if ([self _findInPart: (CWPart *)aPart string: theString mask: theMask options: theOptions]) { return YES; } } } return NO; } @end pantomime1.2-1.2.2+dfsg1/Framework/Pantomime/CWLocalMessage.h000066400000000000000000000064561276751561200236050ustar00rootroot00000000000000/* ** CWLocalMessage.h ** ** Copyright (c) 2001-2007 ** ** Author: Ludovic Marcotte ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** You should have received a copy of the GNU Lesser General Public ** License along with this library; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef _Pantomime_H_CWLocalMessage #define _Pantomime_H_CWLocalMessage #include #import #import #import /*! @class CWLocalMessage @discussion This class, which extends CWMessage, adds local specific information and redefines the behavior of some methods from its superclass. */ @interface CWLocalMessage : CWMessage { @private NSString *_mailFilename; // Name of file in which the message is stored (if using maildir) int _type; // PantomimeFormatMbox or PantomimeFormatMaildir unsigned int _file_position; } /*! @method filePosition @discussion This method is used to obtain the position in the mbox file from which the message begins at. This method isn't really helpful if -type returns something other than PantomimeFormatMbox. @result The position in the file. */ - (unsigned int) filePosition; /*! @method setFilePosition: @discussion This method is used to set the position in the mbox file from which the message begins at. This method isn't really helpful if -type returns something other than PantomimeFormatMbox. @param theFilePosition The position in the file. */ - (void) setFilePosition: (unsigned int) theFilePosition; /*! @method type @discussion This method is used to obtain the type of receiver. Possible values are part of the PantomimeFolderFormat enum. @result The type of the message. */ - (PantomimeFolderFormat) type; /*! @method setType: @discussion This method is used to set the type of receiver. Accepted values are part of the PantomimeFolderFormat enum. @param theType The type of the receiver. */ - (void) setType: (PantomimeFolderFormat) theType; /*! @method mailFilename @discussion This method is used to obtain the associated filename of the receiver, if -type is PantomimeFormatMaildir. @result The filename, nil if none was defined or if -type returns something other than PantomimeFormatMaildir. */ - (NSString *) mailFilename; /*! @method setMailFilename: @discussion This method is used to set the associated filename for the receiver. This is useful and required if -type returns PantomimeFormatMaildir. @param theFilename The name of the file. */ - (void) setMailFilename: (NSString *) theFilename; @end #endif // _Pantomime_H_CWLocalMessage pantomime1.2-1.2.2+dfsg1/Framework/Pantomime/CWLocalMessage.m000066400000000000000000000123101276751561200235740ustar00rootroot00000000000000/* ** CWLocalMessage.m ** ** Copyright (c) 2001-2007 ** ** Author: Ludovic Marcotte ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** You should have received a copy of the GNU Lesser General Public ** License along with this library; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include #include #include #include #include #include #include #include #include #include // O_RDONLY #include // free() and malloc() #include // lseek() and close() #ifdef __MINGW32__ #include #endif static int currentLocalMessageVersion = 1; // // // @implementation CWLocalMessage - (id) init { self = [super init]; [CWLocalMessage setVersion: currentLocalMessageVersion]; _mailFilename = nil; _file_position = 0; return self; } // // NSCoding protocol // - (void) encodeWithCoder: (NSCoder *) theCoder { [super encodeWithCoder: theCoder]; [CWLocalMessage setVersion: currentLocalMessageVersion]; [theCoder encodeObject: [NSNumber numberWithLong: _file_position]]; // Store the name of the file; we need it for local. [theCoder encodeObject: _mailFilename]; // Store the message type; useful to have. [theCoder encodeObject: [NSNumber numberWithInt: _type]]; } // // // - (id) initWithCoder: (NSCoder *) theCoder { self = [super initWithCoder: theCoder]; _file_position = [[theCoder decodeObject] longValue]; // Retrieve the mail file name which we need for local storage. [self setMailFilename: [theCoder decodeObject]]; // Retrieve the message type _type = [[theCoder decodeObject] intValue]; return self; } // // access / mutation methods // - (unsigned int) filePosition { return _file_position; } - (void) setFilePosition: (unsigned int) theFilePosition { _file_position = theFilePosition; } // // // - (PantomimeFolderFormat) type { return _type; } - (void) setType: (PantomimeFolderFormat) theType { _type = theType; } // // // - (NSString *) mailFilename { return _mailFilename; } - (void) setMailFilename: (NSString *) theFilename { ASSIGN(_mailFilename, theFilename); } // // // - (void) dealloc { TEST_RELEASE(_mailFilename); [super dealloc]; } // // // - (NSData *) rawSource { NSData *aData; char *buf; int fd; // If we are reading from a mbox file, the file is already open if ([(CWLocalFolder *)[self folder] type] == PantomimeFormatMbox) { fd = [(CWLocalFolder *)[self folder] fd]; } // For maildir, we need to open the specific file else { #ifdef __MINGW32__ fd = _open([[NSString stringWithFormat: @"%@/cur/%@", [(CWLocalFolder *)[self folder] path], _mailFilename] UTF8String], O_RDONLY); #else fd = open([[NSString stringWithFormat: @"%@/cur/%@", [(CWLocalFolder *)[self folder] path], _mailFilename] UTF8String], O_RDONLY); #endif } if (fd < 0) { NSLog(@"Unable to get the file descriptor"); return nil; } //NSLog(@"Seeking to %d", [self filePosition]); #ifdef __MINGW32__ if (_lseek(fd, [self filePosition], SEEK_SET) < 0) #else if (lseek(fd, [self filePosition], SEEK_SET) < 0) #endif { NSLog(@"Unable to seek."); return nil; } buf = (char *)malloc(_size*sizeof(char)); if (buf != NULL && read_block(fd, buf, _size) >= 0) { aData = [NSData dataWithBytesNoCopy: buf length: _size freeWhenDone: YES]; } else { free(buf); aData = nil; } // If we are operating on a local file, close it. if ([(CWLocalFolder *)[self folder] type] == PantomimeFormatMaildir) { safe_close(fd); } //NSLog(@"READ |%@|", [aData asciiString]); return aData; } // // This method is called to initialize the message if it wasn't. // If we set it to NO and we HAD a content, we release the content; // - (void) setInitialized: (BOOL) aBOOL { [super setInitialized: aBOOL]; if (aBOOL) { NSData *aData; aData = [self rawSource]; if (aData) { NSRange aRange; aRange = [aData rangeOfCString: "\n\n"]; if (aRange.length == 0) { [super setInitialized: NO]; return; } [self setHeadersFromData: [aData subdataWithRange: NSMakeRange(0,aRange.location)]]; [CWMIMEUtility setContentFromRawSource: [aData subdataWithRange: NSMakeRange(aRange.location + 2, [aData length]-(aRange.location+2))] inPart: self]; } else { [super setInitialized: NO]; return; } } else { DESTROY(_content); } } @end pantomime1.2-1.2.2+dfsg1/Framework/Pantomime/CWLocalStore.h000066400000000000000000000070311276751561200233030ustar00rootroot00000000000000/* ** CWLocalStore.h ** ** Copyright (c) 2001-2007 ** ** Author: Ludovic Marcotte ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** You should have received a copy of the GNU Lesser General Public ** License along with this library; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef _Pantomime_H_CWLocalStore #define _Pantomime_H_CWLocalStore #include #import #import #import #import #import /*! @class CWLocalStore @abstract Pantomime local folders client code. @discussion This class, which implements the CWStore protocol, is Pantomime's code for accessing local folders such as mbox mailboxes, maildir mailboxes and more.. */ @interface CWLocalStore : NSObject { @private NSMutableDictionary *_openFolders; NSMutableArray *_folders; NSString *_path; id _delegate; BOOL _secure; } /*! @method initWithPath: @discussion This is the designated initializer for the CWLocalStore class. This method is used to initialize the receiver with the full path of where folders are located. Folders can be in the mbox format, maildir format or directories which hold mbox mailboxes. @param thePath The full path to the mail store. */ - (id) initWithPath: (NSString *) thePath; /*! @method delegate @discussion This method is used to get the delegate of the CWLocalStore's instance. @result The delegate, nil if none was previously set. */ - (id) delegate; /*! @method setDelegate: @discussion This method is used to set the CWLocalStore's delegate. The delegate will not be retained. The CWLocalStore class will invoke methods on the delegate based on actions performed. @param theDelegate The delegate, which implements various callback methods. */ - (void) setDelegate: (id) theDelegate; /*! @method path @discussion This method is used to obtain the full path to the mail store. @result The full path to the mail store. */ - (NSString *) path; /*! @method setPath: @discussion This method is used to set the full path to the mail store. @param thePath The full path to the mail store. */ - (void) setPath: (NSString *) thePath; /*! @method setEnforceMode: @discussion This method is used to enforce or not secure modes (0600 for files, 0700 for directories) on newly created mailboxes. If not enforced, the default permissions used by Foundation when creating files or directories will be used. By default, secure modes are enforced. @param theBOOL YES to enforce secure modes, NO otherwise. */ - (void) setEnforceMode: (BOOL) theBOOL; /*! @method isEnforcingMode @discussion This method is used to verify if secure modes are enforced. @result YES if secure modes are enforced, NO otherwise. */ - (BOOL) isEnforcingMode; @end #endif // _Pantomime_H_CWLocalStore pantomime1.2-1.2.2+dfsg1/Framework/Pantomime/CWLocalStore.m000066400000000000000000000640461276751561200233210ustar00rootroot00000000000000/* ** CWLocalStore.m ** ** Copyright (c) 2001-2007 ** ** Author: Ludovic Marcotte ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** You should have received a copy of the GNU Lesser General Public ** License along with this library; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include // rand() // // Private interface // @interface CWLocalStore (Private) - (NSEnumerator *) _rebuildFolderEnumerator; @end // // // @implementation CWLocalStore - (void) dealloc { RELEASE(_path); RELEASE(_openFolders); RELEASE(_folders); [super dealloc]; } // // // - (id) initWithPath: (NSString *) thePath { BOOL isDirectory; self = [super init]; [self setPath: thePath]; _openFolders = [[NSMutableDictionary alloc] init]; _folders = [[NSMutableArray alloc] init]; _secure = YES; if ([[NSFileManager defaultManager] fileExistsAtPath: thePath isDirectory: &isDirectory]) { if (!isDirectory) { AUTORELEASE(self); return nil; } } else { AUTORELEASE(self); return nil; } return self; } // // // - (id) initWithURL: (CWURLName *) theURL { return [self initWithPath: [theURL path]]; } // // This method will open automatically Inbox (case-insensitive). // It may return nil if the opening failed or Inbox wasn't found. // - (id) defaultFolder { return [self folderForName: @"Inbox"]; } // // This method is used to open the folder theName in the current // directory of this local store. // - (id) folderForName: (NSString *) theName { CWLocalFolder *cachedFolder; if (!theName) return nil; cachedFolder = [_openFolders objectForKey: theName]; if (!cachedFolder) { NSEnumerator *anEnumerator; NSString *aString; anEnumerator = [self folderEnumerator]; while ((aString = [anEnumerator nextObject])) { if ([aString compare: theName] == NSOrderedSame) { CWLocalFolder *aFolder; aFolder = [[CWLocalFolder alloc] initWithPath: [NSString stringWithFormat:@"%@/%@", _path, aString]]; if (aFolder) { [aFolder setStore: self]; [aFolder setName: theName]; // We now cache it and return it [_openFolders setObject: aFolder forKey: theName]; POST_NOTIFICATION(PantomimeFolderOpenCompleted, self, [NSDictionary dictionaryWithObject: aFolder forKey: @"Folder"]); PERFORM_SELECTOR_2(self, @selector(folderOpenCompleted:), PantomimeFolderOpenCompleted, aFolder, @"Folder"); RELEASE(aFolder); } else { POST_NOTIFICATION(PantomimeFolderOpenFailed, self, [NSDictionary dictionaryWithObject: theName forKey: @"FolderName"]); PERFORM_SELECTOR_2(self, @selector(folderOpenFailed:), PantomimeFolderOpenFailed, theName, @"FolderName"); } return aFolder; } } return nil; } //NSLog(@"Returning cached folder!"); return cachedFolder; } // // // - (id) folderForURL: (NSString *) theURL; { CWURLName *theURLName; id aFolder; theURLName = [[CWURLName alloc] initWithString: theURL]; aFolder = [self folderForName: [theURLName foldername]]; RELEASE(theURLName); return aFolder; } // // This method returns the list of folders contained in // a specific directory. It'll currently ignore some things // like Netscape Mail's summary files and Pantomime's local // cache files. // - (NSEnumerator *) folderEnumerator { if ([_folders count] > 0) { POST_NOTIFICATION(PantomimeFolderListCompleted, self, [NSDictionary dictionaryWithObject: [_folders objectEnumerator] forKey: @"NSEnumerator"]); PERFORM_SELECTOR_2(self, @selector(folderListCompleted:), PantomimeFolderListCompleted, [_folders objectEnumerator], @"NSEnumerator"); return [_folders objectEnumerator]; } return [self _rebuildFolderEnumerator]; } // // // - (NSEnumerator *) subscribedFolderEnumerator { return [self folderEnumerator]; } // // // - (id) delegate { return _delegate; } - (void) setDelegate: (id) theDelegate { _delegate = theDelegate; } // // // - (NSString *) path { return _path; } // // // - (void) setPath: (NSString *) thePath { ASSIGN(_path, thePath); } // // // - (void) setEnforceMode: (BOOL) theBOOL; { _secure = theBOOL; } // // // - (BOOL) isEnforcingMode { return _secure; } // // // - (void) close { NSEnumerator *anEnumerator; CWLocalFolder *aFolder; anEnumerator = [self openFoldersEnumerator]; while ((aFolder = [anEnumerator nextObject])) { [aFolder close]; } } // // // - (NSEnumerator *) openFoldersEnumerator { return [_openFolders objectEnumerator]; } // // // - (void) removeFolderFromOpenFolders: (CWFolder *) theFolder { [_openFolders removeObjectForKey: [(CWLocalFolder *)theFolder name]]; } // // // - (BOOL) folderForNameIsOpen: (NSString *) theName { NSEnumerator *anEnumerator; CWLocalFolder *aFolder; anEnumerator = [self openFoldersEnumerator]; while ((aFolder = [anEnumerator nextObject])) { if ([[aFolder name] compare: theName] == NSOrderedSame) { return YES; } } return NO; } // // // - (PantomimeFolderType) folderTypeForFolderName: (NSString *) theName { NSString *aString; BOOL isDir; aString = [NSString stringWithFormat: @"%@/%@", _path, theName]; [[NSFileManager defaultManager] fileExistsAtPath: aString isDirectory: &isDir]; if (isDir) { // This could be a maildir store. Check for maildir specific subfolders. aString = [NSString stringWithFormat: @"%@/%@/cur", _path, theName]; if ( [[NSFileManager defaultManager] fileExistsAtPath: aString isDirectory: &isDir] && isDir ) { return PantomimeHoldsMessages; } else { return PantomimeHoldsFolders; } } return PantomimeHoldsMessages; } // // // - (unsigned char) folderSeparator { return '/'; } // // // - (void) createFolderWithName: (NSString *) theName type: (PantomimeFolderFormat) theType contents: (NSData *) theContents { NSString *aName, *pathToFile; NSFileManager *aFileManager; NSEnumerator *anEnumerator; BOOL b, is_dir; int count; aFileManager = [NSFileManager defaultManager]; anEnumerator = [self folderEnumerator]; count = 0; pathToFile = [NSString stringWithFormat: @"%@/%@", _path, theName]; pathToFile = [pathToFile substringToIndex: ([pathToFile length]-[[pathToFile lastPathComponent] length]-1)]; // We verify if the folder with that name does already exist while ((aName = [anEnumerator nextObject])) { if ([aName compare: theName options: NSCaseInsensitiveSearch] == NSOrderedSame) { POST_NOTIFICATION(PantomimeFolderCreateFailed, self, [NSDictionary dictionaryWithObject: theName forKey: @"Name"]); PERFORM_SELECTOR_2(self, @selector(folderCreateFailed:), PantomimeFolderCreateFailed, theName, @"Name"); return; } } // Ok, the folder doesn't already exist. // Check if we want to create a simple folder/directory. if (theType == PantomimeFormatFolder) { NSString *aString; aString = [NSString stringWithFormat: @"%@/%@", _path, theName]; b = [aFileManager createDirectoryAtPath: aString attributes: nil]; if (b) { NSDictionary *info; if (_secure) [[NSFileManager defaultManager] enforceMode: 0700 atPath: aString]; [self _rebuildFolderEnumerator]; info = [NSDictionary dictionaryWithObjectsAndKeys: theName, @"Name", [NSNumber numberWithInt: 0], @"Count", nil]; POST_NOTIFICATION(PantomimeFolderCreateCompleted, self, info); PERFORM_SELECTOR_3(self, @selector(folderCreateCompleted:), PantomimeFolderCreateCompleted, info); } else { POST_NOTIFICATION(PantomimeFolderCreateFailed, self, [NSDictionary dictionaryWithObject: theName forKey: @"Name"]); PERFORM_SELECTOR_2(self, @selector(folderCreateFailed:), PantomimeFolderCreateFailed, theName, @"Name"); } return; } b = NO; // We want to create a mailbox store; check if it already exists. if ([aFileManager fileExistsAtPath: pathToFile isDirectory: &is_dir]) { int size; size = [[[aFileManager fileAttributesAtPath: pathToFile traverseLink: NO] objectForKey: NSFileSize] intValue]; // If we got an empty file or simply a directory... if (size == 0 || is_dir) { NSString *aString; // If the size is 0, that means we have an empty file. We first convert this // file to a directory. We also remove the cache file. if (size == 0) { [aFileManager removeFileAtPath: [NSString stringWithFormat: @"%@/.%@.cache", [pathToFile substringToIndex: ([pathToFile length]-[[pathToFile lastPathComponent] length]-1)], [pathToFile lastPathComponent]] handler: nil]; [aFileManager removeFileAtPath: pathToFile handler: nil]; [aFileManager createDirectoryAtPath: pathToFile attributes: nil]; } // We can now proceed with the creation of our store. // Check the type of store we want to create switch (theType) { case PantomimeFormatMaildir: // Create the main maildir directory aString = [NSString stringWithFormat: @"%@/%@", _path, theName]; b = [aFileManager createDirectoryAtPath: aString attributes: nil]; if (_secure) [[NSFileManager defaultManager] enforceMode: 0700 atPath: aString]; // Now create the cur, new, and tmp sub-directories. aString = [NSString stringWithFormat: @"%@/%@/cur", _path, theName]; b = b & [aFileManager createDirectoryAtPath: aString attributes: nil]; if (_secure) [[NSFileManager defaultManager] enforceMode: 0700 atPath: aString]; // new aString = [NSString stringWithFormat: @"%@/%@/new", _path, theName]; b = b & [aFileManager createDirectoryAtPath: aString attributes: nil]; if (_secure) [[NSFileManager defaultManager] enforceMode: 0700 atPath: aString]; // tmp aString = [NSString stringWithFormat: @"%@/%@/tmp", _path, theName]; b = b & [aFileManager createDirectoryAtPath: aString attributes: nil]; if (_secure) [[NSFileManager defaultManager] enforceMode: 0700 atPath: aString]; // We create our fist message if (theContents) { aString = [NSString stringWithFormat: @"%@/%@/cur/%@:2,", _path, theName, [NSString stringWithFormat: @"%lld.%d%d.%@", (long long)time(NULL), getpid(), rand(), [[NSHost currentHost] name]]]; [theContents writeToFile: aString atomically: YES]; } break; case PantomimeFormatMbox: default: b = [aFileManager createFileAtPath: [NSString stringWithFormat: @"%@/%@", _path, theName] contents: theContents attributes: nil]; count = [CWLocalFolder numberOfMessagesFromData: theContents]; // We now enforce the mode (0600) on this new mailbox if (_secure) [[NSFileManager defaultManager] enforceMode: 0600 atPath: [NSString stringWithFormat: @"%@/%@", _path, theName]]; break; } // rebuild the folder list [self _rebuildFolderEnumerator]; } else { b = NO; } } if (b) { NSDictionary *info; info = [NSDictionary dictionaryWithObjectsAndKeys: theName, @"Name", [NSNumber numberWithInt: count], @"Count", nil]; POST_NOTIFICATION(PantomimeFolderCreateCompleted, self, info); PERFORM_SELECTOR_3(self, @selector(folderCreateCompleted:), PantomimeFolderCreateCompleted, info); } else { POST_NOTIFICATION(PantomimeFolderCreateFailed, self, [NSDictionary dictionaryWithObject: theName forKey: @"Name"]); PERFORM_SELECTOR_2(self, @selector(folderCreateFailed:), PantomimeFolderCreateFailed, theName, @"Name"); } } // // theName must be the full path of the mailbox. // - (void) deleteFolderWithName: (NSString *) theName { NSFileManager *aFileManager; BOOL aBOOL, is_dir; aFileManager = [NSFileManager defaultManager]; aBOOL = NO; if ([aFileManager fileExistsAtPath: [NSString stringWithFormat: @"%@/%@", _path, theName] isDirectory: &is_dir]) { if (is_dir) { NSEnumerator *theEnumerator; NSArray *theEntries; theEnumerator = [aFileManager enumeratorAtPath: [NSString stringWithFormat: @"%@/%@", _path, theName]]; // FIXME - Verify the Store's path. // If it doesn't contain any mailboxes and it's actually not or Store's path, we remove it. theEntries = [theEnumerator allObjects]; if ([theEntries count] == 0) { aBOOL = [aFileManager removeFileAtPath: [NSString stringWithFormat: @"%@/%@", _path, theName] handler: nil]; // Rebuild the folder tree if (aBOOL) { [self _rebuildFolderEnumerator]; POST_NOTIFICATION(PantomimeFolderDeleteCompleted, self, [NSDictionary dictionaryWithObject: theName forKey: @"Name"]); PERFORM_SELECTOR_1(self, @selector(folderDeleteCompleted:), PantomimeFolderDeleteCompleted); } else { POST_NOTIFICATION(PantomimeFolderDeleteFailed, self, [NSDictionary dictionaryWithObject: theName forKey: @"Name"]); PERFORM_SELECTOR_1(self, @selector(folderDeleteFailed:), PantomimeFolderDeleteFailed); } return; } // We could also be trying to delete a maildir mailbox which // has a directory structure with 3 sub-directories: cur, new, tmp else if ([aFileManager fileExistsAtPath: [NSString stringWithFormat: @"%@/%@/cur", _path, theName] isDirectory: &is_dir]) { // Make sure that these are the maildir directories and not something else. if (![aFileManager fileExistsAtPath: [NSString stringWithFormat: @"%@/%@/new", _path, theName] isDirectory: &is_dir]) { POST_NOTIFICATION(PantomimeFolderDeleteFailed, self, [NSDictionary dictionaryWithObject: theName forKey: @"Name"]); PERFORM_SELECTOR_1(self, @selector(folderDeleteFailed:), PantomimeFolderDeleteFailed); return; } if (![aFileManager fileExistsAtPath: [NSString stringWithFormat: @"%@/%@/tmp", _path, theName] isDirectory: &is_dir] ) { POST_NOTIFICATION(PantomimeFolderDeleteFailed, self, [NSDictionary dictionaryWithObject: theName forKey: @"Name"]); PERFORM_SELECTOR_1(self, @selector(folderDeleteFailed:), PantomimeFolderDeleteFailed); return; } } else { POST_NOTIFICATION(PantomimeFolderDeleteFailed, self, [NSDictionary dictionaryWithObject: theName forKey: @"Name"]); PERFORM_SELECTOR_1(self, @selector(folderDeleteFailed:), PantomimeFolderDeleteFailed); return; } } // We remove the mbox or maildir store aBOOL = [aFileManager removeFileAtPath: [NSString stringWithFormat: @"%@/%@", _path, theName] handler: nil]; // We remove the cache, if the store deletion was successful if (aBOOL) { NSString *aString; aString = [theName lastPathComponent]; [[NSFileManager defaultManager] removeFileAtPath: [NSString stringWithFormat: @"%@/%@.%@.cache", _path, [theName substringToIndex: ([theName length]-[aString length])], aString] handler: nil]; } // Rebuild the folder tree [self _rebuildFolderEnumerator]; } if (aBOOL) { POST_NOTIFICATION(PantomimeFolderDeleteCompleted, self, [NSDictionary dictionaryWithObject: theName forKey: @"Name"]); PERFORM_SELECTOR_1(self, @selector(folderDeleteCompleted:), PantomimeFolderDeleteCompleted); } else { POST_NOTIFICATION(PantomimeFolderDeleteFailed, self, [NSDictionary dictionaryWithObject: theName forKey: @"Name"]); PERFORM_SELECTOR_1(self, @selector(folderDeleteFailed:), PantomimeFolderDeleteFailed); } } // // theName and theNewName MUST be the full path of those mailboxes. // If they begin with the folder separator (ie., '/'), the character is // automatically stripped. // // This method supports renaming mailboxes that are open. // - (void) renameFolderWithName: (NSString *) theName toName: (NSString *) theNewName { NSFileManager *aFileManager; NSDictionary *info; BOOL aBOOL, is_dir; aFileManager = [NSFileManager defaultManager]; aBOOL = NO; theName = [theName stringByDeletingFirstPathSeparator: [self folderSeparator]]; theNewName = [theNewName stringByDeletingFirstPathSeparator: [self folderSeparator]]; info = [NSDictionary dictionaryWithObjectsAndKeys: theName, @"Name", theNewName, @"NewName", nil]; // We do basic verifications on the passed parameters. We also verify if the destination path exists. // If it does, we abort the rename operation since we don't want to overwrite the folder. if (!theName || !theNewName || [[theName stringByTrimmingWhiteSpaces] length] == 0 || [[theNewName stringByTrimmingWhiteSpaces] length] == 0 || [aFileManager fileExistsAtPath: [NSString stringWithFormat: @"%@/%@", _path, theNewName]]) { POST_NOTIFICATION(PantomimeFolderRenameFailed, self, info); PERFORM_SELECTOR_3(self, @selector(folderRenameFailed:), PantomimeFolderRenameFailed, info); return; } // We verify if the source path is valid if ([aFileManager fileExistsAtPath: [NSString stringWithFormat: @"%@/%@", _path, theName] isDirectory: &is_dir]) { CWLocalFolder *aFolder; if (is_dir) { NSEnumerator *theEnumerator; NSArray *theEntries; theEnumerator = [aFileManager enumeratorAtPath: [NSString stringWithFormat: @"%@/%@", _path, theName]]; // FIXME - Verify the Store's path. // If it doesn't contain any mailboxes and it's actually not or Store's path, we rename it. theEntries = [theEnumerator allObjects]; if ([theEntries count] == 0) { aBOOL = [aFileManager movePath: [NSString stringWithFormat: @"%@/%@",_path, theName] toPath: [NSString stringWithFormat: @"%@/%@", _path, theNewName] handler: nil]; if (aBOOL) { POST_NOTIFICATION(PantomimeFolderRenameCompleted, self, info); PERFORM_SELECTOR_3(self, @selector(folderRenameCompleted:), PantomimeFolderRenameCompleted, info); } else { POST_NOTIFICATION(PantomimeFolderRenameFailed, self, info); PERFORM_SELECTOR_3(self, @selector(folderRenameFailed:), PantomimeFolderRenameFailed, info); } } // We could also be trying to delete a maildir mailbox which // has a directory structure with 3 sub-directories: cur, new, tmp else if ([aFileManager fileExistsAtPath: [NSString stringWithFormat: @"%@/%@/cur", _path, theName] isDirectory: &is_dir]) { // Make sure that these are the maildir directories and not something else. if (![aFileManager fileExistsAtPath: [NSString stringWithFormat: @"%@/%@/new", _path, theName] isDirectory: &is_dir]) { POST_NOTIFICATION(PantomimeFolderRenameFailed, self, info); PERFORM_SELECTOR_3(self, @selector(folderRenameFailed:), PantomimeFolderRenameFailed, info); return; } if (![aFileManager fileExistsAtPath: [NSString stringWithFormat: @"%@/%@/tmp", _path, theName] isDirectory: &is_dir]) { POST_NOTIFICATION(PantomimeFolderRenameFailed, self, info); PERFORM_SELECTOR_3(self, @selector(folderRenameFailed:), PantomimeFolderRenameFailed, info); return; } } else { POST_NOTIFICATION(PantomimeFolderRenameFailed, self, info); PERFORM_SELECTOR_3(self, @selector(folderRenameFailed:), PantomimeFolderRenameFailed, info); return; } } // If the mailbox is open, we "close" it first. aFolder = [_openFolders objectForKey: theName]; if (aFolder) { if ([aFolder type] == PantomimeFormatMbox) { [aFolder close_mbox]; } [[aFolder cacheManager] synchronize]; } // We rename the mailbox aBOOL = [aFileManager movePath: [NSString stringWithFormat: @"%@/%@", _path, theName] toPath: [NSString stringWithFormat: @"%@/%@", _path, theNewName] handler: nil]; // We rename the cache, if the store rename was successful if (aBOOL) { NSString *str1, *str2; str1 = [theName lastPathComponent]; str2 = [theNewName lastPathComponent]; [[NSFileManager defaultManager] movePath: [NSString stringWithFormat: @"%@/%@.%@.cache", _path, [theName substringToIndex: ([theName length] - [str1 length])], str1] toPath: [NSString stringWithFormat: @"%@/%@.%@.cache", _path, [theNewName substringToIndex: ([theNewName length] - [str2 length])], str2] handler: nil]; } // If the folder was open, we must re-open and re-lock the mbox file, // recache the folder, adjust some paths and more. if (aFolder) { // We update its name and path [aFolder setName: theNewName]; [aFolder setPath: [NSString stringWithFormat: @"%@/%@", _path, theNewName]]; [[aFolder cacheManager] setPath: [NSString stringWithFormat: @"%@/%@.%@.cache", _path, [theNewName substringToIndex: ([theNewName length] - [[theNewName lastPathComponent] length])], [theNewName lastPathComponent]]]; // We recache the mailbox with its new name. RETAIN(aFolder); [_openFolders removeObjectForKey: theName]; [_openFolders setObject: aFolder forKey: theNewName]; RELEASE(aFolder); // We now open and lock the mbox file. If we use maildir, we must adjust the "mail filename" // of every message in the maildir. if ([aFolder type] == PantomimeFormatMbox) { [aFolder open_mbox]; } } // Rebuild the folder tree [self _rebuildFolderEnumerator]; } if (aBOOL) { POST_NOTIFICATION(PantomimeFolderRenameCompleted, self, info); PERFORM_SELECTOR_3(self, @selector(folderRenameCompleted:), PantomimeFolderRenameCompleted, info); } else { POST_NOTIFICATION(PantomimeFolderRenameFailed, self, info); PERFORM_SELECTOR_3(self, @selector(folderRenameFailed:), PantomimeFolderRenameFailed, info); } } @end // // Private interface // @implementation CWLocalStore (Private) - (NSEnumerator *) _rebuildFolderEnumerator { NSString *aString, *lastPathComponent, *pathToFolder; NSEnumerator *tmpEnumerator; NSArray *tmpArray; int i; // Clear out our cached folder structure and refresh from the file system [_folders removeAllObjects]; [_folders setArray: [[[NSFileManager defaultManager] enumeratorAtPath: _path] allObjects]]; // // We iterate through our array. If mbox A and .A.summary (or .A.cache) exists, we // remove .A.summary (or .A.cache) from our mutable array. // We do this in two runs: // First run: remove maildir sub-directory structure so that is appears as a regular folder. // Second run: remove other stuff like *.cache, *.summary // for (i = 0; i < [_folders count]; i++) { BOOL bIsMailDir; aString = [_folders objectAtIndex: i]; // // First run: // If this is a maildir directory, remove its sub-directory structure from the list, // so that the maildir store appears just like a regular mail store. // if ([[NSFileManager defaultManager] fileExistsAtPath: [NSString stringWithFormat: @"%@/%@/cur", _path, aString] isDirectory: &bIsMailDir] && bIsMailDir) { NSArray *subpaths; // Wust ensure 700 mode un cur/new/tmp folders and 600 on all files (ie., messages) if (_secure) { [[NSFileManager defaultManager] enforceMode: 0700 atPath: [NSString stringWithFormat: @"%@/%@/cur", _path, aString]]; [[NSFileManager defaultManager] enforceMode: 0700 atPath: [NSString stringWithFormat: @"%@/%@/new", _path, aString]]; [[NSFileManager defaultManager] enforceMode: 0700 atPath: [NSString stringWithFormat: @"%@/%@/tmp", _path, aString]]; } // Get all the children of this directory an remove them from our mutable array. subpaths = [[NSFileManager defaultManager] subpathsAtPath: [NSString stringWithFormat: @"%@/%@", _path, aString]]; [_folders removeObjectsInRange: NSMakeRange(i+1,[subpaths count])]; } } // // Second Run: Get rid of cache, summary and OS specific stuff // tmpArray = [[NSArray alloc] initWithArray: _folders]; AUTORELEASE(tmpArray); tmpEnumerator = [tmpArray objectEnumerator]; while ((aString = [tmpEnumerator nextObject])) { lastPathComponent = [aString lastPathComponent]; pathToFolder = [aString substringToIndex: ([aString length] - [lastPathComponent length])]; // We remove Netscape/Mozilla summary file. [_folders removeObject: [NSString stringWithFormat: @"%@.%@.summary", pathToFolder, lastPathComponent]]; // We remove Pantomime's cache file. Before doing so, we ensure it's 600 mode. [_folders removeObject: [NSString stringWithFormat: @"%@.%@.cache", pathToFolder, lastPathComponent]]; if (_secure) [[NSFileManager defaultManager] enforceMode: 0600 atPath: [NSString stringWithFormat: @"%@/%@.%@.cache", _path, pathToFolder, lastPathComponent]]; // We also remove Apple Mac OS X .DS_Store directory [_folders removeObject: [NSString stringWithFormat: @"%@.DS_Store", pathToFolder]]; } return [_folders objectEnumerator]; } @end pantomime1.2-1.2.2+dfsg1/Framework/Pantomime/CWMD5.h000066400000000000000000000050461276751561200216250ustar00rootroot00000000000000/* ** CWMD5.h ** ** Copyright (c) 2002-2006 ** ** Author: Ludovic Marcotte ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** You should have received a copy of the GNU Lesser General Public ** License along with this library; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef _Pantomime_H_CWMD5 #define _Pantomime_H_CWMD5 #import #import #import /*! @class CWMD5 @abstract MD5 Message-Digest algorithm implementation. @discussion This class provides an easy interface to the MD5 Message-Digest algorithm. This algorithm is described in RFC 1321. It also supports the HMAC keyed-hashing for message authentication (described in RFC 2104). HMAC is used in the CRAM-MD5 SASL authentication mechanim. */ @interface CWMD5 : NSObject { @private NSData *_data; BOOL _has_computed_digest; unsigned char _digest[16]; } /*! @method initWithData: @discussion This is the designated initializer for the CWMD5 class. @param theData The data to use for the MD5 operation. @result An instance of CWMD5, nil on failure. */ - (id) initWithData: (NSData *) theData; /*! @method computeDigest @discussion This method is used to compute the MD5 digest for the instance's data. */ - (void) computeDigest; /*! @method digest @discussion This method is used to obtain the computed digest, from the instance's data. @result The digest, as a NSData instance. */ - (NSData *) digest; /*! @method digestAsString @discussion See -digest. @result Returns the digest as a NSString instance. */ - (NSString *) digestAsString; /*! @method hmacAsStringUsingPassword: @discussion Computes the HMAC using thePassword and returns it. @param thePassword The password to use when computing the HMAC. @result The computed HMAC, as a NSString instance. */ - (NSString *) hmacAsStringUsingPassword: (NSString *) thePassword; @end #endif // _Pantomime_H_CWMD5 pantomime1.2-1.2.2+dfsg1/Framework/Pantomime/CWMD5.m000066400000000000000000000322621276751561200216320ustar00rootroot00000000000000/* ** CWMD5.m ** ** Copyright (c) 2002-2007 ** ** Author: Ludovic Marcotte ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** You should have received a copy of the GNU Lesser General Public ** License along with this library; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include #include #include #include #include // For byte order on Mac OS X. #define word32 unsigned int struct MD5Context { word32 buf[4]; word32 bits[2]; unsigned char in[64]; }; void MD5Init(struct MD5Context *context); void MD5Update(struct MD5Context *context, unsigned char const *buf, unsigned len); void MD5Final(unsigned char digest[16], struct MD5Context *context); void MD5Transform(word32 buf[4], word32 const in[16]); void md5_hmac(unsigned char *digest, const unsigned char* text, int text_len, const unsigned char* key, int key_len); // // // @implementation CWMD5 - (id) initWithData: (NSData *) theData { self = [super init]; _data = RETAIN(theData); _has_computed_digest = NO; return self; } // // // - (void) dealloc { RELEASE(_data); [super dealloc]; } // // // - (void) computeDigest { struct MD5Context ctx; unsigned char *bytes; unsigned len; // If we already have computed the digest if (_has_computed_digest) { return; } bytes = (unsigned char *)[_data bytes]; len = [_data length]; MD5Init(&ctx); MD5Update(&ctx, bytes, len); MD5Final(_digest, &ctx); _has_computed_digest = YES; } // // // - (NSData *) digest { if (!_has_computed_digest) { return nil; } return [NSData dataWithBytes: _digest length: 16]; } // // // - (NSString *) digestAsString { if (!_has_computed_digest) { return nil; } else { NSMutableString *aMutableString; int i; aMutableString = [[NSMutableString alloc] init]; for (i = 0; i < 16; i++) { [aMutableString appendFormat: @"%02x", (unsigned int)_digest[i]]; } return AUTORELEASE(aMutableString); } } // // The challenge phrase used is the one that has been initialized // with this object. The digest MUST have been computed first. // - (NSString *) hmacAsStringUsingPassword: (NSString *) thePassword { if (!_has_computed_digest) { return nil; } else { NSMutableString *aMutableString; unsigned char result[16]; unsigned char *s; int i; s = (unsigned char*)[_data cString]; md5_hmac(result, s, strlen((char*)s), (unsigned char*)[thePassword cString], [thePassword length]); aMutableString = [[NSMutableString alloc] init]; for (i = 0; i < 16; i++) { [aMutableString appendFormat: @"%02x", (unsigned int)result[i]]; } return AUTORELEASE(aMutableString); } } @end /* * This code implements the MD5 message-digest algorithm. * The algorithm is due to Ron Rivest. This code was * written by Colin Plumb in 1993, no copyright is claimed. * This code is in the public domain; do with it what you wish. * * Equivalent code is available from RSA Data Security, Inc. * This code has been tested against that, and is equivalent, * except that you don't need to include two pages of legalese * with every copy. * * To compute the message digest of a chunk of bytes, declare an * MD5Context structure, pass it to MD5Init, call MD5Update as * needed on buffers full of bytes, and then call MD5Final, which * will fill a supplied 16-byte array with the digest. */ #if BYTE_ORDER == BIG_ENDIAN static void byteReverse(unsigned char *buf, unsigned longs); /* * Note: this code is harmless on little-endian machines. */ static void byteReverse(unsigned char *buf, unsigned longs) { word32 t; do { t = (word32) ((unsigned) buf[3] << 8 | buf[2]) << 16 | ((unsigned) buf[1] << 8 | buf[0]); *(word32 *) buf = t; buf += 4; } while (--longs); } #elif BYTE_ORDER == LITTLE_ENDIAN #define byteReverse(buf, len) /* Nothing */ #else #warning BROKEN - Compiler byte order check failed for some reason. The MD5 code might not work properly. #endif /* * Start MD5 accumulation. Set bit count to 0 and buffer to mysterious * initialization constants. */ void MD5Init(struct MD5Context *ctx) { ctx->buf[0] = 0x67452301; ctx->buf[1] = 0xefcdab89; ctx->buf[2] = 0x98badcfe; ctx->buf[3] = 0x10325476; ctx->bits[0] = 0; ctx->bits[1] = 0; } /* * Update context to reflect the concatenation of another buffer full * of bytes. */ void MD5Update(struct MD5Context *ctx, unsigned char const *buf, unsigned len) { register word32 t; /* Update bitcount */ t = ctx->bits[0]; if ((ctx->bits[0] = t + ((word32) len << 3)) < t) ctx->bits[1]++; /* Carry from low to high */ ctx->bits[1] += len >> 29; t = (t >> 3) & 0x3f; /* Bytes already in shsInfo->data */ /* Handle any leading odd-sized chunks */ if (t) { unsigned char *p = (unsigned char *) ctx->in + t; t = 64 - t; if (len < t) { memmove(p, buf, len); return; } memmove(p, buf, t); byteReverse(ctx->in, 16); MD5Transform(ctx->buf, (word32 *) ctx->in); buf += t; len -= t; } /* Process data in 64-byte chunks */ while (len >= 64) { memmove(ctx->in, buf, 64); byteReverse(ctx->in, 16); MD5Transform(ctx->buf, (word32 *) ctx->in); buf += 64; len -= 64; } /* Handle any remaining bytes of data. */ memmove(ctx->in, buf, len); } /* * Final wrapup - pad to 64-byte boundary with the bit pattern * 1 0* (64-bit count of bits processed, MSB-first) */ void MD5Final(unsigned char digest[16], struct MD5Context *ctx) { unsigned int count; unsigned char *p; /* Compute number of bytes mod 64 */ count = (ctx->bits[0] >> 3) & 0x3F; /* Set the first char of padding to 0x80. This is safe since there is always at least one byte free */ p = ctx->in + count; *p++ = 0x80; /* Bytes of padding needed to make 64 bytes */ count = 64 - 1 - count; /* Pad out to 56 mod 64 */ if (count < 8) { /* Two lots of padding: Pad the first block to 64 bytes */ memset(p, 0, count); byteReverse(ctx->in, 16); MD5Transform(ctx->buf, (word32 *) ctx->in); /* Now fill the next block with 56 bytes */ memset(ctx->in, 0, 56); } else { /* Pad block to 56 bytes */ memset(p, 0, count - 8); } byteReverse(ctx->in, 14); /* Append length in bits and transform */ ((word32 *) ctx->in)[14] = ctx->bits[0]; ((word32 *) ctx->in)[15] = ctx->bits[1]; MD5Transform(ctx->buf, (word32 *) ctx->in); byteReverse((unsigned char *) ctx->buf, 4); memmove(digest, ctx->buf, 16); memset(&ctx, 0, sizeof(ctx)); /* In case it's sensitive */ } /* The four core functions - F1 is optimized somewhat */ /* #define F1(x, y, z) (x & y | ~x & z) */ #define F1(x, y, z) (z ^ (x & (y ^ z))) #define F2(x, y, z) F1(z, x, y) #define F3(x, y, z) (x ^ y ^ z) #define F4(x, y, z) (y ^ (x | ~z)) /* This is the central step in the MD5 algorithm. */ #define MD5STEP(f, w, x, y, z, data, s) \ ( w += f(x, y, z) + data, w = w<>(32-s), w += x ) /* * The core of the MD5 algorithm, this alters an existing MD5 hash to * reflect the addition of 16 longwords of new data. MD5Update blocks * the data and converts bytes into longwords for this routine. */ void MD5Transform(word32 buf[4], word32 const in[16]) { register word32 a, b, c, d; a = buf[0]; b = buf[1]; c = buf[2]; d = buf[3]; MD5STEP(F1, a, b, c, d, in[0] + 0xd76aa478, 7); MD5STEP(F1, d, a, b, c, in[1] + 0xe8c7b756, 12); MD5STEP(F1, c, d, a, b, in[2] + 0x242070db, 17); MD5STEP(F1, b, c, d, a, in[3] + 0xc1bdceee, 22); MD5STEP(F1, a, b, c, d, in[4] + 0xf57c0faf, 7); MD5STEP(F1, d, a, b, c, in[5] + 0x4787c62a, 12); MD5STEP(F1, c, d, a, b, in[6] + 0xa8304613, 17); MD5STEP(F1, b, c, d, a, in[7] + 0xfd469501, 22); MD5STEP(F1, a, b, c, d, in[8] + 0x698098d8, 7); MD5STEP(F1, d, a, b, c, in[9] + 0x8b44f7af, 12); MD5STEP(F1, c, d, a, b, in[10] + 0xffff5bb1, 17); MD5STEP(F1, b, c, d, a, in[11] + 0x895cd7be, 22); MD5STEP(F1, a, b, c, d, in[12] + 0x6b901122, 7); MD5STEP(F1, d, a, b, c, in[13] + 0xfd987193, 12); MD5STEP(F1, c, d, a, b, in[14] + 0xa679438e, 17); MD5STEP(F1, b, c, d, a, in[15] + 0x49b40821, 22); MD5STEP(F2, a, b, c, d, in[1] + 0xf61e2562, 5); MD5STEP(F2, d, a, b, c, in[6] + 0xc040b340, 9); MD5STEP(F2, c, d, a, b, in[11] + 0x265e5a51, 14); MD5STEP(F2, b, c, d, a, in[0] + 0xe9b6c7aa, 20); MD5STEP(F2, a, b, c, d, in[5] + 0xd62f105d, 5); MD5STEP(F2, d, a, b, c, in[10] + 0x02441453, 9); MD5STEP(F2, c, d, a, b, in[15] + 0xd8a1e681, 14); MD5STEP(F2, b, c, d, a, in[4] + 0xe7d3fbc8, 20); MD5STEP(F2, a, b, c, d, in[9] + 0x21e1cde6, 5); MD5STEP(F2, d, a, b, c, in[14] + 0xc33707d6, 9); MD5STEP(F2, c, d, a, b, in[3] + 0xf4d50d87, 14); MD5STEP(F2, b, c, d, a, in[8] + 0x455a14ed, 20); MD5STEP(F2, a, b, c, d, in[13] + 0xa9e3e905, 5); MD5STEP(F2, d, a, b, c, in[2] + 0xfcefa3f8, 9); MD5STEP(F2, c, d, a, b, in[7] + 0x676f02d9, 14); MD5STEP(F2, b, c, d, a, in[12] + 0x8d2a4c8a, 20); MD5STEP(F3, a, b, c, d, in[5] + 0xfffa3942, 4); MD5STEP(F3, d, a, b, c, in[8] + 0x8771f681, 11); MD5STEP(F3, c, d, a, b, in[11] + 0x6d9d6122, 16); MD5STEP(F3, b, c, d, a, in[14] + 0xfde5380c, 23); MD5STEP(F3, a, b, c, d, in[1] + 0xa4beea44, 4); MD5STEP(F3, d, a, b, c, in[4] + 0x4bdecfa9, 11); MD5STEP(F3, c, d, a, b, in[7] + 0xf6bb4b60, 16); MD5STEP(F3, b, c, d, a, in[10] + 0xbebfbc70, 23); MD5STEP(F3, a, b, c, d, in[13] + 0x289b7ec6, 4); MD5STEP(F3, d, a, b, c, in[0] + 0xeaa127fa, 11); MD5STEP(F3, c, d, a, b, in[3] + 0xd4ef3085, 16); MD5STEP(F3, b, c, d, a, in[6] + 0x04881d05, 23); MD5STEP(F3, a, b, c, d, in[9] + 0xd9d4d039, 4); MD5STEP(F3, d, a, b, c, in[12] + 0xe6db99e5, 11); MD5STEP(F3, c, d, a, b, in[15] + 0x1fa27cf8, 16); MD5STEP(F3, b, c, d, a, in[2] + 0xc4ac5665, 23); MD5STEP(F4, a, b, c, d, in[0] + 0xf4292244, 6); MD5STEP(F4, d, a, b, c, in[7] + 0x432aff97, 10); MD5STEP(F4, c, d, a, b, in[14] + 0xab9423a7, 15); MD5STEP(F4, b, c, d, a, in[5] + 0xfc93a039, 21); MD5STEP(F4, a, b, c, d, in[12] + 0x655b59c3, 6); MD5STEP(F4, d, a, b, c, in[3] + 0x8f0ccc92, 10); MD5STEP(F4, c, d, a, b, in[10] + 0xffeff47d, 15); MD5STEP(F4, b, c, d, a, in[1] + 0x85845dd1, 21); MD5STEP(F4, a, b, c, d, in[8] + 0x6fa87e4f, 6); MD5STEP(F4, d, a, b, c, in[15] + 0xfe2ce6e0, 10); MD5STEP(F4, c, d, a, b, in[6] + 0xa3014314, 15); MD5STEP(F4, b, c, d, a, in[13] + 0x4e0811a1, 21); MD5STEP(F4, a, b, c, d, in[4] + 0xf7537e82, 6); MD5STEP(F4, d, a, b, c, in[11] + 0xbd3af235, 10); MD5STEP(F4, c, d, a, b, in[2] + 0x2ad7d2bb, 15); MD5STEP(F4, b, c, d, a, in[9] + 0xeb86d391, 21); buf[0] += a; buf[1] += b; buf[2] += c; buf[3] += d; } /* ** Function: md5_hmac ** Taken from the file RFC2104 ** Written by Martin Schaaf , modified by Ludovic Marcotte */ void md5_hmac(unsigned char *digest, const unsigned char* text, int text_len, const unsigned char* key, int key_len) { struct MD5Context context; unsigned char k_ipad[64]; /* inner padding - * key XORd with ipad */ unsigned char k_opad[64]; /* outer padding - * key XORd with opad */ /* unsigned char tk[16]; */ int i; /* start out by storing key in pads */ memset(k_ipad, 0, sizeof k_ipad); memset(k_opad, 0, sizeof k_opad); if (key_len > 64) { /* if key is longer than 64 bytes reset it to key=MD5(key) */ struct MD5Context tctx; MD5Init(&tctx); MD5Update(&tctx, key, key_len); MD5Final(k_ipad, &tctx); MD5Final(k_opad, &tctx); } else { memcpy(k_ipad, key, key_len); memcpy(k_opad, key, key_len); } /* * the HMAC_MD5 transform looks like: * * MD5(K XOR opad, MD5(K XOR ipad, text)) * * where K is an n byte key * ipad is the byte 0x36 repeated 64 times * opad is the byte 0x5c repeated 64 times * and text is the data being protected */ /* XOR key with ipad and opad values */ for (i = 0; i < 64; i++) { k_ipad[i] ^= 0x36; k_opad[i] ^= 0x5c; } /* * perform inner MD5 */ MD5Init(&context); /* init context for 1st * pass */ MD5Update(&context, k_ipad, 64); /* start with inner pad */ MD5Update(&context, text, text_len); /* then text of datagram */ MD5Final(digest, &context); /* finish up 1st pass */ /* * perform outer MD5 */ MD5Init(&context); /* init context for 2nd * pass */ MD5Update(&context, k_opad, 64); /* start with outer pad */ MD5Update(&context, digest, 16); /* then results of 1st * hash */ MD5Final(digest, &context); /* finish up 2nd pass */ } pantomime1.2-1.2.2+dfsg1/Framework/Pantomime/CWMIMEMultipart.h000066400000000000000000000046271276751561200236750ustar00rootroot00000000000000/* ** CWMIMEMultipart.h ** ** Copyright (c) 2001-2004 Ludovic Marcotte ** 2013 The GNUstep team ** ** Author: Ludovic Marcotte ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** You should have received a copy of the GNU Lesser General Public ** License along with this library; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef _Pantomime_H_CWMIMEMultipart #define _Pantomime_H_CWMIMEMultipart #import #import #if defined(__APPLE__) && (MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_4) #ifndef NSUInteger #define NSUInteger unsigned int #endif #endif @class CWPart; /*! @class CWMIMEMultipart @discussion This class is used to define a composite multipart. It holds CWPart instances. */ @interface CWMIMEMultipart : NSObject { @private NSMutableArray *_parts; } /*! @method addPart: @discussion This method is used to add new body part to the multipart instance. @param thePart The CWPart instance to add. */ - (void) addPart: (CWPart *) thePart; /*! @method removePart: @discussion This method is used to remove an existing body part from the multipart instance. @param thePart The CWPart instance to remove. */ - (void) removePart: (CWPart *) thePart; /*! @method count @discussion This method returns the number of CWPart objects present in the receiver. @result The number of Part instances. */ - (NSUInteger) count; /*! @method partAtIndex: @discussion This method is used to get the CWPart instance at the specified index. @param theIndex The index of the CWPart instance to get. @result The CWPart instance. If the index is out of bounds, an NSRangeException is raised. */ - (CWPart *) partAtIndex: (unsigned int) theIndex; @end #endif // _Pantomime_H_CWMIMEMultipart pantomime1.2-1.2.2+dfsg1/Framework/Pantomime/CWMIMEMultipart.m000066400000000000000000000030261276751561200236720ustar00rootroot00000000000000/* ** CWMIMEMultipart.m ** ** Copyright (c) 2001-2004 ** ** Author: Ludovic Marcotte ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** You should have received a copy of the GNU Lesser General Public ** License along with this library; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include #include // // // @implementation CWMIMEMultipart - (id) init { self = [super init]; _parts = [[NSMutableArray alloc] init]; return self; } // // // - (void) dealloc { RELEASE(_parts); [super dealloc]; } // // // - (void) addPart: (CWPart *) thePart { if (thePart) { [_parts addObject: thePart]; } } // // // - (void) removePart: (CWPart *) thePart { if (thePart) { [_parts removeObject: thePart]; } } // // // - (NSUInteger) count { return [_parts count]; } // // // - (CWPart *) partAtIndex: (unsigned int) theIndex { return [_parts objectAtIndex: theIndex]; } @end pantomime1.2-1.2.2+dfsg1/Framework/Pantomime/CWMIMEUtility.h000066400000000000000000000132411276751561200233470ustar00rootroot00000000000000/* ** CWMIMEUtility.h ** ** Copyright (c) 2001-2004 ** ** Author: Ludovic Marcotte ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** You should have received a copy of the GNU Lesser General Public ** License along with this library; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef _Pantomime_H_CWMIMEUtility #define _Pantomime_H_CWMIMEUtility #import #import #import #import #include @class CWMessage; @class CWMIMEMultipart; @class CWPart; /*! @class CWMIMEUtility @abstract MIME utility class. @discussion This class provides static methods to deal with the MIME standard. Normally, you should not invoke any of those methods directly. */ @interface CWMIMEUtility: NSObject /*! @method decodeHeader: charset: @discussion This method is used to decode a header value encoded in base64 or quoted-printable. RFC 2047 describes how those headers should be encoded (in particular, "2. Syntax of encoded-words"). If theCharset is not nil, it is used to decode the header. Otherwise, the charset used in the header is used. @param theData The data to decode. @param theCharset The charset to force. @result The decoded header. */ + (NSString *) decodeHeader: (NSData *) theData charset: (NSString *) theCharset; /*! @method encodeHeader: charset: encoding: @discussion This method is used to encode a header value in the format specified by RFC 2047 (in particular, "2. Syntax of encoded-words"). @param theText The text to encode. @param theCharset The charset to use. For example, "iso-8859-1". @param theEncoding The encoding to use. Valid values are part of the PantomimeEncoding enum. @result The encoded data. */ + (NSData *) encodeHeader: (NSString *) theText charset: (NSString *) theCharset encoding: (PantomimeEncoding) theEncoding; + (NSData *) encodeWordUsingBase64: (NSString *) theWord prefixLength: (int) thePrefixLength; + (NSData *) encodeWordUsingQuotedPrintable: (NSString *) theWord prefixLength: (int) thePrefixLength; /*! @method globallyUniqueBoundary @discussion This method is used to generate a unique MIME boundary (or any kind of boundary). @result The boundary, as a NSData instance. */ + (NSData *) globallyUniqueBoundary; /*! @method globallyUniqueID @discussion This method is used to generate a unique ID that CWMessage (or CWPart) instances use as their unique ID. (Message-ID, Content-ID, etc.) @result The unique ID, as a NSData instance. */ + (NSData *) globallyUniqueID; /*! @method compositeMessageContentFromRawSource: @discussion This method is used to obtain a composite type (message) from theData. @param theData The bytes to use. @result A Message instance, nil on error. */ + (CWMessage *) compositeMessageContentFromRawSource: (NSData *) theData; /*! @method compositeMultipartContentFromRawSource:boundary: @discussion This method is used to obtain a composity type (multipart) from theData, using theBoundary. @param theData The bytes to use. @param theBoundary The boundary to use. @result A CWMIMEMultipart instance, nil on error. */ + (CWMIMEMultipart *) compositeMultipartContentFromRawSource: (NSData *) theData boundary: (NSData *) theBoundary; /*! @method discreteContentFromRawSource: encoding: charset: part: @discussion This method is used to obtain discrete types such as text/, application/, image/, etc. It might return a NSString or a NSData object (if the encoding is PantomimeEncodingBase64). @param theData The bytes to use. @param theEncoding The encoding to use. Valid values are part of the PantomimeEncoding enum. @result A NSData instance. */ + (id) discreteContentFromRawSource: (NSData *) theData encoding: (PantomimeEncoding) theEncoding; /*! @method setContentFromRawSource: inPart: @discussion This method is used to initialize a message, or a part of the message using theData. The CWPart's Content-Type MUST be defined BEFORE calling this function otherwise the content will be considered as a pure string. @param theData The bytes to use. @param thePart The part to use, which can be a Part or a Message instance. */ + (void) setContentFromRawSource: (NSData *) theData inPart: (CWPart *) thePart; /*! @method plainTextContentFromPart: @discussion This method is used to obtain a pure "text" part. For example, it can be used to strip any HTML content from a part in order to get only the text. @param thePart The Part instance from which to obtain the text. @result The pure "text". */ + (NSData *) plainTextContentFromPart: (CWPart *) thePart; @end #endif // _Pantomime_H_CWMIMEUtility pantomime1.2-1.2.2+dfsg1/Framework/Pantomime/CWMIMEUtility.m000066400000000000000000000542431276751561200233630ustar00rootroot00000000000000/* ** CWMIMEUtility.m ** ** Copyright (c) 2001-2007 ** 2014 The GNUstep team ** ** Author: Ludovic Marcotte ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** You should have received a copy of the GNU Lesser General Public ** License along with this library; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #include #include #include #include #include // // C functions // char ent(char **ref); char *striphtml(char *s, int encoding); NSString *unique_id(); static const char *hexDigit = "0123456789ABCDEF"; static int seed_count = 1; @implementation CWMIMEUtility // // See RFC2047. // It supports: // // Abcd =?ISO-8859-1?Q?=E8fgh?= // =?iso-8859-1?Q?ab=E7de?= =?iso-8859-1?Q?_?= =?iso-8859-1?Q?oo=F4oo?= // Abd =?ISO-8859-1?Q?=E8?= fghijklmn // // + (NSString *) decodeHeader: (NSData *) theData charset: (NSString *) theCharset { NSMutableString *aMutableString; NSData *charset, *encoded_text; NSString *aString; int i, length, start, i_charset, i_encoding, end; const char *bytes; BOOL ignore_span; char encoding; // We first verify for a nil value if (theData == nil || (length = [theData length]) == 0) { return @""; } // We check for the ISO-2022-JP announcer sequence if ([theData hasCPrefix: "\e$B"]) { return AUTORELEASE([[NSString alloc] initWithData: theData encoding: NSISO2022JPStringEncoding]); } bytes = [theData bytes]; aMutableString = [[NSMutableString alloc] initWithCapacity: length]; start = i = 0; ignore_span = NO; while (i < (length - 1)) { if (bytes[i] != '=' || bytes[i+1] != '?') { if (bytes[i] > 32) { ignore_span = NO; } i++; continue; } if (i != start && !ignore_span) { aString = nil; if (theCharset) { aString = [NSString stringWithData: [NSData dataWithBytes: bytes+start length: i-start] charset: [theCharset dataUsingEncoding: NSASCIIStringEncoding]]; RETAIN(aString); } if (!aString) { aString = [[NSString alloc] initWithCString: bytes+start length: i-start]; } [aMutableString appendString: aString]; DESTROY(aString); } start = i; // skip the =? and one character (or it isn't valid) i += 3; while (i < length && bytes[i] != '?') { i++; } if ( i == length) { break; } i_charset = i; // encoding is a single character if (i+2 >= length) { break; } encoding = bytes[i+1]; if (bytes[i+2] != '?') { break; } i += 3; i_encoding = i; while (i = length) { break; } if (bytes[i+1] != '=') { break; } end = i; i += 2; if (theCharset) { charset = [theCharset dataUsingEncoding: NSASCIIStringEncoding]; } else { charset = [theData subdataWithRange: NSMakeRange(start+2,i_charset-start-2)]; } encoded_text = [theData subdataWithRange: NSMakeRange(i_encoding,end-i_encoding)]; if (encoding == 'q' || encoding == 'Q') { aString = [NSString stringWithData: [encoded_text decodeQuotedPrintableInHeader: YES] charset: charset]; } else if (encoding == 'b' || encoding== 'B') { aString = [NSString stringWithData: [encoded_text decodeBase64] charset: charset]; } else { continue; } if (!aString) { continue; } [aMutableString appendString: aString]; aString = nil; start = i; ignore_span = YES; } i = length; if (i != start && !ignore_span) { aString = nil; if (theCharset) { aString = [NSString stringWithData: [NSData dataWithBytes: bytes+start length: i-start] charset: [theCharset dataUsingEncoding: NSASCIIStringEncoding]]; RETAIN(aString); } if (!aString) { aString = [[NSString alloc] initWithCString: bytes+start length: i-start]; } [aMutableString appendString: aString]; DESTROY(aString); } return AUTORELEASE(aMutableString); } // // // + (NSData *) globallyUniqueBoundary { NSMutableData *aMutableData; aMutableData = [[NSMutableData alloc] init]; [aMutableData appendBytes: "=_" length: 2]; [aMutableData appendCFormat: @"%@", unique_id()]; return AUTORELEASE(aMutableData); } // // Instead of using [[NSHost currentHost] name], // we use gethostname(). This is due to the fact // that NSHost's -name method will block for a good // amount of time if DNS resolutions can't be made. // + (NSData *) globallyUniqueID { NSMutableData *aMutableData; char s[65]; aMutableData = [[NSMutableData alloc] init]; [aMutableData appendCFormat: @"%@", unique_id()]; memset(s, 0, sizeof(s)); gethostname(s, sizeof(s)-1); [aMutableData appendCFormat: @"@%s", s]; return AUTORELEASE(aMutableData); } // // FIXME: Should we really use NSUTF8StringEncoding in base64? // + (NSData *) encodeHeader: (NSString *) theText charset: (NSString *) theCharset encoding: (PantomimeEncoding) theEncoding { NSData *aData; // Initial verification if (!theText || [theText length] == 0) { return [NSData data]; } aData = [theText dataUsingEncoding: [NSString encodingForCharset: [theCharset dataUsingEncoding: NSASCIIStringEncoding]]]; if (theEncoding == PantomimeEncodingQuotedPrintable) { return [aData encodeQuotedPrintableWithLineLength: 0 inHeader: YES]; } else if (theEncoding == PantomimeEncodingBase64) { return [aData encodeBase64WithLineLength: 0]; } // // FIXME: What should we do here, should we just return the 'aData' w/o // encoding it or should we generate an exception? else { return aData; } } // // The format returned is for example: // // =?ISO-8859-1?B?....?= // // This format is known as an encoded-word defined in RFC2047. // If the word doesn't need to be encoded, it's just returned as is. // // FIXME: We should verify that the length doesn't exceed 75 chars. // #warning remove/combine or leave and document + (NSData *) encodeWordUsingBase64: (NSString *) theWord prefixLength: (int) thePrefixLength { // Initial verification if (!theWord || [theWord length] == 0) { return [NSData data]; } else if ([theWord is7bitSafe]) { return [theWord dataUsingEncoding: NSASCIIStringEncoding]; } else { NSMutableData *aMutableData; NSString *aCharset; aMutableData = [[NSMutableData alloc] init]; aCharset = [theWord charset]; [aMutableData appendCFormat: @"=?%@?b?", aCharset]; [aMutableData appendData: [CWMIMEUtility encodeHeader: theWord charset: aCharset encoding: PantomimeEncodingBase64]]; [aMutableData appendCString: "?="]; return AUTORELEASE(aMutableData); } // Never reached. return nil; } // // The format returned is for example: // // =?ISO-8859-1?Q?=E8fgh?= // // This format is known as an encoded-word defined in RFC2047. // If the word doesn't need to be encoded, it's just returned as it. // // The string returned will NOT be more than 75 characters long // for each folded part of the original string. // #warning remove/combine or leave and document + (NSData *) encodeWordUsingQuotedPrintable: (NSString *) theWord prefixLength: (int) thePrefixLength { NSMutableString *aMutableString; NSMutableArray *aMutableArray; NSString *aCharset, *aString; NSMutableData *aMutableData; NSScanner *aScanner; int i, count, previousLocation, currentLocation; BOOL mustUseEncoding; if (!theWord || [theWord length] == 0 ) { return [NSData data]; } // If it's not an ASCII string, we must use the encoding! mustUseEncoding = ![theWord is7bitSafe]; aCharset = nil; if (mustUseEncoding) { aCharset = [theWord charset]; } aMutableString = [[NSMutableString alloc] init]; aMutableArray = [[NSMutableArray alloc] init]; AUTORELEASE(aMutableArray); // We initialize our scanner with the content of our word aScanner = [[NSScanner alloc] initWithString: theWord]; previousLocation = 0; while ([aScanner scanUpToCharactersFromSet: [NSCharacterSet whitespaceCharacterSet] intoString: NULL]) { int length; currentLocation = [aScanner scanLocation]; // aString contains the substring WITH the spaces present BEFORE the word and AFTER the last aString. // // For example, the result of "this is a test" will be // // aString = "this" // aString = " is" // aString = " a" // aString = " test" // aString = [theWord substringWithRange: NSMakeRange(previousLocation, currentLocation - previousLocation)]; if (mustUseEncoding) { // Our 'initial' length contains =?iso-8859-x?q? and ?= length = 18; length += [[CWMIMEUtility encodeHeader: [NSString stringWithFormat: @"%@%@", aMutableString, aString] charset: aCharset encoding: PantomimeEncodingQuotedPrintable] length]; } else { length = [aMutableString length] + [aString length]; } // If we are on the first line, we must consider the prefix length. // For example, the prefix length might be the length of the string "Subject: " if ([aMutableArray count] == 0) { length += thePrefixLength; } if (length > 75) { [aMutableArray addObject: aMutableString]; RELEASE(aMutableString); aMutableString = [[NSMutableString alloc] init]; } [aMutableString appendString: aString]; previousLocation = currentLocation; } // We add our last string to the array. [aMutableArray addObject: aMutableString]; RELEASE(aMutableString); RELEASE(aScanner); aMutableData = [[NSMutableData alloc] init]; count = [aMutableArray count]; for (i = 0; i < count; i++) { aString = [aMutableArray objectAtIndex: i]; // We must append a space (' ') before each folded line. if (i > 0) { [aMutableData appendCString: " "]; } if (mustUseEncoding) { [aMutableData appendCFormat: @"=?%@?q?", aCharset]; [aMutableData appendData: [CWMIMEUtility encodeHeader: aString charset: aCharset encoding: PantomimeEncodingQuotedPrintable] ]; [aMutableData appendCString: "?="]; } else { [aMutableData appendData: [aString dataUsingEncoding: NSASCIIStringEncoding]]; } // We if it is our last string, we must NOT append the \n if (!(i == (count-1))) { [aMutableData appendCString: "\n"]; } } return AUTORELEASE(aMutableData); } // // // + (CWMessage *) compositeMessageContentFromRawSource: (NSData *) theData { return AUTORELEASE([[CWMessage alloc] initWithData: theData]); } // // FIXME: whitespace after boundary markers // + (CWMIMEMultipart *) compositeMultipartContentFromRawSource: (NSData *) theData boundary: (NSData *) theBoundary { CWMIMEMultipart *aMimeMultipart; NSMutableData *aMutableData; NSArray *allParts; NSRange aRange; int i, count; aMimeMultipart = [[CWMIMEMultipart alloc] init]; aMutableData = [[NSMutableData alloc] init]; [aMutableData appendBytes: "--" length: 2]; [aMutableData appendData: theBoundary]; // We first skip everything before the first boundary aRange = [theData rangeOfData: aMutableData]; if (aRange.length && aRange.location) { theData = [theData subdataFromIndex: (aRange.location + aRange.length)]; } [aMutableData setLength: 0]; [aMutableData appendBytes: "\n--" length: 3]; [aMutableData appendData: theBoundary]; // Add terminating 0 so we can use it as a C string below [aMutableData appendBytes: "\0" length: 1]; // We split this mime body part into multiple parts since we have various representations // of the actual body part. allParts = [theData componentsSeparatedByCString: [aMutableData bytes]]; count = [allParts count]; RELEASE(aMutableData); for (i = 0; i < count; i++) { CWPart *aPart; NSData *aData; aData = [allParts objectAtIndex: i]; if (aData && [aData length] > 0) { // This is the last part. Ignore everything past the end marker if ([aData hasCPrefix: "--\n"] || ([aData length] == 2 && [aData hasCPrefix: "--"])) { break; } // We then skip the first character since it's a \n (the one at the end of the boundary) if ([aData hasCPrefix: "\n"]) { aData = [aData subdataFromIndex: 1]; } aPart = [[CWPart alloc] initWithData: aData]; [aPart setSize: [aData length]]; [aMimeMultipart addPart: aPart]; RELEASE(aPart); } } return AUTORELEASE(aMimeMultipart); } // // // + (id) discreteContentFromRawSource: (NSData *) theData encoding: (PantomimeEncoding) theEncoding { if (theEncoding == PantomimeEncodingQuotedPrintable) { return [theData decodeQuotedPrintableInHeader: NO]; } else if (theEncoding == PantomimeEncodingBase64) { return [[theData dataByRemovingLineFeedCharacters] decodeBase64]; } return theData; } // // // + (void) setContentFromRawSource: (NSData *) theData inPart: (CWPart *) thePart { NSAutoreleasePool *pool; // We create a temporary autorelease pool since this method can be // memory consuming on our default autorelease pool. pool = [[NSAutoreleasePool alloc] init]; // // Composite types (message/multipart). // if ([thePart isMIMEType: @"message" subType: @"rfc822"]) { NSData *aData; aData = theData; // We verify the Content-Transfer-Encoding, this part could be base64 encoded. if ([thePart contentTransferEncoding] == PantomimeEncodingBase64) { NSMutableData *aMutableData; aData = [[theData dataByRemovingLineFeedCharacters] decodeBase64]; aMutableData = [NSMutableData dataWithData: aData]; [aMutableData replaceCRLFWithLF]; aData = aMutableData; } [thePart setContent: [CWMIMEUtility compositeMessageContentFromRawSource: aData]]; } else if ([thePart isMIMEType: @"multipart" subType: @"*"]) { [thePart setContent: [CWMIMEUtility compositeMultipartContentFromRawSource: theData boundary: [thePart boundary]]]; } // // Discrete types (text/application/audio/image/video) or any "unsupported Content-Type:s" // // text/* // image/* // application/* // audio/* // video/* // // We also treat those composite type as discrete types: // #warning test extensively those // message/delivery-status // message/disposition-notification // else { [thePart setContent: [CWMIMEUtility discreteContentFromRawSource: theData encoding: [thePart contentTransferEncoding]]]; } RELEASE(pool); } // // // + (NSData *) plainTextContentFromPart: (CWPart *) thePart { NSData *aContent; aContent = (NSData *)[thePart content]; // // If it's a text/html part, we must remove all the formatting codes and // keep only the 'real' text contained in that part. We should do the // same for text/rtf or text/enriched parts. // if ([thePart isMIMEType: @"text" subType: @"html"]) { char *buf, *bytes; buf = (char *)malloc(([aContent length]+1)*sizeof(char)); memset(buf, 0, [aContent length]+1); memcpy(buf, [aContent bytes], [aContent length]); bytes = striphtml(buf, [NSString encodingForPart: thePart]); free(buf); aContent = [NSData dataWithBytesNoCopy: bytes length: strlen(bytes) freeWhenDone: YES]; } return aContent; } @end // // This C function has been written by Abhijit Menon-Sen // This code is in the public domain. // char *striphtml(char *s, int encoding) { char c, *t, *text; if ((t = text = malloc(strlen(s)+1)) == NULL) { return NULL; } while ((c = *s++)) { if (c == '<') { /* * Ignore everything to the end of this tag or sgml comment. */ if (s[0] == '!' && s[1] == '-' && s[2] == '-') { s += 3; while ((c = *s++)) { if (c == '-' && s[0] == '-' && s[1] == '>') { s += 2; break; } } } else { while ((c = *s++)) { if (c == '>') { break; } } } } else if (c == '&') { NSString *aString; c = ent(&s); aString = AUTORELEASE([[NSString alloc] initWithBytes: &c length: 1 encoding: NSISOLatin1StringEncoding]); if ([aString length]) { NSData *aData; aData = [aString dataUsingEncoding: encoding]; if (aData) { char *bytes; int len; bytes = (char *)[aData bytes]; len = [aData length]; while (len--) { *t++ = *bytes; bytes++; } } } } else { *t++ = c; } } *t++ = '\0'; return text; } // // This C function has been written by Abhijit Menon-Sen // This code is in the public domain. // char ent(char **ref) { int i; char c = ' ', *s = *ref, *t = s; struct { char *name; char chr; } refs[] = { { "lt" , '<' }, { "gt" , '>' }, { "amp" , '&' }, { "quot" , '"' }, { "nbsp" , (char)160 }, { "iexcl" , (char)161 }, { "cent" , (char)162 }, { "pound" , (char)163 }, { "curren", (char)164 }, { "yen" , (char)165 }, { "brvbar", (char)166 }, { "sect" , (char)167 }, { "uml" , (char)168 }, { "copy" , (char)169 }, { "ordf" , (char)170 }, { "laquo" , (char)171 }, { "not" , (char)172 }, { "shy" , (char)173 }, { "reg" , (char)174 }, { "macr" , (char)175 }, { "deg" , (char)176 }, { "plusmn", (char)177 }, { "sup2" , (char)178 }, { "sup3" , (char)179 }, { "acute" , (char)180 }, { "micro" , (char)181 }, { "para" , (char)182 }, { "middot", (char)183 }, { "cedil" , (char)184 }, { "sup1" , (char)185 }, { "ordm" , (char)186 }, { "raquo" , (char)187 }, { "frac14", (char)188 }, { "frac12", (char)189 }, { "frac34", (char)190 }, { "iquest", (char)191 }, { "Agrave", (char)192 }, { "Aacute", (char)193 }, { "Acirc" , (char)194 }, { "Atilde", (char)195 }, { "Auml" , (char)196 }, { "Aring" , (char)197 }, { "AElig" , (char)198 }, { "Ccedil", (char)199 }, { "Egrave", (char)200 }, { "Eacute", (char)201 }, { "Ecirc" , (char)202 }, { "Euml" , (char)203 }, { "Igrave", (char)204 }, { "Iacute", (char)205 }, { "Icirc" , (char)206 }, { "Iuml" , (char)207 }, { "ETH" , (char)208 }, { "Ntilde", (char)209 }, { "Ograve", (char)210 }, { "Oacute", (char)211 }, { "Ocirc" , (char)212 }, { "Otilde", (char)213 }, { "Ouml" , (char)214 }, { "times" , (char)215 }, { "Oslash", (char)216 }, { "Ugrave", (char)217 }, { "Uacute", (char)218 }, { "Ucirc" , (char)219 }, { "Uuml" , (char)220 }, { "Yacute", (char)221 }, { "THORN" , (char)222 }, { "szlig" , (char)223 }, { "agrave", (char)224 }, { "aacute", (char)225 }, { "acirc" , (char)226 }, { "atilde", (char)227 }, { "auml" , (char)228 }, { "aring" , (char)229 }, { "aelig" , (char)230 }, { "ccedil", (char)231 }, { "egrave", (char)232 }, { "eacute", (char)233 }, { "ecirc" , (char)234 }, { "euml" , (char)235 }, { "igrave", (char)236 }, { "iacute", (char)237 }, { "icirc" , (char)238 }, { "iuml" , (char)239 }, { "eth" , (char)240 }, { "ntilde", (char)241 }, { "ograve", (char)242 }, { "oacute", (char)243 }, { "ocirc" , (char)244 }, { "otilde", (char)245 }, { "ouml" , (char)246 }, { "divide", (char)247 }, { "oslash", (char)248 }, { "ugrave", (char)249 }, { "uacute", (char)250 }, { "ucirc" , (char)251 }, { "uuml" , (char)252 }, { "yacute", (char)253 }, { "thorn" , (char)254 }, { "yuml" , (char)255 } }; while (isalpha((int)(unsigned char)*s) || isdigit((int)(unsigned char)*s) || *s == '#') s++; for (i = 0; i < sizeof(refs)/sizeof(refs[0]); i++) { if (strncmp(refs[i].name, t, s-t) == 0) { c = refs[i].chr; break; } } if (*s == ';') s++; *ref = s; return c; } // // // NSString *unique_id() { NSMutableData *aMutableData; CWMD5 *aMD5; char random_data[9]; time_t curtime; int i, pid; pid = getpid(); time(&curtime); for (i = 0; i < 8; i++) { srand(seed_count++); random_data[i] = hexDigit[rand()&0xf]; } random_data[8] = '\0'; aMutableData = [[NSMutableData alloc] init]; [aMutableData appendCFormat: @"%d.%d%s", pid, curtime, random_data]; aMD5 = [[CWMD5 alloc] initWithData: aMutableData]; RELEASE(aMutableData); AUTORELEASE(aMD5); [aMD5 computeDigest]; return [aMD5 digestAsString]; } pantomime1.2-1.2.2+dfsg1/Framework/Pantomime/CWMacOSXGlue.h000066400000000000000000000031011276751561200231350ustar00rootroot00000000000000/* ** CWMacOSXGlue.h ** ** Copyright (c) 2001-2004 ** ** Author: Ludovic Marcotte ** Stephane Corthesy ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** You should have received a copy of the GNU Lesser General Public ** License along with this library; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef _Pantomime_H_CWMacOSXGlue #define _Pantomime_H_CWMacOSXGlue #import /*! @category NSObject (PantomimeMacOSXGlue) @discussion This category is used to define a simple method in to raise excections if a non-implemented method is being called on an abstract class instance. You should never use this method directly. */ @interface NSObject (PantomimeMacOSXGlue) /*! @method subclassResponsibility @discussion This method will raise a generic exception whenever it is invoked. @result This method always returns nil. */ - (id) subclassResponsibility: (SEL) theSel; @end #endif // _Pantomime_H_CWMacOSXGlue pantomime1.2-1.2.2+dfsg1/Framework/Pantomime/CWMacOSXGlue.m000066400000000000000000000024521276751561200231520ustar00rootroot00000000000000/* ** CWMacOSXGlue.m ** ** Copyright (c) 2001-2004 ** ** Author: Ludovic Marcotte ** Stephane Corthesy ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** You should have received a copy of the GNU Lesser General Public ** License along with this library; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "CWMacOSXGlue.h" #include #include // // // @implementation NSObject(PantomimeMacOSXGlue) - (id) subclassResponsibility: (SEL) theSel { [NSException raise: NSGenericException format: @"subclass %s should override %s", object_getClassName(self), sel_getName(theSel)]; return nil; } @end pantomime1.2-1.2.2+dfsg1/Framework/Pantomime/CWMessage.h000066400000000000000000000434051276751561200226250ustar00rootroot00000000000000/* ** CWMessage.h ** ** Copyright (c) 2001-2007 ** ** Author: Ludovic Marcotte ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** You should have received a copy of the GNU Lesser General Public ** License along with this library; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef _Pantomime_H_CWMessage #define _Pantomime_H_CWMessage #include #include #include #import #import #import #import #import #import /*! @const PantomimeMessageFetchCompleted */ extern NSString* PantomimeMessageFetchCompleted; /*! @const PantomimeMessageFetchFailed */ extern NSString* PantomimeMessageFetchFailed; /*! @const PantomimeMessagePrefetchCompleted */ extern NSString* PantomimeMessagePrefetchCompleted; /*! @const PantomimeMessagePrefetchFailed */ extern NSString* PantomimeMessagePrefetchFailed; /*! @const PantomimeMessageChanged @discussion This notification is posted when message flags have changed but the called didn't ask for flag changes. */ extern NSString* PantomimeMessageChanged; /*! @const PantomimeMessageExpunged @discussion This notification is posted when a message is expunged but the called didn't expunge the mailbox. */ extern NSString* PantomimeMessageExpunged; @class CWFlags; @class CWFolder; @class CWInternetAddress; /*! @class CWMessage @discussion This class is used to describe Internet messages. This class extends the CWPart class and inherit all its methods. */ @interface CWMessage : CWPart { @protected NSData *_rawSource; @private NSMutableDictionary *_properties; NSMutableArray *_recipients; NSArray *_references; CWFolder *_folder; CWFlags *_flags; unsigned int _message_number; BOOL _initialized; } /*! @method initWithHeaders: @discussion This method is used to initialize the receiver with a predefined set of headers. The headers are specified in a NSDictionary instance where the keys are the header names (for example, "Content-Type") and the values are the respective values of for each keys. This method class -setHeaders:. @param theHeaders The NSDictionary instance holding all headers / values. @result A Message instance, nil on error. */ - (id) initWithHeaders: (NSDictionary *) theHeaders; /*! @method initWithHeadersFromData: @discussion This method is used to initialize the receiver with a predefined set of headers in their raw representation. This method calls -setHeadersFromData:. @param theHeaders The headers in their raw represnetation. @result A Message instance, nil on error. */ - (id) initWithHeadersFromData: (NSData *) theHeaders; /*! @method from @discussion This method is used to obtain the value of the "From" header. @result The value of the "From" header, as an CWInternetAddress instance. */ - (CWInternetAddress *) from; /*! @method setFrom: @discussion This method is used to set the value of the "From:" header. @param theInternetAddress The CWInternetAddress instance. */ - (void) setFrom: (CWInternetAddress *) theInternetAddress; /*! @method messageNumber @discussion This method is used to obtain the message sequence number (MSN) of the receiver. MSN have a special meaning for IMAP messages (see 2.3.1.2. of RFC3501 for details). @result The MSN, 0 if none was previously set. */ - (unsigned int) messageNumber; /*! @method setMessageNumber: @discussion This method is used to set the message number value of the receiver. @param theMessageNumber The value. */ - (void) setMessageNumber: (unsigned int) theMessageNumber; /*! @method messageID @discussion This method is used to obtain the value of the "Message-ID" header. @result The value of the "Message-ID" header. */ - (NSString *) messageID; /*! @method setMessageID: @discussion This method is used to set the value of the "Message-ID" header. @param theMessageID The value of the "Message-ID" header. */ - (void) setMessageID: (NSString *) theMessageID; /*! @method inReplyTo @discussion This method is used to obtain the value of the "In-Reply-To" header. @result The value of the "In-Reply-To" header. */ - (NSString *) inReplyTo; /*! @method setInReplyTo: @discussion This method is used to set the value of the "In-Reply-To" header. @param theInReplyTo The value of the "In-Reply-To" header. */ - (void) setInReplyTo: (NSString *) theInReplyTo; /*! @method receivedDate @discussion This method is used to obtain the value of the "Date" header. @result The value of the "Date" header, as a NSCalendarDate instance. */ - (NSCalendarDate *) receivedDate; /*! @method setReceivedDate: @discussion This method is used to set the value of the "Date" header. @param theDate The NSCalendarDate instance. */ - (void) setReceivedDate: (NSCalendarDate *) theDate; /*! @method addRecipient: @discussion This method is used to add a recipient to the list of all recipients for the receiver. The recipient type is determined by calling the -type method on the CWInternetAddress's instance. @param theAddress The CWInternetAddress instance holding the recipient to add to the list. */ - (void) addRecipient: (CWInternetAddress *) theAddress; /*! @method removeRecipient: @discussion This method is used to remove the specified recipient from the receiver's list of recipients. @param theAddress The recipient to remove. */ - (void) removeRecipient: (CWInternetAddress *) theAddress; /*! @method recipients @discussion This method is used to obtain the list of recipients of the receiver. All recipient types are returned. @result The array of recipients which are all CWInternetAddress instances. */ - (NSArray *) recipients; /*! @method setRecipients: @discussion This method is used to add theRecipients to the list of the receiver's recipients. @param theRecipients The array of CWInternetAddress instances to add to the receiver's list of recipients. */ - (void) setRecipients: (NSArray *) theRecipients; /*! @method recipientsCount @discussion This method is used to obtain the number of recipients the receiver has. @result The count. */ - (unsigned int) recipientsCount; /*! @method removeAllRecipients: @discussion This method is used to remove all recipients from the receiver. */ - (void) removeAllRecipients; /*! @method replyTo @discussion This method is used to obtain the value of the "Reply-To" header. @result The value of the "Reply-To" header, as an array of CWInternetAddress instances. If there are none, nil is returned. */ - (NSArray *) replyTo; /*! @method setReplyTo: @discussion This method is used to set the value of the "Reply-To:" header. @param theAddressList An array of CWInternetAddress instances. */ - (void) setReplyTo: (NSArray *) theAddressList; /*! @method subject @discussion This method is used to obtain the value of the "Subject" header. @result The value of the "Subject" header. */ - (NSString *) subject; /*! @method setSubject: @discussion This method is used to set the value of the "Subject" header. @param theSubject The value to set. */ - (void) setSubject: (NSString *) theSubject; /*! @method baseSubject @discussion This method is used to obtain the base subject. The base subject is basically the value of the "Subject" header but without the "re" or "fwd" (or whatever) prefix. @result The base subject. */ - (NSString *) baseSubject; /*! @method setBaseSubject: @discussion This method is used to set the base subject of the receiver. @param theBaseSubject The base subject to set. */ - (void) setBaseSubject: (NSString *) theBaseSubject; /*! @method isInitialized @discussion This method is used to verify if a message has been initialized or not. An inititalized message is a message for which all parts have been initilized. A message for which only the headers are set is not an initialized message. @result YES if the message is initialized, NO otherwise. */ - (BOOL) isInitialized; /*! @method setInitialized: @discussion This method is used to initialize the message or free the resources taken by its content. Subclasses of CWMessage sometimes overwrite this method. @param theBOOL YES if we want to load the content of the message and initialize the receiver with it. NO if we want to free the resources taken by the decoded content. */ - (void) setInitialized: (BOOL) theBOOL; /*! @method flags @discussion This method is used to obtain the flags associated to the receiver. @result The CWFlags instance of the receiver. */ - (CWFlags *) flags; /*! @method setFlags: @discussion This method is used to set the flags of the receiver, replacing any previous values set. Subclasses of CWMessage sometimes overwrite this method. @param theFlags The new flags for the receiver. */ - (void) setFlags: (CWFlags *) theFlags; /*! @method MIMEVersion @discussion This method is used to obtain the value of the "MIME-Version" header. @result The value of the header, nil if none was set. */ - (NSString *) MIMEVersion; /*! @method setMIMEVersion: @discussion This method is used to set the value of the "MIME-Version" header, replacing any values previously set. @param theMIMEVersion The new value for the header. */ - (void) setMIMEVersion: (NSString *) theMIMEVersion; /*! @method reply: @discussion This method is used to contruct a new CWMessage instance to be used when replying to a message. The returned message will always use the UTF-8 charset. The message will NOT have a content other than the plain text one(s). @param theMode The type of reply operation to do. The default mode is PantomimeNormalReplyMode. @result A CWMessage instance used for replying. */ - (CWMessage *) reply: (PantomimeReplyMode) theMode; /*! @method forward @discussion This method is used to contruct a new CWMessage instance to be used when forward a message. The returned message will always use the UTF-8 charset. @param theMode The type of forward operation to do. @result A CWMessage instance used for forwarding. */ - (CWMessage *) forward: (PantomimeForwardMode) theMode; /*! @method addHeader: withValue: @discussion This method is used to add an extra header to the list of headers of the message. @param theName The header name, which should normally begin with an "X-". @param theValue The header value. */ - (void) addHeader: (NSString *) theName withValue: (NSString *) theValue; /*! @method folder @discussion This method is used to get the associated receiver's folder. @result The CWFolder instance in which the message is stored, nil if no folder holds the receiver. */ - (CWFolder *) folder; /*! @method setFolder: @discussion This method is used to set the associated folder to the message. @param theFolder The folder which holds the receiver. */ - (void) setFolder: (CWFolder *) theFolder; /*! @method rawSource @discussion This method is used to obtain the raw representation of the receiver. Subclasses will overwrite this method so it's not blocking (see the documentation of this method for CWIMAPMessage, for example). @result The raw representation, or nil if it has not been loaded. */ - (NSData *) rawSource; /*! @method setRawSource: @discussion This method is used to set the raw representation of the receiver. No specific actions are taken when invoking this method. @param theRawSource The raw source of the message. */ - (void) setRawSource: (NSData *) theRawSource; /*! @method organization @discussion This method is used to obtain the value of the "Organization" header. @result The value of the "Organization" header. */ - (NSString *) organization; /*! @method setOrganization: @discussion This method is used to set the value of the "Organization" header. @param theOrganization The new value of the header. */ - (void) setOrganization: (NSString *) theOrganization; /*! @method propertyForKey: @discussion This method is used to get an extra property for the specified key. @result The property for the specified key, nil if key isn't found. */ - (id) propertyForKey: (id) theKey; /*! @method setProperty: forKey: @discussion This method is used to set an extra property for the specified key on this folder. If nil is passed for theProperty parameter, the value will actually be REMOVED for theKey. @param theProperty The value of the property. @param theKey The key of the property. */ - (void) setProperty: (id) theProperty forKey: (id) theKey; /*! @method resentDate @discussion This method is used to obtain the value of the "Resent-Date" header. @result The value of the "Resent-Date" header. */ - (NSCalendarDate *) resentDate; /*! @method setResentDate: @discussion This method is used to set the value of the "Resent-Date" header. @param theResentDate The new value of the header. */ - (void) setResentDate: (NSCalendarDate *) theResentDate; /*! @method resentFrom @discussion This method is used to obtain the value of the "Resent-From" header. @result The value of the "Resent-From" header. */ - (CWInternetAddress *) resentFrom; /*! @method setResentFrom: @discussion This method is used to set the value of the "Resent-From" header. @param theInternetAddress The new value of the header. */ - (void) setResentFrom: (CWInternetAddress *) theInternetAddress; /*! @method resentMessageID @discussion This method is used to obtain the value of the "Resent-Message-ID" header. @result The value of the "Resent-Message-ID" header. */ - (NSString *) resentMessageID; /*! @method setResentMessageID: @discussion This method is used to set the value of the "Resent-Message-ID" header. @param theResentMessageID The new value of the header. */ - (void) setResentMessageID: (NSString *) theResentMessageID; /*! @method resentSubject @discussion This method is used to obtain the value of the "Resent-Subject" header. @result The value of the "Resent-Subject" header. */ - (NSString *) resentSubject; /*! @method setResentSubject: @discussion This method is used to set the value of the "Resent-Subject" header. @param theResentSubject The new value of the header. */ - (void) setResentSubject: (NSString *) theResentSubject; /*! @method allReferences @discussion This method is used to obtain the value of the "References" header. The values are particularly useful for message threading. @result The value of the "References" header. This corresponds to a NSArray of NSString instances. Each instance is normally a Message-ID. */ - (NSArray *) allReferences; /*! @method setReferences: @discussion This method is used to the value of the "References" header, replacing any previously defined value. @param theReferences The array of references. */ - (void) setReferences: (NSArray *) theReferences; /*! @method addHeadersFromData:record: @discussion This method is used to add addionnal headers from their raw representation. It will not erase the currently defined headers. It also updates the cache record theRecord with the decoded information. @param The additional headers, in their raw representation. @param theRecord The cache_record to update. */ - (void) addHeadersFromData: (NSData *) theHeaders record: (cache_record *) theRecord; /*! @method setHeadersFromData:record: @discussion This method initalize all the headers of a message from the raw data source. It replaces previously defined values of headers found in theHeaders. It also updates the cache record theRecord with the decoded information. @param theHeaders The bytes to use. */ - (void) setHeadersFromData: (NSData *) theHeaders record: (cache_record *) theRecord; @end // // Message's comparison category // @interface CWMessage (Comparing) - (int) compareAccordingToNumber: (CWMessage *) aMessage; - (int) reverseCompareAccordingToNumber: (CWMessage *) aMessage; - (int) compareAccordingToDate: (CWMessage *) aMessage; - (int) reverseCompareAccordingToDate: (CWMessage *) aMessage; - (int) compareAccordingToSender: (CWMessage *) aMessage; - (int) reverseCompareAccordingToSender: (CWMessage *) aMessage; - (int) compareAccordingToSize: (CWMessage *) aMessage; - (int) reverseCompareAccordingToSize: (CWMessage *) aMessage; @end #endif // _Pantomime_H_CWMessage pantomime1.2-1.2.2+dfsg1/Framework/Pantomime/CWMessage.m000066400000000000000000001363601276751561200226350ustar00rootroot00000000000000/* ** CWMessage.m ** ** Copyright (c) 2001-2007 ** ** Author: Ludovic Marcotte ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** You should have received a copy of the GNU Lesser General Public ** License along with this library; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #define CHECK_RANGE(r,len) (r.location < len && (r.length < len-r.location)) #define LF "\n" static int currentMessageVersion = 2; static CWRegEx *atLeastOneSpaceRegex = nil; static CWRegEx *suffixSubjTrailerRegex = nil; static CWRegEx *prefixSubjLeaderRegex = nil; static CWRegEx *prefixSubjBlobRegex = nil; static CWRegEx *prefixSubjFwdHdrAndSuffixSubjFwdTrlRegex = nil; // // Private methods // @interface CWMessage (Private) - (NSString *) _computeBaseSubject; - (void) _extractText: (NSMutableData *) theMutableData part: (id) thePart quote: (BOOL *) theBOOL; - (NSData *) _formatRecipientsWithType: (int) theType; @end // // // @implementation CWMessage // // We setup regexes used in _computeBaseSubject // + (void) initialize { if (atLeastOneSpaceRegex == nil) { NSString *blobChar = @"[^][]"; NSString *subjTrailer = @"(\\(fwd\\))| "; NSString *subjFwdHdr = @"\\[fwd:"; NSString *subjFwdTrl = @"\\]"; NSString *subjBlob = [NSString stringWithFormat:@"\\[(%@)*\\] *", blobChar]; NSString *subjReFwd = [NSString stringWithFormat:@"((re)|(fwd?)) *(%@)?:", subjBlob]; NSString *subjLeader = [NSString stringWithFormat:@"((%@)*%@)| ", subjBlob, subjReFwd]; atLeastOneSpaceRegex = [[CWRegEx alloc] initWithPattern: @"[[:space:]]+" flags: REG_EXTENDED|REG_ICASE]; suffixSubjTrailerRegex = [[CWRegEx alloc] initWithPattern: [NSString stringWithFormat:@"(%@)*$", subjTrailer] flags: REG_EXTENDED|REG_ICASE]; prefixSubjLeaderRegex = [[CWRegEx alloc] initWithPattern: [NSString stringWithFormat:@"^(%@)", subjLeader] flags: REG_EXTENDED|REG_ICASE]; prefixSubjBlobRegex = [[CWRegEx alloc] initWithPattern: [NSString stringWithFormat:@"^(%@)", subjBlob] flags: REG_EXTENDED|REG_ICASE]; prefixSubjFwdHdrAndSuffixSubjFwdTrlRegex = [[CWRegEx alloc] initWithPattern: [NSString stringWithFormat:@"^(%@)(.*)(%@)$", subjFwdHdr, subjFwdTrl] flags: REG_EXTENDED|REG_ICASE]; } } // // // - (id) init { self = [super init]; [CWMessage setVersion: currentMessageVersion]; _recipients = [[NSMutableArray alloc] init]; _flags = [[CWFlags alloc] init]; _initialized = NO; _references = nil; _folder = nil; // By default, we want the subclass's rawSource method to be called so we set our // rawSource ivar to nil. If it's not nil (ONLY set in initWithData) it'll be returned, // for performances improvements. _rawSource = nil; // We initialize our dictionary holding all extra properties a message might have _properties = [[NSMutableDictionary alloc] init]; return self; } // // // - (id) initWithData: (NSData *) theData { self = [super initWithData: theData]; // Part: -initWithData could fail. We return nil if it does. if (!self) { return nil; } // // We can tell now that this message is fully initialized // NOTE: We must NOT call [self setInitialized: YES] since // it will call the method from the subclass and may do // extremely weird things. _initialized = YES; // We set our rawSource ivar for performance reasons [self setRawSource: theData]; return self; } // // // - (id) initWithData: (NSData *) theData charset: (NSString *) theCharset { [self setDefaultCharset: theCharset]; return [self initWithData: theData]; } // // // - (id) initWithHeadersFromData: (NSData *) theHeaders { self = [self init]; [self setHeadersFromData: theHeaders]; return self; } // // // - (id) initWithHeaders: (NSDictionary *) theHeaders { self = [self init]; [self setHeaders: theHeaders]; return self; } // // // - (void) dealloc { RELEASE(_recipients); RELEASE(_properties); RELEASE(_references); RELEASE(_rawSource); RELEASE(_flags); [super dealloc]; } // // NSCoding protocol // - (void) encodeWithCoder: (NSCoder *) theCoder { // Must also encode Part's superclass [super encodeWithCoder: theCoder]; [CWMessage setVersion: currentMessageVersion]; [theCoder encodeObject: [self receivedDate]]; // Date [theCoder encodeObject: [self from]]; // From [theCoder encodeObject: _recipients]; // To and Cc (Bcc, at worst) [theCoder encodeObject: [self subject]]; // Subject [theCoder encodeObject: [self messageID]]; // Message-ID [theCoder encodeObject: [self MIMEVersion]]; // MIME-Version [theCoder encodeObject: _references]; // References [theCoder encodeObject: [self inReplyTo]]; // In-Reply-To [theCoder encodeObject: [NSNumber numberWithInt: _message_number]]; // Message number [theCoder encodeObject: _flags]; // Message flags } // // // - (id) initWithCoder: (NSCoder *) theCoder { // Must also decode Part's superclass self = [super initWithCoder: theCoder]; _properties = [[NSMutableDictionary alloc] init]; _recipients = [[NSMutableArray alloc] init]; [self setReceivedDate: [theCoder decodeObject]]; // Date [self setFrom: [theCoder decodeObject]]; // From [self setRecipients: [theCoder decodeObject]]; // To and Cc (Bcc, at worst) [self setSubject: [theCoder decodeObject]]; // Subject [self setMessageID: [theCoder decodeObject]]; // Message-ID [self setMIMEVersion: [theCoder decodeObject]]; // MIME-Version [self setReferences: [theCoder decodeObject]]; // References [self setInReplyTo: [theCoder decodeObject]]; // In-Reply-To [self setMessageNumber: [[theCoder decodeObject] intValue]]; // Message number // We decode our flags. We must not simply call [self setFlags: [theCoder decodeObject]] // since IMAPMessage is re-implementing flags and that would cause problems when // unarchiving IMAP caches. _flags = [[CWFlags alloc] init]; [_flags replaceWithFlags: [theCoder decodeObject]]; // It's very important to set the "initialized" ivar to NO since we didn't serialize the content. // or our message. _initialized = NO; // We initialize the rest of our ivars _rawSource = nil; _folder = nil; return self; } // // NSCopying protocol (FIXME) // - (id) copyWithZone: (NSZone *) zone { return RETAIN(self); } // // // - (CWInternetAddress *) from { return [_headers objectForKey: @"From"]; } // // // - (void) setFrom: (CWInternetAddress *) theInternetAddress { if (theInternetAddress) { [_headers setObject: theInternetAddress forKey: @"From"]; } } // // // - (unsigned int) messageNumber { return _message_number; } // // // - (void) setMessageNumber: (unsigned int) theMessageNumber { _message_number = theMessageNumber; } // // // - (NSString *) messageID { NSString *aString; aString = [_headers objectForKey: @"Message-ID"]; if (!aString) { aString = [[CWMIMEUtility globallyUniqueID] asciiString]; [self setMessageID: aString]; } return aString; } // // // - (void) setMessageID: (NSString *) theMessageID { if (theMessageID) { [_headers setObject: theMessageID forKey: @"Message-ID"]; } } // // // - (NSString *) inReplyTo { return [_headers objectForKey: @"In-Reply-To"]; } // // // - (void) setInReplyTo: (NSString *) theInReplyTo { if (theInReplyTo) { [_headers setObject: theInReplyTo forKey: @"In-Reply-To"]; } } // // // - (NSCalendarDate *) receivedDate { return [_headers objectForKey: @"Date"]; } // // // - (void) setReceivedDate: (NSCalendarDate*) theDate { if (theDate) { [_headers setObject: theDate forKey: @"Date"]; } } // // // - (void) addRecipient: (CWInternetAddress *) theAddress { if (theAddress) { [_recipients addObject: theAddress]; } } // // // - (void) removeRecipient: (CWInternetAddress *) theAddress { if (theAddress) { [_recipients removeObject: theAddress]; } } // // // - (NSArray *) recipients { return _recipients; } // // // - (void) setRecipients: (NSArray *) theRecipients { [_recipients removeAllObjects]; if (theRecipients) { [_recipients addObjectsFromArray: theRecipients]; } } // // // - (unsigned int) recipientsCount { return [_recipients count]; } // // // - (void) removeAllRecipients { [_recipients removeAllObjects]; } // // // - (NSArray *) replyTo { return [_headers objectForKey: @"Reply-To"]; } // // // - (void) setReplyTo: (NSArray *) theAddressList { if (theAddressList && [theAddressList count]) { [_headers setObject: theAddressList forKey: @"Reply-To"]; } else { [_headers removeObjectForKey: @"Reply-To"]; } } // // // - (NSString *) subject { return [_headers objectForKey: @"Subject"]; } // // // - (void) setSubject: (NSString *) theSubject { if (theSubject) { [_headers setObject: theSubject forKey: @"Subject"]; // We invalidate our previous base subject. [self setBaseSubject: nil]; } } // // // - (NSString *) baseSubject { NSString *baseSubject; baseSubject = [self propertyForKey: @"baseSubject"]; if (!baseSubject) { baseSubject = [self _computeBaseSubject]; [self setBaseSubject: baseSubject]; } return baseSubject; } // // // - (void) setBaseSubject: (NSString *) theBaseSubject { [self setProperty: theBaseSubject forKey: @"baseSubject"]; } // // // - (BOOL) isInitialized { return _initialized; } // // // - (void) setInitialized: (BOOL) theBOOL { _initialized = theBOOL; } // // // - (NSString *) organization { return [_headers objectForKey: @"Organization"]; } // // // - (void) setOrganization: (NSString *) theOrganization { [_headers setObject: theOrganization forKey: @"Organization"]; } // // // - (id) propertyForKey: (id) theKey { return [_properties objectForKey: theKey]; } // // // - (void) setProperty: (id) theProperty forKey: (id) theKey { if (theProperty) { [_properties setObject: theProperty forKey: theKey]; } else { [_properties removeObjectForKey: theKey]; } } // // // - (NSArray *) allReferences { return _references; } // // // - (void) setReferences: (NSArray *) theReferences { ASSIGN(_references, theReferences); } // // // - (CWFlags *) flags { return _flags; } // // // - (void) setFlags: (CWFlags *) theFlags { ASSIGN(_flags, theFlags); } // // // - (NSString *) MIMEVersion { return [_headers objectForKey: @"MIME-Version"]; } // // // - (void) setMIMEVersion: (NSString *) theMIMEVersion { if (theMIMEVersion) { [_headers setObject: theMIMEVersion forKey: @"MIME-Version"]; } } // // // - (CWMessage *) reply: (PantomimeReplyMode) theMode { CWInternetAddress *anInternetAddress; NSMutableData *aMutableData; CWMessage *theMessage; BOOL needsToQuote; theMessage = [[CWMessage alloc] init]; [theMessage setContentType: @"text/plain"]; [theMessage setCharset: @"utf-8"]; // We set the subject of our message if (![self subject]) { [theMessage setSubject: _(@"Re: your mail")]; } else if ([[[self subject] stringByTrimmingWhiteSpaces] hasREPrefix]) { [theMessage setSubject: [self subject]]; } else { [theMessage setSubject: [NSString stringWithFormat: _(@"Re: %@"), [[self subject] stringByTrimmingWhiteSpaces]]]; } // If Reply-To is defined, we use it. Otherwise, we use From: if ([self replyTo] == nil) { anInternetAddress = [self from]; [anInternetAddress setType: PantomimeToRecipient]; [theMessage addRecipient: anInternetAddress]; } else { int i; for (i = 0; i < [[self replyTo] count]; i++) { anInternetAddress = [[self replyTo] objectAtIndex: i]; [anInternetAddress setType: PantomimeToRecipient]; [theMessage addRecipient: anInternetAddress]; } } // We add our In-Reply-To header if ([self messageID]) { [theMessage setInReplyTo: [self messageID]]; } // If we reply to all, we add the other recipients if ((theMode&PantomimeReplyAllMode) == PantomimeReplyAllMode) { NSEnumerator *anEnumerator; anEnumerator = [_recipients objectEnumerator]; while ((anInternetAddress = [anEnumerator nextObject])) { [anInternetAddress setType: PantomimeCcRecipient]; [theMessage addRecipient: anInternetAddress]; } } // If it's a "simple" reply, we don't compute a content. if ((theMode&PantomimeSimpleReplyMode) == PantomimeSimpleReplyMode) { [theMessage setContent: [NSData data]]; return AUTORELEASE(theMessage); } // We finally work on the content of the message aMutableData = [[NSMutableData alloc] init]; needsToQuote = NO; [self _extractText: aMutableData part: self quote: &needsToQuote]; // // It was impossible for use to find a text/plain part. Let's // inform our user that we can't do anything with this message. // if (![aMutableData length]) { [aMutableData appendData: [@"\t[NON-Text Body part not included]" dataUsingEncoding: NSUTF8StringEncoding]]; needsToQuote = NO; } else { // We remove the signature NSRange aRange; aRange = [aMutableData rangeOfCString: "\n-- " options: NSBackwardsSearch]; if (aRange.length) { [aMutableData replaceBytesInRange: NSMakeRange(aRange.location, [aMutableData length]-aRange.location) withBytes: NULL length: 0]; } } // We now have our content as string, let's 'quote' it if (needsToQuote) { NSData *aData; aData = [aMutableData unwrapWithLimit: 78]; [aMutableData setData: [aData quoteWithLevel: 1 wrappingLimit: 80]]; } [aMutableData insertCString: [[NSString stringWithFormat: @"%@ wrote:\n\n", [[self from] stringValue]] UTF8String] atIndex: 0]; // We verify if we have a Date value. We might receive messages w/o this field // (Yes, I know, it's borken but it's happening). if ([self receivedDate]) { [aMutableData insertCString: [[NSString stringWithFormat: @"On %@ ", [[self receivedDate] description]] UTF8String] atIndex: 0]; } [theMessage setContent: aMutableData]; RELEASE(aMutableData); return AUTORELEASE(theMessage); } // // // - (CWMessage *) forward: (PantomimeForwardMode) theMode; { CWMessage *theMessage; theMessage = [[CWMessage alloc] init]; // We set the subject of our message if ([self subject]) { [theMessage setSubject: [NSString stringWithFormat: @"%@ (fwd)", [self subject]]]; } else { [theMessage setSubject: @"Forwarded mail..."]; } if (theMode == PantomimeAttachmentForwardMode) { CWMIMEMultipart *aMimeMultipart; CWPart *aPart; aMimeMultipart = [[CWMIMEMultipart alloc] init]; aPart = [[CWPart alloc] init]; [aMimeMultipart addPart: aPart]; RELEASE(aPart); aPart = [[CWPart alloc] init]; [aPart setContentType: @"message/rfc822"]; [aPart setContentDisposition: PantomimeAttachmentDisposition]; [aPart setSize: [self size]]; [aPart setContent: self]; [aMimeMultipart addPart: aPart]; RELEASE(aPart); [theMessage setContentType: @"multipart/mixed"]; [theMessage setContent: aMimeMultipart]; RELEASE(aMimeMultipart); } else { NSMutableData *aMutableData; // We create our generic forward message header aMutableData = AUTORELEASE([[NSMutableData alloc] init]); [aMutableData appendCString: "---------- Forwarded message ----------"]; // We verify if we have a Date value. We might receive messages w/o this field // (Yes, I know, it's borken but it's happening). if ([self receivedDate]) { [aMutableData appendCString: "\nDate: "]; [aMutableData appendData: [[[self receivedDate] description] dataUsingEncoding: NSASCIIStringEncoding]]; } [aMutableData appendCString: "\nFrom: "]; [aMutableData appendData: [[[self from] stringValue] dataUsingEncoding: [NSString encodingForPart: self]]]; if ([self subject]) { [aMutableData appendCString: "\nSubject: "]; } [aMutableData appendData: [[NSString stringWithFormat: @"%@\n\n", [self subject]] dataUsingEncoding: [NSString encodingForPart: self]]]; // // If our Content-Type is text/plain, we represent it as a it is, otherwise, // we currently create a new body part representing the forwarded message. // if ([self isMIMEType: @"text" subType: @"*"]) { // We set the content of our message [aMutableData appendData: [CWMIMEUtility plainTextContentFromPart: self]]; // We set the Content-Transfer-Encoding and the Charset to the previous one [theMessage setContentTransferEncoding: [self contentTransferEncoding]]; [theMessage setCharset: [self charset]]; [theMessage setContentType: @"text/plain"]; [theMessage setContent: aMutableData]; [theMessage setSize: [aMutableData length]]; } // // If our Content-Type is a message/rfc822 or any other type like // application/*, audio/*, image/* or video/* // else if ([self isMIMEType: @"application" subType: @"*"] || [self isMIMEType: @"audio" subType: @"*"] || [self isMIMEType: @"image" subType: @"*"] || [self isMIMEType: @"message" subType: @"*"] || [self isMIMEType: @"video" subType: @"*"]) { CWMIMEMultipart *aMimeMultipart; CWPart *aPart; aMimeMultipart = [[CWMIMEMultipart alloc] init]; // We add our text/plain part. aPart = [[CWPart alloc] init]; [aPart setContentType: @"text/plain"]; [aPart setContent: aMutableData]; [aPart setContentDisposition: PantomimeInlineDisposition]; [aPart setSize: [aMutableData length]]; [aMimeMultipart addPart: aPart]; RELEASE(aPart); // We add our content as an attachment aPart = [[CWPart alloc] init]; [aPart setContentType: [self contentType]]; [aPart setContent: [self content]]; [aPart setContentTransferEncoding: [self contentTransferEncoding]]; [aPart setContentDisposition: PantomimeAttachmentDisposition]; [aPart setCharset: [self charset]]; [aPart setFilename: [self filename]]; [aPart setSize: [self size]]; [aMimeMultipart addPart: aPart]; RELEASE(aPart); [theMessage setContentType: @"multipart/mixed"]; [theMessage setContent: aMimeMultipart]; RELEASE(aMimeMultipart); } // // We have a multipart object. We must treat multipart/alternative // parts differently since we don't want to include multipart parts in the forward. // else if ([self isMIMEType: @"multipart" subType: @"*"]) { // // If we have multipart/alternative part, we only keep one part from it. // if ([self isMIMEType: @"multipart" subType: @"alternative"]) { CWMIMEMultipart *aMimeMultipart; CWPart *aPart; int i; aMimeMultipart = (CWMIMEMultipart *)[self content]; aPart = nil; // We search for our text/plain part for (i = 0; i < [aMimeMultipart count]; i++) { aPart = [aMimeMultipart partAtIndex: i]; if ([aPart isMIMEType: @"text" subType: @"plain"]) { break; } else { aPart = nil; } } // We found one if (aPart) { // We set the content of our message [aMutableData appendData: (NSData *)[aPart content]]; // We set the Content-Transfer-Encoding and the Charset to our text part [theMessage setContentTransferEncoding: [aPart contentTransferEncoding]]; [theMessage setCharset: [aPart charset]]; [theMessage setContentType: @"text/plain"]; [theMessage setContent: aMutableData]; [theMessage setSize: [aMutableData length]]; } // We haven't found one! Inform the user that it happened. else { [aMutableData appendCString: "No text/plain part from this multipart/alternative part has been found"]; [aMutableData appendCString: "\nNo parts have been included as attachments with this mail during the forward operation."]; [aMutableData appendCString: "\n\nPlease report this as a bug."]; [theMessage setContent: aMutableData]; [theMessage setSize: [aMutableData length]]; } } // // We surely have a multipart/mixed or multipart/related. // We search for a text/plain part inside our multipart object. // We 'keep' the other parts in a separate new multipart object too // that will become our new content. // else { CWMIMEMultipart *aMimeMultipart, *newMimeMultipart; CWPart *aPart; BOOL hasFoundTextPlain = NO; int i; // We get our current mutipart object aMimeMultipart = (CWMIMEMultipart *)[self content]; // We create our new multipart object for holding all our parts. newMimeMultipart = [[CWMIMEMultipart alloc] init]; for (i = 0; i < [aMimeMultipart count]; i++) { aPart = [aMimeMultipart partAtIndex: i]; if ([aPart isMIMEType: @"text" subType: @"plain"] && !hasFoundTextPlain) { CWPart *newPart; newPart = [[CWPart alloc] init]; // We set the content of our new part [aMutableData appendData: (NSData *)[aPart content]]; [newPart setContentType: @"text/plain"]; [newPart setContent: aMutableData]; [newPart setSize: [aMutableData length]]; // We set the Content-Transfer-Encoding and the Charset to the previous one [newPart setContentTransferEncoding: [aPart contentTransferEncoding]]; [newPart setCharset: [aPart charset]]; // We finally add our new part to our MIME multipart object [newMimeMultipart addPart: newPart]; RELEASE(newPart); hasFoundTextPlain = YES; } // We set the Content-Disposition to "attachment" // all the time. else { [aPart setContentDisposition: PantomimeAttachmentDisposition]; [newMimeMultipart addPart: aPart]; } } [theMessage setContentType: @"multipart/mixed"]; [theMessage setContent: newMimeMultipart]; RELEASE(newMimeMultipart); } } // // We got an unknown part. Let's inform the user about this situation. // else { // We set the content of our message [aMutableData appendCString: "The original message contained an unknown part that was not included in this forwarded message."]; [aMutableData appendCString: "\n\nPlease report this as a bug."]; [theMessage setContentType: @"text/plain"]; [theMessage setContent: aMutableData]; [theMessage setSize: [aMutableData length]]; } } return AUTORELEASE(theMessage); } // // // - (NSData *) dataValue { NSMutableData *aMutableData; NSDictionary *aLocale; NSEnumerator *allHeaderKeyEnumerator; NSString *aKey; NSCalendarDate *aCalendarDate; NSData *aData; // We get our locale in English #ifndef MACOSX aLocale = [NSDictionary dictionaryWithContentsOfFile: [[NSBundle bundleForLibrary: @"gnustep-base"] pathForResource: @"English" ofType: nil inDirectory: @"Languages"]]; #else aLocale = [NSDictionary dictionaryWithContentsOfFile: [[NSBundle bundleForClass: [NSObject class]] pathForResource: @"English" ofType: nil inDirectory: @"Languages"] ]; #endif // We initialize our mutable data object holding the raw data of the // new message. aMutableData = [[NSMutableData alloc] init]; #ifndef MACOSX if ([[NSUserDefaults standardUserDefaults] objectForKey: @"Local Time Zone"]) { aCalendarDate = [[NSDate date] dateWithCalendarFormat: @"%a, %d %b %Y %H:%M:%S %z" timeZone: [NSTimeZone systemTimeZone]]; } else { tzset(); aCalendarDate = [[NSDate date] dateWithCalendarFormat: @"%a, %d %b %Y %H:%M:%S %z" timeZone: [NSTimeZone timeZoneWithAbbreviation: [NSString stringWithCString: tzname[1]]]]; } #else aCalendarDate = [[NSDate date] dateWithCalendarFormat: @"%a, %d %b %Y %H:%M:%S %z" timeZone: [NSTimeZone systemTimeZone]]; #endif [aMutableData appendCFormat: @"Date: %@%s", [aCalendarDate descriptionWithLocale: aLocale], LF]; // We set the subject, if we have one! if ([[[self subject] stringByTrimmingWhiteSpaces] length] > 0) { [aMutableData appendCString: "Subject: "]; [aMutableData appendData: [CWMIMEUtility encodeWordUsingQuotedPrintable: [self subject] prefixLength: 8]]; [aMutableData appendCString: LF]; } // We set our Message-ID [aMutableData appendCFormat: @"Message-ID: <%@>%s", [self messageID], LF]; // We set our MIME-Version header [aMutableData appendCFormat: @"MIME-Version: 1.0 (Generated by Pantomime %@)%s", PANTOMIME_VERSION, LF]; // We encode our From: field [aMutableData appendCFormat: @"From: "]; [aMutableData appendData: [[self from] dataValue]]; [aMutableData appendCFormat: @"%s", LF]; // We encode our To field aData = [self _formatRecipientsWithType: PantomimeToRecipient]; if (aData) { [aMutableData appendCString: "To: "]; [aMutableData appendData: aData]; [aMutableData appendCString: LF]; } // We encode our Cc field aData = [self _formatRecipientsWithType: PantomimeCcRecipient]; if (aData) { [aMutableData appendCString: "Cc: "]; [aMutableData appendData: aData]; [aMutableData appendCString: LF]; } // We encode our Bcc field aData = [self _formatRecipientsWithType: PantomimeBccRecipient]; if (aData) { [aMutableData appendCString: "Bcc: "]; [aMutableData appendData: aData]; [aMutableData appendCString: LF]; } // We set the Reply-To address in case we need to if ([self replyTo]) { int i, count; [aMutableData appendCFormat: @"Reply-To: "]; count = [[self replyTo] count]; for (i = 0; i < count; i++) { [aMutableData appendData: [[[self replyTo] objectAtIndex: i] dataValue]]; if (i < count-1) [aMutableData appendCString: ", "]; } [aMutableData appendCString: LF]; } // We set the Organization header value if we need to if ([self organization]) { [aMutableData appendCString: "Organization: "]; [aMutableData appendData: [CWMIMEUtility encodeWordUsingQuotedPrintable: [self organization] prefixLength: 13]]; [aMutableData appendCString: LF]; } // We set the In-Reply-To header if we need to if ([self headerValueForName: @"In-Reply-To"]) { [aMutableData appendCFormat: @"In-Reply-To: %@%s", [self inReplyTo], LF]; } // We now set all X-* headers allHeaderKeyEnumerator = [_headers keyEnumerator]; while ((aKey = [allHeaderKeyEnumerator nextObject])) { if ([aKey hasPrefix: @"X-"] || ([aKey caseInsensitiveCompare: @"User-Agent"] == NSOrderedSame)) { [aMutableData appendCFormat: @"%@: %@%s", aKey, [self headerValueForName: aKey], LF]; } } // // We add our message header/body separator // [aMutableData appendData: [super dataValue]]; return AUTORELEASE(aMutableData); } // // // - (void) addHeader: (NSString *) theName withValue: (NSString *) theValue { if (theName && theValue) { NSString *aString; if ((aString = [_headers objectForKey: theName])) { aString = [NSString stringWithFormat: @"%@ %@", aString, theValue]; } else { aString = theValue; } [_headers setObject: aString forKey: theName]; } } // // // - (CWFolder *) folder { return _folder; } - (void) setFolder: (CWFolder *) theFolder { _folder = theFolder; } // // This method is used to optain tha raw source of a message. // It's returned as a NSData object. The returned data should // be the message like it's achived in a mbox format and it could // easily be decoded with Message: -initWithData. // // All subclasses of Message MUST implement this method. // - (NSData *) rawSource { if (!_rawSource) { [self subclassResponsibility: _cmd]; return nil; } return _rawSource; } // // // - (void) setRawSource: (NSData *) theRawSource { ASSIGN(_rawSource, theRawSource); } // // // - (NSCalendarDate *) resentDate { return [_headers objectForKey: @"Resent-Date"]; } // // // - (void) setResentDate: (NSCalendarDate *) theResentDate { [_headers setObject: theResentDate forKey: @"Resent-Date"]; } // // // - (CWInternetAddress *) resentFrom { return [_headers objectForKey: @"Resent-From"]; } // // // - (void) setResentFrom: (CWInternetAddress *) theInternetAddress { [_headers setObject: theInternetAddress forKey: @"Resent-From"]; } // // // - (NSString *) resentMessageID { return [_headers objectForKey: @"Resent-Message-ID"]; } // // // - (void) setResentMessageID: (NSString *) theResentMessageID { [_headers setObject: theResentMessageID forKey: @"Resent-Message-ID"]; } // // // - (NSString *) resentSubject { return [_headers objectForKey: @"Resent-Subject"]; } // // // - (void) setResentSubject: (NSString *) theResentSubject { [_headers setObject: theResentSubject forKey: @"Resent-Subject"]; } // // // - (void) addHeadersFromData: (NSData *) theHeaders record: (cache_record *) theRecord { NSArray *allLines; NSData *aData; int i, count; [super setHeadersFromData: theHeaders]; // We MUST be sure to unfold all headers properly before // decoding the headers theHeaders = [theHeaders unfoldLines]; allLines = [theHeaders componentsSeparatedByCString: "\n"]; count = [allLines count]; for (i = 0; i < count; i++) { NSData *aLine = [allLines objectAtIndex: i]; // We stop if we found the header separator. (\n\n) since someone could // have called this method with the entire rawsource of a message. if ([aLine length] == 0) { break; } if ([aLine hasCaseInsensitiveCPrefix: "Bcc"]) { [CWParser parseDestination: aLine forType: PantomimeBccRecipient inMessage: self quick: NO]; } else if ([aLine hasCaseInsensitiveCPrefix: "Cc"]) { aData = [CWParser parseDestination: aLine forType: PantomimeCcRecipient inMessage: self quick: NO]; if (theRecord) theRecord->cc = aData; } else if ([aLine hasCaseInsensitiveCPrefix: "Date"]) { [CWParser parseDate: aLine inMessage: self]; if (theRecord && [self receivedDate]) theRecord->date = [[self receivedDate] timeIntervalSince1970]; } else if ([aLine hasCaseInsensitiveCPrefix: "From"] && ![aLine hasCaseInsensitiveCPrefix: "From "]) { aData = [CWParser parseFrom: aLine inMessage: self quick: NO]; if (theRecord) theRecord->from = aData; } else if ([aLine hasCaseInsensitiveCPrefix: "In-Reply-To"]) { aData = [CWParser parseInReplyTo: aLine inMessage: self quick: NO]; if (theRecord) theRecord->in_reply_to = aData; } else if ([aLine hasCaseInsensitiveCPrefix: "Message-ID"]) { aData = [CWParser parseMessageID: aLine inMessage: self quick: NO]; if (theRecord) theRecord->message_id = aData; } else if ([aLine hasCaseInsensitiveCPrefix: "MIME-Version"]) { [CWParser parseMIMEVersion: aLine inMessage: self]; } else if ([aLine hasCaseInsensitiveCPrefix: "Organization"]) { [CWParser parseOrganization: aLine inMessage: self]; } else if ([aLine hasCaseInsensitiveCPrefix: "References"]) { aData = [CWParser parseReferences: aLine inMessage: self quick: NO]; if (theRecord) theRecord->references = aData; } else if ([aLine hasCaseInsensitiveCPrefix: "Reply-To"]) { [CWParser parseReplyTo: aLine inMessage: self]; } else if ([aLine hasCaseInsensitiveCPrefix: "Resent-From"]) { [CWParser parseResentFrom: aLine inMessage: self]; } else if ([aLine hasCaseInsensitiveCPrefix: "Resent-Bcc"]) { [CWParser parseDestination: aLine forType: PantomimeResentBccRecipient inMessage: self quick: NO]; } else if ([aLine hasCaseInsensitiveCPrefix: "Resent-Cc"]) { [CWParser parseDestination: aLine forType: PantomimeResentCcRecipient inMessage: self quick: NO]; } else if ([aLine hasCaseInsensitiveCPrefix: "Resent-To"]) { [CWParser parseDestination: aLine forType: PantomimeResentToRecipient inMessage: self quick: NO]; } else if ([aLine hasCaseInsensitiveCPrefix: "Status"]) { [CWParser parseStatus: aLine inMessage: self]; } else if ([aLine hasCaseInsensitiveCPrefix: "To"]) { aData = [CWParser parseDestination: aLine forType: PantomimeToRecipient inMessage: self quick: NO]; if (theRecord) theRecord->to = aData; } else if ([aLine hasCaseInsensitiveCPrefix: "X-Status"]) { [CWParser parseXStatus: aLine inMessage: self]; } else if ([aLine hasCaseInsensitiveCPrefix: "Subject"]) { aData = [CWParser parseSubject: aLine inMessage: self quick: NO]; if (theRecord) theRecord->subject = aData; } else { // We MUST NOT parse the headers that we already parsed in // Part as "unknown". if (![aLine hasCaseInsensitiveCPrefix: "Content-Description"] && ![aLine hasCaseInsensitiveCPrefix: "Content-Disposition"] && ![aLine hasCaseInsensitiveCPrefix: "Content-ID"] && ![aLine hasCaseInsensitiveCPrefix: "Content-Length"] && ![aLine hasCaseInsensitiveCPrefix: "Content-Transfer-Encoding"] && ![aLine hasCaseInsensitiveCPrefix: "Content-Type"]) { [CWParser parseUnknownHeader: aLine inMessage: self]; } } } } // // // - (void) setHeadersFromData: (NSData *) theHeaders { [self setHeadersFromData: theHeaders record: NULL]; } // // // - (void) setHeadersFromData: (NSData *) theHeaders record: (cache_record *) theRecord { if (!theHeaders || [theHeaders length] == 0) { return; } [_recipients removeAllObjects]; [_headers removeAllObjects]; [self addHeadersFromData: theHeaders record: theRecord]; } @end // // Message's sorting category // @implementation CWMessage (Comparing) - (int) compareAccordingToNumber: (CWMessage *) aMessage { int num; num = [aMessage messageNumber]; if (_message_number < num) { return NSOrderedAscending; } else if (_message_number > num) { return NSOrderedDescending; } else { return NSOrderedSame; } } - (int) reverseCompareAccordingToNumber: (CWMessage *) aMessage { int num; num = [aMessage messageNumber]; if (num < _message_number) { return NSOrderedAscending; } else if (num > _message_number) { return NSOrderedDescending; } else { return NSOrderedSame; } } - (int) compareAccordingToDate: (CWMessage *) aMessage { NSDate *date1 = [self receivedDate]; NSDate *date2 = [aMessage receivedDate]; NSTimeInterval timeInterval; if (date1 == nil || date2 == nil) { return [self compareAccordingToNumber: aMessage]; } timeInterval = [date1 timeIntervalSinceDate: date2]; if (timeInterval < 0) { return NSOrderedAscending; } else if (timeInterval > 0) { return NSOrderedDescending; } else { return [self compareAccordingToNumber: aMessage]; } } - (int) reverseCompareAccordingToDate: (CWMessage *) aMessage { NSDate *date2 = [self receivedDate]; NSDate *date1 = [aMessage receivedDate]; NSTimeInterval timeInterval; if (date1 == nil || date2 == nil) { return [self reverseCompareAccordingToNumber: aMessage]; } timeInterval = [date1 timeIntervalSinceDate: date2]; if (timeInterval < 0) { return NSOrderedAscending; } else if (timeInterval > 0) { return NSOrderedDescending; } else { return [self reverseCompareAccordingToNumber: aMessage]; } } - (int) compareAccordingToSender: (CWMessage *) aMessage { CWInternetAddress *from1, *from2; NSString *fromString1, *fromString2; NSString *tempString; int result; from1 = [self from]; from2 = [aMessage from]; tempString = [from1 personal]; if (tempString == nil || [tempString length] == 0) { fromString1 = [from1 address]; if (fromString1 == nil) fromString1 = @""; } else { fromString1 = tempString; } tempString = [from2 personal]; if (tempString == nil || [tempString length] == 0) { fromString2 = [from2 address]; if (fromString2 == nil) fromString2 = @""; } else { fromString2 = tempString; } result = [fromString1 caseInsensitiveCompare: fromString2]; if (result == NSOrderedSame) { return [self compareAccordingToNumber: aMessage]; } else { return result; } } - (int) reverseCompareAccordingToSender: (CWMessage *) aMessage { CWInternetAddress *from1, *from2; NSString *fromString1, *fromString2; NSString *tempString; int result; from2 = [self from]; from1 = [aMessage from]; tempString = [from1 personal]; if (tempString == nil || [tempString length] == 0) { fromString1 = [from1 address]; if (fromString1 == nil) fromString1 = @""; } else { fromString1 = tempString; } tempString = [from2 personal]; if (tempString == nil || [tempString length] == 0) { fromString2 = [from2 address]; if (fromString2 == nil) fromString2 = @""; } else { fromString2 = tempString; } result = [fromString1 caseInsensitiveCompare: fromString2]; if (result == NSOrderedSame) { return [self reverseCompareAccordingToNumber: aMessage]; } else { return result; } } - (int) compareAccordingToSubject: (CWMessage *) aMessage { NSString *subject1 = [self baseSubject]; NSString *subject2 = [aMessage baseSubject]; int result; if (subject1 == nil) subject1 = @""; if (subject2 == nil) subject2 = @""; result = [subject1 caseInsensitiveCompare: subject2]; if (result == NSOrderedSame) { return [self compareAccordingToNumber: aMessage]; } else { return result; } } - (int) reverseCompareAccordingToSubject: (CWMessage *) aMessage { NSString *subject2 = [self baseSubject]; NSString *subject1 = [aMessage baseSubject]; int result; if (subject1 == nil) subject1 = @""; if (subject2 == nil) subject2 = @""; result = [subject1 caseInsensitiveCompare: subject2]; if (result == NSOrderedSame) { return [self compareAccordingToNumber: aMessage]; } else { return result; } } - (int) compareAccordingToSize: (CWMessage *) aMessage { int size1 = [self size]; int size2 = [aMessage size]; if (size1 < size2) { return NSOrderedAscending; } else if (size1 > size2) { return NSOrderedDescending; } else { return [self compareAccordingToNumber: aMessage]; } } - (int) reverseCompareAccordingToSize: (CWMessage *) aMessage { int size1 = [aMessage size]; int size2 = [self size]; if (size1 < size2) { return NSOrderedAscending; } else if (size1 > size2) { return NSOrderedDescending; } else { return [self reverseCompareAccordingToNumber: aMessage]; } } @end // // Private methods // @implementation CWMessage (Private) // // Intended to be compatible for use with the draft specification for // sorting by subject contained in // INTERNET MESSAGE ACCESS PROTOCOL - SORT and THREAD EXTENSIONS // draft document, May 2003 // // At the time of this writing, it can be found at // http://www.ietf.org/internet-drafts/draft-ietf-imapext-sort-13.txt // - (NSString *) _computeBaseSubject { NSMutableString *baseSubject; NSArray *theMatches; NSString *aSubject; NSRange aRange; BOOL b1, b2; int i; aSubject = [self subject]; if (!aSubject) { return nil; } baseSubject = [NSMutableString stringWithString: aSubject]; // // (1) Convert any RFC 2047 encoded-words in the subject to // UTF-8 as described in "internationalization // considerations." Convert all tabs and continuations to // space. Convert all multiple spaces to a single space. // theMatches = [atLeastOneSpaceRegex matchString: baseSubject]; for (i = [theMatches count]-1; i >= 0; i--) { aRange = [[theMatches objectAtIndex:i] rangeValue]; if (CHECK_RANGE(aRange, [baseSubject length])) { [baseSubject replaceCharactersInRange: aRange withString:@" "]; } } do { b1 = NO; // // (2) Remove all trailing text of the subject that matches // the subj-trailer ABNF, repeat until no more matches are // possible. // theMatches = [suffixSubjTrailerRegex matchString: baseSubject]; if ([theMatches count] > 0) { aRange = [[theMatches objectAtIndex:0] rangeValue]; if (CHECK_RANGE(aRange,[baseSubject length])) { [baseSubject deleteCharactersInRange: [[theMatches objectAtIndex:0] rangeValue]]; } } do { b2 = NO; // // (3) Remove all prefix text of the subject that matches the // subj-leader ABNF. // theMatches = [prefixSubjLeaderRegex matchString: baseSubject]; if ([theMatches count] > 0) { aRange = [[theMatches objectAtIndex:0] rangeValue]; if (CHECK_RANGE(aRange, [baseSubject length])) { [baseSubject deleteCharactersInRange: [[theMatches objectAtIndex:0] rangeValue]]; b2 = YES; } } // // (4) If there is prefix text of the subject that matches the // subj-blob ABNF, and removing that prefix leaves a non-empty // subj-base, then remove the prefix text. // theMatches = [prefixSubjBlobRegex matchString: baseSubject]; if ([theMatches count] > 0) { aRange = [[theMatches objectAtIndex:0] rangeValue]; if (CHECK_RANGE(aRange, [baseSubject length])) { [baseSubject deleteCharactersInRange:[[theMatches objectAtIndex:0] rangeValue]]; b2 = YES; } } // // (5) Repeat (3) and (4) until no matches remain. // } while (b2); // // (6) If the resulting text begins with the subj-fwd-hdr ABNF // and ends with the subj-fwd-trl ABNF, remove the // subj-fwd-hdr and subj-fwd-trl and repeat from step (2). // theMatches = [prefixSubjFwdHdrAndSuffixSubjFwdTrlRegex matchString:baseSubject]; if ([theMatches count] > 0) { [baseSubject deleteCharactersInRange:NSMakeRange(0,5)]; [baseSubject deleteCharactersInRange:NSMakeRange([baseSubject length] - 1,1)]; b1 = YES; } } while (b1); // // (7) The resulting text is the "base subject" used in the SORT. // return baseSubject; } // // // - (void) _extractText: (NSMutableData *) theMutableData part: (id) thePart quote: (BOOL *) theBOOL { // // We now get the right text part of the message. // // if ([thePart isMIMEType: @"text" subType: @"*"]) { NSData *d; d = [[NSString stringWithData: [CWMIMEUtility plainTextContentFromPart: thePart] charset: [[thePart charset] dataUsingEncoding: NSASCIIStringEncoding]] dataUsingEncoding: NSUTF8StringEncoding]; [theMutableData appendData: d]; *theBOOL = YES; } // // If our message only contains the following part types, we cannot // represent those in a reply. // else if ([thePart isMIMEType: @"application" subType: @"*"] || [thePart isMIMEType: @"audio" subType: @"*"] || [thePart isMIMEType: @"image" subType: @"*"] || [thePart isMIMEType: @"message" subType: @"*"] || [thePart isMIMEType: @"video" subType: @"*"]) { [theMutableData appendData: [@"\t[NON-Text Body part not included]" dataUsingEncoding: NSUTF8StringEncoding]]; } // // We have a multipart type. It can be: // // multipart/appledouble, multipart/alternative, multipart/related, // multipart/mixed or even multipart/report. // // We must search for a text part to use in our reply. // else if ([thePart isMIMEType: @"multipart" subType: @"*"]) { CWMIMEMultipart *aMimeMultipart; CWPart *aPart; int i; aMimeMultipart = (CWMIMEMultipart *)[thePart content]; for (i = 0; i < [aMimeMultipart count]; i++) { aPart = [aMimeMultipart partAtIndex: i]; // // We do a full verification on the Content-Type since we might // have a text/x-{something} like text/x-vcard. // if ([aPart isMIMEType: @"text" subType: @"plain"] || [aPart isMIMEType: @"text" subType: @"enriched"] || [aPart isMIMEType: @"text" subType: @"html"]) { [theMutableData appendData: [[NSString stringWithData: [CWMIMEUtility plainTextContentFromPart: aPart] charset: [[aPart charset] dataUsingEncoding: NSASCIIStringEncoding]] dataUsingEncoding: NSUTF8StringEncoding]]; // If our original Content-Type is multipart/alternative, no need to // consider to the other text/* parts. Otherwise, we just append // all text/* parts. if ([thePart isMIMEType: @"multipart" subType: @"alternative"]) { break; } } // // If we got any other kind of multipart parts, we loop inside of it in order to // extract all text parts. // else if ([aPart isMIMEType: @"multipart" subType: @"*"]) { [self _extractText: theMutableData part: aPart quote: theBOOL]; } } // for ( ... ) *theBOOL = YES; } // else if ([thePart isMIMEType: @"multipart" subType: @"*"]) } // // // - (NSData *) _formatRecipientsWithType: (int) theType { NSMutableData *aMutableData; int i; aMutableData = [[NSMutableData alloc] init]; for (i = 0; i < [_recipients count]; i++) { CWInternetAddress *anInternetAddress; anInternetAddress = [_recipients objectAtIndex: i]; if ([anInternetAddress type] == theType) { [aMutableData appendData: [anInternetAddress dataValue]]; [aMutableData appendCString: ", "]; } } if ([aMutableData length] > 0) { [aMutableData setLength: [aMutableData length]-2]; return AUTORELEASE(aMutableData); } RELEASE(aMutableData); return nil; } @end pantomime1.2-1.2.2+dfsg1/Framework/Pantomime/CWPOP3CacheManager.h000066400000000000000000000041401276751561200241720ustar00rootroot00000000000000/* ** CWPOP3CacheManager.h ** ** Copyright (c) 2001-2007 ** ** Author: Ludovic Marcotte ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** You should have received a copy of the GNU Lesser General Public ** License along with this library; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef _Pantomime_H_CWPOP3CacheManager #define _Pantomime_H_CWPOP3CacheManager #import #include @class CWPOP3CacheObject; @class NSCalendarDate; /*! @class CWPOP3CacheManager @discussion This class provides trivial extensions to the CWCacheManager superclass for CWPOP3Folder instances. This cache manager makes use of CWPOP3CacheObject instances instead of CWPOP3Message instance for speed and size requirements restrictions. */ @interface CWPOP3CacheManager: CWCacheManager { @private NSMapTable *_table; } /*! @method dateForUID: @discussion This method is used to verify if the specific cache record with the POP3 UID theUID is present in the cache. It also returns the date associated to this specific UID. @param theUID The UID to verify. @result The date of the associated UID, nil if not present in the cache.. */ - (NSCalendarDate *) dateForUID: (NSString *) theUID; /*! @method writeRecord: @discussion This method is used to write a cache record to disk. @param theRecord The record to write. */ - (void) writeRecord: (cache_record *) theRecord; @end #endif // _Pantomime_H_CWPOP3CacheManager pantomime1.2-1.2.2+dfsg1/Framework/Pantomime/CWPOP3CacheManager.m000066400000000000000000000113601276751561200242010ustar00rootroot00000000000000/* ** CWPOP3CacheManager.m ** ** Copyright (c) 2001-2007 Ludovic Marcotte ** 2014 ** ** Author: Ludovic Marcotte ** Riccardo Mottola ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** You should have received a copy of the GNU Lesser General Public ** License along with this library; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #import #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include static unsigned short version = 1; // // // @implementation CWPOP3CacheManager - (id) initWithPath: (NSString *) thePath { NSDictionary *attributes; unsigned short int v; if ((self = [super initWithPath: thePath]) == nil) return nil; _table = NSCreateMapTable(NSObjectMapKeyCallBacks, NSObjectMapValueCallBacks, 128); _count = 0; if ((_fd = open([thePath UTF8String], O_RDWR|O_CREAT, S_IRUSR|S_IWUSR)) < 0) { NSLog(@"CANNOT CREATE OR OPEN THE CACHE!)"); abort(); } if (lseek(_fd, 0L, SEEK_SET) < 0) { NSLog(@"UNABLE TO LSEEK INITIAL"); abort(); } attributes = [[NSFileManager defaultManager] fileAttributesAtPath: thePath traverseLink: NO]; // If the cache exists, lets parse it. if ([[attributes objectForKey: NSFileSize] intValue]) { NSString *aUID; NSDate *aDate; unsigned short len; char *s; int i; v = read_unsigned_short(_fd); // Version mismatch. We ignore the cache for now. if (v != version) { if (ftruncate(_fd, 0) == -1) { if (errno == EACCES || errno == EROFS) NSLog(@"UNABLE TO TRUNCATE CACHE FILE WITH OLD VERSION, NOT WRITABLE"); else NSLog(@"UNABLE TO TRUNCATE CACHE FILE WITH OLD VERSION"); close(_fd); abort(); } [self synchronize]; return self; } _count = read_unsigned_int(_fd); //NSLog(@"Init with count = %d version = %d", _count, v); s = (char *)malloc(4096); for (i = 0; i < _count; i++) { aDate = [NSCalendarDate dateWithTimeIntervalSince1970: read_unsigned_int(_fd)]; read_string(_fd, s, &len); aUID = AUTORELEASE([[NSString alloc] initWithData: [NSData dataWithBytes: s length: len] encoding: NSASCIIStringEncoding]); NSMapInsert(_table, aUID, aDate); } free(s); } else { [self synchronize]; } return self; } // // // - (void) dealloc { //NSLog(@"CWPOP3CacheManager: -dealloc, _fd was = %d", _fd); NSFreeMapTable(_table); if (_fd >= 0) close(_fd); [super dealloc]; } // // // - (NSCalendarDate *) dateForUID: (NSString *) theUID { return NSMapGet(_table, theUID); } // // // - (BOOL) synchronize { if (lseek(_fd, 0L, SEEK_SET) < 0) { NSLog(@"fseek failed"); abort(); return NO; } // We write our cache version, count and UID validity. write_unsigned_short(_fd, version); write_unsigned_int(_fd, _count); return (fsync(_fd) == 0); } // // // - (void) writeRecord: (cache_record *) theRecord { NSData *aData; // We do NOT write a record we already have in our cache. // Some POP3 servers, like popa3d, might return the same UID // for messages at different index but with the same content. // If that happens, we just don't write that value in our cache. if (NSMapGet(_table, theRecord->pop3_uid)) { return; } if (lseek(_fd, 0L, SEEK_END) < 0) { NSLog(@"COULD NOT LSEEK TO END OF FILE"); abort(); } write_unsigned_int(_fd, theRecord->date); aData = [theRecord->pop3_uid dataUsingEncoding: NSASCIIStringEncoding]; write_string(_fd, (unsigned char *)[aData bytes], [aData length]); NSMapInsert(_table, theRecord->pop3_uid, [NSCalendarDate dateWithTimeIntervalSince1970: theRecord->date]); _count++; } @end pantomime1.2-1.2.2+dfsg1/Framework/Pantomime/CWPOP3CacheObject.h000066400000000000000000000052151276751561200240320ustar00rootroot00000000000000/* ** CWPOP3CacheObject.h ** ** Copyright (c) 2001-2004 ** ** Author: Ludovic Marcotte ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** You should have received a copy of the GNU Lesser General Public ** License along with this library; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef _Pantomime_H_CWPOP3CacheObject #define _Pantomime_H_CWPOP3CacheObject #import #import #import #import /*! @class CWPOP3CacheObject @discussion This class provides a simple placeholder for storing a POP3 unique message identifier combined with a received date. */ @interface CWPOP3CacheObject : NSObject { @private NSCalendarDate *_date; NSString *_UID; } /*! @method initWithUID: date: @discussion This method is the designated initializer for the CWPOP3CacheObject class. @param theUID The POP3 UID of the message @param theDate The date value of when the message has been downloaded from the POP3 server. @result The instance, nil on error. */ - (id) initWithUID: (NSString *) theUID date: (NSCalendarDate *) theDate; /*! @method date @discussion This method is used to obtain the date value of when the message has been downloaded from the POP3 server. @result The date value, nil if none was set. */ - (NSCalendarDate *) date; /*! @method setDate: @discussion This method is used to set the date value of when the message has been downloaded from the POP3 server. @param theDate The new date value. */ - (void) setDate: (NSCalendarDate *) theDate; /*! @method setUID: @discussion This method is used to set the POP3 unique identifier of the receiver. @param theUID The new UID value. */ - (void) setUID: (NSString *) theUID; /*! @method UID @discussion This method to obtain the POP3 unique identifier of the receiver. @result The unique identifier. */ - (NSString *) UID; @end #endif // _Pantomime_H_CWPOP3CacheObject pantomime1.2-1.2.2+dfsg1/Framework/Pantomime/CWPOP3CacheObject.m000066400000000000000000000044761276751561200240470ustar00rootroot00000000000000/* ** CWPOP3CacheObject.m ** ** Copyright (c) 2001-2004 ** ** Author: Ludovic Marcotte ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** You should have received a copy of the GNU Lesser General Public ** License along with this library; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include #include static int currentPOP3CacheObjectVersion = 1; // // // @implementation CWPOP3CacheObject - (id) init { self = [super init]; [CWPOP3CacheObject setVersion: currentPOP3CacheObjectVersion]; return self; } // // // - (id) initWithUID: (NSString *) theUID date: (NSCalendarDate *) theDate { self = [self init]; [self setUID: theUID]; [self setDate: theDate]; return self; } // // // - (void) dealloc { RELEASE(_date); RELEASE(_UID); [super dealloc]; } // // // - (void) encodeWithCoder: (NSCoder *) theCoder { [CWPOP3CacheObject setVersion: currentPOP3CacheObjectVersion]; [theCoder encodeObject: _UID]; [theCoder encodeObject: _date]; } // // // - (id) initWithCoder: (NSCoder *) theCoder { int version; version = [theCoder versionForClassName: NSStringFromClass([self class])]; self = [super init]; // Initial version of the serialized POP3 cache object if (version == 0) { [self setUID: [theCoder decodeObject]]; [self setDate: [NSCalendarDate calendarDate]]; } else { [self setUID: [theCoder decodeObject]]; [self setDate: [theCoder decodeObject]]; } return self; } // // // - (NSCalendarDate *) date { return _date; } - (void) setDate: (NSCalendarDate *) theDate { ASSIGN(_date, theDate); } - (NSString *) UID { return _UID; } - (void) setUID: (NSString *) theUID { ASSIGN(_UID, theUID); } @end pantomime1.2-1.2.2+dfsg1/Framework/Pantomime/CWPOP3Folder.h000066400000000000000000000075301276751561200231150ustar00rootroot00000000000000/* ** CWPOP3Folder.h ** ** Copyright (c) 2001-2006 ** ** Author: Ludovic Marcotte ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** You should have received a copy of the GNU Lesser General Public ** License along with this library; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef _Pantomime_H_CWPOP3Folder #define _Pantomime_H_CWPOP3Folder #include #import #import /*! @class CWPOP3Folder @discussion This class, which extends the Folder class, is used to implement POP3-specific features. */ @interface CWPOP3Folder : CWFolder { BOOL _leave_on_server; unsigned int _retain_period; } /*! @method prefetchMessageAtIndex: numberOfLines: @discussion This method is used to fetch a certain amount of lines of the message, at the specified index. On completion, this method posts the PantomimeMessagePrefetchCompleted (and calls -messagePrefetchCompleted: on the delegate, if any). This method is fully asynchronous. Since this method can be used to partially fetch the message, it is the responsability of the caller to verify if the message's data is fully loaded. One can verify the lenght of the message's data and compare it to the message's size. @param theIndex The index of the message, which is 1-based in POP3. @param theNumberOfLines The number of lines to fetch. Specifying 0 will only fetch the headers. */ - (void) prefetchMessageAtIndex: (int) theIndex numberOfLines: (unsigned int) theNumberOfLines; /*! @method prefetch @discussion This method is used to cache a certain amount of information from the POP3 server, for all messages. It caches the number of messages, their size and UID. On completion, it posts a PantomimeFolderPrefetchCompleted notification (and calls -folderPrefetchCompleted: on the delegate, if any). This method is also fully asynchronous. */ - (void) prefetch; /*! @method leaveOnServer @discussion This method is used to verify if the receiver leaves the messages on server after retrieve them. @result The value. */ - (BOOL) leaveOnServer; /*! @method setLeaveOnServer: @discussion This method is used to set the flag to leave or not the messages on the POP3 server after fetching them. @param theBOOL YES if we want to leave them on the server after a fetch. If NO, the messages will be automatically deleted after being fetched. */ - (void) setLeaveOnServer: (BOOL) theBOOL; /*! @method retainPeriod @discussion This method is used to obtain the retain period for the messages, if left on the server. @result The retain period. A value of 0 means that the messages will always be retained. */ - (unsigned int) retainPeriod; /*! @method setRetainPeriod: @discussion This method is used to set the retain period (in days) before the messages are deleted from the server. In order for this to work, the receiver must have a cache (instance of CWPOP3CacheManager). @param theRetainPeriod The retain period to use, in number of days. */ - (void) setRetainPeriod: (unsigned int) theRetainPeriod; @end #endif // _Pantomime_H_CWPOP3Folder pantomime1.2-1.2.2+dfsg1/Framework/Pantomime/CWPOP3Folder.m000066400000000000000000000074461276751561200231300ustar00rootroot00000000000000/* ** CWPOP3Folder.m ** ** Copyright (c) 2001-2006 Ludovic Marcotte ** 2014 The GNUstep team ** ** Author: Ludovic Marcotte ** Riccardo Mottola ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** You should have received a copy of the GNU Lesser General Public ** License along with this library; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #if !defined(UINT_MAX) #define UINT_MAX (unsigned int)~0 #endif // // Private methods // @interface CWPOP3Folder (Private) - (void) _deleteOldMessages; @end // // // @implementation CWPOP3Folder - (id) initWithName: (NSString *) theName { self = [super initWithName: theName]; _leave_on_server = YES; _retain_period = 0; return self; } // // // - (void) prefetchMessageAtIndex: (int) theIndex numberOfLines: (unsigned int) theNumberOfLines { [_store sendCommand: POP3_TOP arguments: @"TOP %d %d", theIndex, theNumberOfLines]; } // // // - (void) prefetch { [_store sendCommand: POP3_STAT arguments: @"STAT"]; } // // This method does nothing. // - (void) close { // We do nothing. } // // // - (BOOL) leaveOnServer { return _leave_on_server; } // // // - (void) setLeaveOnServer: (BOOL) theBOOL { _leave_on_server = theBOOL; } // // // - (unsigned int) retainPeriod { return _retain_period; } // // The retain period is set in days. // - (void) setRetainPeriod: (unsigned int) theRetainPeriod { _retain_period = theRetainPeriod; } // // // - (PantomimeFolderMode) mode { return PantomimeReadWriteMode; } // // // - (void) expunge { int count; count = [self count]; // We mark it as deleted if we need to if (!_leave_on_server) { int i; for (i = 1; i <= count; i++) { [_store sendCommand: POP3_DELE arguments: @"DELE %d", i]; } } else if (_retain_period > 0) { [self _deleteOldMessages]; } [_store sendCommand: POP3_EXPUNGE_COMPLETED arguments: @""]; } // // In POP3, we do nothing. // - (void) search: (NSString *) theString mask: (PantomimeSearchMask) theMask options: (PantomimeSearchOption) theOptions { } @end // // Private methods // @implementation CWPOP3Folder (Private) - (void) _deleteOldMessages { int i, count; count = [self count]; for (i = count; i > 0; i--) { NSDate *aDate; aDate = [_cacheManager dateForUID: [[allMessages objectAtIndex: i-1] UID]]; if (aDate) { NSTimeInterval interval; NSInteger days; interval = [aDate timeIntervalSinceNow]; days = -(interval / (24*3600)); if (days >= _retain_period) { [_store sendCommand: POP3_DELE arguments: @"DELE %d", i]; } } } } @end pantomime1.2-1.2.2+dfsg1/Framework/Pantomime/CWPOP3Message.h000066400000000000000000000054271276751561200232710ustar00rootroot00000000000000/* ** CWPOP3Message.h ** ** Copyright (c) 2001-2006 ** ** Author: Ludovic Marcotte ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** You should have received a copy of the GNU Lesser General Public ** License along with this library; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef _Pantomime_H_CWPOP3Message #define _Pantomime_H_CWPOP3Message #import #include /*! @class CWPOP3Message @discussion This class, which extends CWMessage, adds POP3 specific information. */ @interface CWPOP3Message : CWMessage { @private NSString *_UID; } /*! @method UID @discussion This method is used to obtain the UID of a message. @result The UID of the message. RFC 1939 says: "The unique-id of a message is an arbitrary server-determined string, consisting of one to 70 characters in the range 0x21 to 0x7E, which uniquely identifies a message within a maildrop and which persists across sessions.". */ - (NSString *) UID; /*! @method setUID: @discussion This method is used to set the UID of a message. Normally, you shouldn't invoke this method directly. @param theUID The UID of the message. */ - (void) setUID: (NSString *) theUID; /*! @method rawSource @discussion POP3 specific implementation of the rawSource method. This method is always non-blocking. It might return nil if the raw source of the message hasn't yet been fetched from the POP3 server. The POP3Store notifies the delegate when the fetch has been completed using the PantomimeMessagePrefetchCompleted notification. It also calls -messagePrefetchCompleted on the delegate, if any. @result The raw source of the message, nil if not yet fully fetched. */ - (NSData *) rawSource; /*! @method setFlags: @discussion This method, which overrides the one found in CWMessage, can be used to delete message on the POP3 server. The only fact that is honored from this method is PantomimeDeleted. If not specified in theFlags, this method does nothing. @param theIndex The flags to use. */ - (void) setFlags: (CWFlags *) theFlags; @end #endif // _Pantomime_H_CWPOP3Message pantomime1.2-1.2.2+dfsg1/Framework/Pantomime/CWPOP3Message.m000066400000000000000000000047201276751561200232710ustar00rootroot00000000000000/* ** CWPOP3Message.m ** ** Copyright (c) 2001-2006 ** ** Author: Ludovic Marcotte ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** You should have received a copy of the GNU Lesser General Public ** License along with this library; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include #include #include #include #include @implementation CWPOP3Message - (id) init { self = [super init]; [self setUID: nil]; return self; } // // // - (void) dealloc { RELEASE(_UID); [super dealloc]; } // // NSCoding protocol // - (void) encodeWithCoder: (NSCoder *) theCoder { // Must also encode Message's superclass [super encodeWithCoder: theCoder]; [theCoder encodeObject: [self UID]]; } // // // - (id) initWithCoder: (NSCoder *) theCoder { // Must also decode Message's superclass self = [super initWithCoder: theCoder]; [self setUID: [theCoder decodeObject]]; return self; } // // // - (NSString *) UID { return _UID; } // // // - (void) setUID: (NSString *) theUID { ASSIGN(_UID, theUID); } // // // - (NSData *) rawSource { if (!_rawSource) { [[[self folder] store] sendCommand: POP3_RETR arguments: @"RETR %d", [self messageNumber]]; } return _rawSource; } // // // - (void) setInitialized: (BOOL) theBOOL { [super setInitialized: theBOOL]; if (!theBOOL) { DESTROY(_content); return; } if (!_content) { [[[self folder] store] sendCommand: POP3_RETR_AND_INITIALIZE arguments: @"RETR %d", [self messageNumber]]; [super setInitialized: NO]; } } // // // - (void) setFlags: (CWFlags *) theFlags { if ([theFlags contain: PantomimeDeleted]) { [[[self folder] store] sendCommand: POP3_DELE arguments: @"DELE %d", [self messageNumber]]; } [super setFlags: theFlags]; } @end pantomime1.2-1.2.2+dfsg1/Framework/Pantomime/CWPOP3Store.h000066400000000000000000000074151276751561200230000ustar00rootroot00000000000000/* ** CWPOP3Store.h ** ** Copyright (c) 2001-2006 ** ** Author: Ludovic Marcotte ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** You should have received a copy of the GNU Lesser General Public ** License along with this library; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef _Pantomime_H_CWPOP3Store #define _Pantomime_H_CWPOP3Store #include #include #import #import /*! @typedef POP3Command @abstract Supported POP3 commands. @discussion This enum lists the supported POP3 commands available in Pantomime's POP3 client code. @constant POP3_APOP APOP authentication command. @constant POP3_AUTHORIZATION Special command so that we know we are in the authorization state. @constant POP3_DELE The POP3 DELE command. See RFC 1939 for details. @constant POP3_LIST The POP3 LIST command. See RFC 1939 for details. @constant POP3_NOOP The POP3 NOOP command. See RFC 1939 for details. @constant POP3_PASS The POP3 PASS command. See RFC 1939 for details. @constant POP3_QUIT The POP3 QUIT command. See RFC 1939 for details. @constant POP3_RETR The POP3 RETR command. See RFC 1939 for details. @constant POP3_RETR_AND_INITIALIZE Same as POP3_RETR but also initialize the message with the received content. @constant POP3_STAT The POP3 STAT command. See RFC 1939 for details. @constant POP3_STLS The STLS POP3 command - see RFC2595. @constant POP3_TOP The POP3 TOP command. See RFC 1939 for details. @constant POP3_UIDL The POP3 UIDL command. See RFC 1939 for details. @constant POP3_USER The POP3 USER command. See RFC 1939 for details. @constant POP3_EMPTY_QUEUE Special command to empty the command queue. @constant POP3_EXPUNGE_COMPLETED Special command to indicate we are done expunging the deleted messages. */ typedef enum { POP3_APOP = 0x100, POP3_AUTHORIZATION, POP3_CAPA, POP3_DELE, POP3_LIST, POP3_NOOP, POP3_PASS, POP3_QUIT, POP3_RETR, POP3_RETR_AND_INITIALIZE, POP3_STAT, POP3_STLS, POP3_TOP, POP3_UIDL, POP3_USER, POP3_EMPTY_QUEUE, POP3_EXPUNGE_COMPLETED } POP3Command; @class CWPOP3Folder; /*! @class CWPOP3Store @abstract Pantomime POP3 client code. @discussion This class, which extends the CWService class and implements the CWStore protocol, is Pantomime's POP3 client code. */ @interface CWPOP3Store : CWService { @private NSString *_timestamp; CWPOP3Folder *_folder; } /*! @method timestamp @discussion This method is used to obtain the timestamp in the server's greeting. Servers must send that if they do support APOP. @result The timestamp, as a NSString instance. */ - (NSString *) timestamp; /*! @method sendCommand:arguments:... @discussion This method is used to send commands to the POP3 server. Normally, you should not call this method directly. @param theCommand The POP3 command to send. @param theFormat The format defining the variable arguments list. */ - (void) sendCommand: (POP3Command) theCommand arguments: (NSString *) theFormat, ...; @end #endif // _Pantomime_H_CWPOP3Store pantomime1.2-1.2.2+dfsg1/Framework/Pantomime/CWPOP3Store.m000066400000000000000000000543361276751561200230110ustar00rootroot00000000000000/* ** CWPOP3Store.m ** ** Copyright (c) 2001-2006 ** ** Author: Ludovic Marcotte ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** You should have received a copy of the GNU Lesser General Public ** License along with this library; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include // // Some static variables used to enhance the performance. // static NSStringEncoding defaultCStringEncoding; static NSData *CRLF; // // // @interface CWPOP3QueueObject : NSObject { @public POP3Command command; NSString *arguments; } - (id) initWithCommand: (POP3Command) theCommand arguments: (NSString *) theArguments; @end @implementation CWPOP3QueueObject - (id) initWithCommand: (POP3Command) theCommand arguments: (NSString *) theArguments { self = [super init]; command = theCommand; ASSIGN(arguments, theArguments); return self; } - (void) dealloc { RELEASE(arguments); [super dealloc]; } @end // // Private methods // @interface CWPOP3Store (Private) - (void) _parseAPOP; - (void) _parseAUTHORIZATION; - (void) _parseCAPA; - (void) _parseLIST; - (void) _parseNOOP; - (void) _parsePASS; - (void) _parseQUIT; - (void) _parseRETR; - (void) _parseSTAT; - (void) _parseSTLS; - (void) _parseTOP; - (void) _parseUIDL; - (void) _parseUSER; - (void) _parseServerOutput; @end // // // @implementation CWPOP3Store + (void) initialize { defaultCStringEncoding = [NSString defaultCStringEncoding]; CRLF = [[NSData alloc] initWithBytes: "\r\n" length: 2]; } // // // - (id) initWithName: (NSString *) theName port: (unsigned int) thePort { if (thePort == 0) thePort = 110; self = [super initWithName: theName port: thePort]; _lastCommand = POP3_AUTHORIZATION; _timestamp = nil; // We initialize out POP3Folder object. _folder = [[CWPOP3Folder alloc] initWithName: @"Inbox"]; [_folder setStore: self]; // We queue our first "command". [_queue addObject: AUTORELEASE([[CWPOP3QueueObject alloc] initWithCommand: _lastCommand arguments: @""])]; return self; } // // // - (void) dealloc { //NSLog(@"POP3Store: -dealloc"); RELEASE(_folder); RELEASE(_timestamp); [super dealloc]; } // // // - (id) initWithURL: (CWURLName *) theURL { return [self initWithName: [theURL host] port: 110]; } // // // - (NSEnumerator *) folderEnumerator { return [[NSArray arrayWithObject: @"Inbox"] objectEnumerator]; } // // // - (NSEnumerator *) subscribedFolderEnumerator { return [self folderEnumerator]; } // // // - (NSEnumerator *) openFoldersEnumerator { return [[NSArray arrayWithObject: _folder] objectEnumerator]; } // // // - (void) removeFolderFromOpenFolders: (CWFolder *) theFolder { // Do nothing } // // This method authenticates the Store to the POP3 server. // In case of an error, it returns NO. // - (void) authenticate: (NSString *) theUsername password: (NSString *) thePassword mechanism: (NSString *) theMechanism { ASSIGN(_username, theUsername); ASSIGN(_password, thePassword); ASSIGN(_mechanism, theMechanism); // We verify if we must use APOP if (theMechanism && [theMechanism caseInsensitiveCompare: @"APOP"] == NSOrderedSame) { NSMutableData *aMutableData; CWMD5 *aMD5; aMutableData = [[NSMutableData alloc] init]; [aMutableData appendCFormat: @"%@%@", _timestamp, _password]; aMD5 = [[CWMD5 alloc] initWithData: aMutableData]; RELEASE(aMutableData); [aMD5 computeDigest]; [self sendCommand: POP3_APOP arguments: @"APOP %@ %@", _username, [aMD5 digestAsString]]; RELEASE(aMD5); } else { [self sendCommand: POP3_USER arguments: @"USER %@", _username]; } } // // // - (NSArray *) supportedMechanisms { if (_timestamp) { return [NSArray arrayWithObject: @"APOP"]; } return [NSArray array]; } // // The default folder in POP3 is always Inbox. // - (id) defaultFolder { return _folder; } // // This method will always return nil if theName is not // equal to Inbox (case-insensitive) since you cannot // access an other mailbox (other than Inbox) using the // POP3 protocol. // - (id) folderForName: (NSString *) theName { if ([theName caseInsensitiveCompare: @"Inbox"] == NSOrderedSame) { return [self defaultFolder]; } return nil; } // // // - (id) folderForURL: (NSString *) theURL { return [self defaultFolder]; } // // // - (BOOL) folderForNameIsOpen: (NSString *) theName { if ([theName caseInsensitiveCompare: @"Inbox"] == NSOrderedSame) { return YES; } return NO; } // // No other folder is allowed in POP3 other than the Inbox. // Also, this folder can only holds messages. // - (PantomimeFolderType) folderTypeForFolderName: (NSString *) theName { return PantomimeHoldsMessages; } // // POP3 has no concept of folder separator. // - (unsigned char) folderSeparator { return 0; } // // // - (void) close { [self sendCommand: POP3_QUIT arguments: @"QUIT"]; } // // // - (void) noop { [self sendCommand: POP3_NOOP arguments: @"NOOP"]; } // // In POP3, you are NOT allowed to create a folder. // - (void) createFolderWithName: (NSString *) theName type: (PantomimeFolderFormat) theType contents: (NSData *) theContents { } // // In POP3, you are NOT allowed to delete a folder. // - (void) deleteFolderWithName: (NSString *) theName { } // // In POP3, you are NOT allowed to rename a folder. // - (void) renameFolderWithName: (NSString *) theName toName: (NSString *) theNewName { } // // // - (NSString *) timestamp { return _timestamp; } // // From RFC1939: // // Responses in the POP3 consist of a status indicator and a keyword // possibly followed by additional information. All responses are // terminated by a CRLF pair. Responses may be up to 512 characters // long, including the terminating CRLF. There are currently two status // indicators: positive ("+OK") and negative ("-ERR"). Servers MUST // send the "+OK" and "-ERR" in upper case. // // Responses to certain commands are multi-line. In these cases, which // are clearly indicated below, after sending the first line of the // response and a CRLF, any additional lines are sent, each terminated // by a CRLF pair. When all lines of the response have been sent, a // final line is sent, consisting of a termination octet (decimal code // 046, ".") and a CRLF pair. If any line of the multi-line response // begins with the termination octet, the line is "byte-stuffed" by // pre-pending the termination octet to that line of the response. // Hence a multi-line response is terminated with the five octets // "CRLF.CRLF". When examining a multi-line response, the client checks // to see if the line begins with the termination octet. If so and if // octets other than CRLF follow, the first octet of the line (the // termination octet) is stripped away. If so and if CRLF immediately // follows the termination character, then the response from the POP // server is ended and the line containing ".CRLF" is not considered // part of the multi-line response. // - (void) updateRead { id aData; char *buf; int count; [super updateRead]; while ((aData = split_lines(_rbuf))) { buf = (char *)[aData bytes]; count = [aData length]; [_responsesFromServer addObject: aData]; if (count) { switch (*buf) { case '.': // // We verify if we must strip the termination octet // if (count > 1) { aData = [NSMutableData dataWithData: aData]; buf = [aData mutableBytes]; memmove(buf, buf+1, count-2); [aData setLength: count-2]; } else { // We are done receiving multi-line response and // we are ready to parse the received bytes. Before // parsing all the received bytes, we remove the // last line added since it corresponds to our // multi-line response terminator. [_responsesFromServer removeLastObject]; [self _parseServerOutput]; return; } break; case '+': // // There's no real way in POP3 to know if we are currently // reading a multi-line response. We assume we are NOT for // some commands. // if (_lastCommand != POP3_CAPA && _lastCommand != POP3_LIST && _lastCommand != POP3_TOP && _lastCommand != POP3_RETR && _lastCommand != POP3_RETR_AND_INITIALIZE && _lastCommand != POP3_UIDL && (count > 2 && strncmp("+OK", buf, 3) == 0)) { [self _parseServerOutput]; return; } break; case '-': if (_lastCommand != POP3_TOP && _lastCommand != POP3_RETR && _lastCommand != POP3_RETR_AND_INITIALIZE && (count > 3 && strncmp("-ERR", buf, 4) == 0)) { [self _parseServerOutput]; return; } break; } } } } // // From RFC1939: // // Commands in the POP3 consist of a case-insensitive keyword, possibly // followed by one or more arguments. All commands are terminated by a // CRLF pair. Keywords and arguments consist of printable ASCII // characters. Keywords and arguments are each separated by a single // SPACE character. Keywords are three or four characters long. Each // argument may be up to 40 characters long. // - (void) sendCommand: (POP3Command) theCommand arguments: (NSString *) theFormat, ... { CWPOP3QueueObject *aQueueObject; //NSLog(@"sendCommand invoked, cmd = %i", theCommand); if (theCommand == POP3_EMPTY_QUEUE) { if ([_queue count]) { // We dequeue the first inserted command from the queue. aQueueObject = [_queue lastObject]; } else { // The queue is empty, we have nothing more to do... return; } } else { NSString *aString; va_list args; va_start(args, theFormat); aString = [[NSString alloc] initWithFormat: theFormat arguments: args]; aQueueObject = [[CWPOP3QueueObject alloc] initWithCommand: theCommand arguments: aString]; RELEASE(aString); [_queue insertObject: aQueueObject atIndex: 0]; RELEASE(aQueueObject); //NSLog(@"queue size = %d:", [_queue count]); // If we had queued commands, we return since we'll eventually // dequeue them one by one. Otherwise, we run it immediately. if ([_queue count] > 1) { //NSLog(@"QUEUED |%@|", aString); return; } } //NSLog(@"Sending |%@|", aQueueObject->arguments); _lastCommand = aQueueObject->command; // We verify if we had queued an indicator to tell us that we were done // wrt expunging the POP3 folder. if (_lastCommand == POP3_EXPUNGE_COMPLETED) { [_queue removeObject: [_queue lastObject]]; POST_NOTIFICATION(PantomimeFolderExpungeCompleted, self, [NSDictionary dictionaryWithObject: _folder forKey: @"Folder"]); PERFORM_SELECTOR_2(_delegate, @selector(folderExpungeCompleted:), PantomimeFolderExpungeCompleted, _folder, @"Folder"); return; } // We send the command to the POP3 server. [self writeData: [aQueueObject->arguments dataUsingEncoding: defaultCStringEncoding]]; [self writeData: CRLF]; } // // // - (void) startTLS { [self sendCommand: POP3_STLS arguments: @"STLS"]; } @end // // Private methods // @implementation CWPOP3Store (Private) - (void) _parseAPOP { NSData *aData; aData = [_responsesFromServer lastObject]; if ([aData hasCPrefix: "+OK"]) { AUTHENTICATION_COMPLETED(_delegate, @"APOP"); } else { AUTHENTICATION_FAILED(_delegate, @"APOP"); } } // // // - (void) _parseAUTHORIZATION { NSData *aData; aData = [_responsesFromServer lastObject]; if ([aData hasCPrefix: "+OK"]) { NSRange range1, range2; range1 = [aData rangeOfCString: "<"]; range2 = [aData rangeOfCString: ">"]; if (range1.length && range2.length) { ASSIGN(_timestamp, [[aData subdataWithRange: NSMakeRange(range1.location,range2.location-range1.location+1)] asciiString]); } [self sendCommand: POP3_CAPA arguments: @"CAPA"]; } else { // FIXME // connectionLost? or should we call [self close]? } } // // See RFC2449 for details. // - (void) _parseCAPA { NSData *aData; int i, count; count = [_responsesFromServer count]; for (i = 1; i < count; i++) { aData = [_responsesFromServer objectAtIndex: i]; [_capabilities addObject: AUTORELEASE([[NSString alloc] initWithData: aData encoding: defaultCStringEncoding])]; } POST_NOTIFICATION(PantomimeServiceInitialized, self, nil); PERFORM_SELECTOR_1(_delegate, @selector(serviceInitialized:), PantomimeServiceInitialized); } // // From RFC1939: // // If no argument was given and the POP3 server issues a // positive response, then the response given is multi-line. // After the initial +OK, for each message in the maildrop, // the POP3 server responds with a line containing // information for that message. This line is also called a // "scan listing" for that message. If there are no // messages in the maildrop, then the POP3 server responds // with no scan listings--it issues a positive response // followed by a line containing a termination octet and a // CRLF pair. // - (void) _parseLIST { CWPOP3Message *aMessage; int i, idx, count; long size; count = [_responsesFromServer count]; for (i = 1; i < count; i++) { sscanf([[_responsesFromServer objectAtIndex: i] cString], "%i %li", &idx, &size); aMessage = [_folder->allMessages objectAtIndex: (idx-1)]; [aMessage setSize: size]; [aMessage setMessageNumber: i]; } [self sendCommand: POP3_UIDL arguments: @"UIDL"]; } // // // - (void) _parseNOOP { // Do what? } // // // - (void) _parsePASS { NSData *aData; aData = [_responsesFromServer lastObject]; if ([aData hasCPrefix: "+OK"]) { AUTHENTICATION_COMPLETED(_delegate, @""); } else { AUTHENTICATION_FAILED(_delegate, @""); } } // // // - (void) _parseQUIT { // We don't need to do anything special here. [super close]; } // // // - (void) _parseRETR { NSData *aData; aData = [_responsesFromServer objectAtIndex: 0]; if ([aData hasCPrefix: "+OK"]) { NSMutableData *aMutableData; CWPOP3Message *aMessage; int count, i, idx; // We get the idx of the message we are parsing... sscanf([((CWPOP3QueueObject *)[_queue lastObject])->arguments cString], "RETR %d", &idx); aMessage = (CWPOP3Message *)[_folder messageAtIndex: (idx-1)]; aMutableData = [[NSMutableData alloc] initWithCapacity: [aMessage size]]; count = [_responsesFromServer count]; for (i = 1; i < count; i++) { [aMutableData appendData: [_responsesFromServer objectAtIndex: i]]; // We do NOT append the last \n. if (i < count-1) { [aMutableData appendBytes: "\n" length: 1]; } } [aMessage setRawSource: aMutableData]; if (_lastCommand == POP3_RETR_AND_INITIALIZE) { NSRange aRange; aRange = [aMutableData rangeOfCString: "\n\n"]; if (aRange.length == 0) { [aMessage setInitialized: NO]; } else { [aMessage setHeadersFromData: [aMutableData subdataWithRange: NSMakeRange(0,aRange.location)]]; [CWMIMEUtility setContentFromRawSource: [aMutableData subdataWithRange: NSMakeRange(aRange.location + 2, [aMutableData length]-(aRange.location+2))] inPart: aMessage]; [aMessage setInitialized: YES]; } } [aMessage setSize: [aMutableData length]]; RELEASE(aMutableData); // Do that in parse top also? if ([_folder cacheManager]) { cache_record r; r.date = [[NSCalendarDate calendarDate] timeIntervalSince1970]; r.pop3_uid = [aMessage UID]; [[_folder cacheManager] writeRecord: &r]; } POST_NOTIFICATION(PantomimeMessagePrefetchCompleted, self, [NSDictionary dictionaryWithObject: aMessage forKey: @"Message"]); PERFORM_SELECTOR_2(_delegate, @selector(messagePrefetchCompleted:), PantomimeMessagePrefetchCompleted, aMessage, @"Message"); } } // // // - (void) _parseSTAT { NSData *aData; aData = [_responsesFromServer lastObject]; if ([aData hasCPrefix: "+OK"]) { CWPOP3Message *aMessage; int count; long size; sscanf([aData cString], "+OK %i %li", &count, &size); //NSLog(@"count = %d size = %li", count, size); while (count--) { aMessage = [[CWPOP3Message alloc] init]; [aMessage setFolder: _folder]; [_folder->allMessages addObject: aMessage]; RELEASE(aMessage); } //NSLog(@"Folder count = %d", [_folder count]); [self sendCommand: POP3_LIST arguments: @"LIST"]; } else { // FIXME: Do what in case STAT failed? } } // // // - (void) _parseSTLS { NSData *aData; aData = [_responsesFromServer lastObject]; if ([aData hasCPrefix: "+OK"]) { [(CWTCPConnection *)_connection startSSL]; POST_NOTIFICATION(PantomimeServiceInitialized, self, nil); PERFORM_SELECTOR_1(_delegate, @selector(serviceInitialized:), PantomimeServiceInitialized); } else { // FIXME: Handle the case where STLS failed } } // // This method is very similar to the _parseRETR method. // We don't touch the message's size (set in _parseLIST) // since we must know how much we had to read, // - (void) _parseTOP { NSData *aData; aData = [_responsesFromServer objectAtIndex: 0]; if ([aData hasCPrefix: "+OK"]) { NSMutableData *aMutableData; CWPOP3Message *aMessage; int count, i, idx, num; // We get the idx of the message we are parsing... sscanf([((CWPOP3QueueObject *)[_queue lastObject])->arguments cString], "TOP %d %d", &idx, &num); //NSLog(@"PARTIALLY DECODING MESSAGE no. %d - number of lines %d!", idx, num); aMessage = (CWPOP3Message *)[_folder messageAtIndex: (idx-1)]; aMutableData = [[NSMutableData alloc] init]; count = [_responsesFromServer count]; for (i = 1; i < count; i++) { [aMutableData appendData: [_responsesFromServer objectAtIndex: i]]; [aMutableData appendBytes: "\n" length: 1]; } [aMessage setRawSource: aMutableData]; RELEASE(aMutableData); POST_NOTIFICATION(PantomimeMessagePrefetchCompleted, self, [NSDictionary dictionaryWithObject: aMessage forKey: @"Message"]); PERFORM_SELECTOR_2(_delegate, @selector(messagePrefetchCompleted:), PantomimeMessagePrefetchCompleted, aMessage, @"Message"); } } // // // - (void) _parseUIDL { int i, idx, count; char buf[71]; count = [_responsesFromServer count]; for (i = 1; i < count; i++) { memset(buf, 0, 71); sscanf([[_responsesFromServer objectAtIndex: i] cString],"%i %s", &idx, buf); [[_folder->allMessages objectAtIndex: (idx-1)] setUID: [NSString stringWithCString: buf]]; } POST_NOTIFICATION(PantomimeFolderPrefetchCompleted, self, [NSDictionary dictionaryWithObject: _folder forKey: @"Folder"]); PERFORM_SELECTOR_2(_delegate, @selector(folderPrefetchCompleted:), PantomimeFolderPrefetchCompleted, _folder, @"Folder"); } // // From RFC1939: // // To authenticate using the USER and PASS command // combination, the client must first issue the USER // command. If the POP3 server responds with a positive // status indicator ("+OK"), then the client may issue // either the PASS command to complete the authentication, // or the QUIT command to terminate the POP3 session. If // the POP3 server responds with a negative status indicator // ("-ERR") to the USER command, then the client may either // issue a new authentication command or may issue the QUIT // command. // - (void) _parseUSER { NSData *aData; aData = [_responsesFromServer lastObject]; if ([aData hasCPrefix: "+OK"]) { [self sendCommand: POP3_PASS arguments: @"PASS %@", _password]; } else { // We must terminate the POP3 session. [self close]; } } // // // - (void) _parseServerOutput { if (![_responsesFromServer count]) { return; } //NSLog(@"In _parseServerOutput...%d", _lastCommand); switch (_lastCommand) { case POP3_APOP: [self _parseAPOP]; break; case POP3_AUTHORIZATION: [self _parseAUTHORIZATION]; break; case POP3_CAPA: [self _parseCAPA]; break; case POP3_LIST: [self _parseLIST]; break; case POP3_NOOP: [self _parseNOOP]; break; case POP3_PASS: [self _parsePASS]; break; case POP3_QUIT: [self _parseQUIT]; break; case POP3_RETR: case POP3_RETR_AND_INITIALIZE: [self _parseRETR]; break; case POP3_STAT: [self _parseSTAT]; break; case POP3_STLS: [self _parseSTLS]; break; case POP3_TOP: [self _parseTOP]; break; case POP3_UIDL: [self _parseUIDL]; break; case POP3_USER: [self _parseUSER]; break; default: //NSLog(@"UNKNOWN POP3 LAST COMMAND %d", _lastCommand); break; // FIXME } // We are done parsing this entry... [_responsesFromServer removeAllObjects]; // We remove the last object of the queue, if needed. //NSLog(@"Removing oldest command from queue (%d)...", [_queue count]); if ([_queue count]) { [_queue removeLastObject]; [self sendCommand: POP3_EMPTY_QUEUE arguments: @""]; } } @end pantomime1.2-1.2.2+dfsg1/Framework/Pantomime/CWParser.h000066400000000000000000000212621276751561200224720ustar00rootroot00000000000000/* ** CWParser.h ** ** Copyright (c) 2001-2006 ** ** Author: Ludovic Marcotte ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** You should have received a copy of the GNU Lesser General Public ** License along with this library; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef _Pantomime_H_CWParser #define _Pantomime_H_CWParser #import #import #include @class CWPart; @class CWMessage; /*! @class CWParser @abstract Utility class providing class methods to parse messages. @discussion This class provide useful methods (all class methods) to parse messages from their raw representation. */ @interface CWParser: NSObject /*! @method parseContentDescription: inPart: @discussion This method is used to parse a Content-Disposition header line. @param theLine The line to parse. @param thePart The part in which to store the parsed value, if any. */ + (void) parseContentDescription: (NSData *) theLine inPart: (CWPart *) thePart; /*! @method parseContentDisposition: inPart: @discussion This method is used to parse a Content-Disposition header line. It supports the following parameters: "filename" ; case-insensitive @param theLine The line to parse. @param thePart The part in which to store the parsed value, if any. */ + (void) parseContentDisposition: (NSData *) theLine inPart: (CWPart *) thePart; /*! @method parseContentID: inPart: @discussion This method is used to parse a Content-ID header line. @param theLine The line to parse. @param thePart The part in which to store the parsed value, if any. */ + (void) parseContentID: (NSData *) theLine inPart: (CWPart *) thePart; /*! @method parseContentTransferEncoding: inPart: @discussion This method is used to parse a Content-Transfer-Encoding header line. It supports: "7bit" (or none) ; case-insensitive "quoted-printable" "base64" "8bit" "binary" @param theLine The line to parse. @param thePart The part in which to store the parsed value, if any. */ + (void) parseContentTransferEncoding: (NSData *) theLine inPart: (CWPart *) thePart; /*! @method parseContentType: inPart: @discussion This method is used to parse a Content-Type header line. This method parses correct lines like: "Content-Type: text/plain", "Content-Type: Text/plain;" "Content-Type: text/plain; charset="iso-8859-1"", "Content-Type: text", "Content-Type: text/plain", and so on. This method also parses (if it needs to) the following parameters: "boundary" (if Content-Type is multipart/something), "charset" (if Content-Type is text/plain) "name", "format" and so on. @param theLine The line to parse. @param thePart The part in which to store the parsed values, if any. */ + (void) parseContentType: (NSData *) theLine inPart: (CWPart *) thePart; /*! @method parseDate: inMessage: @discussion This method is used to parse a Date header line. @param theLine The line to parse. @param theMessage The message in which to store the parsed value, if any. */ + (void) parseDate: (NSData *) theLine inMessage: (CWMessage *) theMessage; /*! @method parseDestination: forType: inMessage: @discussion This method is used to parse the To: Cc: Bcc: headers value. @param theLine The line to parse. @param theType The type to parse (one of the values of the PantomimeRecipientType enum) @param theMessage The message in which to store the parsed value, if any. */ + (NSData *) parseDestination: (NSData *) theLine forType: (PantomimeRecipientType) theType inMessage: (CWMessage *) theMessage quick: (BOOL) theBOOL; /*! @method parseFrom: inMessage: @discussion This method is used to parse a From header line. @param theLine The line to parse. @param theMessage The message in which to store the parsed value, if any. */ + (NSData *) parseFrom: (NSData *) theLine inMessage: (CWMessage *) theMessage quick: (BOOL) theBOOL; /*! @method parseInReplyTo: inMessage: @discussion This method is used to parse a In-Reply-To header line. @param theLine The line to parse. @param theMessage The message in which to store the parsed value, if any. */ + (NSData *) parseInReplyTo: (NSData *) theLine inMessage: (CWMessage *) theMessage quick: (BOOL) theBOOL; /*! @method parseMessageID: inMessage: @discussion This method is used to parse a Message-ID header line. @param theLine The line to parse. @param theMessage The message in which to store the parsed value, if any. */ + (NSData *) parseMessageID: (NSData *) theLine inMessage: (CWMessage *) theMessage quick: (BOOL) theBOOL; /*! @method parseMIMEVersion: inMessage: @discussion This method is used to parse a MIME-Version header line. @param theLine The line to parse. @param theMessage The message in which to store the parsed value, if any. */ + (void) parseMIMEVersion: (NSData *) theLine inMessage: (CWMessage *) theMessage; /*! @method parseReferences: inMessage: @discussion This method is used to parse a References header line. @param theLine The line to parse. @param theMessage The message in which to store the parsed value, if any. */ + (NSData *) parseReferences: (NSData *) theLine inMessage: (CWMessage *) theMessage quick: (BOOL) theBOOL; /*! @method parseReply: inMessage: @discussion This method is used to parse a Reply-To header line. @param theLine The line to parse. @param theMessage The message in which to store the parsed value, if any. */ + (void) parseReplyTo: (NSData *) theLine inMessage: (CWMessage *) theMessage; /*! @method parseResentFrom: inMessage: @discussion This method is used to parse a Resent-From header line. @param theLine The line to parse. @param theMessage The message in which to store the parsed value, if any. */ + (void) parseResentFrom: (NSData *) theLine inMessage: (CWMessage *) theMessage; /*! @method parseStatus: inMessage: @discussion This method is used to parse a Status header line. This header is commonly added by some MUA:s like Pine. @param theLine The line to parse. @param theMessage The message in which to store the parsed value, if any. */ + (void) parseStatus: (NSData *) theLine inMessage: (CWMessage *) theMessage; /*! @method parseXStatus: inMessage: @discussion This method is used to parse a X-Status header line. This header is commonly added by some MUA:s like Pine. @param theLine The line to parse. @param theMessage The message in which to store the parsed value, if any. */ + (void) parseXStatus: (NSData *) theLine inMessage: (CWMessage *) theMessage; /*! @method parseSubject: inMessage: @discussion This method is used to parse a Subject header line. @param theLine The line to parse. @param theMessage The message in which to store the parsed value, if any. */ + (NSData *) parseSubject: (NSData *) theLine inMessage: (CWMessage *) theMessage quick: (BOOL) theBOOL; /*! @method parseUnknownHeader: inMessage: @discussion This method is used to parse the headers that we don't "support natively". @param theLine The line to parse. @param theMessage The message in which to store the parsed value, if any. */ + (void) parseUnknownHeader: (NSData *) theLine inMessage: (CWMessage *) theMessage; /*! @method parseOrganization: inMessage: @discussion This method is used to parse a Organization header line. @param theLine The line to parse. @param theMessage The message in which to store the parsed value, if any. */ + (void) parseOrganization: (NSData *) theLine inMessage: (CWMessage *) theMessage; @end #endif // _Pantomime_H_CWParser pantomime1.2-1.2.2+dfsg1/Framework/Pantomime/CWParser.m000066400000000000000000000713461276751561200225070ustar00rootroot00000000000000/* ** CWParser.m ** ** Copyright (c) 2001-2007 ** ** Author: Ludovic Marcotte ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** You should have received a copy of the GNU Lesser General Public ** License along with this library; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include #include #include #include #include #include #include #include #include #include // For NULL on OS X #include #include //#include #include #include #include #include // // // static char *month_name[12] = {"jan", "feb", "mar", "apr", "may", "jun", "jul", "aug", "sep", "oct", "nov", "dec"}; static struct _timezone { char *name; /* time zone name */ int offset; /* offset, in minutes, EAST of GMT */ } timezone_info[] = { /* the following are from RFC-822 */ { "ut", 0 }, { "gmt", 0 }, { "est", -5*3600 }, { "edt", -4*3600 }, /* USA eastern standard */ { "cst", -6*3600 }, { "cdt", -5*3600 }, /* USA central standard */ { "mst", -7*3600 }, { "mdt", -6*3600 }, /* USA mountain standard */ { "pst", -8*3600 }, { "pdt", -7*3600 }, /* USA pacific standard */ { "z", 0 }, /* zulu time (the rest of the military codes are bogus) */ /* popular European timezones */ { "wet", 0*3600 }, /* western european */ { "met", 1*3600 }, /* middle european */ { "eet", 2*3600 }, /* eastern european */ { "bst", 1*3600 }, /* ??? british summer time */ /* Canadian timezones */ { "ast", -4*3600 }, { "adt", -3*3600 }, /* atlantic */ { "nst", -3*1800 },{ "ndt", -2*1800 }, /* newfoundland */ { "yst", -9*3600 }, { "ydt", -8*3600 }, /* yukon */ { "hst", -10*3600 }, /* hawaii (not really canada) */ /* Asian timezones */ { "jst", 9*3600 }, /* japan */ { "sst", 8*3600 }, /* singapore */ /* South-Pacific timezones */ { "nzst", 12*3600 }, { "nzdt", 13*3600 }, /* new zealand */ { "wst", 8*3600 }, { "wdt", 9*3600 }, /* western australia */ /* * Daylight savings modifiers. These are not real timezones. * They are used for things like "met dst". The "met" timezone * is 1*3600, and applying the "dst" modifier makes it 2*3600. */ { "dst", 1*3600 }, { "dt", 1*3600 }, { "st", 1*3600 } }; // // // int next_word(unsigned char *buf, unsigned int start, unsigned int len, unsigned char *word) { unsigned char *p; int i; for (p = buf+start, i = start; (isspace(*p) || *p == ','); ++p, ++i); if (start >= len) return -1; while (i < len && !(isspace(*p) || *p == ',')) { *word++ = *p++; i++; } *word = '\0'; return p-buf-start; } // // private methods // @interface CWParser (Private) + (id) _parameterValueUsingLine: (NSData *) theLine range: (NSRange) theRange decode: (BOOL) theBOOL charset: (NSString *) theCharset; @end // // // @implementation CWParser + (void) parseContentDescription: (NSData *) theLine inPart: (CWPart *) thePart { NSData *aData; aData = [[theLine subdataFromIndex: 20] dataByTrimmingWhiteSpaces]; if (aData && [aData length]) { [thePart setContentDescription: [[aData dataFromQuotedData] asciiString] ]; } } // // // + (void) parseContentDisposition: (NSData *) theLine inPart: (CWPart *) thePart { if ([theLine length] > 21) { NSData *aData; NSRange aRange; aData = [theLine subdataFromIndex: 21]; aRange = [aData rangeOfCString: ";"]; if (aRange.length > 0) { NSRange filenameRange; // We set the content disposition to this part [thePart setContentDisposition: ([[[aData subdataWithRange: NSMakeRange(0, aRange.location)] asciiString] caseInsensitiveCompare: @"inline"] == NSOrderedSame ? PantomimeInlineDisposition : PantomimeAttachmentDisposition)]; // We now decode our filename filenameRange = [aData rangeOfCString: "filename"]; if (filenameRange.length > 0) { [thePart setFilename: [CWParser _parameterValueUsingLine: aData range: filenameRange decode: YES charset: [thePart defaultCharset]]]; } } else { [thePart setContentDisposition: ([[[aData dataByTrimmingWhiteSpaces] asciiString] caseInsensitiveCompare: @"inline"] == NSOrderedSame ? PantomimeInlineDisposition : PantomimeAttachmentDisposition)]; } } else { [thePart setContentDisposition: PantomimeAttachmentDisposition]; } } // // // + (void) parseContentID: (NSData *) theLine inPart: (CWPart *) thePart { if ([theLine length] > 12) { NSData *aData; aData = [theLine subdataFromIndex: 12]; if ([aData hasCPrefix: "<"] && [aData hasCSuffix: ">"]) { [thePart setContentID: [[aData subdataWithRange: NSMakeRange(1, [aData length]-2)] asciiString]]; } else { [thePart setContentID: [aData asciiString]]; } } else { [thePart setContentID: @""]; } } // // // + (void) parseContentTransferEncoding: (NSData *) theLine inPart: (CWPart *) thePart { if ([theLine length] > 26) { NSData *aData; aData = [[theLine subdataFromIndex: 26] dataByTrimmingWhiteSpaces]; if ([aData caseInsensitiveCCompare: "quoted-printable"] == NSOrderedSame) { [thePart setContentTransferEncoding: PantomimeEncodingQuotedPrintable]; } else if ([aData caseInsensitiveCCompare: "base64"] == NSOrderedSame) { [thePart setContentTransferEncoding: PantomimeEncodingBase64]; } else if ([aData caseInsensitiveCCompare: "8bit"] == NSOrderedSame) { [thePart setContentTransferEncoding: PantomimeEncoding8bit]; } else if ([aData caseInsensitiveCCompare: "binary"] == NSOrderedSame) { [thePart setContentTransferEncoding: PantomimeEncodingBinary]; } else { [thePart setContentTransferEncoding: PantomimeEncodingNone]; } } else { [thePart setContentTransferEncoding: PantomimeEncodingNone]; } } // // // + (void) parseContentType: (NSData *) theLine inPart: (CWPart *) thePart { NSRange aRange; NSData *aData; int x; if ([theLine length] <= 14) { [thePart setContentType: @"text/plain"]; return; } aData = [[theLine subdataFromIndex: 13] dataByTrimmingWhiteSpaces]; // We first skip the parameters, if we need to x = [aData indexOfCharacter: ';']; if (x > 0) { aData = [aData subdataToIndex: x]; } // We see if there's a subtype specified for text, if none was specified, we append "/plain" x = [aData indexOfCharacter: '/']; if (x < 0 && [aData hasCaseInsensitiveCPrefix: "text"]) { [thePart setContentType: [[[aData asciiString] stringByAppendingString: @"/plain"] lowercaseString]]; } else { [thePart setContentType: [[aData asciiString] lowercaseString]]; } // // We decode our boundary (if we need to) // aRange = [theLine rangeOfCString: "boundary" options: NSCaseInsensitiveSearch]; if (aRange.length > 0) { [thePart setBoundary: [CWParser _parameterValueUsingLine: theLine range: aRange decode: NO charset: nil]]; } // // We decode our charset (if we need to) // aRange = [theLine rangeOfCString: "charset" options: NSCaseInsensitiveSearch]; if (aRange.length > 0) { [thePart setCharset: [[CWParser _parameterValueUsingLine: theLine range: aRange decode: NO charset: nil] asciiString]]; } // // We decode our format (if we need to). See RFC2646. // aRange = [theLine rangeOfCString: "format" options: NSCaseInsensitiveSearch]; if (aRange.length > 0) { NSData *aFormat; aFormat = [CWParser _parameterValueUsingLine: theLine range: aRange decode: NO charset: nil]; if ([aFormat caseInsensitiveCCompare: "flowed"] == NSOrderedSame) { [thePart setFormat: PantomimeFormatFlowed]; } else { [thePart setFormat: PantomimeFormatUnknown]; } } else { [thePart setFormat: PantomimeFormatUnknown]; } // // We decode the parameter "name" iif the thePart is an instance of Part // if ([thePart isKindOfClass: [CWPart class]]) { aRange = [theLine rangeOfCString: "name" options: NSCaseInsensitiveSearch]; if (aRange.length > 0) { [thePart setFilename: [CWParser _parameterValueUsingLine: theLine range: aRange decode: YES charset: [thePart defaultCharset]]]; } } } // // // + (void) parseDate: (NSData *) theLine inMessage: (CWMessage *) theMessage { if ([theLine length] > 6) { NSData *aData; int month, day, year, hours, mins, secs, tz, i, j, len, tot, s; unsigned char *bytes, *word; aData = [theLine subdataFromIndex: 6]; word = malloc(256); //NSLog(@"Have to parse |%@|", [aData asciiString]); bytes = (unsigned char*)[aData bytes]; tot = [aData length]; i = len = 0; s = 0; tz = 0; // date-time = [ day-of-week "," ] date FWS time [CFWS] // day-of-week = ([FWS] day-name) / obs-day-of-week // day-name = "Mon" / "Tue" / "Wed" / "Thu" / // "Fri" / "Sat" / "Sun" // date = day month year // year = 4*DIGIT / obs-year // month = (FWS month-name FWS) / obs-month // month-name = "Jan" / "Feb" / "Mar" / "Apr" / // "May" / "Jun" / "Jul" / "Aug" / // "Sep" / "Oct" / "Nov" / "Dec" // // day = ([FWS] 1*2DIGIT) / obs-day // time = time-of-day FWS zone // time-of-day = hour ":" minute [ ":" second ] // hour = 2DIGIT / obs-hour // minute = 2DIGIT / obs-minute // second = 2DIGIT / obs-second // zone = (( "+" / "-" ) 4DIGIT) / obs-zone // // We need to handle RFC2822 and UNIX time: // // Date: Wed, 02 Jan 2002 09:07:19 -0700 // Date: 02 Jan 2002 19:57:49 +0000 // // And broken dates such as: // // Date: Thu, 03 Jan 2002 16:40:30 GMT // Date: Wed, 2 Jan 2002 08:56:18 -0700 (MST) // Date: Wed, 9 Jan 2002 10:04:23 -0500 (Eastern Standard Time) // Date: 11-Jan-02 // Date: Tue, 15 Jan 2002 15:45:53 -0801 // Date: Thu, 17 Jan 2002 11:54:11 -0900
// //while (i < tot && isspace(*bytes)) // { // i++; bytes++; // } len = next_word(bytes, i, tot, word); if (len <= 0) { free(word); return; } if (isalpha(*word)) { //NSLog(@"UNIX DATE"); // We skip the first word, no need for it. i += len+1; len = next_word(bytes, i, tot, word); if (len <= 0) { free(word); return; } } month = year = -1; // We got a RFC 822 date. The syntax is: // day month year hh:mm:ss zone // For example: 03 Apr 2003 17:27:06 +0200 //NSLog(@"RFC-822 time"); day = atoi((const char*)word); //printf("len = %d |%s| day = %d\n", len, word, day); // We get the month name and we convert it. i += len+1; len = next_word(bytes, i, tot, word); if (len <= 0) { free(word); return; } for (j = 0; j < 12; j++) { if (strncasecmp((const char*)word, month_name[j], 3) == 0) { month = j+1; } } if (month < 0) { free(word); return; } //printf("len = %d |%s| month = %d\n", len, word, month); // We get the year. i += len+1; len = next_word(bytes, i, tot, word); if (len <= 0) { free(word); return; } year = atoi((const char*)word); if (year < 70) year += 2000; if (year < 100) year += 1900; //printf("len = %d |%s| year = %d\n", len, word, year); // We parse the time using the hh:mm:ss format. i += len+1; len = next_word(bytes, i, tot, word); if (len <= 0) { free(word); return; } sscanf((const char*)word, "%d:%d:%d", &hours, &mins, &secs); //printf("len = %d |%s| %d:%d:%d\n", len, word, hours, mins, secs); // We parse the timezone. i += len+1; len = next_word(bytes, i, tot, word); if (len <= 0) { tz = 0; } else { unsigned char *p; p = word; if (*p == '-' || *p == '+') { s = (*p == '-' ? -1 : 1); p++; } len = strlen((const char*)p); if (isdigit(*p)) { if (len == 2) { tz = (*(p)-48)*36000+*((p+1)-48)*3600; } else { tz = (*(p)-48)*36000+(*(p+1)-48)*3600+(*(p+2)-48)*10+(*(p+3)-48); } } else { for (j = 0; j < sizeof(timezone_info)/sizeof(timezone_info[0]); j++) { if (strncasecmp((const char*)p, timezone_info[j].name, len) == 0) { tz = timezone_info[j].offset; } } } tz = s*tz; } [theMessage setReceivedDate: [NSCalendarDate dateWithYear: year month: month day: day hour: hours minute: mins second: secs timeZone: [NSTimeZone timeZoneForSecondsFromGMT: tz]]]; free(word); } } // // // + (NSData *) parseDestination: (NSData *) theLine forType: (PantomimeRecipientType) theType inMessage: (CWMessage *) theMessage quick: (BOOL) theBOOL { CWInternetAddress *anInternetAddress; NSData *aData; int i, len, s_len, x, y; unsigned char *bytes; BOOL b; len = 0; if (theBOOL) { aData = theLine; } else { switch (theType) { case PantomimeBccRecipient: len = 5; break; case PantomimeCcRecipient: case PantomimeToRecipient: len = 4; break; case PantomimeResentBccRecipient: len = 12; break; case PantomimeResentCcRecipient: case PantomimeResentToRecipient: len = 11; break; } // We skip over emtpy headers. if (len >= [theLine length]) return [NSData data]; aData = [theLine subdataFromIndex: len]; } bytes = (unsigned char*)[aData bytes]; len = [aData length]; b = NO; x = 0; for (i = 0; i < len; i++) { if (*bytes == '"') { b = !b; } if (*bytes == ',' || i == len-1) { if (b) { bytes++; continue; } y = i; // We strip the trailing comma for all but the last entries. s_len = y-x; if (i == len-1) s_len++; anInternetAddress = [[CWInternetAddress alloc] initWithString: [CWMIMEUtility decodeHeader: [[aData subdataWithRange: NSMakeRange(x, s_len)] dataByTrimmingWhiteSpaces] charset: [theMessage defaultCharset]]]; [anInternetAddress setType: theType]; [theMessage addRecipient: anInternetAddress]; RELEASE(anInternetAddress); x = y+1; } bytes++; } return aData; } // // // + (NSData *) parseFrom: (NSData *) theLine inMessage: (CWMessage *) theMessage quick: (BOOL) theBOOL; { CWInternetAddress *anInternetAddress; NSData *aData; if (!theBOOL && !([theLine length] > 6)) { return [NSData data]; } if (theBOOL) { aData = theLine; } else { aData = [theLine subdataFromIndex: 6]; } anInternetAddress = [[CWInternetAddress alloc] initWithString: [CWMIMEUtility decodeHeader: aData charset: [theMessage defaultCharset]]]; [theMessage setFrom: anInternetAddress]; RELEASE(anInternetAddress); return aData; } // // This method is used to parse the In-Reply-To: header value. // + (NSData *) parseInReplyTo: (NSData *) theLine inMessage: (CWMessage *) theMessage quick: (BOOL) theBOOL { NSData *aData; int x, y; if (theBOOL) { aData = theLine; } else if ([theLine length] > 13) { aData = [theLine subdataFromIndex: 13]; } else { return [NSData data]; } // We check for lame headers like that: // // In-Reply-To: <4575197F.7020602@de.ibm.com> (Markus Deuling's message of "Tue, 05 Dec 2006 08:02:23 +0100") // In-Reply-To: ; from reldred@viablelinks.com on Wed, Mar 26, 2003 at 11:23:37AM -0800 // x = [aData indexOfCharacter: ';']; y = [aData indexOfCharacter: ' ']; if (x > 0 && x < y) { aData = [aData subdataToIndex: x]; } else if (y > 0) { aData = [aData subdataToIndex: y]; } [theMessage setInReplyTo: [aData asciiString]]; return aData; } // // // + (NSData *) parseMessageID: (NSData *) theLine inMessage: (CWMessage *) theMessage quick: (BOOL) theBOOL { NSData *aData; if (!theBOOL && !([theLine length] > 12)) { return [NSData data]; } if (theBOOL) aData = theLine; else aData = [theLine subdataFromIndex: 12]; [theMessage setMessageID: [[aData dataByTrimmingWhiteSpaces] asciiString]]; return aData; } // // // + (void) parseMIMEVersion: (NSData *) theLine inMessage: (CWMessage *) theMessage { if ([theLine length] > 14) { [theMessage setMIMEVersion: [[theLine subdataFromIndex: 14] asciiString]]; } } // // // + (NSData *) parseReferences: (NSData *) theLine inMessage: (CWMessage *) theMessage quick: (BOOL) theBOOL { NSData *aData; aData = nil; if (theBOOL) { aData = theLine; } else if ([theLine length] > 12) { aData = [theLine subdataFromIndex: 12]; } if (aData && [aData length]) { NSMutableArray *aMutableArray; NSArray *allReferences; NSData *aReference; NSString *aString; int i, count; allReferences = [aData componentsSeparatedByCString: " "]; count = [allReferences count]; aMutableArray = [[NSMutableArray alloc] initWithCapacity: count]; for (i = 0; i < count; i++) { aReference = [allReferences objectAtIndex: i]; aString = [aReference asciiString]; // We protect ourself against values that could hold 8-bit characters. if (aString) { [aMutableArray addObject: aString]; } } [theMessage setReferences: aMutableArray]; RELEASE(aMutableArray); return aData; } return [NSData data]; } // // // + (void) parseReplyTo: (NSData *) theLine inMessage: (CWMessage *) theMessage { if ([theLine length] > 10) { CWInternetAddress *anInternetAddress; NSMutableArray *aMutableArray; NSData *aData; unsigned char *bytes; int i, len, s_len, x, y; BOOL b; aMutableArray = [[NSMutableArray alloc] init]; aData = [theLine subdataFromIndex: 10]; bytes = (unsigned char*)[aData bytes]; len = [aData length]; b = NO; x = 0; for (i = 0; i < len; i++) { if (*bytes == '"') { b = !b; } if (*bytes == ',' || i == len-1) { if (b) { bytes++; continue; } y = i; // We strip the trailing comma for all but the last entries. s_len = y-x; if (i == len-1) s_len++; anInternetAddress = [[CWInternetAddress alloc] initWithString: [CWMIMEUtility decodeHeader: [[aData subdataWithRange: NSMakeRange(x, s_len)] dataByTrimmingWhiteSpaces] charset: [theMessage defaultCharset]]]; [aMutableArray addObject: anInternetAddress]; RELEASE(anInternetAddress); x = y+1; } bytes++; } if ([aMutableArray count]) { [theMessage setReplyTo: aMutableArray]; } RELEASE(aMutableArray); } } // // // + (void) parseResentFrom: (NSData *) theLine inMessage: (CWMessage *) theMessage { if ([theLine length] > 13) { CWInternetAddress *anInternetAddress; anInternetAddress = [[CWInternetAddress alloc] initWithString: [CWMIMEUtility decodeHeader: [theLine subdataFromIndex: 13] charset: [theMessage defaultCharset]]]; [theMessage setResentFrom: anInternetAddress]; RELEASE(anInternetAddress); } } // // // + (void) parseStatus: (NSData *) theLine inMessage: (CWMessage *) theMessage { if ([theLine length] > 8) { NSData *aData; aData = [theLine subdataFromIndex: 8]; [[theMessage flags] addFlagsFromData: aData format: PantomimeFormatMbox]; [theMessage addHeader: @"Status" withValue: [aData asciiString]]; } } // // // + (void) parseXStatus: (NSData *) theLine inMessage: (CWMessage *) theMessage { if ([theLine length] > 10) { NSData *aData; aData = [theLine subdataFromIndex: 10]; [[theMessage flags] addFlagsFromData: aData format: PantomimeFormatMbox]; [theMessage addHeader: @"X-Status" withValue: [aData asciiString]]; } } // // // + (NSData *) parseSubject: (NSData *) theLine inMessage: (CWMessage *) theMessage quick: (BOOL) theBOOL { NSData *aData; if (theBOOL) { aData = theLine; } else if ([theLine length] > 9) { aData = [[theLine subdataFromIndex: 8] dataByTrimmingWhiteSpaces]; } else { return [NSData data]; } [theMessage setSubject: [CWMIMEUtility decodeHeader: aData charset: [theMessage defaultCharset]]]; return aData; } // // // + (void) parseUnknownHeader: (NSData *) theLine inMessage: (CWMessage *) theMessage { NSData *aName, *aValue; NSRange range; range = [theLine rangeOfCString: ":"]; if (range.location != NSNotFound) { aName = [theLine subdataWithRange: NSMakeRange(0, range.location)]; // we keep only the headers that have a value if (([theLine length]-range.location-1) > 0) { aValue = [theLine subdataWithRange: NSMakeRange(range.location + 2, [theLine length]-range.location-2)]; [theMessage addHeader: [aName asciiString] withValue: [aValue asciiString]]; } } } // // // + (void) parseOrganization: (NSData *) theLine inMessage: (CWMessage *) theMessage { NSString *organization; if ([theLine length] > 14) { organization = [CWMIMEUtility decodeHeader: [[theLine subdataFromIndex: 13] dataByTrimmingWhiteSpaces] charset: [theMessage defaultCharset]]; } else { organization = @""; } [theMessage setOrganization: organization]; } @end // // private methods // @implementation CWParser (Private) + (id) _parameterValueUsingLine: (NSData *) theLine range: (NSRange) theRange decode: (BOOL) theBOOL charset: (NSString *) theCharset { NSMutableData *aMutableData; NSRange r1, r2; int value_start, value_end, parameters_count,len; BOOL is_rfc2231, has_charset; is_rfc2231 = has_charset = NO; len = [theLine length]; // // Look for the first occurrence of '=' before the end of the line within // our range. That marke the beginning of the value. If we don't find one, // we set the beggining right after the end of the key tag // r1 = [theLine rangeOfCString: "=" options: 0 range: NSMakeRange(NSMaxRange(theRange), len-NSMaxRange(theRange))]; if (r1.length > 0) { // If "=" was found, but after ";", something is very broken // and we just return nil. That can happen if we have a Content-Type like: // // Content-Type: text/x-patch; name=mpg321-format-string.diff; charset=ISO-8859-1 // // "format" is part of the _name_ parameter. It has nothing to do with format=flowed. // #warning FIXME - consider format= when passing the parameter range #if 0 if (r1.location > value_end) { return nil; } #endif value_start = r1.location+r1.length; } else { value_start = theRange.location+theRange.length; } // The parameter can be quoted or not like this (for example, with a charset): // charset="us-ascii" // charset = "us-ascii" // charset=us-ascii // charset = us-ascii // It can be terminated by ';' or end of line. // Look the the first occurrence of ';'. // That marks the end of this key value pair. // If we don't find one, we set it to the end of the line. r1 = [theLine rangeOfCString: ";" options: 0 range: NSMakeRange(NSMaxRange(theRange), len-NSMaxRange(theRange))]; if (r1.length > 0) { value_end = r1.location-1; } else { value_end = len-1; } // We now have a range that should contain our value. // Build a NSRange out of it. if (value_end - value_start + 1 > 0) { r1 = NSMakeRange(value_start, value_end-value_start+1); } else { r1 = NSMakeRange(value_start, 0); } aMutableData = AUTORELEASE([[NSMutableData alloc] initWithData: [[[theLine subdataWithRange: r1] dataByTrimmingWhiteSpaces] dataFromQuotedData]]); // // VERY IMPORTANT: // // We check if something was encoded using RFC2231. We need to adjust // value_end if we find a multi-line parameter. We also proceed // with data substitution while we loop for parameter values unfolding. // if ([theLine characterAtIndex: NSMaxRange(theRange)] == '*') { is_rfc2231 = YES; // We consider parameter value continuations (Section 3. of the RFC) // in order the set the appropriate end boundary. if ([theLine characterAtIndex: NSMaxRange(theRange)+1] == '0') { // int end; // We check if we have a charset, in case of a multiline value. if ([theLine characterAtIndex: NSMaxRange(theRange)+2] == '=') { has_charset = YES; } r1.location = theRange.location; r1.length = theRange.length; parameters_count = 1; while (YES) { // end = NSMaxRange(r1); r1 = [theLine rangeOfCString: [[NSString stringWithFormat: @"%s*%i", [[theLine subdataWithRange: theRange] cString], parameters_count] UTF8String] options: 0 range: NSMakeRange(NSMaxRange(r1), len-NSMaxRange(r1))]; parameters_count++; if (r1.location != NSNotFound) { value_start = NSMaxRange(r1)+2; if ([theLine characterAtIndex: value_start+1] == '*') value_start++; r2 = [theLine rangeOfCString: ";" options: 0 range: NSMakeRange(NSMaxRange(r1), len-NSMaxRange(r1))]; if (r2.length > 0) { value_end = r2.location-1; } else { value_end = len; } [aMutableData appendData: [[[theLine subdataWithRange: NSMakeRange(value_start,value_end-value_start)] dataFromSemicolonTerminatedData] dataFromQuotedData]]; } else { break; } } // We now search again for ";" //r2 = [theLine rangeOfCString: ";" // options: 0 // range: NSMakeRange(end, len-end)]; // //if (r2.length > 0) // { // value_end = r2.location-1; // } //else // { // value_end = len-1; //} } else if ([theLine characterAtIndex: NSMaxRange(theRange)+1] == '=') { has_charset = YES; } } if (is_rfc2231) { if (has_charset) { BOOL lang = NO; NSData *aCharset; aCharset = nil; r1 = [aMutableData rangeOfCString: "'"]; if (r1.location != NSNotFound) { lang = YES; // We check for a language r2 = [aMutableData rangeOfCString: "'" options: 0 range: NSMakeRange(NSMaxRange(r1), [aMutableData length]-NSMaxRange(r1))]; if (r2.length && r2.location > r1.location+1) { NSLog(@"WE'VE GOT A LANGUAGE!"); } aCharset = [aMutableData subdataToIndex: r2.location-1]; // We strip the charset and the language information from our data [aMutableData replaceBytesInRange: NSMakeRange(0, NSMaxRange(r2)) withBytes: NULL length: 0]; } if (theBOOL) { NSString *aString; aString = AUTORELEASE([[NSString alloc] initWithData: aMutableData encoding: NSASCIIStringEncoding]); if (lang) { return [aString stringByReplacingPercentEscapesUsingEncoding: [NSString encodingForCharset: aCharset]]; } else { return aString; } } } } else { if (theBOOL) { return [CWMIMEUtility decodeHeader: aMutableData charset: theCharset]; } } return aMutableData; } @end pantomime1.2-1.2.2+dfsg1/Framework/Pantomime/CWPart.h000066400000000000000000000324621276751561200221500ustar00rootroot00000000000000/* ** CWPart.h ** ** Copyright (c) 2001-2007 ** ** Author: Ludovic Marcotte ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** You should have received a copy of the GNU Lesser General Public ** License along with this library; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef _Pantomime_H_CWPart #define _Pantomime_H_CWPart #import #import #import #import #import #include /*! @class CWPart @discussion This class defines what Internet messages are composed of. An Internet message is composed of various parts which can be text parts, images, PDF documents and so on. Even a message is a part, with additional headers (like "From:", "Subject:" and so on). CWMessage is a superclass of CWPart. */ @interface CWPart : NSObject { @protected NSMutableDictionary *_parameters; NSMutableDictionary *_headers; NSString *_defaultCharset; NSObject *_content; int _line_length; int _size; } /*! @method initWithData: @discussion This method is used to initialize the CWPart instance with the specified data. It splits the header part with the content part and calls -setHeadersFromData: with the header part and CWMIMEUtility: +setContentFromRawSource: inPart: with the content part. This method will recursively go in sub-parts (if needed) and initilize them also. @param theData The bytes to use. @result A CWPart instance, nil on error. */ - (id) initWithData: (NSData *) theData; /*! @method initWithData: charset: @discussion This method acts like -initWithData: but it uses theCharset instead of the Part's charset (found in theData). @param theData The bytes to use. @param theCharset The charset to force. @result A CWPart instance, nil on error. */ - (id) initWithData: (NSData *) theData charset: (NSString *) theCharset; /*! @method setHeadersFromData: @discussion This method initalize all the headers of a part from the raw data source. It replaces previously defined values of headers found in theHeaders. @param theHeaders The bytes to use. */ - (void) setHeadersFromData: (NSData *) theHeaders; /*! @method contentType @discussion This method is used to get the value of the receiver's "Content-Type" header. If none is specified, nil will be returned. It's up to the callee to use whatever charset it wants. Section 5.2 or RFC2045 recommends to use "text/plain" in this case. @result The value. If none was set, nil will be returned. */ - (NSString *) contentType; /*! @method setContentType: @discussion This method is used to set the value of the receiver's "Content-Type" header. @param theContentType The "Content-Type" value. */ - (void) setContentType: (NSString*) theContentType; /*! @method contentID @discussion This method is used to get the value of the receiver's "Content-ID" header. @result The value. If none was set, nil will be returned. */ - (NSString *) contentID; /*! @method setContentID: @discussion This method is used to set the value of the receiver's "Content-ID" header. @param theContentID The "Content-ID" value. */ - (void) setContentID: (NSString *) theContentID; /*! @method contentDescription @discussion This method is used to get the value of the receiver's "Content-Description" header. @result The value. If none was set, nil will be returned. */ - (NSString *) contentDescription; /*! @method setContentDescription: @discussion This method is used to set the value of the receiver's "Content-Description" header. @param theContentDescription The "Content-Description" value. */ - (void) setContentDescription: (NSString *) theContentDescription; /*! @method contentDisposition @discussion This method is used to get the value of the receiver's "Content-Disposition" header. @result The value. If none was set, PantomimeInlineDisposition will be returned. */ - (PantomimeContentDisposition) contentDisposition; /*! @method setContentDisposition: @discussion This method is used to set the value of the receiver's "Content-Disposition" header. @param theContentDisposition The "Content-Disposition" value. */ - (void) setContentDisposition: (PantomimeContentDisposition) theContentDisposition; /*! @method contentTransferEncoding @discussion This method is used to get the value of the receiver's "Content-Transfer-Encoding" header. @result The value. If none was set, PantomimeEncodingNone will be returned. */ - (PantomimeEncoding) contentTransferEncoding; /*! @method setContentTransferEndocing: @discussion This method is used to set the value of the receiver's "Content-Transfer-Encoding" header. @param theEncoding The "Content-Transfer-Encoding" value. Accepted values are part of the PantomimeEncoding enum. */ - (void) setContentTransferEncoding: (PantomimeEncoding) theEncoding; /*! @method filename @discussion This method is used to get the name of the receiver's file, if any. @result The name of the file, nil if none was specified. */ - (NSString *) filename; /*! @method setFilename: @discussion This method is used to set the name of the receiver's file. @param theFilename The name of the file. If nil is passed or if the length of the string is 0, "unknown" will be set as the filename. */ - (void) setFilename: (NSString *) theFilename; /*! @method format @discussion This method is used to obtain the format of the receiver. Possible values are part of the PantomimeMessageFormat. See RFC 2646 for a detailed description of the "flowed" format. @result The format, PantomimeFormatUnknown if no value was previously set. */ - (PantomimeMessageFormat) format; /*! @method setFormat: @discussion This method is used to set the format of the receiver. Accepted values are part of the PantomimeMessageFormat enum. @param theFormat The format to use. */ - (void) setFormat: (PantomimeMessageFormat) theFormat; /*! @method lineLength @discussion This method is used to return the maximum length that a line can use in a text part. @result The length, 0 if not defined. */ - (int) lineLength; /*! @method setLineLength: @discussion This method is used to set the maximum length of a line that can be used for a text part. @param theLineLength The length. */ - (void) setLineLength: (int) theLineLength; /*! @method isMIMEType: subType: @discussion This method is used to verify if the receiver matches a specific MIME type. The "*" wildcard can be used for the sub-type. @param thePrimaryType The left part of the MIME type. @param theSubType The right part of the MIME type. @result YES if it matches, NO otherwise. */ - (BOOL) isMIMEType: (NSString *) thePrimaryType subType: (NSString *) theSubType; /*! @method content @discussion This method is used to obtain the decoded content of the receiver. The returned value can be a NSString instance, a NSData instance, a CWMIMEMultipart instance or a CWMessage instance. @result The decoded content of the part. */ - (NSObject *) content; /*! @method setContent: @discussion This method is used to set the content of the receiver. The content will later be correctly encoded before the message is submitted or saved on disk (using -dataValue). Accepted values are instances of NSData, CWMIMEMultipart or CWMessage otherwise, a NSInvalidArgumentException will be thrown. @param theContent The content of the part. */ - (void) setContent: (NSObject *) theContent; /*! @method size @discussion This method is used to obtain the receiver's size (total number of bytes of its raw representation). @result The size of the receiver. */ - (long) size; /*! @method setSize: @discussion This method is used to set the receiver's size. @param theSize The value of the size. */ - (void) setSize: (long) theSize; /*! @method dataValue @discussion This method is used to encoded the receiver's using the MIME standard before it is ready for submisssion (using a Transport method) or being saved on disk. The CWMessage class overwrites this method in order to add Message-specific headers such as "From", "Subject" and so on. @result The encoded CWPart instance, as a NSData instance. */ - (NSData *) dataValue; /*! @method boundary @discussion This method is used to get the boundary that separates parts that compose a multipart composite part. @result The boundary as a NSData instance, nil if none was set. */ - (NSData *) boundary; /*! @method setBoundary: @discussion This method is used to set the boundary used to separate parts that compose a multipart composite part message. @param theBoundary The value of the boundary. */ - (void) setBoundary: (NSData *) theBoundary; /*! @method protocol @discussion This method is used to obtain the value of the "protocol" parameter found in some Content-Type headers. This parameter is often present in PGP encoded messages. @result The value of the "protocol" parameter, nil if none was set. */ - (NSData *) protocol; /*! @method setProtocol: @discussion This method is used to set the value of the "protocol" parameter. This parameter will be added to the ones found in the Content-Type header in -dataValue. @param theProtocol The value of the "protocol" parameter. */ - (void) setProtocol: (NSData *) theProtocol; /*! @method charset @discussion This method is used to obtain the value of the "charset" parameter found in the Content-Type header. @result The value of the "charset" parameter, "us-ascii" if none was set. */ - (NSString *) charset; /*! @method setCharset: @discussion This method is used to set the value of the "charset" parameter found in the Content-Type header. @param theCharset The charset to use. */ - (void) setCharset: (NSString *) theCharset; /*! @method defaultCharset @discussion This method is used to get the charset that will be enforced for usage when decoding the part. @result The enforced charset. */ - (NSString *) defaultCharset; /*! @method setDefaultCharset: @discussion This method is used to set the charset that will be enforced for usage when the part is being decoded. @param theCharset The charset to force. */ - (void) setDefaultCharset: (NSString *) theCharset; /*! @method parameterForKey: @discussion This method is used to obtain a parameter value based on its name. The name serves as the key. Parameters are only part of the Content-Type header field.They are NOT part of the Content-Disposition header. @param theKey The key for which the value will be returned. @result The parameter value, nil if non-existent. */ - (id) parameterForKey: (NSString *) theKey; /*! @method setPrameter:forKey: @discussion This method is used to set a parameter value based on its name. The name serves as the key. Parameters are only part of the Content-Type header field. They are NOT part of the Content-Disposition header. @param theParameter The value of the parameter. A nil value will remove any existing defined value for the specified key, @param theKey The key for which the value will be set. */ - (void) setParameter: (id) theParameter forKey: (NSString *) theKey; /*! @method allHeaders @discussion This method is used to return all header names / values. @result The NSDictionary holding everything. */ - (NSDictionary *) allHeaders; /*! @method headerValueForName: @discussion This method is used to obtain the value of the header specified by theName. The search is performed in a case-insensitive way. @param theName The name of the header. For example, it could be "Date". @result The value of the header. */ - (id) headerValueForName: (NSString *) theName; /*! @method setHeaders: @discussion This method is used to add the headers of theHeaders to the list of headers of the receiver. @param theHeaders The headers to add. */ - (void) setHeaders: (NSDictionary *) theHeaders; @end #endif // _Pantomime_H_CWPart pantomime1.2-1.2.2+dfsg1/Framework/Pantomime/CWPart.m000066400000000000000000000434611276751561200221560ustar00rootroot00000000000000/* ** CWPart.m ** ** Copyright (c) 2001-2007 ** ** Author: Ludovic Marcotte ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** You should have received a copy of the GNU Lesser General Public ** License along with this library; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include #include #include #include #include #include #include #include #include #include #include #include #define LF "\n" static int currentPartVersion = 2; // // // @implementation CWPart - (id) init { self = [super init]; [CWPart setVersion: currentPartVersion]; // We initialize our dictionary that will hold all our headers with a capacity of 25. // This is an empirical number that is used to speedup the addition of headers w/o // reallocating our array everytime we add a new element. _headers = [[NSMutableDictionary alloc] initWithCapacity: 25]; _parameters = [[NSMutableDictionary alloc] init]; _line_length = _size = 0; _content = nil; return self; } // // // - (void) dealloc { RELEASE(_defaultCharset); RELEASE(_parameters); RELEASE(_headers); RELEASE(_content); [super dealloc]; } // // // - (id) initWithData: (NSData *) theData { NSRange aRange; aRange = [theData rangeOfCString: "\n\n"]; if (aRange.length == 0) { AUTORELEASE(self); return nil; } // We initialize our message with the headers and the content self = [self init]; [CWPart setVersion: currentPartVersion]; // We verify if we have an empty body part content like: // X-UID: 5dc5aa4b82240000 // // This is a MIME Message // // ------=_NextPart_000_007F_01BDF6C7.FABAC1B0 // // // ------=_NextPart_000_007F_01BDF6C7.FABAC1B0 // Content-Type: text/html; name="7english.co.kr.htm" if ([theData length] == 2) { [self setContent: [NSData data]]; return self; } [self setHeadersFromData: [theData subdataWithRange: NSMakeRange(0,aRange.location)]]; [CWMIMEUtility setContentFromRawSource: [theData subdataWithRange: NSMakeRange(aRange.location + 2, [theData length]-(aRange.location+2))] inPart: self]; return self; } // // // - (id) initWithData: (NSData *) theData charset: (NSString *) theCharset { [CWPart setVersion: currentPartVersion]; [self setDefaultCharset: theCharset]; return [self initWithData: theData]; } // // NSCoding protocol // - (void) encodeWithCoder: (NSCoder *) theCoder { [CWPart setVersion: currentPartVersion]; [theCoder encodeObject: [self contentType]]; [theCoder encodeObject: [self contentID]]; [theCoder encodeObject: [self contentDescription]]; [theCoder encodeObject: [NSNumber numberWithInt: [self contentDisposition]]]; [theCoder encodeObject: [self filename]]; [theCoder encodeObject: [NSNumber numberWithInt: [self contentTransferEncoding]]]; [theCoder encodeObject: [NSNumber numberWithInt: [self format]]]; [theCoder encodeObject: [NSNumber numberWithInt: _size]]; [theCoder encodeObject: [self boundary]]; [theCoder encodeObject: [self charset]]; [theCoder encodeObject: _defaultCharset]; } - (id) initWithCoder: (NSCoder *) theCoder { self = [super init]; _headers = [[NSMutableDictionary alloc] initWithCapacity: 25]; _parameters = [[NSMutableDictionary alloc] init]; [self setContentType: [theCoder decodeObject]]; [self setContentID: [theCoder decodeObject]]; [self setContentDescription: [theCoder decodeObject]]; [self setContentDisposition: [[theCoder decodeObject] intValue]]; [self setFilename: [theCoder decodeObject]]; [self setContentTransferEncoding: [[theCoder decodeObject] intValue]]; [self setFormat: [[theCoder decodeObject] intValue]]; [self setSize: [[theCoder decodeObject] intValue]]; [self setBoundary: [theCoder decodeObject]]; [self setCharset: [theCoder decodeObject]]; [self setDefaultCharset: [theCoder decodeObject]]; _content = nil; return self; } // // access / mutation methods // - (NSObject *) content { return _content; } // // // - (void) setContent: (NSObject *) theContent { if (theContent && !([theContent isKindOfClass: [NSData class]] || [theContent isKindOfClass: [CWMessage class]] || [theContent isKindOfClass: [CWMIMEMultipart class]])) { [NSException raise: NSInvalidArgumentException format: @"Invalid argument to CWPart: -setContent: The content MUST be either a NSData, CWMessage or CWMIMEMessage instance."]; } ASSIGN(_content, theContent); } // // // - (NSString *) contentType { return [_headers objectForKey: @"Content-Type"]; } - (void) setContentType: (NSString*) theContentType { if (theContentType) { [_headers setObject: theContentType forKey: @"Content-Type"]; } } // // // - (NSString *) contentID { return [_headers objectForKey: @"Content-Id"]; } - (void) setContentID: (NSString *) theContentID { if (theContentID) { [_headers setObject: theContentID forKey: @"Content-Id"]; } } // // // - (NSString *) contentDescription { return [_headers objectForKey: @"Content-Description"]; } - (void) setContentDescription: (NSString *) theContentDescription { if (theContentDescription) { [_headers setObject: theContentDescription forKey: @"Content-Description"]; } } // // // - (PantomimeContentDisposition) contentDisposition { id o; o = [_headers objectForKey: @"Content-Disposition"]; return (o ? [o intValue] : PantomimeInlineDisposition); } - (void) setContentDisposition: (PantomimeContentDisposition) theContentDisposition { [_headers setObject: [NSNumber numberWithInt: theContentDisposition] forKey: @"Content-Disposition"]; } // // // - (PantomimeEncoding) contentTransferEncoding { id o; o = [_headers objectForKey: @"Content-Transfer-Encoding"]; if (o) { return [o intValue]; } // Default value for the Content-Transfer-Encoding. // See RFC2045 - 6.1. Content-Transfer-Encoding Syntax. return PantomimeEncodingNone; } - (void) setContentTransferEncoding: (PantomimeEncoding) theEncoding { [_headers setObject: [NSNumber numberWithInt: theEncoding] forKey: @"Content-Transfer-Encoding"]; } // // // - (NSString *) filename { return [_parameters objectForKey: @"filename"]; //return _filename; } - (void) setFilename: (NSString *) theFilename { if (theFilename && ([theFilename length] > 0)) { //ASSIGN(_filename, theFilename); [_parameters setObject: theFilename forKey: @"filename"]; } else { //ASSIGN(_filename, @"unknown"); [_parameters setObject: @"unknown" forKey: @"filename"]; } } // // // - (PantomimeMessageFormat) format { id o; o = [_parameters objectForKey: @"format"]; if (o) { return [o intValue]; } return PantomimeFormatUnknown; } - (void) setFormat: (PantomimeMessageFormat) theFormat { [_parameters setObject: [NSNumber numberWithInt: theFormat] forKey: @"format"]; } // // // - (int) lineLength { return _line_length; } - (void) setLineLength: (int) theLineLength { _line_length = theLineLength; } // // This method is used to very if the part is of the following primaryType / subType // - (BOOL) isMIMEType: (NSString *) thePrimaryType subType: (NSString *) theSubType { NSString *aString; if (![self contentType]) { return NO;//[self setContentType: @"text/plain"]; } if ([theSubType compare: @"*"] == NSOrderedSame) { if ([[self contentType] hasCaseInsensitivePrefix: thePrimaryType]) { return YES; } } else { aString = [NSString stringWithFormat: @"%@/%@", thePrimaryType, theSubType]; if ([aString caseInsensitiveCompare: [self contentType]] == NSOrderedSame) { return YES; } } return NO; } // // // - (long) size { return _size; } - (void) setSize: (long) theSize { _size = theSize; } // // // - (NSData *) dataValue { NSMutableData *aMutableData; NSMutableArray *allKeys; NSData *aDataToSend; NSArray *allLines; NSString *aFilename; int i, count; aMutableData = [[NSMutableData alloc] init]; // We start off by exactring the filename of the part. if ([[self filename] is7bitSafe]) { aFilename = [self filename]; } else { aFilename = [[NSString alloc] initWithData: [CWMIMEUtility encodeWordUsingQuotedPrintable: [self filename] prefixLength: 0] encoding: NSASCIIStringEncoding]; AUTORELEASE(aFilename); } // We encode our Content-Transfer-Encoding header. if ([self contentTransferEncoding] != PantomimeEncodingNone) { [aMutableData appendCFormat: @"Content-Transfer-Encoding: %@%s", [NSString stringValueOfTransferEncoding: [self contentTransferEncoding]], LF]; } // We encode our Content-ID header. if ([self contentID]) { [aMutableData appendCFormat: @"Content-ID: %@%s", [self contentID], LF]; } // We encode our Content-Description header. if ([self contentDescription]) { [aMutableData appendCString: "Content-Description: "]; [aMutableData appendData: [CWMIMEUtility encodeWordUsingQuotedPrintable: [self contentDescription] prefixLength: 21]]; [aMutableData appendCString: LF]; } // We now encode the Content-Type header with its parameters. [aMutableData appendCFormat: @"Content-Type: %@", [self contentType]]; if ([self charset]) { [aMutableData appendCFormat: @"; charset=\"%@\"", [self charset]]; } if ([self format] == PantomimeFormatFlowed && ([self contentTransferEncoding] == PantomimeEncodingNone || [self contentTransferEncoding] == PantomimeEncoding8bit)) { [aMutableData appendCString: "; format=\"flowed\""]; } if (aFilename && [aFilename length]) { [aMutableData appendCFormat: @"; name=\"%@\"", aFilename]; } // Before checking for all other parameters, we check for the boundary one // If we got a CWMIMEMultipart instance as the content but no boundary // was set, we create a boundary and we set it. if ([self boundary] || [_content isKindOfClass: [CWMIMEMultipart class]]) { if (![self boundary]) { [self setBoundary: [CWMIMEUtility globallyUniqueBoundary]]; } [aMutableData appendCFormat: @";%s\tboundary=\"",LF]; [aMutableData appendData: [self boundary]]; [aMutableData appendCString: "\""]; } // We now check for any other additional parameters. If we have some, // we add them one per line. We first REMOVE what we have added! We'll // likely and protocol= here. allKeys = [NSMutableArray arrayWithArray: [_parameters allKeys]]; [allKeys removeObject: @"boundary"]; [allKeys removeObject: @"charset"]; [allKeys removeObject: @"filename"]; [allKeys removeObject: @"format"]; for (i = 0; i < [allKeys count]; i++) { [aMutableData appendCFormat: @";%s", LF]; [aMutableData appendCFormat: @"\t%@=\"%@\"", [allKeys objectAtIndex: i], [_parameters objectForKey: [allKeys objectAtIndex: i]]]; } [aMutableData appendCString: LF]; // We encode our Content-Disposition header. We ignore other parameters // (other than the filename one) since they are pretty much worthless. // See RFC2183 for details. if ([self contentDisposition] == PantomimeAttachmentDisposition) { [aMutableData appendCString: "Content-Disposition: attachment"]; if (aFilename && [aFilename length]) { [aMutableData appendCFormat: @"; filename=\"%@\"", aFilename]; } [aMutableData appendCString: LF]; } if ([_content isKindOfClass: [CWMessage class]]) { aDataToSend = [(CWMessage *)_content rawSource]; } else if ([_content isKindOfClass: [CWMIMEMultipart class]]) { CWMIMEMultipart *aMimeMultipart; NSMutableData *md; CWPart *aPart; md = [[NSMutableData alloc] init]; aMimeMultipart = (CWMIMEMultipart *)_content; count = [aMimeMultipart count]; for (i = 0; i < count; i++) { aPart = [aMimeMultipart partAtIndex: i]; if (i > 0) { [md appendBytes: LF length: strlen(LF)]; } [md appendBytes: "--" length: 2]; [md appendData: [self boundary]]; [md appendBytes: LF length: strlen(LF)]; [md appendData: [aPart dataValue]]; } [md appendBytes: "--" length: 2]; [md appendData: [self boundary]]; [md appendBytes: "--" length: 2]; [md appendBytes: LF length: strlen(LF)]; aDataToSend = AUTORELEASE(md); } else { aDataToSend = (NSData *)_content; } // We separe our part's headers from the content [aMutableData appendCFormat: @"%s", LF]; // We now encode our content the way it was specified if ([self contentTransferEncoding] == PantomimeEncodingQuotedPrintable) { aDataToSend = [aDataToSend encodeQuotedPrintableWithLineLength: 72 inHeader: NO]; } else if ([self contentTransferEncoding] == PantomimeEncodingBase64) { aDataToSend = [aDataToSend encodeBase64WithLineLength: 72]; } else if (([self contentTransferEncoding] == PantomimeEncodingNone || [self contentTransferEncoding] == PantomimeEncoding8bit) && [self format] == PantomimeFormatFlowed) { int limit; limit = _line_length; if (limit < 2 || limit > 998) { limit = 72; } aDataToSend = [aDataToSend wrapWithLimit: limit]; } allLines = [aDataToSend componentsSeparatedByCString: "\n"]; count = [allLines count]; for (i = 0; i < count; i++) { if (i == count-1 && [[allLines objectAtIndex: i] length] == 0) { break; } [aMutableData appendData: [allLines objectAtIndex: i]]; [aMutableData appendBytes: LF length: 1]; } return AUTORELEASE(aMutableData); } // // // - (NSData *) boundary { return [_parameters objectForKey: @"boundary"]; } - (void) setBoundary: (NSData *) theBoundary { if (theBoundary) { [_parameters setObject: theBoundary forKey: @"boundary"]; } } // // // - (NSData *) protocol { return [_parameters objectForKey: @"protocol"]; //return _protocol; } - (void) setProtocol: (NSData *) theProtocol { //ASSIGN(_protocol, theProtocol); if (theProtocol) { [_parameters setObject: theProtocol forKey: @"protocol"]; } } // // // - (NSString *) charset { return [_parameters objectForKey: @"charset"]; } - (void) setCharset: (NSString *) theCharset { if (theCharset) { [_parameters setObject: theCharset forKey: @"charset"]; } } // // // - (NSString *) defaultCharset { return _defaultCharset; } // // // - (void) setDefaultCharset: (NSString *) theCharset { ASSIGN(_defaultCharset, theCharset); } // // // - (void) setHeadersFromData: (NSData *) theHeaders { NSAutoreleasePool *pool; NSArray *allLines; int i, count; if (!theHeaders || [theHeaders length] == 0) { return; } // We initialize a local autorelease pool pool = [[NSAutoreleasePool alloc] init]; // We MUST be sure to unfold all headers properly before // decoding the headers theHeaders = [theHeaders unfoldLines]; allLines = [theHeaders componentsSeparatedByCString: "\n"]; count = [allLines count]; for (i = 0; i < count; i++) { NSData *aLine = [allLines objectAtIndex: i]; // We stop if we found the header separator. (\n\n) since someone could // have called this method with the entire rawsource of a message. if ([aLine length] == 0) { break; } if ([aLine hasCaseInsensitiveCPrefix: "Content-Description"]) { [CWParser parseContentDescription: aLine inPart: self]; } else if ([aLine hasCaseInsensitiveCPrefix: "Content-Disposition"]) { [CWParser parseContentDisposition: aLine inPart: self]; } else if ([aLine hasCaseInsensitiveCPrefix: "Content-ID"]) { [CWParser parseContentID: aLine inPart: self]; } else if ([aLine hasCaseInsensitiveCPrefix: "Content-Length"]) { // We just ignore that for now. } else if ([aLine hasCaseInsensitiveCPrefix: "Content-Transfer-Encoding"]) { [CWParser parseContentTransferEncoding: aLine inPart: self]; } else if ([aLine hasCaseInsensitiveCPrefix: "Content-Type"]) { [CWParser parseContentType: aLine inPart: self]; } } RELEASE(pool); } // // // - (id) parameterForKey: (NSString *) theKey { return [_parameters objectForKey: theKey]; } - (void) setParameter: (id) theParameter forKey: (NSString *) theKey { if (theParameter) { [_parameters setObject: theParameter forKey: theKey]; } else { [_parameters removeObjectForKey: theKey]; } } // // // - (NSDictionary *) allHeaders { return _headers; } // // // - (id) headerValueForName: (NSString *) theName { NSArray *allKeys; int count; allKeys = [_headers allKeys]; count = [allKeys count]; while (count--) { if ([[allKeys objectAtIndex: count] caseInsensitiveCompare: theName] == NSOrderedSame) { return [_headers objectForKey: [allKeys objectAtIndex: count]]; } } return nil; } // // // - (void) setHeaders: (NSDictionary *) theHeaders { if (theHeaders) { [_headers addEntriesFromDictionary: theHeaders]; } else { [_headers removeAllObjects]; } } @end pantomime1.2-1.2.2+dfsg1/Framework/Pantomime/CWRegEx.h000066400000000000000000000067641276751561200222620ustar00rootroot00000000000000/* ** CWRegEx.h ** ** Copyright (c) 2001-2004 ** ** Author: Francis Lachapelle ** Ludovic Marcotte ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** You should have received a copy of the GNU Lesser General Public ** License along with this library; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef _Pantomime_H_CWRegEx #define _Pantomime_H_CWRegEx #include #include #import #import /*! @class CWRegEx @abstract Provides a simple object-oriented wrapper around POSIX regex. @discussion This class provides a simple and efficient interface around POSIX regex, which are available on most UNIX (or like) systems. */ @interface CWRegEx : NSObject { @private regex_t _re; } /*! @method initWithPattern: @discussion This method invokes initWithPattern: flags: with the default REG_EXTENDED flag. @param thePattern The regular expression to use. @result An instance of CWRegEx, nil in case of an error. */ - (id) initWithPattern: (NSString *) thePattern; /*! @method initWithPattern: flags: @discussion This method is used to initialize a CWRegEx instance using the specified pattern and flags. @param thePattern The regular expression to use. @param theFlags The flags to use. See regcomp(3) for a description of the available flags. @result An instance of CWRegEx, nil in case of an error. */ - (id) initWithPattern: (NSString *) thePattern flags: (int) theFlags; /*! @method regexWithPattern: @discussion Invokes initWithPattern: with thePattern and autoreleases the returned instance. */ + (id) regexWithPattern: (NSString *) thePattern; /*! @method regexWithPattern: flags: @discussion Invokes initWithPattern: flags: with thePattern and theFlags, then autoreleases the returned instance. */ + (id) regexWithPattern: (NSString *) thePattern flags: (int) theFlags; /*! @method matchString: @discussion This method is used to try to match theString using the instance's pattern. @param theString The string to match. @result An array of matches (NSString instances), which can be empty but not nil. */ - (NSArray *) matchString: (NSString *) theString; /*! @method matchString: withPattern: isCaseSensitive: @discussion This method provides an easy way to quickly match a string with the specified pattern, in a case-sensitive manner or not. @param theString The string to match. @param thePattern The regular expression to use. @param theBOOL Case-sensitive, or not. @result An array of matches (NSString instances), which can be empty but not nil. */ + (NSArray *) matchString: (NSString *) theString withPattern: (NSString *) thePattern isCaseSensitive: (BOOL) theBOOL; @end #endif // _Pantomime_H_CWRegEx pantomime1.2-1.2.2+dfsg1/Framework/Pantomime/CWRegEx.m000066400000000000000000000066301276751561200222570ustar00rootroot00000000000000/* ** CWRegEx.m ** ** Copyright (c) 2001-2004 ** ** Author: Francis Lachapelle ** Ludovic Marcotte ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** You should have received a copy of the GNU Lesser General Public ** License along with this library; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include #include #import #import #include // // // @implementation CWRegEx - (id) init { return [self initWithPattern: @""]; } // // // - (id) initWithPattern: (NSString *) thePattern { return [self initWithPattern: thePattern flags: REG_EXTENDED]; } // // // - (id) initWithPattern: (NSString *) thePattern flags: (int) theFlags { int status; char *error; if ((self = [super init])) { status = regcomp(&_re, [thePattern cString], theFlags); if (status != 0) { error = malloc(255*sizeof(char)); regerror(status, &_re, error, 255); free(error); AUTORELEASE(self); self = nil; } } return self; } // // // + (id) regexWithPattern: (NSString *) thePattern { return AUTORELEASE([[self alloc] initWithPattern: thePattern]); } // // // + (id) regexWithPattern: (NSString *) thePattern flags: (int) theFlags { return AUTORELEASE([[self alloc] initWithPattern: thePattern flags: theFlags]); } // // // - (void)dealloc { regfree(&_re); [super dealloc]; } // // // - (NSArray *) matchString: (NSString *) theString { NSMutableArray *aMutableArray; int offset, status; char *s, *error; regmatch_t rm[1]; s = (char*)[theString lossyCString]; aMutableArray = [[NSMutableArray alloc] init]; status = regexec(&_re, s, 1, rm, 0); offset = 0; while (status == 0) { NSValue *aValue; aValue = [NSValue valueWithRange: NSMakeRange(offset + rm[0].rm_so, rm[0].rm_eo - rm[0].rm_so)]; [aMutableArray addObject: aValue]; offset += rm[0].rm_eo; if (rm[0].rm_eo - rm[0].rm_so == 0) { status = 1; } else { status = regexec(&_re, s + offset, 1, rm, REG_NOTBOL); } } if (status != REG_NOMATCH) { error = malloc(255*sizeof(char)); regerror(status, &_re, error, 255); free(error); } return AUTORELEASE(aMutableArray); } // // // + (NSArray *) matchString: (NSString *) theString withPattern: (NSString *) thePattern isCaseSensitive: (BOOL) theBOOL { int flags; CWRegEx *regex; NSArray *result; flags = REG_EXTENDED; if (!theBOOL) { flags |= REG_ICASE; } if ((regex = [CWRegEx regexWithPattern: thePattern flags: flags]) == nil) { result = [NSArray array]; } else { result = [regex matchString: theString]; } return result; } @end pantomime1.2-1.2.2+dfsg1/Framework/Pantomime/CWSMTP.h000066400000000000000000000211541276751561200220210ustar00rootroot00000000000000/* ** CWSMTP.h ** ** Copyright (c) 2001-2006 ** ** Author: Ludovic Marcotte ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** You should have received a copy of the GNU Lesser General Public ** License along with this library; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef _Pantomime_H_CWSMTP #define _Pantomime_H_CWSMTP #include #include #import #import #import #import /*! @const PantomimeTransactionInitiationCompleted */ extern NSString* PantomimeTransactionInitiationCompleted; /*! @const PantomimeTransactionInitiationFailed */ extern NSString* PantomimeTransactionInitiationFailed; /*! @const PantomimeRecipientIdentificationCompleted */ extern NSString* PantomimeRecipientIdentificationCompleted; /*! @const PantomimeRecipientIdentificationFailed */ extern NSString* PantomimeRecipientIdentificationFailed; /*! @const PantomimeTransactionResetCompleted */ extern NSString* PantomimeTransactionResetCompleted; /*! @const PantomimeTransactionResetFailed */ extern NSString* PantomimeTransactionResetFailed; @class CWMessage; /*! @category NSObject (SMTPClient) @discussion This informal protocol defines methods that can implemented in SMTP's delegate to control the behavior of the class or to obtain status information. */ @interface NSObject (SMTPClient) /*! @method transactionInitiationCompleted: @discussion This method is automatically invoked on the delegate after the SMTP MAIL FROM command has completed. The userInfo's part of the notification contains the message that has been sent. The key to obtain it is "Message". A PantomimeTransactionInitiationCompleted notification is also posted. @param theNotification The notification holding the information. */ - (void) transactionInitiationCompleted: (NSNotification *) theNotification; /*! @method transactionInitiationFailed: @discussion This method is automatically invoked on the delegate after the SMTP MAIL FROM command has failed. The userInfo's part of the notification contains the message that has not been sent. The key to obtain it is "Message". A PantomimeTransactionInitiatioFailed notification is also posted. @param theNotification The notification holding the information. */ - (void) transactionInitiationFailed: (NSNotification *) theNotification; /*! @method recipientIdentificationCompleted: @discussion This method is automatically invoked on the delegate after the SMTP RCPT TO command has completed. The userInfo's part of the notification contains the recipients (CWInternetAddress instances) that were sucessfully sent. The key to obtain it is "Recipients". A PantomimeRecipientIdentificationCompleted notification is also posted. @param theNotification The notification holding the information. */ - (void) recipientIdentificationCompleted: (NSNotification *) theNotification; /*! @method recipientIdentificationFailed: @discussion This method is automatically invoked on the delegate after the SMTP RCPT TO command has failed. The userInfo's part of the notification contains the recipient (CWInternetAddress instance) that was not sucessfully sent. The key to obtain it is "Recipient". A PantomimeRecipientIdentificationFailed notification is also posted. @param theNotification The notification holding the information. */ - (void) recipientIdentificationFailed: (NSNotification *) theNotification; /*! @method transactionResetCompleted: @discussion This method is automatically invoked on the delegate after the SMTP RSET command has completed. A PantomimeTransactionResetCompleted notification is also posted. @param theNotification The notification holding the information. */ - (void) transactionResetCompleted: (NSNotification *) theNotification; /*! @method transactionResetFailed: @discussion This method is automatically invoked on the delegate after the SMTP RSET command has completed and failed. This should never really happen but this method could be invoked, if the SMTP server isnt RFC-strict. A PantomimeTransactionResetFailed notification is also posted. @param theNotification The notification holding the information. */ - (void) transactionResetFailed: (NSNotification *) theNotification; @end /*! @typedef SMTPCommand @abstract Supported SMTP commands. @discussion This enum lists the supported SMTP commands available in Pantomime's SMTP client code. @constant SMTP_AUTH_CRAM_MD5 CRAM-MD5 authentication. @constant SMTP_AUTH_LOGIN LOGIN authentication. @constant SMTP_AUTH_LOGIN_CHALLENGE Challenge during the LOGIN authentication. @constant SMTP_AUTH_PLAIN PLAIN authentication. @constant SMTP_DATA The DATA SMTP command - see 4.1.1.4 DATA (DATA) of RFC 2821. @constant SMTP_EHLO The EHLO SMTP command - see 4.1.1.1 Extended HELLO (EHLO) or HELLO (HELO) of RFC 2821. @constant SMTP_HELO The HELO SMTP command - see 4.1.1.1 Extended HELLO (EHLO) or HELLO (HELO) of RFC 2821. @constant SMTP_MAIL The MAIL SMTP command - see 4.1.1.2 MAIL (MAIL) of RFC 2821. @constant SMTP_NOOP The NOOP SMTP command - see 4.1.1.9 NOOP (NOOP) of RFC 2821. @constant SMTP_QUIT The QUIT SMTP command - see 4.1.1.10 QUIT (QUIT) of RFC 2821. @constant SMTP_RCPT The RCPT SMTP command - see 4.1.1.3 RECIPIENT (RCPT) of RFC 2821. @constant SMTP_RSET The RSET SMTP command - see 4.1.1.5 RESET (RSET) of RFC 2821. @constant SMTP_STARTTLS The STARTTLS SMTP command - see RFC2487. @constant SMTP_AUTHORIZATION Special command to know we are in the autorization state. @constant SMTP_EMPTY_QUEUE Special command to empty the command queue. */ typedef enum { SMTP_AUTH_CRAM_MD5 = 0x1000, SMTP_AUTH_LOGIN, SMTP_AUTH_LOGIN_CHALLENGE, SMTP_AUTH_PLAIN, SMTP_DATA, SMTP_EHLO, SMTP_HELO, SMTP_MAIL, SMTP_NOOP, SMTP_QUIT, SMTP_RCPT, SMTP_RSET, SMTP_STARTTLS, SMTP_AUTHORIZATION, SMTP_EMPTY_QUEUE, } SMTPCommand; /*! @class CWSMTP @abstract Pantomime SMTP client code. @discussion This class, which extends the CWService class and implements the CWTransport protocol, is Pantomime's SMTP client code. */ @interface CWSMTP : CWService { @private NSMutableArray *_sent_recipients; NSMutableArray *_recipients; CWMessage *_message; NSData *_data; unsigned int _max_size; BOOL _redirected; } /*! @method lastResponse @discussion This method is used to obtain the last response received from the SMTP server. If the server sent a multi-line response, only the last line will be returned. @result The last response in its complete form, nil if no response was read. */ - (NSData *) lastResponse; /*! @method lastResponseCode @discussion This method is used to obtain the last response code received from the SMTP server. If the server sent a multi-line response, only the code of the last line will be returned. @result The last response code in its complete form, 0 if no response was read. */ - (int) lastResponseCode; /*! @method reset @discussion This method is used to send the RSET SMTP command. See 4.1.1.5 RESET (RSET) of RFC 2821 for a full description of this command. It will NOT reset to nil the previously used recipients, message or message data. If you wish to change either of them, call the corresponding accessor method between your -sendMessage calls. */ - (void) reset; /*! @method sendCommand: arguments: ... @discussion This method is used to send commands to the SMTP server. Normally, you should not call this method directly. @param theCommand The SMTP command to send. @param theFormat The format defining the variable arguments list. */ - (void) sendCommand: (SMTPCommand) theCommand arguments: (NSString *) theFormat, ...; @end #endif // _Pantomime_H_CWSMTP pantomime1.2-1.2.2+dfsg1/Framework/Pantomime/CWSMTP.m000066400000000000000000000640611276751561200220320ustar00rootroot00000000000000/* ** CWSMTP.m ** ** Copyright (c) 2001-2007 ** ** Author: Ludovic Marcotte ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** You should have received a copy of the GNU Lesser General Public ** License along with this library; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include #include #include #include #include #include #include #include #include #include // // Some static variables used to enhance the performance. // static NSStringEncoding defaultCStringEncoding; static NSData *CRLF; // // This function returns the next recipient from the array depending // if the message is redirected or not. // static inline CWInternetAddress *next_recipient(NSMutableArray *theRecipients, BOOL aBOOL) { CWInternetAddress *theAddress; int i, count; count = [theRecipients count]; for (i = 0; i < count; i++) { theAddress = [theRecipients objectAtIndex: i]; if (aBOOL) { if ([theAddress type] > 3) { return theAddress; } } else { if ([theAddress type] < 4) { return theAddress; } } } return nil; } // // // @interface CWSMTPQueueObject : NSObject { @public SMTPCommand command; NSString *arguments; } - (id) initWithCommand: (SMTPCommand) theCommand arguments: (NSString *) theArguments; @end @implementation CWSMTPQueueObject - (id) initWithCommand: (SMTPCommand) theCommand arguments: (NSString *) theArguments { self = [super init]; command = theCommand; ASSIGN(arguments, theArguments); return self; } - (void) dealloc { RELEASE(arguments); [super dealloc]; } @end // // Private SMTP methods // @interface CWSMTP (Private) - (void) _fail; - (void) _parseAUTH_CRAM_MD5; - (void) _parseAUTH_LOGIN; - (void) _parseAUTH_LOGIN_CHALLENGE; - (void) _parseAUTH_PLAIN; - (void) _parseAUTHORIZATION; - (void) _parseDATA; - (void) _parseEHLO; - (void) _parseHELO; - (void) _parseMAIL; - (void) _parseNOOP; - (void) _parseQUIT; - (void) _parseRCPT; - (void) _parseRSET; - (void) _parseServerOutput; @end // // // @implementation CWSMTP + (void) initialize { defaultCStringEncoding = [NSString defaultCStringEncoding]; CRLF = [[NSData alloc] initWithBytes: "\r\n" length: 2]; } // // initializers // - (id) initWithName: (NSString *) theName port: (unsigned int) thePort { self = [super initWithName: theName port: thePort]; _sent_recipients = nil; _recipients = nil; _message = nil; _data = nil; _max_size = 0; _lastCommand = SMTP_AUTHORIZATION; // We queue our first "command". [_queue addObject: AUTORELEASE([[CWSMTPQueueObject alloc] initWithCommand: _lastCommand arguments: @""])]; return self; } // // // - (void) dealloc { //NSLog(@"SMTP: -dealloc"); RELEASE(_message); RELEASE(_data); RELEASE(_recipients); RELEASE(_sent_recipients); [super dealloc]; } // // This method returns the last response obtained from the SMTP // server. If the last command issued a multiline response, it'll return the // last text response and none of the previous ones. // - (NSData *) lastResponse { return [_responsesFromServer lastObject]; } // // Same as -lastResponse except it does return only the response code. // - (int) lastResponseCode { if ([_responsesFromServer count] > 0) { return atoi([[[_responsesFromServer lastObject] subdataToIndex: 3] cString]); } return 0; } // // This method is used to authenticate ourself to the SMTP server. // - (void) authenticate: (NSString *) theUsername password: (NSString *) thePassword mechanism: (NSString *) theMechanism { ASSIGN(_username, theUsername); ASSIGN(_password, thePassword); ASSIGN(_mechanism, theMechanism); if (!theMechanism) { AUTHENTICATION_FAILED(_delegate, @""); } else if ([theMechanism caseInsensitiveCompare: @"PLAIN"] == NSOrderedSame) { [self sendCommand: SMTP_AUTH_PLAIN arguments: @"AUTH PLAIN"]; } else if ([theMechanism caseInsensitiveCompare: @"LOGIN"] == NSOrderedSame) { [self sendCommand: SMTP_AUTH_LOGIN arguments: @"AUTH LOGIN"]; } else if ([theMechanism caseInsensitiveCompare: @"CRAM-MD5"] == NSOrderedSame) { [self sendCommand: SMTP_AUTH_CRAM_MD5 arguments: @"AUTH CRAM-MD5"]; } else { // Unknown / Unsupported mechanism AUTHENTICATION_FAILED(_delegate, theMechanism); } } // // // - (void) close { [self sendCommand: SMTP_QUIT arguments: @"QUIT"]; } // // This method sends a NOOP SMTP command. // - (void) noop { [self sendCommand: SMTP_NOOP arguments: @"NOOP"]; } // // This method sends a RSET SMTP command. // - (void) reset { [self sendCommand: SMTP_RSET arguments: @"RSET"]; } // // This method sends a SMTP command to the server. // // It automatically adds the trailing CRLF to every command. // // RFC2821: // // The SMTP commands define the mail transfer or the mail system // function requested by the user. SMTP commands are character strings // terminated by . The commands themselves are alphabetic // characters terminated by if parameters follow and // otherwise. (In the interest of improved interoperability, SMTP // receivers are encouraged to tolerate trailing white space before the // terminating .) The syntax of the local part of a mailbox must // conform to receiver site conventions and the syntax specified in // section 4.1.2. The SMTP commands are discussed below. The SMTP // replies are discussed in section 4.2. // // The following list of commands is supported: // // - EHLO / HELO // - MAIL // - RCPT // - DATA // - RSET // - QUIT // // Unimplemented commands: // // - VRFY // - EXPN // - HELP // - NOOP // - (void) sendCommand: (SMTPCommand) theCommand arguments: (NSString *) theFormat, ... { CWSMTPQueueObject *aQueueObject; if (theCommand == SMTP_EMPTY_QUEUE) { if ([_queue count]) { // We dequeue the first inserted command from the queue. aQueueObject = [_queue lastObject]; } else { // The queue is empty, we have nothing more to do... return; } } else { NSString *aString; va_list args; va_start(args, theFormat); aString = [[NSString alloc] initWithFormat: theFormat arguments: args]; aQueueObject = [[CWSMTPQueueObject alloc] initWithCommand: theCommand arguments: aString]; RELEASE(aString); [_queue insertObject: aQueueObject atIndex: 0]; RELEASE(aQueueObject); // If we had queued commands, we return since we'll eventually // dequeue them one by one. Otherwise, we run it immediately. if ([_queue count] > 1) { return; } } _lastCommand = aQueueObject->command; // We send the command to the POP3 server. [self writeData: [aQueueObject->arguments dataUsingEncoding: defaultCStringEncoding]]; [self writeData: CRLF]; } // // To send a message, we need its data value and the recipients at least. // // Depending on what was specified using the "set" methods, we initialize // what we really want and proceed to send the mail. // - (void) sendMessage { NSString *aString; if (!_message && !_data) { [self _fail]; return; } if (!_recipients && _message) { ASSIGN(_recipients, [NSMutableArray arrayWithArray: [_message recipients]]); if (!_data) { ASSIGN(_data, [_message dataValue]); } } else if (!_recipients && _data) { CWMessage *aMessage; aMessage = [[CWMessage alloc] initWithData: _data]; ASSIGN(_message, aMessage); ASSIGN(_recipients, [NSMutableArray arrayWithArray: [aMessage recipients]]); RELEASE(aMessage); } DESTROY(_sent_recipients); _sent_recipients = [_recipients mutableCopy]; // We first verify if it's a redirected message if ([_message resentFrom]) { _redirected = YES; aString = [[_message resentFrom] address]; } else { _redirected = NO; aString = [[_message from] address]; } if (_max_size) { [self sendCommand: SMTP_MAIL arguments: @"MAIL FROM:<%@> SIZE=%d", aString, [_data length]]; } else { [self sendCommand: SMTP_MAIL arguments: @"MAIL FROM:<%@>", aString]; } } // // // - (void) setMessage: (CWMessage *) theMessage { DESTROY(_data); ASSIGN(_message, theMessage); } - (CWMessage *) message { return _message; } // // // - (void) setMessageData: (NSData *) theData { DESTROY(_message); ASSIGN(_data, theData); } - (NSData *) messageData { return _data; } // // // - (void) setRecipients: (NSArray *) theRecipients { DESTROY(_recipients); if (theRecipients) { ASSIGN(_recipients, [NSMutableArray arrayWithArray: theRecipients]); } } - (NSArray *) recipients { return _recipients; } // // This methods reads everything the server sends. Once it judge it has // read a full response, it calls _parseServerOutput in order to react // to what we've just received from the server. // // // RFC2821 rationale: // // An SMTP reply consists of a three digit number (transmitted as three // numeric characters) followed by some text unless specified otherwise // in this document. The number is for use by automata to determine // what state to enter next; the text is for the human user. The three // digits contain enough encoded information that the SMTP client need // not examine the text and may either discard it or pass it on to the // user, as appropriate. Exceptions are as noted elsewhere in this // document. In particular, the 220, 221, 251, 421, and 551 reply codes // are associated with message text that must be parsed and interpreted // by machines // // (...) // // The format for multiline replies requires that every line, except the // last, begin with the reply code, followed immediately by a hyphen, // "-" (also known as minus), followed by text. The last line will // begin with the reply code, followed immediately by , optionally // some text, and . As noted above, servers SHOULD send the // if subsequent text is not sent, but clients MUST be prepared for it // to be omitted. // // For example: // // 123-First line // 123-Second line // 123-234 text beginning with numbers // 123 The last line // // // (...) // // ... Only the EHLO, EXPN, and HELP // commands are expected to result in multiline replies in normal // circumstances, however, multiline replies are allowed for any // command. // - (void) updateRead { NSData *aData; char *buf; int count; //NSLog(@"IN UPDATE READ"); [super updateRead]; while ((aData = split_lines(_rbuf))) { [_responsesFromServer addObject: aData]; buf = (char *)[aData bytes]; count = [aData length]; // If we got only a response code OR if we're done reading // a multiline reply, we parse the output! if (count == 3 || (count > 3 && (*(buf+3) != '-'))) { [self _parseServerOutput]; } } } // // // - (void) startTLS { [self sendCommand: SMTP_STARTTLS arguments: @"STARTTLS"]; } @end // // Private methods // @implementation CWSMTP (Private) - (void) _fail { if (_message) POST_NOTIFICATION(PantomimeMessageNotSent, self, [NSDictionary dictionaryWithObject: _message forKey: @"Message"]); else POST_NOTIFICATION(PantomimeMessageNotSent, self, [NSDictionary dictionaryWithObject: AUTORELEASE([CWMessage new]) forKey: @"Message"]); PERFORM_SELECTOR_2(_delegate, @selector(messageNotSent:), PantomimeMessageNotSent, _message, @"Message"); } - (void) _parseAUTH_CRAM_MD5 { NSData *aData; aData = [_responsesFromServer lastObject]; if ([aData hasCPrefix: "334"]) { NSString *aString; CWMD5 *aMD5; // We trim the "334 ", decode the data using base64 and we keep the challenge phrase aData = [[aData subdataFromIndex: 4] decodeBase64]; aMD5 = [[CWMD5 alloc] initWithData: aData]; [aMD5 computeDigest]; aString = [NSString stringWithFormat: @"%@ %@", _username, [aMD5 hmacAsStringUsingPassword: _password]]; [self writeData: [[aString dataUsingEncoding: defaultCStringEncoding] encodeBase64WithLineLength: 0]]; [self writeData: CRLF]; RELEASE(aMD5); } else if ([aData hasCPrefix: "235"]) { AUTHENTICATION_COMPLETED(_delegate, @"CRAM-MD5"); } else { AUTHENTICATION_FAILED(_delegate, @"CRAM-MD5"); } } // // // - (void) _parseAUTH_LOGIN { NSData *aData; aData = [_responsesFromServer lastObject]; if ([aData hasCPrefix: "334"]) { NSString *aString; aString = [[NSString alloc] initWithData: [[_username dataUsingEncoding: defaultCStringEncoding] encodeBase64WithLineLength: 0] encoding: defaultCStringEncoding]; [self sendCommand: SMTP_AUTH_LOGIN_CHALLENGE arguments: aString]; RELEASE(aString); } else { AUTHENTICATION_FAILED(_delegate, @"LOGIN"); } } // // FIXME, rename if needed. // - (void) _parseAUTH_LOGIN_CHALLENGE { NSData *aData; aData = [_responsesFromServer lastObject]; if ([aData hasCPrefix: "334"]) { NSString *aString; aString = [[NSString alloc] initWithData: [[_password dataUsingEncoding: defaultCStringEncoding] encodeBase64WithLineLength: 0] encoding: defaultCStringEncoding]; [self sendCommand: SMTP_AUTH_LOGIN_CHALLENGE arguments: aString]; RELEASE(aString); } else if ([aData hasCPrefix: "235"]) { AUTHENTICATION_COMPLETED(_delegate, @"LOGIN"); } else { AUTHENTICATION_FAILED(_delegate, @"LOGIN"); } } // // // - (void) _parseAUTH_PLAIN { NSData *aData; aData = [_responsesFromServer lastObject]; if ([aData hasCPrefix: "334"]) { NSMutableData *aMutableData; int len_username, len_password; len_username = [_username length]; if (!_password) { len_password = 0; } else { len_password = [_password length]; } // We create our phrase aMutableData = [NSMutableData dataWithLength: (len_username + len_password + 2)]; [aMutableData replaceBytesInRange: NSMakeRange(1,len_username) withBytes: [[_username dataUsingEncoding: defaultCStringEncoding] bytes]]; [aMutableData replaceBytesInRange: NSMakeRange(2 + len_username, len_password) withBytes: [[_password dataUsingEncoding: defaultCStringEncoding] bytes]]; [self writeData: [aMutableData encodeBase64WithLineLength: 0]]; [self writeData: CRLF]; } else if ([aData hasCPrefix: "235"]) { AUTHENTICATION_COMPLETED(_delegate, @"PLAIN"); } else { AUTHENTICATION_FAILED(_delegate, @"PLAIN"); } } // // // - (void) _parseAUTHORIZATION { NSData *aData; aData = [_responsesFromServer lastObject]; // 220 Service ready if ([aData hasCPrefix: "220"]) { [self sendCommand: SMTP_EHLO arguments: @"EHLO localhost.localdomain"]; } else { // Handle the fact when a server is loaded and can't handle our requests // right away. #warning FIXME } } // // // - (void) _parseDATA { NSData *aData; aData = [_responsesFromServer lastObject]; // If we can proceed to write the message's data, let's do so. if ([aData hasCPrefix: "354"]) { NSMutableData *aMutableData; NSRange r1, r2; // We first replace all occurences of LF by CRLF in the Message's data. // aMutableData = [[NSMutableData dataWithData: _data] replaceLFWithCRLF]; // // According to RFC 2821 section 4.5.2, we must check for the character // sequence "."; any occurrence have its period duplicated // to avoid data transparency. // r1 = [aMutableData rangeOfCString: "\r\n."]; while (r1.location != NSNotFound) { [aMutableData replaceBytesInRange: r1 withBytes: "\r\n.." length: 4]; r1 = [aMutableData rangeOfCString: "\r\n." options: 0 range: NSMakeRange(NSMaxRange(r1)+1, [aMutableData length]-NSMaxRange(r1)-1)]; } // // We now look for the Bcc: header. If it is present, we remove it. // Some servers, like qmail, do not remove it automatically. // r1 = [aMutableData rangeOfCString: "\r\n\r\n"]; r1 = [aMutableData rangeOfCString: "\r\nBcc: " options: 0 range: NSMakeRange(0,r1.location-1)]; if (r1.location != NSNotFound) { // We search for the first \r\n AFTER the Bcc: header and // replace the whole thing with \r\n. r2 = [aMutableData rangeOfCString: "\r\n" options: 0 range: NSMakeRange(NSMaxRange(r1)+1,[aMutableData length]-NSMaxRange(r1)-1)]; [aMutableData replaceBytesInRange: NSMakeRange(r1.location, NSMaxRange(r2)-r1.location) withBytes: "\r\n" length: 2]; } [self writeData: aMutableData]; [self writeData: [NSData dataWithBytes: "\r\n.\r\n" length: 5]]; } else if ([aData hasCPrefix: "250"]) { // The data we wrote in the previous call was sucessfully written. // We inform the delegate that the mail was sucessfully sent. POST_NOTIFICATION(PantomimeMessageSent, self, [NSDictionary dictionaryWithObject: _message forKey: @"Message"]); PERFORM_SELECTOR_2(_delegate, @selector(messageSent:), PantomimeMessageSent, _message, @"Message"); } else { [self _fail]; } } // // // - (void) _parseEHLO { NSData *aData; int i, count; count = [_responsesFromServer count]; for (i = 0; i < count; i++) { aData = [_responsesFromServer objectAtIndex: i]; if ([aData hasCPrefix: "250"]) { // We parse the SMTP service extensions. For now, we support the SIZE // and the AUTH extensions. We ignore the rest. aData = [aData subdataFromIndex: 4]; // We add it to our capabilities [_capabilities addObject: AUTORELEASE([[NSString alloc] initWithData: aData encoding: defaultCStringEncoding])]; // Example of responses: // // AUTH LOGIN // AUTH=PLAIN CRAM-MD5 DIGEST-MD5 // if ([aData hasCPrefix: "AUTH"]) { NSEnumerator *theEnumerator; id aString; // We chomp the "AUTH " or "AUTH=" part and we decode our // supported mechanisms. theEnumerator = [[[aData subdataFromIndex: 5] componentsSeparatedByCString: " "] objectEnumerator]; while ((aString = [theEnumerator nextObject])) { aString = [aString asciiString]; if (![_supportedMechanisms containsObject: aString]) { [_supportedMechanisms addObject: aString]; } } } // // SIZE size-param // size-param ::= [1*DIGIT] // // See RFC1870 for detailed information. // else if ([aData hasCPrefix: "SIZE"]) { NSRange aRange; // We must be careful here. Some broken servers will send only // 250-SIZE // and we don't want to parse an inexistant value. aRange = [aData rangeOfCString: " "]; if (aRange.length) { _max_size = atoi([[aData subdataFromIndex: aRange.location+1] cString]); } } } else { // The server doesn't handle EHLO. We send it // a HELO greeting instead. [self sendCommand: SMTP_HELO arguments: @"HELO localhost.localdomain"]; break; } } #warning FIXME - Inform the delegate if it is ready or not, especially if EHLO failed POST_NOTIFICATION(PantomimeServiceInitialized, self, nil); PERFORM_SELECTOR_1(_delegate, @selector(serviceInitialized:), PantomimeServiceInitialized); } // // // - (void) _parseHELO { // FIXME - Implement. + inform the delegate if it's ready or not. } // // This method parses the result received from the server // after issuing a "MAIL FROM: <>" command. // // If the result is successful, we proceed by sending the first RCPT. // - (void) _parseMAIL { NSData *aData; aData = [_responsesFromServer lastObject]; if ([aData hasCPrefix: "250"]) { // We write the first recipient while respecting the fact // that we are bouncing or not the message. POST_NOTIFICATION(PantomimeTransactionInitiationCompleted, self, [NSDictionary dictionaryWithObject: _message forKey: @"Message"]); PERFORM_SELECTOR_1(_delegate, @selector(transactionInitiationCompleted:), PantomimeTransactionInitiationCompleted); [self sendCommand: SMTP_RCPT arguments: @"RCPT TO:<%@>", [next_recipient(_sent_recipients, _redirected) address]]; } else { if (PERFORM_SELECTOR_1(_delegate, @selector(transactionInitiationFailed:), PantomimeTransactionInitiationFailed)) { POST_NOTIFICATION(PantomimeTransactionInitiationFailed, self, [NSDictionary dictionaryWithObject: _message forKey: @"Message"]); } else { [self _fail]; } } } // // // - (void) _parseNOOP { // Do what? } // // // - (void) _parseQUIT { NSData *aData; aData = [_responsesFromServer lastObject]; if ([aData hasCPrefix: "221"]) { // Do anything special here? } [super close]; } // // This method is invoked everytime we sent a recipient to the // server using the RCPT command. // // If it was successful, this command sends the next one, if any // by first removing the previously sent one from _recipients. // - (void) _parseRCPT { NSData *aData; aData = [_responsesFromServer lastObject]; if ([aData hasCPrefix: "250"]) { CWInternetAddress *theAddress; theAddress = next_recipient(_sent_recipients, _redirected); if (theAddress) { [_sent_recipients removeObject: theAddress]; theAddress = next_recipient(_sent_recipients, _redirected); if (theAddress) { [self sendCommand: SMTP_RCPT arguments: @"RCPT TO:<%@>", [theAddress address]]; return; } } // We are done writing the recipients, we now write the content // of the message. POST_NOTIFICATION(PantomimeRecipientIdentificationCompleted, self, [NSDictionary dictionaryWithObject: _recipients forKey: @"Recipients"]); PERFORM_SELECTOR_2(_delegate, @selector(recipientIdentificationCompleted:), PantomimeRecipientIdentificationCompleted, _recipients, @"Recipients"); [self sendCommand: SMTP_DATA arguments: @"DATA"]; } else { #warning also send the invalid recipient in perform selector and when posting the notification if (PERFORM_SELECTOR_1(_delegate, @selector(recipientIdentificationFailed:), PantomimeRecipientIdentificationFailed)) { POST_NOTIFICATION(PantomimeRecipientIdentificationFailed, self, [NSDictionary dictionaryWithObject: _recipients forKey: @"Recipients"]); } else { [self _fail]; } } } // // // - (void) _parseRSET { NSData *aData; aData = [_responsesFromServer lastObject]; if ([aData hasCPrefix: "250"]) { POST_NOTIFICATION(PantomimeTransactionResetCompleted, self, nil); PERFORM_SELECTOR_1(_delegate, @selector(transactionResetCompleted:), PantomimeTransactionResetCompleted); } else { POST_NOTIFICATION(PantomimeTransactionResetFailed, self, nil); PERFORM_SELECTOR_1(_delegate, @selector(transactionResetFailed:), PantomimeTransactionResetFailed); } } // // // - (void) _parseSTARTTLS { NSData *aData; aData = [_responsesFromServer lastObject]; if ([aData hasCPrefix: "220"]) { // We first activate SSL. [(CWTCPConnection *)_connection startSSL]; // We now forget about the initial negotiated state; see RFC2487 for more details, [_supportedMechanisms removeAllObjects]; [self sendCommand: SMTP_EHLO arguments: @"EHLO localhost.localdomain"]; } else { // The server probably doesn't support TLS. We inform the delegate that the transaction initiation // failed or that the message wasn't sent. if (PERFORM_SELECTOR_1(_delegate, @selector(transactionInitiationFailed:), PantomimeTransactionInitiationFailed)) { POST_NOTIFICATION(PantomimeTransactionInitiationFailed, self, [NSDictionary dictionaryWithObject: _message forKey: @"Message"]); } else { [self _fail]; } } } // // // - (void) _parseServerOutput { NSData *aData; if (![_responsesFromServer count]) { return; } // We read only the first response. The _parseXYZ methods // will handle multiline responses. aData = [_responsesFromServer objectAtIndex: 0]; if ([aData hasCPrefix: "421"]) { // FIXME: - lost connection //NSLog(@"LOST CONNECTION TO THE SERVER"); [super close]; } else { switch (_lastCommand) { case SMTP_AUTH_CRAM_MD5: [self _parseAUTH_CRAM_MD5]; break; case SMTP_AUTH_LOGIN: [self _parseAUTH_LOGIN]; break; case SMTP_AUTH_LOGIN_CHALLENGE: [self _parseAUTH_LOGIN_CHALLENGE]; break; case SMTP_AUTH_PLAIN: [self _parseAUTH_PLAIN]; break; case SMTP_DATA: [self _parseDATA]; break; case SMTP_EHLO: [self _parseEHLO]; break; case SMTP_HELO: [self _parseHELO]; break; case SMTP_MAIL: [self _parseMAIL]; break; case SMTP_NOOP: [self _parseNOOP]; break; case SMTP_QUIT: [self _parseQUIT]; break; case SMTP_RCPT: [self _parseRCPT]; break; case SMTP_RSET: [self _parseRSET]; break; case SMTP_STARTTLS: [self _parseSTARTTLS]; break; case SMTP_AUTHORIZATION: [self _parseAUTHORIZATION]; break; default: break; // FIXME } } // We are done parsing this entry... [_responsesFromServer removeAllObjects]; // We remove the last object of the queue.... if ([_queue lastObject]) { [_queue removeLastObject]; } [self sendCommand: SMTP_EMPTY_QUEUE arguments: @""]; } @end pantomime1.2-1.2.2+dfsg1/Framework/Pantomime/CWSendmail.h000066400000000000000000000053321276751561200227720ustar00rootroot00000000000000/* ** CWSendmail.h ** ** Copyright (c) 2001-2007 ** ** Author: Ludovic Marcotte ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** You should have received a copy of the GNU Lesser General Public ** License along with this library; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef _Pantomime_H_CWSendmail #define _Pantomime_H_CWSendmail #include #import #import @class NSTask; /*! @class CWSendmail @discussion This class, which implements the CWTransport protocol, is used to provide an interface to the "sendmail" command found on most UNIX system in order to submit messages directly instead of using SMTP. */ @interface CWSendmail : NSObject { @private NSMutableArray *_recipients; CWMessage *_message; NSData *_data; NSString *_path; id _delegate; } /*! @method initWithPath: @discussion This is the designated initializer for the CWSendmail class. @param thePath The complete path to the "sendmail" binary. @result An instance of Sendmail, nil on error. */ - (id) initWithPath: (NSString *) thePath; /*! @method setDelegate: @discussion This method is used to set the CWSendmail instance's delegate. The delegate will not be retained. The CWSendmail class (and its subclasses) will invoke methods on the delegate based on actions performed. @param theDelegate The delegate, which implements various callback methods. */ - (void) setDelegate: (id) theDelegate; /*! @method delegate @discussion This method is used to obtain the delegate of the CWSendmail's instance. @result The delegate, nil if none was previously set. */ - (id) delegate; /*! @method setPath: @discussion This method is used to set the path to the "sendmail" binary. @param thePath The full path to the binary. */ - (void) setPath: (NSString *) thePath; /*! @method path @discussion This method is used to get the path to the "sendmail" binary previously set by calling -setPath:. @result The path to the "sendmail" binary. */ - (NSString *) path; @end #endif // _Pantomime_H_CWSendmail pantomime1.2-1.2.2+dfsg1/Framework/Pantomime/CWSendmail.m000066400000000000000000000130021276751561200227700ustar00rootroot00000000000000/* ** CWSendmail.m ** ** Copyright (c) 2001-2007 ** ** Author: Ludovic Marcotte ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** You should have received a copy of the GNU Lesser General Public ** License along with this library; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include #include #include #include #include #include #include #include #include #include #include #include // // Sendmail's private interface // @interface CWSendmail (Private) - (void) _fail; - (void) _taskDidTerminate: (NSNotification *) theNotification; @end // // // @implementation CWSendmail - (id) initWithPath: (NSString *) thePath; { self = [super init]; [self setPath: thePath]; _delegate = nil; return self; } - (void) dealloc { RELEASE(_message); RELEASE(_data); RELEASE(_recipients); RELEASE(_path); [super dealloc]; } // // access / mutation methods // - (void) setDelegate: (id) theDelegate { _delegate = theDelegate; } - (id) delegate { return _delegate; } // // // - (void) setPath: (NSString *) thePath { ASSIGN(_path, [thePath stringByTrimmingWhiteSpaces]); } - (NSString *) path { return _path; } // // // - (void) setMessage: (CWMessage *) theMessage { ASSIGN(_message, theMessage); } - (CWMessage *) message { return _message; } // // // - (void) setMessageData: (NSData *) theData { ASSIGN(_data, theData); } - (NSData *) messageData { return _data; } // // That does nothing but we keep it if a developer wanna // use that ivar. // - (void) setRecipients: (NSArray *) theRecipients { ASSIGN(_recipients, [NSMutableArray arrayWithArray: theRecipients]); } - (NSArray *) recipients { return _recipients; } // // // - (void) sendMessage { NSString *aString, *aFilename; NSFileHandle *aFileHandle; NSRange aRange; NSTask *aTask; if ((!_message && !_data) || !_path) { [self _fail]; return; } if (!_data && _message) { [self setMessageData: [_message dataValue]]; } // We verify if _pathToSendmail is a valid one (ie., readable and executable) aRange = [_path rangeOfString: @" "]; aString = _path; if (aRange.location != NSNotFound) { aString = [_path substringToIndex: aRange.location]; } if (![[NSFileManager defaultManager] isExecutableFileAtPath: aString]) { [self _fail]; return; } // We now create our task and send the message aFilename = [NSString stringWithFormat: @"%@/%d_%@", NSTemporaryDirectory(), [[NSProcessInfo processInfo] processIdentifier], NSUserName()]; if (![_data writeToFile: aFilename atomically: YES]) { [self _fail]; return; } [[NSFileManager defaultManager] enforceMode: 0600 atPath: aFilename]; aFileHandle = [NSFileHandle fileHandleForReadingAtPath: aFilename]; aTask = [[NSTask alloc] init]; // We register for our notification [[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(_taskDidTerminate:) name: NSTaskDidTerminateNotification object: aTask]; // We build our right string aString = [_path stringByTrimmingWhiteSpaces]; // We verify if our program to launch has any arguments aRange = [aString rangeOfString: @" "]; if (aRange.length) { [aTask setLaunchPath: [aString substringToIndex: aRange.location]]; [aTask setArguments: [[aString substringFromIndex: (aRange.location + 1)] componentsSeparatedByString: @" "]]; } else { [aTask setLaunchPath: aString]; } [aTask setStandardInput: aFileHandle]; // We launch our task [aTask launch]; [aFileHandle closeFile]; [[NSFileManager defaultManager] removeFileAtPath: aFilename handler: nil]; } @end // // // @implementation CWSendmail (Private) - (void) _fail { if (_message) POST_NOTIFICATION(PantomimeMessageNotSent, self, [NSDictionary dictionaryWithObject: _message forKey: @"Message"]); else POST_NOTIFICATION(PantomimeMessageNotSent, self, [NSDictionary dictionaryWithObject: AUTORELEASE([CWMessage new]) forKey: @"Message"]); PERFORM_SELECTOR_1(_delegate, @selector(messageNotSent:), PantomimeMessageNotSent); } - (void) _taskDidTerminate: (NSNotification *) theNotification { // We first unregister ourself for the notification [[NSNotificationCenter defaultCenter] removeObserver: self]; if ([[theNotification object] terminationStatus] == 0) { POST_NOTIFICATION(PantomimeMessageSent, self, [NSDictionary dictionaryWithObject: _message forKey: @"Message"]); PERFORM_SELECTOR_2(_delegate, @selector(messageSent:), PantomimeMessageSent, _message, @"Message"); } else { [self _fail]; } } @end pantomime1.2-1.2.2+dfsg1/Framework/Pantomime/CWService.h000066400000000000000000000464041276751561200226430ustar00rootroot00000000000000/* ** CWService.h ** ** Copyright (c) 2001-2007 ** ** Author: Ludovic Marcotte ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** You should have received a copy of the GNU Lesser General Public ** License along with this library; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef _Pantomime_H_CWService #define _Pantomime_H_CWService #include #import #import #import #import #import #ifdef MACOSX #import #include #endif @class CWService; /*! @function split_lines @discussion This function is used to split lines from theMutableData and return the first one found immediately (by removing it first from theMutableData). IMAP, POP3 and SMTP servers reponses are always ended by CRLF. @param theMutableData The data from which to split lines from. @result A line as a NSData instance, nil if no line was splitted. */ static inline NSData *split_lines(NSMutableData *theMutableData) { char *bytes, *end; int i, count; end = bytes = (char *)[theMutableData mutableBytes]; count = [theMutableData length]; for (i = 0; i < count; i++) { if (*end == '\n' && *(end-1) == '\r') { NSData *aData; aData = [NSData dataWithBytes: bytes length: (i-1)]; memmove(bytes,end+1,count-i-1); [theMutableData setLength: count-i-1]; return aData; } end++; } return nil; } /*! @const PantomimeAuthenticationCompleted */ extern NSString* PantomimeAuthenticationCompleted; /*! @const PantomimeAuthenticationFailed */ extern NSString* PantomimeAuthenticationFailed; /*! @const PantomimeConnectionEstablished */ extern NSString* PantomimeConnectionEstablished; /*! @const PantomimeConnectionLost */ extern NSString* PantomimeConnectionLost; /*! @const PantomimeConnectionTerminated */ extern NSString* PantomimeConnectionTerminated; /*! @const PantomimeConnectionTimedOut */ extern NSString* PantomimeConnectionTimedOut; /*! @const PantomimeRequestCancelled */ extern NSString* PantomimeRequestCancelled; /*! @const PantomimeServiceInitialized */ extern NSString* PantomimeServiceInitialized; /*! @const PantomimeServiceReconnected */ extern NSString* PantomimeServiceReconnected; /*! @const PantomimeProtocolException @description This exception can be raised if a major protocol handling error occured in one of the CWService subclasses. This would mean that Pantomime has a bug. */ extern NSString* PantomimeProtocolException; /*! @category NSObject (CWServiceClient) @discussion This informal protocol defines methods that can implemented in CWService's delegate (CWIMAPStore, CWPOP3Store or CWSMTP instance) to control the behavior of the class or to obtain status information. You can release/autorelease a CWService instance in -connectionTimedOut:, -connectionLost: or -connectionTerminated (or the respective notification handlers). You may NOT do it elsewhere. */ @interface NSObject (CWServiceClient) /*! @method authenticationCompleted: @discussion This method is automatically called on the delegate when the authentication has sucessfully completed on the underlying Service's instance. A PantomimeAuthenticationCompleted notification is also posted. The authentication mechanism that was used can be obtained from the notification's userInfo using the "Mechanism" key. @param theNotification The notification holding the information. */ - (void) authenticationCompleted: (NSNotification *) theNotification; /*! @method authenticationFailed: @discussion This method is automatically called on the delegate when the authentication has failed on the underlying Service's instance. A PantomimeAuthenticationCompleted notification is also posted. The authentication mechanism that was used can be obtained from the notification's userInfo using the "Mechanism" key. @param theNotification The notification holding the information. */ - (void) authenticationFailed: (NSNotification *) theNotification; /*! @method connectionEstablished: @discussion Invoked once the connection has been established with the peer. A PantomimeConnectionEstablished notification is also posted. @param theNotification The notification holding the information. */ - (void) connectionEstablished: (NSNotification *) theNotification; /*! @method connectionLost: @discussion Invoked when the connection to the peer has been lost without the "user's" intervention. A PantomimeConnectionLost notification is also posted. @param theNotification The notification holding the information. */ - (void) connectionLost: (NSNotification *) theNotification; /*! @method connectionTerminated: @discussion Invoked when the connection has been cleanly terminated with the peer. A PantomimeConnectionTerminated notification is also posted. @param theNotification The notification holding the information. */ - (void) connectionTerminated: (NSNotification *) theNotification; /*! @method connectionTimedOut: @discussion Invoked when connecting to a peer on a non-blocking fashion but the associated timeout has expired. It is also invoked when we try to read bytes from the peer or when trying send bytes to it. The method isConnected can be invoked in order if we got this timeout when trying to connect (the value will be set to "NO") or when we are connected but can't read or write anymore. A PantomimeConnectionTimedOut notification is also posted. @param theNotification The notification holding the information. */ - (void) connectionTimedOut: (NSNotification *) theNotification; /*! @method service: receivedData: @discussion Invoked when bytes have been received by the underlying CWService's connection. No notification is posted. @param theService The CWService instance that generated network activity. @param theData The received bytes. */ - (void) service: (CWService *) theService receivedData: (NSData *) theData; /*! @method service: sentData: @discussion Invoked when bytes have been sent using the underlying CWService's connection. No notification is posted. @param theService The CWService instance that generated network activity. @param theData The sent bytes. */ - (void) service: (CWService *) theService sentData: (NSData *) theData; /*! @method requestCancelled: @discussion This method is automatically called after a request has been cancelled. The connection was automatically closed PRIOR to calling this delegate method. A PantomimeRequestCancelled notification is also posted. @param theNotification The notification holding the information. */ - (void) requestCancelled: (NSNotification *) theNotification; /*! @method serviceInitialized: @discussion This method is automatically invoked on the delegate when the Service is fully initialized. This method is invoked after -connectionEstablished: is called. A PantomimeServiceInitialized notification is also posted. @param theNotification The notification holding the information. */ - (void) serviceInitialized: (NSNotification *) theNotification; /*! @method serviceReconnected: @discussion When a service lost its connection, -connectionWasLost: is called. Usually, -reconnect is called to re-establish the connection with the remote host. Once it has completed, -serviceReconnected: is invoked on the delegate. A PantomimeServiceReconnected notification is also posted. @param theNotification The notification holding the information. */ - (void) serviceReconnected: (NSNotification *) theNotification; @end #ifdef MACOSX typedef enum {ET_RDESC, ET_WDESC, ET_EDESC} RunLoopEventType; /*! @class CWService @discussion This abstract class defines the basic behavior and implementation of all Pantomime internet services such as SMTP, POP3 and IMAP. You should never instantiate this class directly. You rather need to instantiate the CWSMTP, CWPOP3Store or CWIMAPStore classes, which fully implement the abstract methods found in this class. */ @interface CWService : NSObject #else @interface CWService : NSObject #endif { @protected NSMutableArray *_supportedMechanisms; NSMutableArray *_responsesFromServer; NSMutableArray *_capabilities; NSMutableArray *_runLoopModes; NSMutableArray *_queue; NSMutableData *_wbuf; NSMutableData *_rbuf; NSString *_mechanism; NSString *_username; NSString *_password; NSString *_name; #ifdef MACOSX CFRunLoopSourceRef _runLoopSource; CFSocketContext *_context; CFSocketRef _socket; #endif unsigned int _connectionTimeout; unsigned int _readTimeout; unsigned int _writeTimeout; unsigned int _lastCommand; unsigned int _port; BOOL _connected; id _delegate; id _connection; NSTimer * _timer; int _counter; struct { NSMutableArray *previous_queue; BOOL reconnecting; BOOL opening_mailbox; } _connection_state; } /*! @method initWithName: port: @discussion This is the designated initializer for the CWService class. Once called, it'll open a connection to the server specified by theName using the specified port (thePort). @param theName The FQDN of the server. @param thePort The server port to which we will connect. @result An instance of a Service class, nil on error. */ - (id) initWithName: (NSString *) theName port: (unsigned int) thePort; /*! @method setDelegate: @discussion This method is used to set the CWService's delegate. The delegate will not be retained. The CWService class (and its subclasses) will invoke methods on the delegate based on actions performed. @param theDelegate The delegate, which implements various callback methods. */ - (void) setDelegate: (id) theDelegate; /*! @method delegate @discussion This method is used to get the delegate of the CWService's instance. @result The delegate, nil if none was previously set. */ - (id) delegate; /*! @method name @discussion This method is used to obtain the server name. @result The server name. */ - (NSString *) name; /*! @method setName: @discussion This method is used to set the server name to which we will eventually connect to. @param theName The name of the server. */ - (void) setName: (NSString *) theName; /*! @method port @discussion This method is used to obtain the server port. @result The server port. */ - (unsigned int) port; /*! @method setPort: @discussion This method is used to set the server port to which we will eventually connect to. @param theName The port of the server. */ - (void) setPort: (unsigned int) thePort; /*! @method connection @discussion This method is used to retrieve the associated connection object for the service (usually a CWTCPConnection instance). @result The associated connectio object. */ - (id) connection; /*! @method username @discussion This method is used to get the username (if any) that will be used to authenticate to the service. @result The username. */ - (NSString *) username; /*! @method setUsername: @discussion This method is used to set the username that will be used to authenticate to the service. @param theUsername The username for authentication. */ - (void) setUsername: (NSString *) theUsername; /*! @method supportedMechanisms @discussion This method is used to return the supported SASL authentication mecanisms by the receiver. @result An array of NSString instances which indicates what SASL mechanisms are supported. */ - (NSArray *) supportedMechanisms; /*! @method isConnected @discussion This method is used to verify if the receiver is connected to the server. @result YES if connected, NO otherwise. */ - (BOOL) isConnected; /*! @method authenticate: password: mechanism: @discussion This method is used to authentifcate the receiver to the server. This method posts a PantomimeAuthenticationCompleted (or calls the -authenticationCompleted: method on the delegate, if any) if the authentication is sucessful. If not, it posts the PantomimeAuthenticationFailed notification (or calls the -authenticationFailed: method on the delegate, if any). This method is fully asynchronous. @param theUsername The username to use, overwriting -username: if any. @param thePassword The password to use. @param theMechanism The authentication mechanism to use. */ - (void) authenticate: (NSString *) theUsername password: (NSString *) thePassword mechanism: (NSString *) theMechanism; /*! @method cancelRequest @discussion This method will cancel any pending requests or communications with the server and close the connection. It'll post a PantomimeRequestCancelled once it has fully cancelled everything. This method is fully asynchronous. */ - (void) cancelRequest; /*! @method close @discussion This method is used to close the connection to the server. If the receiver is not in a connected state, it does nothing. If it is, it posts a PantomimeConnectionTerminated notification once it has completed and invokes -connectionTerminated: on the delegate, if any. */ - (void) close; /*! @method connect @discussion This method is used to connect the receiver to the server. It will block until the connection was succefully established (or until it fails). @result 0 on success, -1 on error. */ - (int) connect; /*! @method connectInBackgroundAndNotify @discussion This method is used connect the receiver to the server. The call to this method is non-blocking. This method will post a PantomimeConnectionEstablished notification once the connection has been establish (and call -connectionEstablished: on the delegate, if any). Otherwise, it will post a PantomimeConnectionTimedOut notification (and call -connectionTimedOut: on the delegate, if any). */ - (void) connectInBackgroundAndNotify; /*! @method noop @discussion This method is used to generate some traffic on a server so the connection doesn't idle and gets terminated by the server. Subclasses of CWService need to implement this method. */ - (void) noop; /*! @method receivedEvent: type: extra: forMode: @discussion This method is automatically invoked when the receiver can either read or write bytes to its underlying CWConnection instance. Never call this method directly. @param theData The file descriptor. @param theType The type of event that occured. @param theExtra Additional information. @param theMode The runloop modes. */ - (void) receivedEvent: (void *) theData type: (RunLoopEventType) theType extra: (void *) theExtra forMode: (NSString *) theMode; /*! @method reconnect @discussion Pending. @result Pending. */ - (int) reconnect; /*! @method updateRead @discussion This method is invoked automatically when bytes are available to be read. You should never have to invoke this method directly. */ - (void) updateRead; /*! @method updateWrite @discussion This method is invoked automatically when bytes are available to be written. You should never have to invoke this method directly. */ - (void) updateWrite; /*! @method writeData: @discussion This method is used to buffer bytes to be written on the socket. You should never have to invoke this method directly. @param The bytes to buffer, as a NSData instance. */ - (void) writeData: (NSData *) theData; /*! @method addRunLoopMode: @discussion This method is used to add an additional mode that the run-loop will use to listen for network events for reading and writing. Note that this method does nothing on OS X since only the kCFRunLoopCommonModes mode is used. @param The additional mode. NSDefaultRunLoopMode is always present so there is no need to add it. */ - (void) addRunLoopMode: (NSString *) theMode; /*! @method connectionTimeout @discussion This method is used to get the timeout used when connecting to the host. @result The connecton timeout. */ - (unsigned int) connectionTimeout; /*! @method setConnectionTimeout: @discussion This method is used to set the timeout used when connecting to the host. @param theConnectionTimeout The timeout to use. */ - (void) setConnectionTimeout: (unsigned int) theConnectionTimeout; /*! @method readTimeout @discussion This method is used to get the timeout used when reading bytes from the socket. @result The read timeout. */ - (unsigned int) readTimeout; /*! @method setReadTimeout @discussion This method is used to set the timeout used when reading bytes from the socket. @param The timeout to use. */ - (void) setReadTimeout: (unsigned int) theReadTimeout; /*! @method writeTimeout @discussion This method is used to get the timeout used when writing bytes from the socket. @result The write timeout. */ - (unsigned int) writeTimeout; /*! @method setWriteTimeout @discussion This method is used to set the timeout used when writing bytes from the socket. @param The timeout to use. */ - (void) setWriteTimeout: (unsigned int) theWriteTimeout; /*! @method startTLS @discussion This method is used to activate TLS over a non-secure connection. This method can be called in the -serviceInitialized: delegate method. The latter will be invoked again once TLS has been activated successfully. */ - (void) startTLS; /*! @method lastCommand @discussion This method is used to get the last command that has been sent by CWService subclasses to the remote server. To know which commands can be sent, see the documentation of the associated subclasses. @result The last command sent, 0 otherwise. */ - (unsigned int) lastCommand; /*! @method capabilities @discussion This method is used to obtain the capabilities of the associated service. @result The capabilities, as an array of NSString instances. */ - (NSArray *) capabilities; @end #endif // _Pantomime_H_CWService pantomime1.2-1.2.2+dfsg1/Framework/Pantomime/CWService.m000066400000000000000000000510131276751561200226400ustar00rootroot00000000000000/* ** CWService.m ** ** Copyright (c) 2001-2007 ** ** Author: Ludovic Marcotte ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** You should have received a copy of the GNU Lesser General Public ** License along with this library; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include #include #include #include #include #include #include #include #include #include // // It's important that the read buffer be bigger than the PMTU. Since almost all networks // permit 1500-byte packets and few permit more, the PMTU will generally be around 1500. // 2k is fine, 4k accomodates FDDI (and HIPPI?) networks too. // #define NET_BUF_SIZE 4096 // // We set the size increment of blocks we will write. Under Mac OS X, we use 1024 bytes // in order to avoid a strange bug in SSL_write. This prevents us from no longer beeing // notified after a couple of writes that we can actually write data! // #define WRITE_BLOCK_SIZE 1024 // // Default timeout used when waiting for something to complete. // #define DEFAULT_TIMEOUT 60 // // Service's private interface. // @interface CWService (Private) - (int) _addWatchers; - (void) _removeWatchers; - (void) _connectionTick: (id) sender; - (void) _queueTick: (id) sender; @end // // OS X's implementation of the GNUstep RunLoop Extensions // #ifdef MACOSX static NSMapTable *fd_to_cfsocket; void socket_callback(CFSocketRef s, CFSocketCallBackType type, CFDataRef address, const void* data, void* info) { if (type&kCFSocketWriteCallBack) { [(CWService *)info receivedEvent: (void*)CFSocketGetNative(s) type: ET_WDESC extra: 0 forMode: nil]; } if (type&kCFSocketReadCallBack) { [(CWService *)info receivedEvent: (void*)CFSocketGetNative(s) type: ET_RDESC extra: 0 forMode: nil]; } } @interface NSRunLoop (PantomimeRunLoopExtensions) - (void) addEvent: (void *) data type: (RunLoopEventType) type watcher: (id) watcher forMode: (NSString *) mode; - (void) removeEvent: (void *) data type: (RunLoopEventType) type forMode: (NSString *) mode all: (BOOL) removeAll; @end @implementation NSRunLoop (PantomimeRunLoopExtensions) - (void) addEvent: (void *) data type: (RunLoopEventType) type watcher: (id) watcher forMode: (NSString *) mode { CFSocketRef socket; int fd; fd = (int)data; socket = (CFSocketRef)NSMapGet(fd_to_cfsocket, (void*)fd); // We prevent dealing with callbacks when the socket is NOT // in a connected state. This can happen, under OS X, if // we call -addEvent: type: watcher: forMode: but the // connection hasn't yet been established. If it hasn't been // established, -_addWatchers: was not called so the fd is // NOT in our map table. if (!socket) { return; } switch (type) { case ET_RDESC: CFSocketEnableCallBacks(socket, kCFSocketReadCallBack); break; case ET_WDESC: CFSocketEnableCallBacks(socket, kCFSocketWriteCallBack); break; default: break; } } - (void) removeEvent: (void *) data type: (RunLoopEventType) type forMode: (NSString *) mode all: (BOOL) removeAll { CFSocketRef socket; int fd; fd = (int)data; socket = (CFSocketRef)NSMapGet(fd_to_cfsocket, (void*)fd); // See the description in -addEvent: type: watcher: forMode:. if (!socket) { return; } switch (type) { case ET_RDESC: CFSocketDisableCallBacks(socket, kCFSocketReadCallBack); break; case ET_WDESC: CFSocketDisableCallBacks(socket, kCFSocketWriteCallBack); break; default: break; } } @end #endif // MACOSX // // // @implementation CWService #ifdef MACOSX + (void) initialize { fd_to_cfsocket = NSCreateMapTable(NSIntMapKeyCallBacks, NSIntMapValueCallBacks, 16); } #endif // // // - (id) init { self = [super init]; _supportedMechanisms = [[NSMutableArray alloc] init]; _responsesFromServer = [[NSMutableArray alloc] init]; _capabilities = [[NSMutableArray alloc] init]; _queue = [[NSMutableArray alloc] init]; _username = nil; _password = nil; _rbuf = [[NSMutableData alloc] init]; _wbuf = [[NSMutableData alloc] init]; _runLoopModes = [[NSMutableArray alloc] initWithObjects: NSDefaultRunLoopMode, nil]; _connectionTimeout = _readTimeout = _writeTimeout = DEFAULT_TIMEOUT; _counter = _lastCommand = 0; _connection_state.previous_queue = [[NSMutableArray alloc] init]; _connection_state.reconnecting = _connection_state.opening_mailbox = NO; return self; } // // // - (id) initWithName: (NSString *) theName port: (unsigned int) thePort { self = [self init]; [self setName: theName]; [self setPort: thePort]; return self; } // // // - (void) dealloc { //NSLog(@"Service: -dealloc"); [self setDelegate: nil]; RELEASE(_supportedMechanisms); RELEASE(_responsesFromServer); RELEASE(_capabilities); RELEASE(_queue); RELEASE(_rbuf); RELEASE(_wbuf); TEST_RELEASE(_mechanism); TEST_RELEASE(_username); TEST_RELEASE(_password); RELEASE(_name); TEST_RELEASE((id)_connection); RELEASE(_runLoopModes); RELEASE(_connection_state.previous_queue); [super dealloc]; } // // access / mutation methods // - (void) setDelegate: (id) theDelegate { _delegate = theDelegate; } - (id) delegate { return _delegate; } // // // - (NSString *) name { return _name; } - (void) setName: (NSString *) theName { ASSIGN(_name, theName); } // // // - (unsigned int) port { return _port; } - (void) setPort: (unsigned int) thePort { _port = thePort; } // // // - (id) connection { return _connection; } // // // - (NSArray *) supportedMechanisms { return [NSArray arrayWithArray: _supportedMechanisms]; } // // // - (NSString *) username { return _username; } - (void) setUsername: (NSString *) theUsername { ASSIGN(_username, theUsername); } // // // - (BOOL) isConnected { return _connected; } // // Other methods // - (void) authenticate: (NSString *) theUsername password: (NSString *) thePassword mechanism: (NSString *) theMechanism { [self subclassResponsibility: _cmd]; } // // // - (void) cancelRequest { // If we were in the process of establishing // a connection, let's stop our internal timer. [_timer invalidate]; DESTROY(_timer); [self _removeWatchers]; [_connection close]; DESTROY(_connection); [_queue removeAllObjects]; POST_NOTIFICATION(PantomimeRequestCancelled, self, nil); PERFORM_SELECTOR_1(_delegate, @selector(requestCancelled:), PantomimeRequestCancelled); } // // // - (void) close { // // If we are reconnecting, no matter what, we close and release our current connection immediately. // We do that since we'll create a new on in -connect/-connectInBackgroundAndNotify. No need // to return immediately since _connected will be set to NO in _removeWatchers. // if (_connection_state.reconnecting) { [self _removeWatchers]; [_connection close]; DESTROY(_connection); } if (_connected) { [self _removeWatchers]; [_connection close]; POST_NOTIFICATION(PantomimeConnectionTerminated, self, nil); PERFORM_SELECTOR_1(_delegate, @selector(connectionTerminated:), PantomimeConnectionTerminated); } } // // If the connection or binding succeeds, zero is returned. // On error, -1 is returned, and errno is set appropriately // - (int) connect { _connection = [[CWTCPConnection alloc] initWithName: _name port: _port background: NO]; if (!_connection) { return -1; } return [self _addWatchers]; } // // // - (void) connectInBackgroundAndNotify { int i; _connection = [[CWTCPConnection alloc] initWithName: _name port: _port background: YES]; if (!_connection) { POST_NOTIFICATION(PantomimeConnectionTimedOut, self, nil); PERFORM_SELECTOR_1(_delegate, @selector(connectionTimedOut:), PantomimeConnectionTimedOut); return; } _timer = [NSTimer timerWithTimeInterval: 0.1 target: self selector: @selector(_connectionTick:) userInfo: nil repeats: YES]; RETAIN(_timer); for (i = 0; i < [_runLoopModes count]; i++) { [[NSRunLoop currentRunLoop] addTimer: _timer forMode: [_runLoopModes objectAtIndex: i]]; } [_timer fire]; } // // // - (void) noop { [self subclassResponsibility: _cmd]; } // // // - (void) updateRead { char buf[NET_BUF_SIZE]; int count; while ((count = [_connection read: buf length: NET_BUF_SIZE]) > 0) { NSData *aData; aData = [[NSData alloc] initWithBytes: buf length: count]; if (_delegate && [_delegate respondsToSelector: @selector(service:receivedData:)]) { [_delegate performSelector: @selector(service:receivedData:) withObject: self withObject: aData]; } [_rbuf appendData: aData]; RELEASE(aData); } if (count == 0) { // // We check to see if we got disconnected. // // The data that causes select to return is the EOF because the other side // has closed the connection. This causes read to return zero. // if (!((CWTCPConnection *)_connection)->ssl_handshaking && _connected) { [self _removeWatchers]; [_connection close]; POST_NOTIFICATION(PantomimeConnectionLost, self, nil); PERFORM_SELECTOR_1(_delegate, @selector(connectionLost:), PantomimeConnectionLost); } } else { // We reset our connection timeout counter. This could happen when we are performing operations // that return a large amount of data. The queue might be non-empty but network I/O could be // going on at the same time. This could also be problematic for lenghty IMAP search or // mailbox preload. _counter = 0; } } // // // - (void) updateWrite { if ([_wbuf length] > 0) { char *bytes; int count, len, i; bytes = (char *)[_wbuf mutableBytes]; len = [_wbuf length]; #ifdef MACOSX count = [_connection write: bytes length: len > WRITE_BLOCK_SIZE ? WRITE_BLOCK_SIZE : len]; #else count = [_connection write: bytes length: len]; #endif // If nothing was written or if an error occured, we return. if (count <= 0) { return; } // Otherwise, we inform our delegate that we wrote some data... else if (_delegate && [_delegate respondsToSelector: @selector(service:sentData:)]) { [_delegate performSelector: @selector(service:sentData:) withObject: self withObject: [_wbuf subdataToIndex: count]]; } //NSLog(@"count = %d, len = %d", count, len); // If we have been able to write everything... if (count == len) { [_wbuf setLength: 0]; #ifndef __MINGW32__ // If we are done writing, let's remove the watcher on our fd. for (i = 0; i < [_runLoopModes count]; i++) { [[NSRunLoop currentRunLoop] removeEvent: (void *)[_connection fd] type: ET_WDESC forMode: [_runLoopModes objectAtIndex: i] all: YES]; } #endif } else { memmove(bytes, bytes+count, len-count); [_wbuf setLength: len-count]; // We enable the write callback under OS X. // See the rationale in -writeData: #ifdef MACOSX for (i = 0; i < [_runLoopModes count]; i++) { [[NSRunLoop currentRunLoop] addEvent: (void *)[_connection fd] type: ET_WDESC watcher: self forMode: [_runLoopModes objectAtIndex: i]]; } #endif } } } // // // - (void) writeData: (NSData *) theData { if (theData && [theData length]) { int i; [_wbuf appendData: theData]; // // Let's not try to enable the write callback if we are not connected // There's no reason to try to enable the write callback if we // are not connected. // if (!_connected) { return; } // // We re-enable the write callback. // // Rationale from OS X's CoreFoundation: // // By default kCFSocketReadCallBack, kCFSocketAcceptCallBack, and kCFSocketDataCallBack callbacks are // automatically reenabled, whereas kCFSocketWriteCallBack callbacks are not; kCFSocketConnectCallBack // callbacks can only occur once, so they cannot be reenabled. Be careful about automatically reenabling // read and write callbacks, because this implies that the callbacks will be sent repeatedly if the socket // remains readable or writable respectively. Be sure to set these flags only for callback types that your // CFSocket actually possesses; the result of setting them for other callback types is undefined. // #ifndef __MINGW32__ for (i = 0; i < [_runLoopModes count]; i++) { [[NSRunLoop currentRunLoop] addEvent: (void *)[_connection fd] type: ET_WDESC watcher: self forMode: [_runLoopModes objectAtIndex: i]]; } #endif } } // // RunLoopEvents protocol's implementations. // - (void) receivedEvent: (void *) theData type: (RunLoopEventType) theType extra: (void *) theExtra forMode: (NSString *) theMode { AUTORELEASE(RETAIN(self)); // Don't be deallocated while handling event switch (theType) { #ifdef __MINGW32__ case ET_HANDLE: case ET_TRIGGER: [self updateRead]; [self updateWrite]; break; #else case ET_RDESC: [self updateRead]; break; case ET_WDESC: [self updateWrite]; break; case ET_EDESC: //NSLog(@"GOT ET_EDESC! %d current fd = %d", theData, [_connection fd]); break; #endif default: break; } } // // // - (int) reconnect { [self subclassResponsibility: _cmd]; return 0; } // // // - (NSDate *) timedOutEvent: (void *) theData type: (RunLoopEventType) theType forMode: (NSString *) theMode { //NSLog(@"timed out event!"); return nil; } // // // - (void) addRunLoopMode: (NSString *) theMode { #ifndef MACOSX if (theMode && ![_runLoopModes containsObject: theMode]) { [_runLoopModes addObject: theMode]; } #endif } // // // - (unsigned int) connectionTimeout { return _connectionTimeout; } - (void) setConnectionTimeout: (unsigned int) theConnectionTimeout { _connectionTimeout = (theConnectionTimeout > 0 ? theConnectionTimeout : DEFAULT_TIMEOUT); } - (unsigned int) readTimeout { return _readTimeout; } - (void) setReadTimeout: (unsigned int) theReadTimeout { _readTimeout = (theReadTimeout > 0 ? theReadTimeout: DEFAULT_TIMEOUT); } - (unsigned int) writeTimeout { return _writeTimeout; } - (void) setWriteTimeout: (unsigned int) theWriteTimeout { _writeTimeout = (theWriteTimeout > 0 ? theWriteTimeout : DEFAULT_TIMEOUT); } - (void) startTLS { [self subclassResponsibility: _cmd]; } - (unsigned int) lastCommand { return _lastCommand; } - (NSArray *) capabilities { return _capabilities; } @end // // // @implementation CWService (Private) // // This methods adds watchers on a file descriptor. // It returns 0 if it has completed successfully. // - (int) _addWatchers { int i; // // Under Mac OS X, we must also create a CFSocket and a runloop source in order // to enabled callbacks write read/write availability. // #ifdef MACOSX _context = (CFSocketContext *)malloc(sizeof(CFSocketContext)); memset(_context, 0, sizeof(CFSocketContext)); _context->info = self; _socket = CFSocketCreateWithNative(NULL, [_connection fd], kCFSocketReadCallBack|kCFSocketWriteCallBack, socket_callback, _context); CFSocketDisableCallBacks(_socket, kCFSocketReadCallBack|kCFSocketWriteCallBack); if (!_socket) { //NSLog(@"Failed to create CFSocket from native."); return -1; } _runLoopSource = CFSocketCreateRunLoopSource(NULL, _socket, 1); if (!_runLoopSource) { //NSLog(@"Failed to create the runloop source."); return -1; } CFRunLoopAddSource(CFRunLoopGetCurrent(), _runLoopSource, kCFRunLoopCommonModes); NSMapInsert(fd_to_cfsocket, (void *)[_connection fd], (void *)_socket); #endif // We get ready to monitor for read/write timeouts _timer = [NSTimer timerWithTimeInterval: 1 target: self selector: @selector(_queueTick:) userInfo: nil repeats: YES]; RETAIN(_timer); _counter = 0; //NSLog(@"Adding watchers on %d", [_connection fd]); for (i = 0; i < [_runLoopModes count]; i++) { [[NSRunLoop currentRunLoop] addEvent: (void *)[_connection fd] #ifdef __MINGW32__ type: ET_HANDLE #else type: ET_RDESC #endif watcher: self forMode: [_runLoopModes objectAtIndex: i]]; [[NSRunLoop currentRunLoop] addEvent: (void *)[_connection fd] #ifdef __MINGW32__ type: ET_TRIGGER #else type: ET_EDESC #endif watcher: self forMode: [_runLoopModes objectAtIndex: i]]; [[NSRunLoop currentRunLoop] addTimer: _timer forMode: [_runLoopModes objectAtIndex: i]]; } _connected = YES; POST_NOTIFICATION(PantomimeConnectionEstablished, self, nil); PERFORM_SELECTOR_1(_delegate, @selector(connectionEstablished:), PantomimeConnectionEstablished); [_timer fire]; return 0; } // // // - (void) _removeWatchers { int i; // // If we are not connected, no need to remove the watchers on our file descriptor. // This could also generate a crash under OS X as the _runLoopSource, _socket etc. // ivars aren't initialized. // if (!_connected) { return; } [_timer invalidate]; DESTROY(_timer); _connected = NO; //NSLog(@"Removing all watchers on %d...", [_connection fd]); for (i = 0; i < [_runLoopModes count]; i++) { #ifdef __MINGW32__ [[NSRunLoop currentRunLoop] removeEvent: (void *)[_connection fd] type: ET_HANDLE forMode: [_runLoopModes objectAtIndex: i] all: YES]; [[NSRunLoop currentRunLoop] removeEvent: (void *)[_connection fd] type: ET_TRIGGER forMode: [_runLoopModes objectAtIndex: i] all: YES]; #else [[NSRunLoop currentRunLoop] removeEvent: (void *)[_connection fd] type: ET_RDESC forMode: [_runLoopModes objectAtIndex: i] all: YES]; [[NSRunLoop currentRunLoop] removeEvent: (void *)[_connection fd] type: ET_WDESC forMode: [_runLoopModes objectAtIndex: i] all: YES]; [[NSRunLoop currentRunLoop] removeEvent: (void *)[_connection fd] type: ET_EDESC forMode: [_runLoopModes objectAtIndex: i] all: YES]; #endif } #ifdef MACOSX if (CFRunLoopSourceIsValid(_runLoopSource)) { CFRunLoopSourceInvalidate(_runLoopSource); CFRelease(_runLoopSource); } if (CFSocketIsValid(_socket)) { CFSocketInvalidate(_socket); } NSMapRemove(fd_to_cfsocket, (void *)[_connection fd]); CFRelease(_socket); free(_context); #endif } // // // - (void) _connectionTick: (id) sender { if ((_counter/10) == _connectionTimeout) { [_timer invalidate]; DESTROY(_timer); POST_NOTIFICATION(PantomimeConnectionTimedOut, self, nil); PERFORM_SELECTOR_1(_delegate, @selector(connectionTimedOut:), PantomimeConnectionTimedOut); return; } if ([_connection isConnected]) { [_timer invalidate]; DESTROY(_timer); [self _addWatchers]; return; } _counter++; } // // // - (void) _queueTick: (id) sender { if ([_queue count]) { if (_counter == _readTimeout) { NSLog(@"Waited %d secs, read/write timeout", _readTimeout); [_timer invalidate]; DESTROY(_timer); POST_NOTIFICATION(PantomimeConnectionTimedOut, self, nil); PERFORM_SELECTOR_1(_delegate, @selector(connectionTimedOut:), PantomimeConnectionTimedOut); } _counter++; } else { _counter = 0; } } @end pantomime1.2-1.2.2+dfsg1/Framework/Pantomime/CWService.m.orig000066400000000000000000000507101276751561200236020ustar00rootroot00000000000000/* ** CWService.m ** ** Copyright (c) 2001-2007 ** ** Author: Ludovic Marcotte ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** You should have received a copy of the GNU Lesser General Public ** License along with this library; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include #include #include #include #include #include #include #include #include #include // // It's important that the read buffer be bigger than the PMTU. Since almost all networks // permit 1500-byte packets and few permit more, the PMTU will generally be around 1500. // 2k is fine, 4k accomodates FDDI (and HIPPI?) networks too. // #define NET_BUF_SIZE 4096 // // We set the size increment of blocks we will write. Under Mac OS X, we use 1024 bytes // in order to avoid a strange bug in SSL_write. This prevents us from no longer beeing // notified after a couple of writes that we can actually write data! // #define WRITE_BLOCK_SIZE 1024 // // Default timeout used when waiting for something to complete. // #define DEFAULT_TIMEOUT 60 // // Service's private interface. // @interface CWService (Private) - (int) _addWatchers; - (void) _removeWatchers; - (void) _connectionTick: (id) sender; - (void) _queueTick: (id) sender; @end // // OS X's implementation of the GNUstep RunLoop Extensions // #ifdef MACOSX static NSMapTable *fd_to_cfsocket; void socket_callback(CFSocketRef s, CFSocketCallBackType type, CFDataRef address, const void* data, void* info) { if (type&kCFSocketWriteCallBack) { [(CWService *)info receivedEvent: (void*)CFSocketGetNative(s) type: ET_WDESC extra: 0 forMode: nil]; } if (type&kCFSocketReadCallBack) { [(CWService *)info receivedEvent: (void*)CFSocketGetNative(s) type: ET_RDESC extra: 0 forMode: nil]; } } @interface NSRunLoop (PantomimeRunLoopExtensions) - (void) addEvent: (void *) data type: (RunLoopEventType) type watcher: (id) watcher forMode: (NSString *) mode; - (void) removeEvent: (void *) data type: (RunLoopEventType) type forMode: (NSString *) mode all: (BOOL) removeAll; @end @implementation NSRunLoop (PantomimeRunLoopExtensions) - (void) addEvent: (void *) data type: (RunLoopEventType) type watcher: (id) watcher forMode: (NSString *) mode { CFSocketRef socket; int fd; fd = (int)data; socket = (CFSocketRef)NSMapGet(fd_to_cfsocket, (void*)fd); // We prevent dealing with callbacks when the socket is NOT // in a connected state. This can happen, under OS X, if // we call -addEvent: type: watcher: forMode: but the // connection hasn't yet been established. If it hasn't been // established, -_addWatchers: was not called so the fd is // NOT in our map table. if (!socket) { return; } switch (type) { case ET_RDESC: CFSocketEnableCallBacks(socket, kCFSocketReadCallBack); break; case ET_WDESC: CFSocketEnableCallBacks(socket, kCFSocketWriteCallBack); break; default: break; } } - (void) removeEvent: (void *) data type: (RunLoopEventType) type forMode: (NSString *) mode all: (BOOL) removeAll { CFSocketRef socket; int fd; fd = (int)data; socket = (CFSocketRef)NSMapGet(fd_to_cfsocket, (void*)fd); // See the description in -addEvent: type: watcher: forMode:. if (!socket) { return; } switch (type) { case ET_RDESC: CFSocketDisableCallBacks(socket, kCFSocketReadCallBack); break; case ET_WDESC: CFSocketDisableCallBacks(socket, kCFSocketWriteCallBack); break; default: break; } } @end #endif // MACOSX // // // @implementation CWService #ifdef MACOSX + (void) initialize { fd_to_cfsocket = NSCreateMapTable(NSIntMapKeyCallBacks, NSIntMapValueCallBacks, 16); } #endif // // // - (id) init { self = [super init]; _supportedMechanisms = [[NSMutableArray alloc] init]; _responsesFromServer = [[NSMutableArray alloc] init]; _capabilities = [[NSMutableArray alloc] init]; _queue = [[NSMutableArray alloc] init]; _username = nil; _password = nil; _rbuf = [[NSMutableData alloc] init]; _wbuf = [[NSMutableData alloc] init]; _runLoopModes = [[NSMutableArray alloc] initWithObjects: NSDefaultRunLoopMode, nil]; _connectionTimeout = _readTimeout = _writeTimeout = DEFAULT_TIMEOUT; _counter = _lastCommand = 0; _connection_state.previous_queue = [[NSMutableArray alloc] init]; _connection_state.reconnecting = _connection_state.opening_mailbox = NO; return self; } // // // - (id) initWithName: (NSString *) theName port: (unsigned int) thePort { self = [self init]; [self setName: theName]; [self setPort: thePort]; return self; } // // // - (void) dealloc { //NSLog(@"Service: -dealloc"); [self setDelegate: nil]; RELEASE(_supportedMechanisms); RELEASE(_responsesFromServer); RELEASE(_capabilities); RELEASE(_queue); RELEASE(_rbuf); RELEASE(_wbuf); TEST_RELEASE(_mechanism); TEST_RELEASE(_username); TEST_RELEASE(_password); RELEASE(_name); TEST_RELEASE((id)_connection); RELEASE(_runLoopModes); RELEASE(_connection_state.previous_queue); [super dealloc]; } // // access / mutation methods // - (void) setDelegate: (id) theDelegate { _delegate = theDelegate; } - (id) delegate { return _delegate; } // // // - (NSString *) name { return _name; } - (void) setName: (NSString *) theName { ASSIGN(_name, theName); } // // // - (unsigned int) port { return _port; } - (void) setPort: (unsigned int) thePort { _port = thePort; } // // // - (id) connection { return _connection; } // // // - (NSArray *) supportedMechanisms { return [NSArray arrayWithArray: _supportedMechanisms]; } // // // - (NSString *) username { return _username; } - (void) setUsername: (NSString *) theUsername { ASSIGN(_username, theUsername); } // // // - (BOOL) isConnected { return _connected; } // // Other methods // - (void) authenticate: (NSString *) theUsername password: (NSString *) thePassword mechanism: (NSString *) theMechanism { [self subclassResponsibility: _cmd]; } // // // - (void) cancelRequest { // If we were in the process of establishing // a connection, let's stop our internal timer. [_timer invalidate]; DESTROY(_timer); [self _removeWatchers]; [_connection close]; DESTROY(_connection); [_queue removeAllObjects]; POST_NOTIFICATION(PantomimeRequestCancelled, self, nil); PERFORM_SELECTOR_1(_delegate, @selector(requestCancelled:), PantomimeRequestCancelled); } // // // - (void) close { // // If we are reconnecting, no matter what, we close and release our current connection immediately. // We do that since we'll create a new on in -connect/-connectInBackgroundAndNotify. No need // to return immediately since _connected will be set to NO in _removeWatchers. // if (_connection_state.reconnecting) { [self _removeWatchers]; [_connection close]; DESTROY(_connection); } if (_connected) { [self _removeWatchers]; [_connection close]; POST_NOTIFICATION(PantomimeConnectionTerminated, self, nil); PERFORM_SELECTOR_1(_delegate, @selector(connectionTerminated:), PantomimeConnectionTerminated); } } // // If the connection or binding succeeds, zero is returned. // On error, -1 is returned, and errno is set appropriately // - (int) connect { _connection = [[CWTCPConnection alloc] initWithName: _name port: _port background: NO]; if (!_connection) { return -1; } return [self _addWatchers]; } // // // - (void) connectInBackgroundAndNotify { int i; _connection = [[CWTCPConnection alloc] initWithName: _name port: _port background: YES]; if (!_connection) { POST_NOTIFICATION(PantomimeConnectionTimedOut, self, nil); PERFORM_SELECTOR_1(_delegate, @selector(connectionTimedOut:), PantomimeConnectionTimedOut); return; } _timer = [NSTimer timerWithTimeInterval: 0.1 target: self selector: @selector(_connectionTick:) userInfo: nil repeats: YES]; RETAIN(_timer); for (i = 0; i < [_runLoopModes count]; i++) { [[NSRunLoop currentRunLoop] addTimer: _timer forMode: [_runLoopModes objectAtIndex: i]]; } [_timer fire]; } // // // - (void) noop { [self subclassResponsibility: _cmd]; } // // // - (void) updateRead { char buf[NET_BUF_SIZE]; int count; while ((count = [_connection read: buf length: NET_BUF_SIZE]) > 0) { NSData *aData; aData = [[NSData alloc] initWithBytes: buf length: count]; if (_delegate && [_delegate respondsToSelector: @selector(service:receivedData:)]) { [_delegate performSelector: @selector(service:receivedData:) withObject: self withObject: aData]; } [_rbuf appendData: aData]; RELEASE(aData); } if (count == 0) { // // We check to see if we got disconnected. // // The data that causes select to return is the EOF because the other side // has closed the connection. This causes read to return zero. // if (!((CWTCPConnection *)_connection)->ssl_handshaking && _connected) { [self _removeWatchers]; [_connection close]; POST_NOTIFICATION(PantomimeConnectionLost, self, nil); PERFORM_SELECTOR_1(_delegate, @selector(connectionLost:), PantomimeConnectionLost); } } else { // We reset our connection timeout counter. This could happen when we are performing operations // that return a large amount of data. The queue might be non-empty but network I/O could be // going on at the same time. This could also be problematic for lenghty IMAP search or // mailbox preload. _counter = 0; } } // // // - (void) updateWrite { if ([_wbuf length] > 0) { char *bytes; int count, len, i; bytes = (char *)[_wbuf mutableBytes]; len = [_wbuf length]; #ifdef MACOSX count = [_connection write: bytes length: len > WRITE_BLOCK_SIZE ? WRITE_BLOCK_SIZE : len]; #else count = [_connection write: bytes length: len]; #endif // If nothing was written or if an error occured, we return. if (count <= 0) { return; } // Otherwise, we inform our delegate that we wrote some data... else if (_delegate && [_delegate respondsToSelector: @selector(service:sentData:)]) { [_delegate performSelector: @selector(service:sentData:) withObject: self withObject: [_wbuf subdataToIndex: count]]; } //NSLog(@"count = %d, len = %d", count, len); // If we have been able to write everything... if (count == len) { [_wbuf setLength: 0]; #ifndef __MINGW32__ // If we are done writing, let's remove the watcher on our fd. for (i = 0; i < [_runLoopModes count]; i++) { [[NSRunLoop currentRunLoop] removeEvent: (void *)[_connection fd] type: ET_WDESC forMode: [_runLoopModes objectAtIndex: i] all: YES]; } #endif } else { memmove(bytes, bytes+count, len-count); [_wbuf setLength: len-count]; // We enable the write callback under OS X. // See the rationale in -writeData: #ifdef MACOSX for (i = 0; i < [_runLoopModes count]; i++) { [[NSRunLoop currentRunLoop] addEvent: (void *)[_connection fd] type: ET_WDESC watcher: self forMode: [_runLoopModes objectAtIndex: i]]; } #endif } } } // // // - (void) writeData: (NSData *) theData { if (theData && [theData length]) { int i; [_wbuf appendData: theData]; // // Let's not try to enable the write callback if we are not connected // There's no reason to try to enable the write callback if we // are not connected. // if (!_connected) { return; } // // We re-enable the write callback. // // Rationale from OS X's CoreFoundation: // // By default kCFSocketReadCallBack, kCFSocketAcceptCallBack, and kCFSocketDataCallBack callbacks are // automatically reenabled, whereas kCFSocketWriteCallBack callbacks are not; kCFSocketConnectCallBack // callbacks can only occur once, so they cannot be reenabled. Be careful about automatically reenabling // read and write callbacks, because this implies that the callbacks will be sent repeatedly if the socket // remains readable or writable respectively. Be sure to set these flags only for callback types that your // CFSocket actually possesses; the result of setting them for other callback types is undefined. // #ifndef __MINGW32__ for (i = 0; i < [_runLoopModes count]; i++) { [[NSRunLoop currentRunLoop] addEvent: (void *)[_connection fd] type: ET_WDESC watcher: self forMode: [_runLoopModes objectAtIndex: i]]; } #endif } } // // RunLoopEvents protocol's implementations. // - (void) receivedEvent: (void *) theData type: (RunLoopEventType) theType extra: (void *) theExtra forMode: (NSString *) theMode { switch (theType) { #ifdef __MINGW32__ case ET_HANDLE: case ET_TRIGGER: [self updateRead]; [self updateWrite]; break; #else case ET_RDESC: [self updateRead]; break; case ET_WDESC: [self updateWrite]; break; case ET_EDESC: //NSLog(@"GOT ET_EDESC! %d current fd = %d", theData, [_connection fd]); break; #endif default: break; } } // // // - (int) reconnect { [self subclassResponsibility: _cmd]; return 0; } // // // - (NSDate *) timedOutEvent: (void *) theData type: (RunLoopEventType) theType forMode: (NSString *) theMode { //NSLog(@"timed out event!"); return nil; } // // // - (void) addRunLoopMode: (NSString *) theMode { #ifndef MACOSX if (theMode && ![_runLoopModes containsObject: theMode]) { [_runLoopModes addObject: theMode]; } #endif } // // // - (unsigned int) connectionTimeout { return _connectionTimeout; } - (void) setConnectionTimeout: (unsigned int) theConnectionTimeout { _connectionTimeout = (theConnectionTimeout > 0 ? theConnectionTimeout : DEFAULT_TIMEOUT); } - (unsigned int) readTimeout { return _readTimeout; } - (void) setReadTimeout: (unsigned int) theReadTimeout { _readTimeout = (theReadTimeout > 0 ? theReadTimeout: DEFAULT_TIMEOUT); } - (unsigned int) writeTimeout { return _writeTimeout; } - (void) setWriteTimeout: (unsigned int) theWriteTimeout { _writeTimeout = (theWriteTimeout > 0 ? theWriteTimeout : DEFAULT_TIMEOUT); } - (void) startTLS { [self subclassResponsibility: _cmd]; } - (unsigned int) lastCommand { return _lastCommand; } - (NSArray *) capabilities { return _capabilities; } @end // // // @implementation CWService (Private) // // This methods adds watchers on a file descriptor. // It returns 0 if it has completed successfully. // - (int) _addWatchers { int i; // // Under Mac OS X, we must also create a CFSocket and a runloop source in order // to enabled callbacks write read/write availability. // #ifdef MACOSX _context = (CFSocketContext *)malloc(sizeof(CFSocketContext)); memset(_context, 0, sizeof(CFSocketContext)); _context->info = self; _socket = CFSocketCreateWithNative(NULL, [_connection fd], kCFSocketReadCallBack|kCFSocketWriteCallBack, socket_callback, _context); CFSocketDisableCallBacks(_socket, kCFSocketReadCallBack|kCFSocketWriteCallBack); if (!_socket) { //NSLog(@"Failed to create CFSocket from native."); return -1; } _runLoopSource = CFSocketCreateRunLoopSource(NULL, _socket, 1); if (!_runLoopSource) { //NSLog(@"Failed to create the runloop source."); return -1; } CFRunLoopAddSource(CFRunLoopGetCurrent(), _runLoopSource, kCFRunLoopCommonModes); NSMapInsert(fd_to_cfsocket, (void *)[_connection fd], (void *)_socket); #endif // We get ready to monitor for read/write timeouts _timer = [NSTimer timerWithTimeInterval: 1 target: self selector: @selector(_queueTick:) userInfo: nil repeats: YES]; RETAIN(_timer); _counter = 0; //NSLog(@"Adding watchers on %d", [_connection fd]); for (i = 0; i < [_runLoopModes count]; i++) { [[NSRunLoop currentRunLoop] addEvent: (void *)[_connection fd] #ifdef __MINGW32__ type: ET_HANDLE #else type: ET_RDESC #endif watcher: self forMode: [_runLoopModes objectAtIndex: i]]; [[NSRunLoop currentRunLoop] addEvent: (void *)[_connection fd] #ifdef __MINGW32__ type: ET_TRIGGER #else type: ET_EDESC #endif watcher: self forMode: [_runLoopModes objectAtIndex: i]]; [[NSRunLoop currentRunLoop] addTimer: _timer forMode: [_runLoopModes objectAtIndex: i]]; } _connected = YES; POST_NOTIFICATION(PantomimeConnectionEstablished, self, nil); PERFORM_SELECTOR_1(_delegate, @selector(connectionEstablished:), PantomimeConnectionEstablished); [_timer fire]; return 0; } // // // - (void) _removeWatchers { int i; // // If we are not connected, no need to remove the watchers on our file descriptor. // This could also generate a crash under OS X as the _runLoopSource, _socket etc. // ivars aren't initialized. // if (!_connected) { return; } [_timer invalidate]; DESTROY(_timer); _connected = NO; //NSLog(@"Removing all watchers on %d...", [_connection fd]); for (i = 0; i < [_runLoopModes count]; i++) { #ifdef __MINGW32__ [[NSRunLoop currentRunLoop] removeEvent: (void *)[_connection fd] type: ET_HANDLE forMode: [_runLoopModes objectAtIndex: i] all: YES]; [[NSRunLoop currentRunLoop] removeEvent: (void *)[_connection fd] type: ET_TRIGGER forMode: [_runLoopModes objectAtIndex: i] all: YES]; #else [[NSRunLoop currentRunLoop] removeEvent: (void *)[_connection fd] type: ET_RDESC forMode: [_runLoopModes objectAtIndex: i] all: YES]; [[NSRunLoop currentRunLoop] removeEvent: (void *)[_connection fd] type: ET_WDESC forMode: [_runLoopModes objectAtIndex: i] all: YES]; [[NSRunLoop currentRunLoop] removeEvent: (void *)[_connection fd] type: ET_EDESC forMode: [_runLoopModes objectAtIndex: i] all: YES]; #endif } #ifdef MACOSX if (CFRunLoopSourceIsValid(_runLoopSource)) { CFRunLoopSourceInvalidate(_runLoopSource); CFRelease(_runLoopSource); } if (CFSocketIsValid(_socket)) { CFSocketInvalidate(_socket); } NSMapRemove(fd_to_cfsocket, (void *)[_connection fd]); CFRelease(_socket); free(_context); #endif } // // // - (void) _connectionTick: (id) sender { if ((_counter/10) == _connectionTimeout) { [_timer invalidate]; DESTROY(_timer); POST_NOTIFICATION(PantomimeConnectionTimedOut, self, nil); PERFORM_SELECTOR_1(_delegate, @selector(connectionTimedOut:), PantomimeConnectionTimedOut); return; } if ([_connection isConnected]) { [_timer invalidate]; DESTROY(_timer); [self _addWatchers]; return; } _counter++; } // // // - (void) _queueTick: (id) sender { if ([_queue count]) { if (_counter == _readTimeout) { NSLog(@"Waited %d secs, read/write timeout", _readTimeout); [_timer invalidate]; DESTROY(_timer); POST_NOTIFICATION(PantomimeConnectionTimedOut, self, nil); PERFORM_SELECTOR_1(_delegate, @selector(connectionTimedOut:), PantomimeConnectionTimedOut); } _counter++; } else { _counter = 0; } } @end pantomime1.2-1.2.2+dfsg1/Framework/Pantomime/CWStore.h000066400000000000000000000170411276751561200223320ustar00rootroot00000000000000/* ** CWStore.h ** ** Copyright (c) 2001-2006 ** ** Author: Ludovic Marcotte ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** You should have received a copy of the GNU Lesser General Public ** License along with this library; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef _Pantomime_H_CWStore #define _Pantomime_H_CWStore #import #import #include /*! @const PantomimeFolderCreateCompleted */ extern NSString* PantomimeFolderCreateCompleted; /*! @const PantomimeFolderCreateFailed */ extern NSString* PantomimeFolderCreateFailed; /*! @const PantomimeFolderDeleteCompleted */ extern NSString* PantomimeFolderDeleteCompleted; /*! @const PantomimeFolderDeleteFailed */ extern NSString* PantomimeFolderDeleteFailed; /*! @const PantomimeFolderRenameCompleted */ extern NSString* PantomimeFolderRenameCompleted; /*! @const PantomimeFolderRenameFailed */ extern NSString* PantomimeFolderRenameFailed; @class CWFolder; @class CWURLName; /*! @protocol CWStore @discussion This protocol defines a basic set of methods that classes implementing the protocol must implement in order to offer all the required functionalities of a message store. CWIMAPStore, CWLocalStore and CWPOP3Store are classes that currently implement this protocol. */ @protocol CWStore /*! @method initWithURL: @discussion This method is used to initialize a Store instance using the specified URL. theURL. @param theURL The URL, as a CWURLName instance. @result A CWStore subclass instance, nil on error. */ - (id) initWithURL: (CWURLName *) theURL; /*! @method defaultFolder @discussion This method is used to obtain the default folder of the receiver. For example, CWPOP3Store will always return the "INBOX" folder as no other folder is accessible in POP3. @result A CWFolder subclass instance. */ - (id) defaultFolder; /*! @method folderForName: @discussion This method is used to obtain a CWFolder instance with the specifed name. @param theName The name of the folder to obtain. @result A CWFolder subclass instance. */ - (id) folderForName: (NSString *) theName; /*! @method folderForURL: @discussion This method is used to obtain a Folder instance with the specifed URL. theURL must be in form which is understood by the CWURLName class. @param theURL The URL, as a NSString instance. @result A CWFolder subclass instance. */ - (id) folderForURL: (NSString *) theURL; /*! @method folderEnumerator @discussion This method is used to get the list of all available folders on the receiver. The name of the folders are returned, not actual CWFolder subclass instances. @result The list of folder names. */ - (NSEnumerator *) folderEnumerator; /*! @method subscribedFolderEnumerator @discussion This method is used to get the list of subscribed folders on the receiver. The name of the folders are returned, not actual CWFolder subclass instances. This generally returns a subset of the list returned by -folderEnumerator. @result The list of folder names. */ - (NSEnumerator *) subscribedFolderEnumerator; /*! @method openFoldersEnumerator @discussion This method is used to obtain all the CWFolder subclass instance which are in the open state in the receiver. @result The list of open folders. */ - (NSEnumerator *) openFoldersEnumerator; /*! @method removeFolderFromOpenFolders: @discussion This method is used to remove the specified folder from the list of open folders in the receiver. Normally, you should never invoke this method directly. @param theFolder The CWFolder subclass instance to remove from the list of open folders. */ - (void) removeFolderFromOpenFolders: (CWFolder *) theFolder; /*! @method folderForNameIsOpen: @discussion This method is used to verify if the folder with the specified name is in an open state in the receiver. @result YES if it is in an open state, NO otherwise. */ - (BOOL) folderForNameIsOpen: (NSString *) theName; /*! @method folderTypeForFolderName: @discussion This method is used to obtain the folder type of the specified folder name. The returned value is part of the folderTypeForFolderName enum. @param theName The name of the folder. @result The type of the folder. */ - (PantomimeFolderType) folderTypeForFolderName: (NSString *) theName; /*! @method folderSeparator @discussion This method is used to obtain the folder separator of the receiver. The separator hierarchically separates folders. Returned values are generatlly either '/' or '.'. @result The folder separator, 0 if none was set. For example, in CWIMAPStore, this method will return NULL if -folderEnumerator or -subscribedFolderEnumerator was not invoked before calling this method. */ - (unsigned char) folderSeparator; /*! @method close @discussion This method is used to close the receiver. Classes implementing the CWStore protocol will also release all resources, like open folders, CWConnection instances, etc. */ - (void) close; /*! @method createFolderWithName:type:contents: @discussion This method is used to create a new folder with the specified name, type and contents. On success, it posts the PantomimeFolderCreateCompleted notification and calls -folderCreateCompleted: on the delegate. On failure, it posts the PantomimeFolderCreateFailed notification and calls -folderCreateFailed: on the delegate. @param theName The name of the folder to create. It must be a full path. @param theType The folder type. Accepted values are part of the PantomimeFolderFormat enum. @param theContents The initial content of the folder. It must be in mbox format. */ - (void) createFolderWithName: (NSString *) theName type: (PantomimeFolderFormat) theType contents: (NSData *) theContents; /*! @method deleteFolderWithName: @discussion This method is used to delete the folder specified by theName. On success, it posts the PantomimeFolderDeleteCompleted notification. On error, it posts the PantomimeFolderDeleteFailed notification. @param theName The name of the folder to delete. */ - (void) deleteFolderWithName: (NSString *) theName; /*! @method renameFolderWithName:toName: @discussion This method is used to rename a folder. On success, this method posts a PantomimeFolderRenameCompleted notification. On error, it posts a PantomimeFolderRenameFailed notification. @param theName The name of the folder to rename. @param theNewName The name of the folder to rename it to. */ - (void) renameFolderWithName: (NSString *) theName toName: (NSString *) theNewName; @end #endif // _Pantomime_H_CWStore pantomime1.2-1.2.2+dfsg1/Framework/Pantomime/CWTCPConnection.h000066400000000000000000000042461276751561200237070ustar00rootroot00000000000000/* ** CWTCPConnection.h ** ** Copyright (c) 2001-2007 ** ** Author: Ludovic Marcotte ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** You should have received a copy of the GNU Lesser General Public ** License along with this library; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef _Pantomime_H_CWTCPConnection #define _Pantomime_H_CWTCPConnection #include #define id openssl_id #define MD5 MDFIVE #include #undef MD5 #undef id #import /*! @class CWTCPConnection @discussion This class, which implements the CWConnection protocol, offers an elegant interface to a TCP connection. See the documentation of the CWConnection protocol in order to see all the methods one can use on an instance of this class. Normally, you should never have to use this class or one of its methods directly. */ @interface CWTCPConnection : NSObject { @public BOOL ssl_handshaking; @private NSString *_name; unsigned int _connectionTimeout; unsigned int _port; int _fd; BOOL _dns_resolution_completed; SSL_CTX *_ctx; SSL *_ssl; } /*! @method startSSL @discussion This method is used to start the SSL handshaking on an altready established TCP connection. @result 0 on success, < 0 on error. */ - (int) startSSL; /*! @method isSSL @discussion This method is used to verify if the connection TCP connection is using SSL or not. @result YES if using SSL, NO otherwise. */ - (BOOL) isSSL; @end #endif // _Pantomime_H_CWTCPConnection pantomime1.2-1.2.2+dfsg1/Framework/Pantomime/CWTCPConnection.m000066400000000000000000000232101276751561200237040ustar00rootroot00000000000000/* ** CWTCPConnection.m ** ** Copyright (c) 2001-2007 ** ** Author: Ludovic Marcotte ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** You should have received a copy of the GNU Lesser General Public ** License along with this library; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include #include #include #include #include #include //test #include #include #include #ifdef __MINGW32__ #include #else #include #include #include #include #endif #include #include #include #include // For read() and write() and close() #ifdef MACOSX #include // For read() and write() on OS X #endif #ifndef FIONBIO #include // For FIONBIO on Solaris #endif #define DEFAULT_TIMEOUT 60 // // // @interface CWTCPConnection (Private) - (void) _DNSResolutionCompleted: (NSNotification *) theNotification; - (void) _DNSResolutionFailed: (NSNotification *) theNotification; @end // // // @implementation CWTCPConnection + (void) initialize { SSL_library_init(); SSL_load_error_strings(); } // // // - (id) initWithName: (NSString *) theName port: (unsigned int) thePort background: (BOOL) theBOOL { return [self initWithName: theName port: thePort connectionTimeout: DEFAULT_TIMEOUT readTimeout: DEFAULT_TIMEOUT writeTimeout: DEFAULT_TIMEOUT background: theBOOL]; } // // This methods throws an exception if the connection timeout // is exhausted and the connection hasn't been established yet. // - (id) initWithName: (NSString *) theName port: (unsigned int) thePort connectionTimeout: (unsigned int) theConnectionTimeout readTimeout: (unsigned int) theReadTimeout writeTimeout: (unsigned int) theWriteTimeout background: (BOOL) theBOOL { NSArray *addresses; struct sockaddr_in server; #ifdef __MINGW32__ u_long nonblock = 1; #else int nonblock = 1; #endif if (theName == nil || thePort <= 0) { AUTORELEASE(self); return nil; } _connectionTimeout = theConnectionTimeout; ASSIGN(_name, theName); _port = thePort; _dns_resolution_completed = ssl_handshaking = NO; _ssl = NULL; // We get the file descriptor associated to a socket _fd = socket(PF_INET, SOCK_STREAM, 0); if (_fd == -1) { AUTORELEASE(self); return nil; } [[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(_DNSResolutionCompleted:) name: PantomimeDNSResolutionCompleted object: nil]; [[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(_DNSResolutionFailed:) name: PantomimeDNSResolutionFailed object: nil]; if (!theBOOL) { addresses = [[CWDNSManager singleInstance] addressesForName: theName background: NO]; if (!addresses) { safe_close(_fd); AUTORELEASE(self); return nil; } _dns_resolution_completed = YES; server.sin_family = AF_INET; server.sin_addr.s_addr = [[addresses objectAtIndex: 0] intValue]; server.sin_port = htons(thePort); // If we don't connect in background, we must try to connect right away // and return on any errors. if (connect(_fd, (struct sockaddr *)&server, sizeof(server)) != 0) { AUTORELEASE(self); return nil; } } // We set the non-blocking I/O flag on _fd #ifdef __MINGW32__ if (ioctlsocket(_fd, FIONBIO, &nonblock) == -1) #else if (ioctl(_fd, FIONBIO, &nonblock) == -1) #endif { safe_close(_fd); AUTORELEASE(self); return nil; } if (theBOOL) [[CWDNSManager singleInstance] addressesForName: theName background: YES]; return self; } // // // - (void) dealloc { //NSLog(@"TCPConnection: -dealloc"); [[NSNotificationCenter defaultCenter] removeObserver: self]; RELEASE(_name); if (_ssl) { SSL_free(_ssl); } if (_ctx) { SSL_CTX_free(_ctx); } [super dealloc]; } // // This method is used to return the file descriptor // associated with our socket. // - (int) fd { return _fd; } // // // - (BOOL) isConnected { struct timeval timeout; fd_set fdset; int value; if (!_dns_resolution_completed) { return NO; } // We remove all descriptors from the set fdset FD_ZERO(&fdset); // We add the descriptor _fd to the fdset set FD_SET(_fd, &fdset); // We set the timeout for our connection timeout.tv_sec = 0; timeout.tv_usec = 1; value = select(_fd + 1, NULL, &fdset, NULL, &timeout); // An error occured.. if (value == -1) { return NO; } // Our fdset has ready descriptors (for writability) else if (value > 0) { #ifdef __MINGW32__ int size; #else socklen_t size; #endif int error; size = sizeof(error); // We get the options at the socket level (so we use SOL_SOCKET) // returns -1 on error, 0 on success if (getsockopt(_fd, SOL_SOCKET, SO_ERROR, &error, &size) == -1) { return NO; } if (error != 0) { #warning handle right way in CWService tick if the port was incorrectly specified return NO; } } // select() has returned 0 which means that the timeout has expired. else { return NO; } return YES; } // // // - (BOOL) isSSL { return (_ssl ? YES : NO); } // // other methods // - (void) close { //NSLog(@"TCPConnection: -close"); if (_ssl) { SSL_shutdown(_ssl); } safe_close(_fd); _fd = -1; } // // // - (int) read: (char *) buf length: (int) len { if (ssl_handshaking) { return 0; } if (_ssl) { return SSL_read(_ssl, buf, len); } return safe_recv(_fd, buf, len, 0); } // // // - (int) write: (char *) buf length: (int) len { if (ssl_handshaking) { return 0; } if (_ssl) { return SSL_write(_ssl, buf, len); } return send(_fd, buf, len, 0); } // // 0 -> success // -1 -> // -2 -> handshake error // - (int) startSSL { int ret; // For now, we do not verify the certificates... _ctx = SSL_CTX_new(SSLv23_client_method()); SSL_CTX_set_verify(_ctx, SSL_VERIFY_NONE, NULL); SSL_CTX_set_mode(_ctx, SSL_MODE_ENABLE_PARTIAL_WRITE); // We then connect the SSL socket _ssl = SSL_new(_ctx); SSL_set_fd(_ssl, _fd); ret = SSL_connect(_ssl); if (ret != 1) { int rc; rc = SSL_get_error(_ssl, ret); if ((rc != SSL_ERROR_WANT_READ) && (rc != SSL_ERROR_WANT_WRITE)) { // SSL handshake error... //NSLog(@"SSL handshake error."); return -2; } else { NSDate *limit; //NSLog(@"SSL handshaking... %d", rc); ssl_handshaking = YES; limit = [[NSDate alloc] initWithTimeIntervalSinceNow: DEFAULT_TIMEOUT]; while ((rc == SSL_ERROR_WANT_READ || rc == SSL_ERROR_WANT_WRITE) && [limit timeIntervalSinceNow] > 0.0) { [[NSRunLoop currentRunLoop] runUntilDate: [NSDate dateWithTimeIntervalSinceNow: 0.1]]; ret = SSL_connect(_ssl); //NSLog(@"ret = %d", ret); if (ret != 1) { //int e = errno; rc = SSL_get_error(_ssl, ret); //NSLog(@"%s errno = %s", ERR_error_string(rc, NULL), strerror(e)); } else { rc = SSL_ERROR_NONE; } //NSLog(@"rc = %d", rc); } RELEASE(limit); if (rc != SSL_ERROR_NONE) { //NSLog(@"ERROR DURING HANDSHAKING..."); //NSLog(@"unable to make SSL connection: %s", ERR_error_string(rc, NULL)); //ERR_print_errors_fp(stderr); ssl_handshaking = NO; SSL_free(_ssl); _ssl = NULL; return -2; } // We are done with handshaking ssl_handshaking = NO; } } // Everything went all right, let's tell our caller. return 0; } @end // // // @implementation CWTCPConnection (Private) - (void) _DNSResolutionCompleted: (NSNotification *) theNotification { struct sockaddr_in server; if (![[[theNotification userInfo] objectForKey: @"Name"] isEqualToString: _name]) { return; } //NSLog(@"DNS resolution completed for name |%@|", [[theNotification userInfo] objectForKey: @"Name"]); [[NSNotificationCenter defaultCenter] removeObserver: self]; _dns_resolution_completed = YES; server.sin_family = AF_INET; server.sin_addr.s_addr = [[[theNotification userInfo] objectForKey: @"Address"] intValue]; server.sin_port = htons(_port); // We initiate our connection to the socket if (connect(_fd, (struct sockaddr *)&server, sizeof(server)) == -1) { #ifdef __MINGW32__ if (WSAGetLastError() == WSAEWOULDBLOCK) #else if (errno == EINPROGRESS) #endif { return; } // if ( errno == EINPROGRESS ) ... else { NSLog(@"Failed to connect asynchronously."); safe_close(_fd); } } // if ( connect(...) ) } // // // - (void) _DNSResolutionFailed: (NSNotification *) theNotification { //NSLog(@"DNS resolution failed!"); _dns_resolution_completed = YES; safe_close(_fd); [[NSNotificationCenter defaultCenter] removeObserver: self]; } @end pantomime1.2-1.2.2+dfsg1/Framework/Pantomime/CWTransport.h000066400000000000000000000113221276751561200232260ustar00rootroot00000000000000/* ** CWTransport.h ** ** Copyright (c) 2001-2006 ** ** Author: Ludovic Marcotte ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** You should have received a copy of the GNU Lesser General Public ** License along with this library; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef _Pantomime_H_CWTransport #define _Pantomime_H_CWTransport #import #import #import /*! @const PantomimeMessageSent */ extern NSString* PantomimeMessageSent; /*! @const PantomimeMessageNotSent */ extern NSString* PantomimeMessageNotSent; @class CWMessage; /*! @category NSObject (TransportClient) @discussion This informal protocol defines methods that can implemented in CWTransport's delegate (CWSMTP or CWSendmail instances) to control the behavior of the class or to obtain status information. */ @interface NSObject (TransportClient) /*! @method messageSent: @discussion This method is automatically invoked on the delegate after the SMTP DATA command has completed. The userInfo's part of the notification contains the message that has been sent. The key to obtain it is "Message". A PantomimeMessageSent notification is also posted. @param theNotification The notification holding the information. */ - (void) messageSent: (NSNotification *) theNotification; /*! @method messageNotSent: @discussion This method is automatically invoked on the delegate if any error occurs when trying to send a message (like if a SMTP server won't relay our mails). The userInfo's part of the notification contains the message that has not been sent. The key to obtain it is "Message". A PantomimeMessageNotSent notification is also posted. @param theNotification The notification holding the information. */ - (void) messageNotSent: (NSNotification *) theNotification; @end /*! @protocol CWTransport @discussion This protocol defines a generic interface for sending messages. The CWSMTP and CWSendmail classes fully implement this protocol. */ @protocol CWTransport /*! @method sendMessage @discussion This method sends the message previously set with -setMessage: or -setMessageData:. It posts a PantomimeTransportMessageNotSent notification (and calls -messageNotSent: on the delegate, if any) if the message could not be sent. It ports a PantomimeTransportMessageSent notification (and calls -messageSent: on the delegate, if any) if the message has been successfully sent. This method is fully asynchronous. */ - (void) sendMessage; /*! @method setMessage: @discussion This method is used to set the message (instance of the CWMessage class) that the transport class will eventually send (by calling -sendMessage). @param theMessage The message to send. */ - (void) setMessage: (CWMessage *) theMessage; /*! @method message @discussion This method is used to obtain the Message instance previously set by calling -setMessage: @result The CWMessage instance. */ - (CWMessage *) message; /*! @method setMessageData: @discussion This method is used to set the message (as raw source) that the transport class will eventually send (by calling -sendMessage). @param theMessage The message to send. */ - (void) setMessageData: (NSData *) theData; /*! @method messageData @discussion This method is used to obtain the message (its raw representation) previously set by calling -setMessageData: @result The message's raw representation. */ - (NSData *) messageData; /*! @method setRecipients: @discussion This method is used to specify the recipients of the message. @param theRecipients An NSArray instance which contains CWInternetAddress instances for all recipients. */ - (void) setRecipients: (NSArray *) theRecipients; /*! @method recipients @discussion This method is used to obtain the recipients set when calling -setRecipients:. @result The array of recipients. */ - (NSArray *) recipients; @end #endif // _Pantomime_H_CWTransport pantomime1.2-1.2.2+dfsg1/Framework/Pantomime/CWURLName.h000066400000000000000000000067621276751561200225110ustar00rootroot00000000000000/* ** CWURLName.h ** ** Copyright (c) 2001-2004 ** ** Author: Ludovic Marcotte ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** You should have received a copy of the GNU Lesser General Public ** License along with this library; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef _Pantomime_H_CWURLName #define _Pantomime_H_CWURLName #import #import /*! @class CWURLName @discussion This class provides support for handling POP3, IMAP and local URL schemes. The POP3 URL scheme is described in RFC 2384. The IMAP URL scheme is described in RFC 2192 while the local URL scheme is a simple Pantomime scheme to refer to local mailboxes. */ @interface CWURLName : NSObject { @private NSString *_protocol; NSString *_foldername; NSString *_path; NSString *_host; unsigned int _port; NSString *_username; NSString *_password; } /*! @method initWithString: @discussion This method invokes -initWithString: path: with a nil path. @param theString The URL. @result A CWURLName instance, nil on error. */ - (id) initWithString: (NSString *) theString; /*! @method initWithString: path: @discussion This is the designated initializer for the URLName class. @param theString The URL. @param thePath The path to the local mailstore. @result A CWURLName instance, nil on error. */ - (id) initWithString: (NSString *) theString path: (NSString *) thePath; /*! @method protocol @discussion This method is used to obtain the protocol part of an URL. @result POP3, IMAP or LOCAL. */ - (NSString *) protocol; /*! @method foldername @discussion This method is used to obtain the name of the folder of the receiver. @result The name of the folder. */ - (NSString *) foldername; /*! @method path @discussion This method is used to obtain the path to the mailstore. @result The full path. */ - (NSString *) path; /*! @method host @discussion This method is used to obtain the host name part of an URL. @result The host name. */ - (NSString *) host; /*! @method host @discussion This method is used to obtain the port part of an URL. @result The port. */ - (unsigned int) port; /*! @method username @discussion This method is used to obtain the username part of an URL. @result The username. */ - (NSString *) username; /*! @method password @discussion This method is used to obtain the password part of an URL. @result The password. */ - (NSString *) password; /*! @method stringValue @discussion This method is used to obtain the string representation of the receiver. The returned format is the same as one that could be used by an initializer. @result The string value. */ - (NSString *) stringValue; @end #endif // _Pantomime_H_CWURLName pantomime1.2-1.2.2+dfsg1/Framework/Pantomime/CWURLName.m000066400000000000000000000144671276751561200225170ustar00rootroot00000000000000/* ** CWURLName.m ** ** Copyright (c) 2001-2004 ** ** Author: Ludovic Marcotte ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** You should have received a copy of the GNU Lesser General Public ** License along with this library; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include #include #include // // Private methods // @interface CWURLName (Private) - (void) _decodeIMAP: (NSString *) theString; - (void) _decodeLocal: (NSString *) theString; - (void) _decodePOP3: (NSString *) theString; - (void) _decodeURL: (NSString *) theString; @end // // // @implementation CWURLName - (id) initWithString: (NSString *) theString { return [self initWithString: theString path: nil]; } // // // - (id) initWithString: (NSString *) theString path: (NSString *) thePath { self = [super init]; // We initialize our ivars _protocol = nil; _foldername = nil; _host = nil; _port = 0; _username = nil; _password = nil; _path = thePath; if (_path) { RETAIN(_path); } // We now decode our URL [self _decodeURL: theString]; return self; } // // // - (void) dealloc { TEST_RELEASE(_protocol); TEST_RELEASE(_foldername); TEST_RELEASE(_path); TEST_RELEASE(_host); TEST_RELEASE(_username); TEST_RELEASE(_password); [super dealloc]; } // // access/mutation methods // - (NSString *) protocol { return _protocol; } - (NSString *) foldername { return _foldername; } - (NSString *) path { return _path; } - (NSString *) host; { return _host; } - (unsigned int) port { return _port; } - (NSString *) username { return _username; } - (NSString *) password { return _password; } - (NSString *) description { return [NSString stringWithFormat: @"protocol = (%@), foldername = (%@), path = (%@), host = (%@), port = (%d), username = (%@), password = (%@)", _protocol, _foldername, _path, _host, _port, _username, _password]; } - (NSString *) stringValue { if ([_protocol caseInsensitiveCompare: @"LOCAL"] == NSOrderedSame) { return [NSString stringWithFormat: @"local://%@/%@", _path, _foldername]; } else if ([_protocol caseInsensitiveCompare: @"IMAP"] == NSOrderedSame) { return [NSString stringWithFormat: @"imap://%@@%@/%@", _username, _host, _foldername]; } else { return [NSString stringWithFormat: @"pop3://%@@%@", _username, _host]; } } @end // // Private methods // @implementation CWURLName (Private) //// FIXME (finish!) // imap:/// // // Examples: imap://minbari.org/gray-council;UIDVALIDITY=385759045/;UID=20 // imap://michael@minbari.org/users.*;type=list // imap://psicorp.org/~peter/%E6%97%A5%E6%9C%AC%E8%AA%9E/ // imap://;AUTH=KERBEROS_V4@minbari.org/gray-council/;uid=20/;section=1.2 // imap://;AUTH=*@minbari.org/gray%20council?SUBJECT%20shadows // // Note: The imap:// part isn't present in the received string as parameter. // - (void) _decodeIMAP: (NSString *) theString { NSRange r1, r2; // We decode the username r1 = [theString rangeOfString: @"@" options: NSBackwardsSearch]; if (r1.length) { _username = [theString substringToIndex: r1.location]; RETAIN(_username); } else { r1.location = 0; } r2 = [theString rangeOfString: @"/" options: 0 range: NSMakeRange(r1.location, [theString length] - r1.location)]; if (r1.length) { _host = [theString substringWithRange: NSMakeRange(r1.location + 1, r2.location - r1.location - 1)]; } else { _host = [theString substringWithRange: NSMakeRange(r1.location, r2.location - r1.location)]; } RETAIN(_host); _foldername = [theString substringFromIndex: (r2.location + 1)]; RETAIN(_foldername); } // // local:/// (full path) // // Note: The local:// part isn't present in the received string as parameter. // - (void) _decodeLocal: (NSString *) theString { // If localMailDirectoryPath is nil, we return the last path component // of the URL as the foldername. if (!_path) { _foldername = [theString lastPathComponent]; RETAIN(_foldername); _path = [theString substringToIndex: ([theString length] - [_foldername length])]; RETAIN(_path); } else { _foldername = [theString substringFromIndex: ([_path length] + 1)]; RETAIN(_foldername); } } // // FIXME (finish!) // pop://;auth=@: // // Examples: pop://rg@mailsrv.qualcomm.com // pop://rg;AUTH=+APOP@mail.eudora.com:8110 // pop://baz;AUTH=SCRAM-MD5@foo.bar // // Note: The pop:// part isn't present in the received string as parameter. // - (void) _decodePOP3: (NSString *) theString { NSRange aRange; _foldername = [[NSString alloc] initWithString: @"INBOX"]; aRange = [theString rangeOfString: @"@"]; _username = [theString substringToIndex: aRange.location]; RETAIN(_username); _host = [theString substringFromIndex: (aRange.location + 1)]; RETAIN(_host); } // // // - (void) _decodeURL: (NSString *) theString { NSRange aRange; // We first decode our protocol. aRange = [theString rangeOfString: @"://"]; if (aRange.length) { NSString *aString; _protocol = [theString substringToIndex: aRange.location]; RETAIN(_protocol); aString = [theString substringFromIndex: (aRange.location + aRange.length)]; if ([_protocol caseInsensitiveCompare: @"LOCAL"] == NSOrderedSame) { [self _decodeLocal: aString]; } else if ([_protocol caseInsensitiveCompare: @"POP3"] == NSOrderedSame) { [self _decodePOP3: aString]; } else if ([_protocol caseInsensitiveCompare: @"IMAP"] == NSOrderedSame) { [self _decodeIMAP: aString]; } } } @end pantomime1.2-1.2.2+dfsg1/Framework/Pantomime/CWUUFile.h000066400000000000000000000071221276751561200223660ustar00rootroot00000000000000/* ** CWUUFile.h ** ** Copyright (c) 2002-2004 ** ** Author: Ludovic Marcotte ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** You should have received a copy of the GNU Lesser General Public ** License along with this library; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef _Pantomime_H_CWUUFile #define _Pantomime_H_CWUUFile #import #import #import #import /*! @class CWUUFile @abstract Provides an interface to decode information that is uuencoded. @discussion This class provides an interface to decode uuencoded information from a string and access / mutation methods to access or modify the decoded information. */ @interface CWUUFile : NSObject { NSDictionary *_attributes; NSString *_name; NSData *_data; } /*! @method initWithName: data: attributes: @discussion This is the designated initializer for the CWUUFile class. @param theName The name of the file. @param theData The bytes of the file. @param theAttributes The file attributes of the original file. @result An instance of CWUUFile, nil on error. */ - (id) initWithName: (NSString *) theName data: (NSData *) theData attributes: (NSDictionary *) theAttributes; /*! @method name @discussion This method is used to obtain the name of the file. @result The name of the file. */ - (NSString *) name; /*! @method setName: @discussion This method is used to set the name of the file. @param theName The name of the file. */ - (void) setName: (NSString *) theName; /*! @method data @discussion This method is used to obtain the bytes of the file, as an NSData instance. @result The bytes of the file. */ - (NSData *) data; /*! @method setData: @discussion This method is used to set the bytes of the file, as an NSData instance. @param theData The bytes of the file. */ - (void) setData: (NSData *) theData; /*! @method data @discussion This method is used to obtain the attributes of the file, @result The attributes of the file. */ - (NSDictionary *) attributes; /*! @method setAttributes: @discussion This method is used to set the attributes of the file. @param theName The attributes of the file. */ - (void) setAttributes: (NSDictionary *) theAttributes; /*! @method fileFromUUEncodedString: @discussion This method will decode a uuencoded file from theString. You must pass the entire string of the uuencoded file, and only this. @result The CWUUFile instance. */ + (CWUUFile *) fileFromUUEncodedString: (NSString *) theString; /*! @method rangeOfUUEncodedStringFromString: range: @discussion This method is used to obtain the range of a uuencoded file from theString in theRange. @result The range of the uuencoded file. */ + (NSRange) rangeOfUUEncodedStringFromString: (NSString *) theString range: (NSRange) theRange; @end #endif // _Pantomime_H_CWUUFile pantomime1.2-1.2.2+dfsg1/Framework/Pantomime/CWUUFile.m000066400000000000000000000102341276751561200223710ustar00rootroot00000000000000/* ** CWUUFile.m ** ** Copyright (c) 2002-2004 ** ** Author: Ludovic Marcotte ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** You should have received a copy of the GNU Lesser General Public ** License along with this library; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include #include #include #include #include #define UUDECODE(c) (((c) - ' ') & 077) // // // void uudecodeline(char *line, NSMutableData *data) { int c, len; len = UUDECODE(*line++); while (len) { c = UUDECODE(*line) << 2 | UUDECODE(line[1]) >> 4; [data appendBytes: &c length: 1]; if (--len) { c = UUDECODE(line[1]) << 4 | UUDECODE(line[2]) >> 2; [data appendBytes: &c length: 1]; if (--len) { c = UUDECODE(line[2]) << 6 | UUDECODE(line[3]); [data appendBytes: &c length: 1]; len--; } } line += 4; } return; } // // // @implementation CWUUFile - (id) initWithName: (NSString *) theName data: (NSData *) theData attributes: (NSDictionary *) theAttributes { self = [super init]; [self setName: theName]; [self setData: theData]; [self setAttributes: theAttributes]; return self; } // // // - (void) dealloc { RELEASE(_name); RELEASE(_data); RELEASE(_attributes); [super dealloc]; } // // access / mutation methods // - (NSString *) name { return _name; } - (void) setName: (NSString *) theName { ASSIGN(_name, theName); } // // // - (NSData *) data { return _data; } - (void) setData: (NSData *) theData { ASSIGN(_data, theData); } // // // - (NSDictionary *) attributes { return _attributes; } - (void) setAttributes: (NSDictionary *) theAttributes { ASSIGN(_attributes, theAttributes); } // // // + (CWUUFile *) fileFromUUEncodedString: (NSString *) theString { NSString *aString, *aFilename; NSNumber *theFilePermissions; NSMutableData *aMutableData; NSArray *allLines; CWUUFile *aUUFile; int i, count; aMutableData = [NSMutableData dataWithCapacity: [theString length]]; allLines = [theString componentsSeparatedByString: @"\n"]; // We decode our filename and our mode aString = [allLines objectAtIndex: 0]; theFilePermissions = [NSNumber numberWithInt: [[[aString componentsSeparatedByString: @" "] objectAtIndex: 1] intValue]]; aFilename = [[aString componentsSeparatedByString: @" "] objectAtIndex: 2]; // We now get the data representing our uuencoding string count = [allLines count]-1; for (i = 1; i < count; i++) { uudecodeline((char *)[[allLines objectAtIndex: i] cString], aMutableData); } // We finally initialize our file wrapper will all our informations aUUFile = [[CWUUFile alloc] initWithName: aFilename data: aMutableData attributes: [NSDictionary dictionaryWithObject: theFilePermissions forKey: NSFilePosixPermissions]]; return AUTORELEASE(aUUFile); } // // FIXME, we currently ignore theRange // + (NSRange) rangeOfUUEncodedStringFromString: (NSString *) theString range: (NSRange) theRange { NSRange r1, r2; r1 = [theString rangeOfString: @"begin "]; if (r1.length == 0) { return NSMakeRange(NSNotFound, 0); } r2 = [theString rangeOfString: @"\nend" options: 0 range: NSMakeRange(r1.location, [theString length] - r1.location)]; if (r2.length == 0) { return NSMakeRange(NSNotFound, 0); } return NSMakeRange(r1.location, (r2.location + r2.length) - r1.location); } @end pantomime1.2-1.2.2+dfsg1/Framework/Pantomime/CWVirtualFolder.h000066400000000000000000000033661276751561200240250ustar00rootroot00000000000000/* ** CWVirtualFolder.h ** ** Copyright (c) 2003-2004 ** ** Author: Ludovic Marcotte ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** You should have received a copy of the GNU Lesser General Public ** License along with this library; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef _Pantomime_H_CWVirtualFolder #define _Pantomime_H_CWVirtualFolder #include #import /*! @class CWVirtualFolder @abstract Description pending. Do not use. @discussion Description pending. Do not use. */ @interface CWVirtualFolder : CWFolder { @private NSMutableArray *_allFolders; } /*! @method addFolder: @discussion Description pending. Do not use. @param theFolder Description pending. Do not use. */ - (void) addFolder: (CWFolder *) theFolder; /*! @method removeFolder: @discussion Description pending. Do not use. @param theFolder Description pending. Do not use. */ - (void) removeFolder: (CWFolder *) theFolder; /*! @method setDelegate: @discussion Description pending. Do not use. @param theDelegate Description pending. Do not use. */ - (void) setDelegate: (id) theDelegate; @end #endif // _Pantomime_H_CWVirtualFolder pantomime1.2-1.2.2+dfsg1/Framework/Pantomime/CWVirtualFolder.m000066400000000000000000000064711276751561200240320ustar00rootroot00000000000000/* ** CWVirtualFolder.m ** ** Copyright (c) 2003-2004 ** ** Author: Ludovic Marcotte ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** You should have received a copy of the GNU Lesser General Public ** License along with this library; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include #include // // // @implementation CWVirtualFolder - (id) initWithName: (NSString *) theName { self = [super initWithName: theName]; _allFolders = [[NSMutableArray alloc] init]; return self; } // // // - (void) dealloc { RELEASE(_allFolders); [super dealloc]; } // // New, VitualFolder specific methods. // - (void) addFolder: (CWFolder *) theFolder { NSMutableArray *aMutableArray; if (!theFolder) return; [_allFolders addObject: theFolder]; aMutableArray = [[NSMutableArray alloc] initWithArray: self->allMessages]; [aMutableArray addObjectsFromArray: theFolder->allMessages]; [super setMessages: aMutableArray]; RELEASE(aMutableArray); } - (void) removeFolder: (CWFolder *) theFolder { if (!theFolder) return; [_allFolders removeObject: theFolder]; } // // Re-implementations of some methods // - (void) close { [_allFolders makeObjectsPerformSelector: @selector(close)]; [_allFolders removeAllObjects]; } // // When doing an expunge on a virtual folder, we must re-initialize // the allMessages ivar since it's holding messages potentially removed // from the real Folder objects. // #warning FIXME - (void) expunge: (BOOL) returnDeletedMessages { #if 0 NSMutableArray *aMutableArray; int i; aMutableArray = [[NSMutableArray alloc] init]; [self->allMessages removeAllObjects]; for (i = 0; i < [_allFolders count]; i++) { // We first expunge all messages [aMutableArray addObjectsFromArray: [[_allFolders objectAtIndex: i] expunge: returnDeletedMessages]]; // We add back our messages... [self->allMessages addObjectsFromArray: ((Folder *)[_allFolders objectAtIndex: i])->allMessages]; } [self updateCache]; return AUTORELEASE(aMutableArray); #endif } // // When we search in a virtual folder, we search in all folders and // we concatenate all the search results. // - (void) search: (NSString *) theString mask: (PantomimeSearchMask) theMask options: (PantomimeSearchOption) theOptions { #warning FIXME #if 0 NSMutableArray *aMutableArray; int i; aMutableArray = [[NSMutableArray alloc] init]; for (i = 0; i < [_allFolders count]; i++) { [aMutableArray addObjectsFromArray: [[_allFolders objectAtIndex: i] search: theString mask: theMask options: theOptions]]; } AUTORELEASE(aMutableArray); #endif } - (void) setDelegate: (id) theDelegate { // Go through all IMAP folder and set it. } @end pantomime1.2-1.2.2+dfsg1/Framework/Pantomime/CWWINDOWS_1250.h000066400000000000000000000020311276751561200230300ustar00rootroot00000000000000/* ** CWWINDOWS_1250.h ** ** Copyright (c) 2001-2004 ** ** Author: Ludovic Marcotte ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** You should have received a copy of the GNU Lesser General Public ** License along with this library; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef _Pantomime_H_CWWINDOW_1250 #define _Pantomime_H_CWWINDOW_1250 #include @interface CWWINDOWS_1250 : CWCharset @end #endif // _Pantomime_H_CWWINDOW_1250 pantomime1.2-1.2.2+dfsg1/Framework/Pantomime/CWWINDOWS_1250.m000066400000000000000000000070051276751561200230430ustar00rootroot00000000000000#include static struct charset_code code_table[]={ {0x20,0x0020}, {0x21,0x0021}, {0x22,0x0022}, {0x23,0x0023}, {0x24,0x0024}, {0x25,0x0025}, {0x26,0x0026}, {0x27,0x0027}, {0x28,0x0028}, {0x29,0x0029}, {0x2a,0x002a}, {0x2b,0x002b}, {0x2c,0x002c}, {0x2d,0x002d}, {0x2e,0x002e}, {0x2f,0x002f}, {0x30,0x0030}, {0x31,0x0031}, {0x32,0x0032}, {0x33,0x0033}, {0x34,0x0034}, {0x35,0x0035}, {0x36,0x0036}, {0x37,0x0037}, {0x38,0x0038}, {0x39,0x0039}, {0x3a,0x003a}, {0x3b,0x003b}, {0x3c,0x003c}, {0x3d,0x003d}, {0x3e,0x003e}, {0x3f,0x003f}, {0x40,0x0040}, {0x41,0x0041}, {0x42,0x0042}, {0x43,0x0043}, {0x44,0x0044}, {0x45,0x0045}, {0x46,0x0046}, {0x47,0x0047}, {0x48,0x0048}, {0x49,0x0049}, {0x4a,0x004a}, {0x4b,0x004b}, {0x4c,0x004c}, {0x4d,0x004d}, {0x4e,0x004e}, {0x4f,0x004f}, {0x50,0x0050}, {0x51,0x0051}, {0x52,0x0052}, {0x53,0x0053}, {0x54,0x0054}, {0x55,0x0055}, {0x56,0x0056}, {0x57,0x0057}, {0x58,0x0058}, {0x59,0x0059}, {0x5a,0x005a}, {0x5b,0x005b}, {0x5c,0x005c}, {0x5d,0x005d}, {0x5e,0x005e}, {0x5f,0x005f}, {0x60,0x0060}, {0x61,0x0061}, {0x62,0x0062}, {0x63,0x0063}, {0x64,0x0064}, {0x65,0x0065}, {0x66,0x0066}, {0x67,0x0067}, {0x68,0x0068}, {0x69,0x0069}, {0x6a,0x006a}, {0x6b,0x006b}, {0x6c,0x006c}, {0x6d,0x006d}, {0x6e,0x006e}, {0x6f,0x006f}, {0x70,0x0070}, {0x71,0x0071}, {0x72,0x0072}, {0x73,0x0073}, {0x74,0x0074}, {0x75,0x0075}, {0x76,0x0076}, {0x77,0x0077}, {0x78,0x0078}, {0x79,0x0079}, {0x7a,0x007a}, {0x7b,0x007b}, {0x7c,0x007c}, {0x7d,0x007d}, {0x7e,0x007e}, {0x80,0x20ac}, {0x82,0x201a}, {0x84,0x201e}, {0x85,0x2026}, {0x86,0x2020}, {0x87,0x2021}, {0x89,0x2030}, {0x8a,0x0160}, {0x8b,0x2039}, {0x8c,0x015a}, {0x8d,0x0164}, {0x8e,0x017d}, {0x8f,0x0179}, {0x91,0x2018}, {0x92,0x2019}, {0x93,0x201c}, {0x94,0x201d}, {0x95,0x2022}, {0x96,0x2013}, {0x97,0x2014}, {0x99,0x2122}, {0x9a,0x0161}, {0x9b,0x203a}, {0x9c,0x015b}, {0x9d,0x0165}, {0x9e,0x017e}, {0x9f,0x017a}, {0xa0,0x00a0}, {0xa1,0x02c7}, {0xa2,0x02d8}, {0xa3,0x0141}, {0xa4,0x00a4}, {0xa5,0x0104}, {0xa6,0x00a6}, {0xa7,0x00a7}, {0xa8,0x00a8}, {0xa9,0x00a9}, {0xaa,0x015e}, {0xab,0x00ab}, {0xad,0x00ad}, {0xae,0x00ae}, {0xaf,0x017b}, {0xb0,0x00b0}, {0xb1,0x00b1}, {0xb2,0x02db}, {0xb3,0x0142}, {0xb4,0x00b4}, {0xb5,0x00b5}, {0xb6,0x00b6}, {0xb7,0x00b7}, {0xb8,0x00b8}, {0xb9,0x0105}, {0xba,0x015f}, {0xbb,0x00bb}, {0xbc,0x013d}, {0xbd,0x02dd}, {0xbe,0x013e}, {0xbf,0x017c}, {0xc0,0x0154}, {0xc1,0x00c1}, {0xc2,0x00c2}, {0xc3,0x0102}, {0xc4,0x00c4}, {0xc5,0x0139}, {0xc6,0x0106}, {0xc7,0x00c7}, {0xc8,0x010c}, {0xc9,0x00c9}, {0xca,0x0118}, {0xcb,0x00cb}, {0xcc,0x011a}, {0xcd,0x00cd}, {0xce,0x00ce}, {0xcf,0x010e}, {0xd0,0x0110}, {0xd1,0x0143}, {0xd2,0x0147}, {0xd3,0x00d3}, {0xd4,0x00d4}, {0xd5,0x0150}, {0xd6,0x00d6}, {0xd7,0x00d7}, {0xd8,0x0158}, {0xd9,0x016e}, {0xda,0x00da}, {0xdb,0x0170}, {0xdc,0x00dc}, {0xdd,0x00dd}, {0xde,0x0162}, {0xdf,0x00df}, {0xe0,0x0155}, {0xe1,0x00e1}, {0xe2,0x00e2}, {0xe3,0x0103}, {0xe4,0x00e4}, {0xe5,0x013a}, {0xe6,0x0107}, {0xe7,0x00e7}, {0xe8,0x010d}, {0xe9,0x00e9}, {0xea,0x0119}, {0xeb,0x00eb}, {0xec,0x011b}, {0xed,0x00ed}, {0xee,0x00ee}, {0xef,0x010f}, {0xf0,0x0111}, {0xf1,0x0144}, {0xf2,0x0148}, {0xf3,0x00f3}, {0xf4,0x00f4}, {0xf5,0x0151}, {0xf6,0x00f6}, {0xf7,0x00f7}, {0xf8,0x0159}, {0xf9,0x016f}, {0xfa,0x00fa}, {0xfb,0x0171}, {0xfc,0x00fc}, {0xfd,0x00fd}, {0xfe,0x0163}, {0xff,0x02d9}, }; @implementation CWWINDOWS_1250 - (id) init { return [super initWithCodeCharTable: code_table length: sizeof(code_table)/sizeof(code_table[0])]; } - (NSString *) name { return @"windows-1250"; } @end pantomime1.2-1.2.2+dfsg1/Framework/Pantomime/CWWINDOWS_1251.h000066400000000000000000000020311276751561200230310ustar00rootroot00000000000000/* ** CWWINDOWS_1251.h ** ** Copyright (c) 2001-2004 ** ** Author: Ludovic Marcotte ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** You should have received a copy of the GNU Lesser General Public ** License along with this library; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef _Pantomime_H_CWWINDOW_1251 #define _Pantomime_H_CWWINDOW_1251 #include @interface CWWINDOWS_1251 : CWCharset @end #endif // _Pantomime_H_CWWINDOW_1251 pantomime1.2-1.2.2+dfsg1/Framework/Pantomime/CWWINDOWS_1251.m000066400000000000000000000071401276751561200230440ustar00rootroot00000000000000#include static struct charset_code code_table[]={ {0x20,0x0020}, {0x21,0x0021}, {0x22,0x0022}, {0x23,0x0023}, {0x24,0x0024}, {0x25,0x0025}, {0x26,0x0026}, {0x27,0x0027}, {0x28,0x0028}, {0x29,0x0029}, {0x2a,0x002a}, {0x2b,0x002b}, {0x2c,0x002c}, {0x2d,0x002d}, {0x2e,0x002e}, {0x2f,0x002f}, {0x30,0x0030}, {0x31,0x0031}, {0x32,0x0032}, {0x33,0x0033}, {0x34,0x0034}, {0x35,0x0035}, {0x36,0x0036}, {0x37,0x0037}, {0x38,0x0038}, {0x39,0x0039}, {0x3a,0x003a}, {0x3b,0x003b}, {0x3c,0x003c}, {0x3d,0x003d}, {0x3e,0x003e}, {0x3f,0x003f}, {0x40,0x0040}, {0x41,0x0041}, {0x42,0x0042}, {0x43,0x0043}, {0x44,0x0044}, {0x45,0x0045}, {0x46,0x0046}, {0x47,0x0047}, {0x48,0x0048}, {0x49,0x0049}, {0x4a,0x004a}, {0x4b,0x004b}, {0x4c,0x004c}, {0x4d,0x004d}, {0x4e,0x004e}, {0x4f,0x004f}, {0x50,0x0050}, {0x51,0x0051}, {0x52,0x0052}, {0x53,0x0053}, {0x54,0x0054}, {0x55,0x0055}, {0x56,0x0056}, {0x57,0x0057}, {0x58,0x0058}, {0x59,0x0059}, {0x5a,0x005a}, {0x5b,0x005b}, {0x5c,0x005c}, {0x5d,0x005d}, {0x5e,0x005e}, {0x5f,0x005f}, {0x60,0x0060}, {0x61,0x0061}, {0x62,0x0062}, {0x63,0x0063}, {0x64,0x0064}, {0x65,0x0065}, {0x66,0x0066}, {0x67,0x0067}, {0x68,0x0068}, {0x69,0x0069}, {0x6a,0x006a}, {0x6b,0x006b}, {0x6c,0x006c}, {0x6d,0x006d}, {0x6e,0x006e}, {0x6f,0x006f}, {0x70,0x0070}, {0x71,0x0071}, {0x72,0x0072}, {0x73,0x0073}, {0x74,0x0074}, {0x75,0x0075}, {0x76,0x0076}, {0x77,0x0077}, {0x78,0x0078}, {0x79,0x0079}, {0x7a,0x007a}, {0x7b,0x007b}, {0x7c,0x007c}, {0x7d,0x007d}, {0x7e,0x007e}, {0x7f,0x007f}, {0x80,0x0402}, {0x81,0x0403}, {0x82,0x201a}, {0x83,0x0453}, {0x84,0x201e}, {0x85,0x2026}, {0x86,0x2020}, {0x87,0x2021}, {0x88,0x20ac}, {0x89,0x2030}, {0x8a,0x0409}, {0x8b,0x2039}, {0x8c,0x040a}, {0x8d,0x040c}, {0x8e,0x040b}, {0x8f,0x040f}, {0x90,0x0452}, {0x91,0x2018}, {0x92,0x2019}, {0x93,0x201c}, {0x94,0x201d}, {0x95,0x2022}, {0x96,0x2013}, {0x97,0x2014}, {0x99,0x2122}, {0x9a,0x0459}, {0x9b,0x203a}, {0x9c,0x045a}, {0x9d,0x045c}, {0x9e,0x045b}, {0x9f,0x045f}, {0xa0,0x00a0}, {0xa1,0x040e}, {0xa2,0x045e}, {0xa3,0x0408}, {0xa4,0x00a4}, {0xa5,0x0490}, {0xa6,0x00a6}, {0xa7,0x00a7}, {0xa8,0x0401}, {0xa9,0x00a9}, {0xaa,0x0404}, {0xab,0x00ab}, {0xac,0x00ac}, {0xad,0x00ad}, {0xae,0x00ae}, {0xaf,0x0407}, {0xb0,0x00b0}, {0xb1,0x00b1}, {0xb2,0x0406}, {0xb3,0x0456}, {0xb4,0x0491}, {0xb5,0x00b5}, {0xb6,0x00b6}, {0xb7,0x00b7}, {0xb8,0x0451}, {0xb9,0x2116}, {0xba,0x0454}, {0xbb,0x00bb}, {0xbc,0x0458}, {0xbd,0x0405}, {0xbe,0x0455}, {0xbf,0x0457}, {0xc0,0x0410}, {0xc1,0x0411}, {0xc2,0x0412}, {0xc3,0x0413}, {0xc4,0x0414}, {0xc5,0x0415}, {0xc6,0x0416}, {0xc7,0x0417}, {0xc8,0x0418}, {0xc9,0x0419}, {0xca,0x041a}, {0xcb,0x041b}, {0xcc,0x041c}, {0xcd,0x041d}, {0xce,0x041e}, {0xcf,0x041f}, {0xd0,0x0420}, {0xd1,0x0421}, {0xd2,0x0422}, {0xd3,0x0423}, {0xd4,0x0424}, {0xd5,0x0425}, {0xd6,0x0426}, {0xd7,0x0427}, {0xd8,0x0428}, {0xd9,0x0429}, {0xda,0x042a}, {0xdb,0x042b}, {0xdc,0x042c}, {0xdd,0x042d}, {0xde,0x042e}, {0xdf,0x042f}, {0xe0,0x0430}, {0xe1,0x0431}, {0xe2,0x0432}, {0xe3,0x0433}, {0xe4,0x0434}, {0xe5,0x0435}, {0xe6,0x0436}, {0xe7,0x0437}, {0xe8,0x0438}, {0xe9,0x0439}, {0xea,0x043a}, {0xeb,0x043b}, {0xec,0x043c}, {0xed,0x043d}, {0xee,0x043e}, {0xef,0x043f}, {0xf0,0x0440}, {0xf1,0x0441}, {0xf2,0x0442}, {0xf3,0x0443}, {0xf4,0x0444}, {0xf5,0x0445}, {0xf6,0x0446}, {0xf7,0x0447}, {0xf8,0x0448}, {0xf9,0x0449}, {0xfa,0x044a}, {0xfb,0x044b}, {0xfc,0x044c}, {0xfd,0x044d}, {0xfe,0x044e}, {0xff,0x044f}, }; @implementation CWWINDOWS_1251 - (id) init { return [super initWithCodeCharTable: code_table length: sizeof(code_table)/sizeof(code_table[0])]; } - (NSString *) name { return @"windows-1251"; } @end pantomime1.2-1.2.2+dfsg1/Framework/Pantomime/CWWINDOWS_1252.h000066400000000000000000000020311276751561200230320ustar00rootroot00000000000000/* ** CWWINDOWS_1252.h ** ** Copyright (c) 2001-2004 ** ** Author: Ludovic Marcotte ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** You should have received a copy of the GNU Lesser General Public ** License along with this library; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef _Pantomime_H_CWWINDOW_1252 #define _Pantomime_H_CWWINDOW_1252 #include @interface CWWINDOWS_1252 : CWCharset @end #endif // _Pantomime_H_CWWINDOW_1252 pantomime1.2-1.2.2+dfsg1/Framework/Pantomime/CWWINDOWS_1252.m000066400000000000000000000070241276751561200230460ustar00rootroot00000000000000#include static struct charset_code code_table[]={ {0x20,0x0020}, {0x21,0x0021}, {0x22,0x0022}, {0x23,0x0023}, {0x24,0x0024}, {0x25,0x0025}, {0x26,0x0026}, {0x27,0x0027}, {0x28,0x0028}, {0x29,0x0029}, {0x2a,0x002a}, {0x2b,0x002b}, {0x2c,0x002c}, {0x2d,0x002d}, {0x2e,0x002e}, {0x2f,0x002f}, {0x30,0x0030}, {0x31,0x0031}, {0x32,0x0032}, {0x33,0x0033}, {0x34,0x0034}, {0x35,0x0035}, {0x36,0x0036}, {0x37,0x0037}, {0x38,0x0038}, {0x39,0x0039}, {0x3a,0x003a}, {0x3b,0x003b}, {0x3c,0x003c}, {0x3d,0x003d}, {0x3e,0x003e}, {0x3f,0x003f}, {0x40,0x0040}, {0x41,0x0041}, {0x42,0x0042}, {0x43,0x0043}, {0x44,0x0044}, {0x45,0x0045}, {0x46,0x0046}, {0x47,0x0047}, {0x48,0x0048}, {0x49,0x0049}, {0x4a,0x004a}, {0x4b,0x004b}, {0x4c,0x004c}, {0x4d,0x004d}, {0x4e,0x004e}, {0x4f,0x004f}, {0x50,0x0050}, {0x51,0x0051}, {0x52,0x0052}, {0x53,0x0053}, {0x54,0x0054}, {0x55,0x0055}, {0x56,0x0056}, {0x57,0x0057}, {0x58,0x0058}, {0x59,0x0059}, {0x5a,0x005a}, {0x5b,0x005b}, {0x5c,0x005c}, {0x5d,0x005d}, {0x5e,0x005e}, {0x5f,0x005f}, {0x60,0x0060}, {0x61,0x0061}, {0x62,0x0062}, {0x63,0x0063}, {0x64,0x0064}, {0x65,0x0065}, {0x66,0x0066}, {0x67,0x0067}, {0x68,0x0068}, {0x69,0x0069}, {0x6a,0x006a}, {0x6b,0x006b}, {0x6c,0x006c}, {0x6d,0x006d}, {0x6e,0x006e}, {0x6f,0x006f}, {0x70,0x0070}, {0x71,0x0071}, {0x72,0x0072}, {0x73,0x0073}, {0x74,0x0074}, {0x75,0x0075}, {0x76,0x0076}, {0x77,0x0077}, {0x78,0x0078}, {0x79,0x0079}, {0x7a,0x007a}, {0x7b,0x007b}, {0x7c,0x007c}, {0x7d,0x007d}, {0x7e,0x007e}, {0x80,0x20ac}, {0x82,0x201a}, {0x83,0x0192}, {0x84,0x201e}, {0x85,0x2026}, {0x86,0x2020}, {0x87,0x2021}, {0x88,0x02c6}, {0x89,0x2030}, {0x8a,0x0160}, {0x8b,0x2039}, {0x8c,0x0152}, {0x8e,0x017d}, {0x91,0x2018}, {0x92,0x2019}, {0x93,0x201c}, {0x94,0x201d}, {0x95,0x2022}, {0x96,0x2013}, {0x97,0x2014}, {0x98,0x02dc}, {0x99,0x2122}, {0x9a,0x0161}, {0x9b,0x203a}, {0x9c,0x0153}, {0x9e,0x017e}, {0x9f,0x0178}, {0xa0,0x00a0}, {0xa1,0x00a1}, {0xa2,0x00a2}, {0xa3,0x00a3}, {0xa4,0x00a4}, {0xa5,0x00a5}, {0xa6,0x00a6}, {0xa7,0x00a7}, {0xa8,0x00a8}, {0xa9,0x00a9}, {0xaa,0x00aa}, {0xab,0x00ab}, {0xac,0x00ac}, {0xad,0x00ad}, {0xae,0x00ae}, {0xaf,0x00af}, {0xb0,0x00b0}, {0xb1,0x00b1}, {0xb2,0x00b2}, {0xb3,0x00b3}, {0xb4,0x00b4}, {0xb5,0x00b5}, {0xb6,0x00b6}, {0xb7,0x00b7}, {0xb8,0x00b8}, {0xb9,0x00b9}, {0xba,0x00ba}, {0xbb,0x00bb}, {0xbc,0x00bc}, {0xbd,0x00bd}, {0xbe,0x00be}, {0xbf,0x00bf}, {0xc0,0x00c0}, {0xc1,0x00c1}, {0xc2,0x00c2}, {0xc3,0x00c3}, {0xc4,0x00c4}, {0xc5,0x00c5}, {0xc6,0x00c6}, {0xc7,0x00c7}, {0xc8,0x00c8}, {0xc9,0x00c9}, {0xca,0x00ca}, {0xcb,0x00cb}, {0xcc,0x00cc}, {0xcd,0x00cd}, {0xce,0x00ce}, {0xcf,0x00cf}, {0xd0,0x00d0}, {0xd1,0x00d1}, {0xd2,0x00d2}, {0xd3,0x00d3}, {0xd4,0x00d4}, {0xd5,0x00d5}, {0xd6,0x00d6}, {0xd7,0x00d7}, {0xd8,0x00d8}, {0xd9,0x00d9}, {0xda,0x00da}, {0xdb,0x00db}, {0xdc,0x00dc}, {0xdd,0x00dd}, {0xde,0x00de}, {0xdf,0x00df}, {0xe0,0x00e0}, {0xe1,0x00e1}, {0xe2,0x00e2}, {0xe3,0x00e3}, {0xe4,0x00e4}, {0xe5,0x00e5}, {0xe6,0x00e6}, {0xe7,0x00e7}, {0xe8,0x00e8}, {0xe9,0x00e9}, {0xea,0x00ea}, {0xeb,0x00eb}, {0xec,0x00ec}, {0xed,0x00ed}, {0xee,0x00ee}, {0xef,0x00ef}, {0xf0,0x00f0}, {0xf1,0x00f1}, {0xf2,0x00f2}, {0xf3,0x00f3}, {0xf4,0x00f4}, {0xf5,0x00f5}, {0xf6,0x00f6}, {0xf7,0x00f7}, {0xf8,0x00f8}, {0xf9,0x00f9}, {0xfa,0x00fa}, {0xfb,0x00fb}, {0xfc,0x00fc}, {0xfd,0x00fd}, {0xfe,0x00fe}, {0xff,0x00ff}, }; @implementation CWWINDOWS_1252 - (id) init { return [super initWithCodeCharTable: code_table length: sizeof(code_table)/sizeof(code_table[0])]; } - (NSString *) name { return @"windows-1252"; } @end pantomime1.2-1.2.2+dfsg1/Framework/Pantomime/CWWINDOWS_1253.h000066400000000000000000000020311276751561200230330ustar00rootroot00000000000000/* ** CWWINDOWS_1253.h ** ** Copyright (c) 2001-2004 ** ** Author: Ludovic Marcotte ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** You should have received a copy of the GNU Lesser General Public ** License along with this library; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef _Pantomime_H_CWWINDOW_1253 #define _Pantomime_H_CWWINDOW_1253 #include @interface CWWINDOWS_1253 : CWCharset @end #endif // _Pantomime_H_CWWINDOW_1253 pantomime1.2-1.2.2+dfsg1/Framework/Pantomime/CWWINDOWS_1253.m000066400000000000000000000065361276751561200230560ustar00rootroot00000000000000#include static struct charset_code code_table[]={ {0x20,0x0020}, {0x21,0x0021}, {0x22,0x0022}, {0x23,0x0023}, {0x24,0x0024}, {0x25,0x0025}, {0x26,0x0026}, {0x27,0x0027}, {0x28,0x0028}, {0x29,0x0029}, {0x2a,0x002a}, {0x2b,0x002b}, {0x2c,0x002c}, {0x2d,0x002d}, {0x2e,0x002e}, {0x2f,0x002f}, {0x30,0x0030}, {0x31,0x0031}, {0x32,0x0032}, {0x33,0x0033}, {0x34,0x0034}, {0x35,0x0035}, {0x36,0x0036}, {0x37,0x0037}, {0x38,0x0038}, {0x39,0x0039}, {0x3a,0x003a}, {0x3b,0x003b}, {0x3c,0x003c}, {0x3d,0x003d}, {0x3e,0x003e}, {0x3f,0x003f}, {0x40,0x0040}, {0x41,0x0041}, {0x42,0x0042}, {0x43,0x0043}, {0x44,0x0044}, {0x45,0x0045}, {0x46,0x0046}, {0x47,0x0047}, {0x48,0x0048}, {0x49,0x0049}, {0x4a,0x004a}, {0x4b,0x004b}, {0x4c,0x004c}, {0x4d,0x004d}, {0x4e,0x004e}, {0x4f,0x004f}, {0x50,0x0050}, {0x51,0x0051}, {0x52,0x0052}, {0x53,0x0053}, {0x54,0x0054}, {0x55,0x0055}, {0x56,0x0056}, {0x57,0x0057}, {0x58,0x0058}, {0x59,0x0059}, {0x5a,0x005a}, {0x5b,0x005b}, {0x5c,0x005c}, {0x5d,0x005d}, {0x5e,0x005e}, {0x5f,0x005f}, {0x60,0x0060}, {0x61,0x0061}, {0x62,0x0062}, {0x63,0x0063}, {0x64,0x0064}, {0x65,0x0065}, {0x66,0x0066}, {0x67,0x0067}, {0x68,0x0068}, {0x69,0x0069}, {0x6a,0x006a}, {0x6b,0x006b}, {0x6c,0x006c}, {0x6d,0x006d}, {0x6e,0x006e}, {0x6f,0x006f}, {0x70,0x0070}, {0x71,0x0071}, {0x72,0x0072}, {0x73,0x0073}, {0x74,0x0074}, {0x75,0x0075}, {0x76,0x0076}, {0x77,0x0077}, {0x78,0x0078}, {0x79,0x0079}, {0x7a,0x007a}, {0x7b,0x007b}, {0x7c,0x007c}, {0x7d,0x007d}, {0x7e,0x007e}, {0x80,0x20ac}, {0x82,0x201a}, {0x83,0x0192}, {0x84,0x201e}, {0x85,0x2026}, {0x86,0x2020}, {0x87,0x2021}, {0x89,0x2030}, {0x8b,0x2039}, {0x91,0x2018}, {0x92,0x2019}, {0x93,0x201c}, {0x94,0x201d}, {0x95,0x2022}, {0x96,0x2013}, {0x97,0x2014}, {0x99,0x2122}, {0x9b,0x203a}, {0xa0,0x00a0}, {0xa1,0x0385}, {0xa2,0x0386}, {0xa3,0x00a3}, {0xa4,0x00a4}, {0xa5,0x00a5}, {0xa6,0x00a6}, {0xa7,0x00a7}, {0xa8,0x00a8}, {0xa9,0x00a9}, {0xab,0x00ab}, {0xac,0x00ac}, {0xad,0x00ad}, {0xae,0x00ae}, {0xaf,0x2015}, {0xb0,0x00b0}, {0xb1,0x00b1}, {0xb2,0x00b2}, {0xb3,0x00b3}, {0xb4,0x0384}, {0xb5,0x00b5}, {0xb6,0x00b6}, {0xb7,0x00b7}, {0xb8,0x0388}, {0xb9,0x0389}, {0xba,0x038a}, {0xbb,0x00bb}, {0xbc,0x038c}, {0xbd,0x00bd}, {0xbe,0x038e}, {0xbf,0x038f}, {0xc0,0x0390}, {0xc1,0x0391}, {0xc2,0x0392}, {0xc3,0x0393}, {0xc4,0x0394}, {0xc5,0x0395}, {0xc6,0x0396}, {0xc7,0x0397}, {0xc8,0x0398}, {0xc9,0x0399}, {0xca,0x039a}, {0xcb,0x039b}, {0xcc,0x039c}, {0xcd,0x039d}, {0xce,0x039e}, {0xcf,0x039f}, {0xd0,0x03a0}, {0xd1,0x03a1}, {0xd3,0x03a3}, {0xd4,0x03a4}, {0xd5,0x03a5}, {0xd6,0x03a6}, {0xd7,0x03a7}, {0xd8,0x03a8}, {0xd9,0x03a9}, {0xda,0x03aa}, {0xdb,0x03ab}, {0xdc,0x03ac}, {0xdd,0x03ad}, {0xde,0x03ae}, {0xdf,0x03af}, {0xe0,0x03b0}, {0xe1,0x03b1}, {0xe2,0x03b2}, {0xe3,0x03b3}, {0xe4,0x03b4}, {0xe5,0x03b5}, {0xe6,0x03b6}, {0xe7,0x03b7}, {0xe8,0x03b8}, {0xe9,0x03b9}, {0xea,0x03ba}, {0xeb,0x03bb}, {0xec,0x03bc}, {0xed,0x03bd}, {0xee,0x03be}, {0xef,0x03bf}, {0xf0,0x03c0}, {0xf1,0x03c1}, {0xf2,0x03c2}, {0xf3,0x03c3}, {0xf4,0x03c4}, {0xf5,0x03c5}, {0xf6,0x03c6}, {0xf7,0x03c7}, {0xf8,0x03c8}, {0xf9,0x03c9}, {0xfa,0x03ca}, {0xfb,0x03cb}, {0xfc,0x03cc}, {0xfd,0x03cd}, {0xfe,0x03ce}, }; @implementation CWWINDOWS_1253 - (id) init { return [super initWithCodeCharTable: code_table length: sizeof(code_table)/sizeof(code_table[0])]; } - (NSString *) name { return @"windows-1253"; } @end pantomime1.2-1.2.2+dfsg1/Framework/Pantomime/CWWINDOWS_1254.h000066400000000000000000000020311276751561200230340ustar00rootroot00000000000000/* ** CWWINDOWS_1254.h ** ** Copyright (c) 2001-2004 ** ** Author: Ludovic Marcotte ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** You should have received a copy of the GNU Lesser General Public ** License along with this library; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef _Pantomime_H_CWWINDOW_1254 #define _Pantomime_H_CWWINDOW_1254 #include @interface CWWINDOWS_1254 : CWCharset @end #endif // _Pantomime_H_CWWINDOW_1254 pantomime1.2-1.2.2+dfsg1/Framework/Pantomime/CWWINDOWS_1254.m000066400000000000000000000067661276751561200230640ustar00rootroot00000000000000#include static struct charset_code code_table[]={ {0x20,0x0020}, {0x21,0x0021}, {0x22,0x0022}, {0x23,0x0023}, {0x24,0x0024}, {0x25,0x0025}, {0x26,0x0026}, {0x27,0x0027}, {0x28,0x0028}, {0x29,0x0029}, {0x2a,0x002a}, {0x2b,0x002b}, {0x2c,0x002c}, {0x2d,0x002d}, {0x2e,0x002e}, {0x2f,0x002f}, {0x30,0x0030}, {0x31,0x0031}, {0x32,0x0032}, {0x33,0x0033}, {0x34,0x0034}, {0x35,0x0035}, {0x36,0x0036}, {0x37,0x0037}, {0x38,0x0038}, {0x39,0x0039}, {0x3a,0x003a}, {0x3b,0x003b}, {0x3c,0x003c}, {0x3d,0x003d}, {0x3e,0x003e}, {0x3f,0x003f}, {0x40,0x0040}, {0x41,0x0041}, {0x42,0x0042}, {0x43,0x0043}, {0x44,0x0044}, {0x45,0x0045}, {0x46,0x0046}, {0x47,0x0047}, {0x48,0x0048}, {0x49,0x0049}, {0x4a,0x004a}, {0x4b,0x004b}, {0x4c,0x004c}, {0x4d,0x004d}, {0x4e,0x004e}, {0x4f,0x004f}, {0x50,0x0050}, {0x51,0x0051}, {0x52,0x0052}, {0x53,0x0053}, {0x54,0x0054}, {0x55,0x0055}, {0x56,0x0056}, {0x57,0x0057}, {0x58,0x0058}, {0x59,0x0059}, {0x5a,0x005a}, {0x5b,0x005b}, {0x5c,0x005c}, {0x5d,0x005d}, {0x5e,0x005e}, {0x5f,0x005f}, {0x60,0x0060}, {0x61,0x0061}, {0x62,0x0062}, {0x63,0x0063}, {0x64,0x0064}, {0x65,0x0065}, {0x66,0x0066}, {0x67,0x0067}, {0x68,0x0068}, {0x69,0x0069}, {0x6a,0x006a}, {0x6b,0x006b}, {0x6c,0x006c}, {0x6d,0x006d}, {0x6e,0x006e}, {0x6f,0x006f}, {0x70,0x0070}, {0x71,0x0071}, {0x72,0x0072}, {0x73,0x0073}, {0x74,0x0074}, {0x75,0x0075}, {0x76,0x0076}, {0x77,0x0077}, {0x78,0x0078}, {0x79,0x0079}, {0x7a,0x007a}, {0x7b,0x007b}, {0x7c,0x007c}, {0x7d,0x007d}, {0x7e,0x007e}, {0x80,0x20ac}, {0x82,0x201a}, {0x83,0x0192}, {0x84,0x201e}, {0x85,0x2026}, {0x86,0x2020}, {0x87,0x2021}, {0x88,0x02c6}, {0x89,0x2030}, {0x8a,0x0160}, {0x8b,0x2039}, {0x8c,0x0152}, {0x91,0x2018}, {0x92,0x2019}, {0x93,0x201c}, {0x94,0x201d}, {0x95,0x2022}, {0x96,0x2013}, {0x97,0x2014}, {0x98,0x02dc}, {0x99,0x2122}, {0x9a,0x0161}, {0x9b,0x203a}, {0x9c,0x0153}, {0x9f,0x0178}, {0xa0,0x00a0}, {0xa1,0x00a1}, {0xa2,0x00a2}, {0xa3,0x00a3}, {0xa4,0x00a4}, {0xa5,0x00a5}, {0xa6,0x00a6}, {0xa7,0x00a7}, {0xa8,0x00a8}, {0xa9,0x00a9}, {0xaa,0x00aa}, {0xab,0x00ab}, {0xac,0x00ac}, {0xad,0x00ad}, {0xae,0x00ae}, {0xaf,0x00af}, {0xb0,0x00b0}, {0xb1,0x00b1}, {0xb2,0x00b2}, {0xb3,0x00b3}, {0xb4,0x00b4}, {0xb5,0x00b5}, {0xb6,0x00b6}, {0xb7,0x00b7}, {0xb8,0x00b8}, {0xb9,0x00b9}, {0xba,0x00ba}, {0xbb,0x00bb}, {0xbc,0x00bc}, {0xbd,0x00bd}, {0xbe,0x00be}, {0xbf,0x00bf}, {0xc0,0x00c0}, {0xc1,0x00c1}, {0xc2,0x00c2}, {0xc3,0x00c3}, {0xc4,0x00c4}, {0xc5,0x00c5}, {0xc6,0x00c6}, {0xc7,0x00c7}, {0xc8,0x00c8}, {0xc9,0x00c9}, {0xca,0x00ca}, {0xcb,0x00cb}, {0xcc,0x00cc}, {0xcd,0x00cd}, {0xce,0x00ce}, {0xcf,0x00cf}, {0xd0,0x011e}, {0xd1,0x00d1}, {0xd2,0x00d2}, {0xd3,0x00d3}, {0xd4,0x00d4}, {0xd5,0x00d5}, {0xd6,0x00d6}, {0xd7,0x00d7}, {0xd8,0x00d8}, {0xd9,0x00d9}, {0xda,0x00da}, {0xdb,0x00db}, {0xdc,0x00dc}, {0xdd,0x0130}, {0xde,0x015e}, {0xdf,0x00df}, {0xe0,0x00e0}, {0xe1,0x00e1}, {0xe2,0x00e2}, {0xe3,0x00e3}, {0xe4,0x00e4}, {0xe5,0x00e5}, {0xe6,0x00e6}, {0xe7,0x00e7}, {0xe8,0x00e8}, {0xe9,0x00e9}, {0xea,0x00ea}, {0xeb,0x00eb}, {0xec,0x00ec}, {0xed,0x00ed}, {0xee,0x00ee}, {0xef,0x00ef}, {0xf0,0x011f}, {0xf1,0x00f1}, {0xf2,0x00f2}, {0xf3,0x00f3}, {0xf4,0x00f4}, {0xf5,0x00f5}, {0xf6,0x00f6}, {0xf7,0x00f7}, {0xf8,0x00f8}, {0xf9,0x00f9}, {0xfa,0x00fa}, {0xfb,0x00fb}, {0xfc,0x00fc}, {0xfd,0x0131}, {0xfe,0x015f}, {0xff,0x00ff}, }; @implementation CWWINDOWS_1254 - (id) init { return [super initWithCodeCharTable: code_table length: sizeof(code_table)/sizeof(code_table[0])]; } - (NSString *) name { return @"windows-1254"; } @end pantomime1.2-1.2.2+dfsg1/Framework/Pantomime/GNUmakefile000066400000000000000000000110131276751561200226760ustar00rootroot00000000000000# # GNUstep Makefile for the Pantomime Framework # # Copyright (C) 2001-2006 # 2013-2014 # # Author: Ludovic Marcotte # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ include $(GNUSTEP_MAKEFILES)/common.make FRAMEWORK_NAME = Pantomime PANTOMIME_MAJOR_VERSION=1 PANTOMIME_MINOR_VERSION=2 PANTOMIME_SUBMINOR_VERSION=2 PANTOMIME_VERSION=${PANTOMIME_MAJOR_VERSION}.${PANTOMIME_MINOR_VERSION}.${PANTOMIME_SUBMINOR_VERSION} VERSION=${PANTOMIME_VERSION} Pantomime_INTERFACE_VERSION=1.2 # C sources files to be compiled Pantomime_C_FILES = \ io.c # The Objective-C source files to be compiled Pantomime_OBJC_FILES = \ CWCacheManager.m \ CWCharset.m \ CWConstants.m \ CWContainer.m \ CWDNSManager.m \ CWFlags.m \ CWFolder.m \ CWFolderInformation.m \ CWIMAPCacheManager.m \ CWIMAPFolder.m \ CWIMAPMessage.m \ CWIMAPStore.m \ CWInternetAddress.m \ CWISO8859_1.m \ CWISO8859_2.m \ CWISO8859_3.m \ CWISO8859_4.m \ CWISO8859_5.m \ CWISO8859_6.m \ CWISO8859_7.m \ CWISO8859_8.m \ CWISO8859_9.m \ CWISO8859_10.m \ CWISO8859_11.m \ CWISO8859_13.m \ CWISO8859_14.m \ CWISO8859_15.m \ CWKOI8_R.m \ CWKOI8_U.m \ CWLocalCacheManager.m \ CWLocalFolder.m \ CWLocalFolder+maildir.m \ CWLocalFolder+mbox.m \ CWLocalMessage.m \ CWLocalStore.m \ CWMD5.m \ CWMessage.m \ CWMIMEMultipart.m \ CWMIMEUtility.m \ CWParser.m \ CWPart.m \ CWPOP3CacheManager.m \ CWPOP3CacheObject.m \ CWPOP3Folder.m \ CWPOP3Message.m \ CWPOP3Store.m \ CWRegEx.m \ CWService.m \ CWSendmail.m \ CWSMTP.m \ CWTCPConnection.m \ CWURLName.m \ CWUUFile.m \ CWVirtualFolder.m \ CWWINDOWS_1250.m \ CWWINDOWS_1251.m \ CWWINDOWS_1252.m \ CWWINDOWS_1253.m \ CWWINDOWS_1254.m \ NSData+Extensions.m \ NSFileManager+Extensions.m \ NSScanner+Extensions.m \ NSString+Extensions.m # The Headers that are to be installed with the Pantomime Framework Pantomime_HEADER_FILES = \ io.h \ CWCacheManager.h \ CWCharset.h \ CWConnection.h \ CWConstants.h \ CWContainer.h \ CWDNSManager.h \ CWFlags.h \ CWFolder.h \ CWFolderInformation.h \ CWIMAPCacheManager.h \ CWIMAPFolder.h \ CWIMAPMessage.h \ CWIMAPStore.h \ CWInternetAddress.h \ CWISO8859_1.h \ CWISO8859_2.h \ CWISO8859_3.h \ CWISO8859_4.h \ CWISO8859_5.h \ CWISO8859_6.h \ CWISO8859_7.h \ CWISO8859_8.h \ CWISO8859_9.h \ CWISO8859_10.h \ CWISO8859_11.h \ CWISO8859_13.h \ CWISO8859_14.h \ CWISO8859_15.h \ CWKOI8_R.h \ CWKOI8_U.h \ CWLocalCacheManager.h \ CWLocalFolder.h \ CWLocalFolder+maildir.h \ CWLocalFolder+mbox.h \ CWLocalMessage.h \ CWLocalStore.h \ CWMD5.h \ CWMIMEMultipart.h \ CWMIMEUtility.h \ CWMessage.h \ CWParser.h \ CWPart.h \ CWPOP3CacheManager.h \ CWPOP3CacheObject.h \ CWPOP3Folder.h \ CWPOP3Message.h \ CWPOP3Store.h \ CWRegEx.h \ CWSendmail.h \ CWService.h \ CWSMTP.h \ CWStore.h \ CWTCPConnection.h \ CWTransport.h \ CWURLName.h \ CWUUFile.h \ CWVirtualFolder.h \ CWWINDOWS_1250.h \ CWWINDOWS_1251.h \ CWWINDOWS_1252.h \ CWWINDOWS_1253.h \ CWWINDOWS_1254.h \ NSData+Extensions.h \ NSFileManager+Extensions.h \ NSScanner+Extensions.h \ NSString+Extensions.h \ Pantomime.h Pantomime_RESOURCE_FILES = \ ../../Resources/*.lproj Pantomime_LANGUAGES = \ ../../Resources/English\ ../../Resources/German Pantomime_LOCALIZED_RESOURCE_FILES = Localizable.strings ADDITIONAL_INCLUDE_DIRS = -I.. ADDITIONAL_OBJCFLAGS += -DHAVE_ICONV -Wall -Wno-import ifeq ($(GNUSTEP_TARGET_OS),mingw32) #ADDITIONAL_GUI_LIBS += -lregex -liconv -lssl -lcrypto LIBRARIES_DEPEND_UPON += $(FND_LIBS) $(OBJC_LIBS) -lregex -liconv -lssl else #ADDITIONAL_LDFLAGS += -lssl -lcrypto LIBRARIES_DEPEND_UPON += $(FND_LIBS) $(OBJC_LIBS) -lssl endif # Under Solaris, we include SSL headers / libraries ifeq ($(findstring solaris, $(GNUSTEP_TARGET_OS)), solaris) ADDITIONAL_OBJCFLAGS += -I/usr/local/ssl/include ADDITIONAL_LDFLAGS += -L/usr/local/ssl/lib endif include $(GNUSTEP_MAKEFILES)/framework.make pantomime1.2-1.2.2+dfsg1/Framework/Pantomime/NSData+Extensions.h000066400000000000000000000303711276751561200242520ustar00rootroot00000000000000/* ** NSData+Extensions.h ** ** Copyright (c) 2001-2007 ** ** Author: Ludovic Marcotte ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** You should have received a copy of the GNU Lesser General Public ** License along with this library; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef _Pantomime_H_NSData_Extensions #define _Pantomime_H_NSData_Extensions #import #import #import /*! @category NSData (PantomimeExtensions) @abstract Pantomime extensions to NSData. @discussion This category provides useful extensions for handling NSData objects. */ @interface NSData (PantomimeExtensions) /*! @method decodeBase64 @abstract Decode using the base64 encoding. @discussion This method is used to decode data that has been encoded using the base64 method. @result Returns the decoded bytes, as a NSData instance. */ - (NSData *) decodeBase64; /*! @method encodeBase64WithLineLength: @abstract Encoding the bytes using the base64 encoding @discussion Pending. @param theLength Specifies the length of the lines if wrapping should be done. 0 disables any wrapping. @result Returns a NSData object on success, nil on error. */ - (NSData *) encodeBase64WithLineLength: (int) theLength; /*! @method unfoldLines @abstract Unfold lines contained in this object. @discussion This method is used to replace all occurences of "\n " or "\n\t" by "\n". @result Returns a new NSData object. */ - (NSData *) unfoldLines; /*! @method decodeQuotedPrintableInHeader @abstract Decode using the quoted-printable encoding. @discussion This method is used to decode data that has been encoded using the quoted-printable method. @param aBOOL Specifies if we are decoding data from a message header, or not. @result Returns a new NSData object. */ - (NSData *) decodeQuotedPrintableInHeader: (BOOL) aBOOL; /*! @method encodeQuotedPrintableWithLineLength:inHeader: @abstract Encoding the bytes using the quoted-printable encoding @discussion Pending. @param aBOOL Specifies if we are encoding data from a message header, or not. @param theLength Specifies the length of the lines if wrapping should be done. 0 disables any wrapping. @result Returns a NSData object. */ - (NSData *) encodeQuotedPrintableWithLineLength: (int) theLength inHeader: (BOOL) aBOOL; /*! @method rangeOfData: @discussion This method searches for theData in the receiver and returns the associated NSRange. @param theData The data to search for in the receiver. @result The associated range. */ -(NSRange) rangeOfData: (NSData *) theData; /*! @method rangeOfCString: @discussion Invokes rangeOfCString:options:range: with no option and the complete range. @param theCString The C string to search for. @result The associated range of the C string in the receiver. */ -(NSRange) rangeOfCString: (const char *) theCString; /*! @method rangeOfCString: @discussion Invokes rangeOfCString:options:range: with theOptions and the complete range. @param theCString The C string to search for. @param theOptions The options used during the search. @result The associated range of the C string in the receiver. */ -(NSRange) rangeOfCString: (const char *) theCString options: (unsigned int) theOptions; /*! @method rangeOfCString: @discussion Search for theCString using theOptions and theRange in the receiver. @param theCString The C string to search for. @param theOptions The options used during the search. @param theRange The range to use when performing the search. @result The associated range of the C string in the receiver. */ -(NSRange) rangeOfCString: (const char *) theCString options: (unsigned int) theOptions range: (NSRange) theRange; /*! @method subdataFromIndex: @discussion This method is used to obtain the subdata from theIndex in the receiver. The byte at theIndex is part of the returned NSData instance. @param theIndex The index used to get the subdata from. @result The subdata. */ - (NSData *) subdataFromIndex: (int) theIndex; /*! @method subdataToIndex: @discussion This method is used to obtain the subdata to theIndex from the receiver. The byte at theIndex is not included in returned NSData instance. @param theIndex The index used to get the subdata to. @result The subdata. */ - (NSData *) subdataToIndex: (int) theIndex; /*! @method dataByTrimmingWhiteSpaces @discussion This method is used to trim the leading and trailing spaces (space characters, tabs, newlines, carriage returns or other characters with no visible representation) from the receiver. @result The trimmed data. */ - (NSData *) dataByTrimmingWhiteSpaces; /*! @method dataFromQuotedData @discussion This method returns an unquoted data if the data has a leading AND trailing quote. @result The unquoted data or the original if it does not match the criteria. */ - (NSData *) dataFromQuotedData; /*! @method dataFromSemicolonTerminatedData @discussion This method returns the data by omitting the ending semicolon, if present. @result The data without the ending semicolon. */ - (NSData *) dataFromSemicolonTerminatedData; /*! @method dataByRemovingLineFeedCharacters @discussion This method is used to return the receiver without any occurences of the line feed (LF, control-J, ASCII 10) character. @result The data withtout line feed characters. */ - (NSData *) dataByRemovingLineFeedCharacters; /*! @method indexOfCharacter: @discussion This method finds the first occurence of the character in the receiver and returns its index (zero-based) @param theCharacter The caracter to be searched for. @result The index of the character, -1 if it's not found in the receiver. */ - (int) indexOfCharacter: (char) theCharacter; /*! @method hasCPrefix: @discussion This method is used to verify if the receiver has theCString as a prefix. @param theCString The C string to look for. @result YES if theCString is a prefix of the receiver, NO otherwise. */ - (BOOL) hasCPrefix: (const char *) theCString; /*! @method hasCSuffix: @discussion This method is used to verify if the receiver has theCString as a suffix. @param theCString The C string to look for. @result YES if theCString is a suffix of the receiver, NO otherwise. */ - (BOOL) hasCSuffix: (const char *) theCString; /*! @method hasCaseInsensitiveCPrefix: @discussion Same as -hasCPrefix but the comparison is done in a case-insensitiveness matter. @param thePrefix The prefix to be used. @result YES the there is a match, NO otherwise. */ - (BOOL) hasCaseInsensitiveCPrefix: (const char *) theCString; /*! @method hasCaseInsensitiveCSuffix: @discussion Same as -hasCSuffix but the comparison is done in a case-insensitiveness matter. @param theSuffix The suffix to be used. @result YES the there is a match, NO otherwise. */ - (BOOL) hasCaseInsensitiveCSuffix: (const char *) theCString; /*! @method caseInsensitiveCCompare: @discussion This method is used to compare theCString with our receiver's bytes. @param theCString The C string to compare the receiver with. @result One of the three possible values of the NSComparisonResult enum. */ - (NSComparisonResult) caseInsensitiveCCompare: (const char *) theCString; /*! @method componentsSeparatedByCString: @discussion This method is used to separate the receiver into subdata, using theCString as the separator. @param theCString The separator to use, as a C string. @result An instance of NSArray holding all components. The array is empty if the separator was not found in the receiver. */ - (NSArray *) componentsSeparatedByCString: (const char *) theCString; /*! @method asciiString @discussion This method turns the receiver into a NSString object. The receiver's bytes must be all-ASCII bytes. @result A NSString instance, nil if the conversion failed. */ -(NSString *) asciiString; /*! @method cString @discussion This method returns the receiver's byte as a NULL terminated C string. @result The NULL terminated C string. */ -(const char *) cString; - (unichar) characterAtIndex: (int) theIndex; /*! @method quoteWithLevel:wrappingLimit: @discussion This method is used to quote an unwrapped string. @param theLevel The quoting level. @param theLimit The line wrapping limit to use, in number of characters. @result Returns a quoted string as a NSData instance. An empty NSData instance is returned if theLevel is greater than theLimit. */ - (NSData *) quoteWithLevel: (int) theLevel wrappingLimit: (int) theLimit; /*! @method unwrapWithLimit: @discussion This method is used to unwrap the string using a quote limit. This method implements the behavior specified in RFC2646. @param theQuoteLimit The quote limit to use for unwrapping the string. @result The unwrapped string, as a NSData instance. */ - (NSData *) unwrapWithLimit: (int) theQuoteLimit; /*! @method wrapWithLimit: @discussion This method wraps the string at the theLimit with respect to RFC2646. @param theLimit The limit to use for wrapping the string. The limit corresponds to the maximum length of a line, specified in characters. @result The wrapped string. */ - (NSData *) wrapWithLimit: (int) theLimit; @end /*! @category NSMutableData (PantomimeExtensions) @abstract Pantomime extensions to NSMutableData. @discussion This category provides useful extensions for handling NSMutableData objects. */ @interface NSMutableData (PantomimeExtensions) /*! @method appendCFormat: @discussion This method is used to append the variable arguments to the receiver. The bytes of the arguments must be composed only of ASCII characters. @param theFormat The format of the rest of the argument, as this method is a variadic method. */ -(void) appendCFormat: (NSString *) theFormat, ...; /*! @method appendCString: @discussion This method is used to append the C string to the receiver. @param theCString The C string to append. */ -(void) appendCString: (const char *) theCString; /*! @method insertCString: atIndex: @discussion This method is used to insert the C string into the received at the specified index. If theIndex is zero or less, the C string will be added at the beginning of the receiver. If theIndex is greater than the receiver's length, the C string will be appended to the receiver. @param theCString The C string to insert into the receiver. @param theIndex The index where to insert the C string. */ - (void) insertCString: (const char *) theCString atIndex: (int) theIndex; /*! @method replaceCRLFWithLF @discussion This method destructively elides all carriage return (CR, Control-M, ASCII 13) from the receiver. */ - (void) replaceCRLFWithLF; /*! @method replaceLFWithCRLF @discussion This method is used to replace all occurences of line feed characters by sequences of a carriage return followed by line feed characters in the receiver. */ - (NSMutableData *) replaceLFWithCRLF; @end #endif // _Pantomime_H_NSData_Extensions pantomime1.2-1.2.2+dfsg1/Framework/Pantomime/NSData+Extensions.m000066400000000000000000000754311276751561200242650ustar00rootroot00000000000000/* ** NSData+Extensions.m ** ** Copyright (c) 2001-2007 ** 2014 ** ** Author: Ludovic Marcotte ** Riccardo Mottola ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** You should have received a copy of the GNU Lesser General Public ** License along with this library; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "Pantomime/NSData+Extensions.h" #include #include #include #include "Pantomime/CWConstants.h" #include #include // // C functions and constants // int getValue(char c); void nb64ChunkFor3Characters(char *buf, const char *inBuf, int numChars); static const char basis_64[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; static const char *hexDigit = "0123456789ABCDEF"; // TODO: // add an NSData cluster member NSSubrangeData that retaind its parent and // used its data. Would make almost all of these operations work without // copying. @implementation NSData (PantomimeExtensions) // // FIXME: this should ignore characters in the stream that aren't in // the base64 alphabet (as per the spec). would remove need for // ...removeLinefeeds... too // - (NSData *) decodeBase64 { int i, j, length, rawIndex, block, pad, data_len; const unsigned char *bytes; char *raw; if ([self length] == 0) { return [NSData data]; } data_len = [self length]; bytes = [self bytes]; pad = 0; for (i = data_len - 1; bytes[i] == '='; i--) { pad++; } length = data_len * 6 / 8 - pad; raw = (char *)malloc(length); rawIndex = 0; for (i = 0; i < data_len; i += 4) { block = (getValue(bytes[i]) << 18) + (getValue(bytes[i+1]) << 12) + (getValue(bytes[i+2]) << 6) + (getValue(bytes[i+3])); for (j = 0; j < 3 && rawIndex+j < length; j++) { raw[rawIndex+j] = (char)((block >> (8 * (2 - j))) & 0xff); } rawIndex += 3; } // This could happen for broken encoded base64 content such as the following example: // ------=_NextPart_KO_X1098V29876N91O412QM815 // Content-Type: text/plain; charset=UTF-8 // Content-Disposition: attachment; filename="teste.txt" // Content-Transfer-Encoding: base64 // // ==== // if (length < 0) { free(raw); return [NSData data]; } return AUTORELEASE([[NSData alloc] initWithBytesNoCopy: raw length: length]); } // // // - (NSData *) encodeBase64WithLineLength: (int) theLength { const char *inBytes = [self bytes]; const char *inBytesPtr = inBytes; int inLength = [self length]; char *outBytes = malloc(sizeof(char)*inLength*2); char *outBytesPtr = outBytes; int numWordsPerLine = theLength/4; int wordCounter = 0; // We memset 0 our buffer so with are sure to not have // any garbage in it. memset(outBytes, 0, sizeof(char)*inLength*2); while (inLength > 0) { nb64ChunkFor3Characters(outBytesPtr, inBytesPtr, inLength); outBytesPtr += 4; inBytesPtr += 3; inLength -= 3; wordCounter ++; if (theLength && wordCounter == numWordsPerLine) { wordCounter = 0; *outBytesPtr = '\n'; outBytesPtr++; } } return AUTORELEASE([[NSData alloc] initWithBytesNoCopy: outBytes length: (outBytesPtr-outBytes)]); } // // // - (NSData *) unfoldLines { NSMutableData *aMutableData; int i, length; const unsigned char *bytes, *b; length = [self length]; b = bytes = [self bytes]; aMutableData = [[NSMutableData alloc] initWithCapacity: length]; [aMutableData appendBytes: b length: 1]; b++; for (i = 1; i < length; i++,b++) { if (b[-1]=='\n' && (*b==' ' || *b=='\t')) { [aMutableData setLength: ([aMutableData length] - 1)]; } [aMutableData appendBytes: b length: 1]; } return AUTORELEASE(aMutableData); } // // // - (NSData *) decodeQuotedPrintableInHeader: (BOOL) aBOOL { NSMutableData *result; const unsigned char *bytes,*b; unsigned char ch; NSUInteger i,len; len = [self length]; bytes = [self bytes]; result = [[NSMutableData alloc] initWithCapacity: len]; ch=0; b=bytes; for (i = 0; i < len; i++,b++) { if (b[0]=='=' && i+1='A' && *b<='F') { ch=16*(*b-'A'+10); } else if (*b>='a' && *b<='f') { ch=16*(*b-'a'+10); } else if (*b>='0' && *b<='9') { ch=16*(*b-'0'); } else { [[NSException exceptionWithName:@"Pantomime Exception" reason:@"Hex data contained invalid char" userInfo:nil] raise]; return nil; } b++,i++; if (*b>='A' && *b<='F') { ch+=*b-'A'+10; } else if (*b>='a' && *b<='f') { ch+=*b-'a'+10; } else if (*b>='0' && *b<='9') { ch+=*b-'0'; } else { [[NSException exceptionWithName:@"Pantomime Exception" reason:@"Hex data contained invalid char" userInfo:nil] raise]; return nil; } [result appendBytes: &ch length: 1]; } else if (aBOOL && *b=='_') { ch=0x20; [result appendBytes: &ch length: 1]; } else { [result appendBytes: b length: 1]; } } return AUTORELEASE(result); } // // // - (NSData *) encodeQuotedPrintableWithLineLength: (int) theLength inHeader: (BOOL) aBOOL { NSMutableData *aMutableData; const unsigned char *b; int i, length, line; char buf[4]; aMutableData = [[NSMutableData alloc] initWithCapacity: [self length]]; b = [self bytes]; length = [self length]; buf[3] = 0; buf[0] = '='; line = 0; for (i = 0; i < length; i++, b++) { if (theLength && line >= theLength) { [aMutableData appendBytes: "=\n" length: 2]; line = 0; } // RFC says must encode space and tab right before end of line if ( (*b == ' ' || *b == '\t') && i < length - 1 && b[1] == '\n') { buf[1] = hexDigit[(*b)>>4]; buf[2] = hexDigit[(*b)&15]; [aMutableData appendBytes: buf length: 3]; line += 3; } // FIXME: really always pass \n through here? else if (!aBOOL && (*b == '\n' || *b == ' ' || *b == '\t' || (*b >= 33 && *b <= 60) || (*b >= 62 && *b <= 126))) { [aMutableData appendBytes: b length: 1]; if (*b == '\n') { line = 0; } else { line++; } } else if (aBOOL && ((*b >= 'a' && *b <= 'z') || (*b >= 'A' && *b <= 'Z'))) { [aMutableData appendBytes: b length: 1]; if (*b == '\n') { line = 0; } else { line++; } } else if (aBOOL && *b == ' ') { [aMutableData appendBytes: "_" length: 1]; } else { buf[1] = hexDigit[(*b)>>4]; buf[2] = hexDigit[(*b)&15]; [aMutableData appendBytes: buf length: 3]; line += 3; } } return AUTORELEASE(aMutableData); } // // // - (NSRange) rangeOfData: (NSData *) theData { const char *b, *bytes, *str; int i, len, slen; bytes = [self bytes]; len = [self length]; if (!theData) { return NSMakeRange(NSNotFound,0); } slen = [theData length]; str = [theData bytes]; b = bytes; // TODO: this could be optimized i = 0; b += i; for (; i<= len-slen; i++, b++) { if (!memcmp(str,b,slen)) { return NSMakeRange(i,slen); } } return NSMakeRange(NSNotFound,0); } // // // - (NSRange) rangeOfCString: (const char *) theCString { return [self rangeOfCString: theCString options: 0 range: NSMakeRange(0,[self length])]; } // // // -(NSRange) rangeOfCString: (const char *) theCString options: (unsigned int) theOptions { return [self rangeOfCString: theCString options: theOptions range: NSMakeRange(0,[self length])]; } // // // -(NSRange) rangeOfCString: (const char *) theCString options: (unsigned int) theOptions range: (NSRange) theRange { const char *b, *bytes; int i, len, slen; if (!theCString) { return NSMakeRange(NSNotFound,0); } bytes = [self bytes]; len = [self length]; slen = strlen(theCString); b = bytes; if (len > theRange.location + theRange.length) { len = theRange.location + theRange.length; } #warning this could be optimized if (theOptions == NSCaseInsensitiveSearch) { i = theRange.location; b += i; for (; i <= len-slen; i++, b++) { if (!strncasecmp(theCString,b,slen)) { return NSMakeRange(i,slen); } } } else { i = theRange.location; b += i; for (; i <= len-slen; i++, b++) { if (!memcmp(theCString,b,slen)) { return NSMakeRange(i,slen); } } } return NSMakeRange(NSNotFound,0); } // // // - (NSData *) subdataFromIndex: (int) theIndex { return [self subdataWithRange: NSMakeRange(theIndex, [self length] - theIndex)]; } // // // - (NSData *) subdataToIndex: (int) theIndex { return [self subdataWithRange: NSMakeRange(0, theIndex)]; } // // // - (NSData *) dataByTrimmingWhiteSpaces { const char *bytes; int i, j, len; bytes = [self bytes]; len = [self length]; for (i = 0; i < len && (bytes[i] == ' ' || bytes[i] == '\t'); i++) ; for (j = len-1; j >= 0 && (bytes[j] == ' ' || bytes[i] == '\t'); j--) ; if (j <= i) { return AUTORELEASE(RETAIN(self)); } return [self subdataWithRange: NSMakeRange(i, j-i+1)]; } // // // - (NSData *) dataByRemovingLineFeedCharacters { NSMutableData *aMutableData; const char *bytes; int i, j, len; char *dest; bytes = [self bytes]; len = [self length]; aMutableData = [[NSMutableData alloc] init]; [aMutableData setLength: len]; dest = [aMutableData mutableBytes]; for (i = j = 0; i < len; i++) { if (bytes[i] != '\n') { dest[j++] = bytes[i]; } } [aMutableData setLength: j]; return AUTORELEASE(aMutableData); } // // // - (NSData *) dataFromQuotedData { const char *bytes; int len; bytes = [self bytes]; len = [self length]; if (len < 2) { return AUTORELEASE(RETAIN(self)); } if (bytes[0] == '"' && bytes[len-1] == '"') { return [self subdataWithRange: NSMakeRange(1, len-2)]; } return AUTORELEASE(RETAIN(self)); } // // // - (NSData *) dataFromSemicolonTerminatedData { const char *bytes; int len; bytes = [self bytes]; len = [self length]; if (len < 2) { return AUTORELEASE(RETAIN(self)); } if (bytes[len-1] == ';') { return [self subdataToIndex: len-1]; } return AUTORELEASE(RETAIN(self)); } // // // - (int) indexOfCharacter: (char) theCharacter { const char *b; int i, len; b = [self bytes]; len = [self length]; for ( i = 0; i < len; i++, b++) if (*b == theCharacter) { return i; } return -1; } // // // - (BOOL) hasCPrefix: (const char *) theCString { const char *bytes; int len, slen; if (!theCString) { return NO; } bytes = [self bytes]; len = [self length]; slen = strlen(theCString); if ( slen > len) { return NO; } if (!strncmp(bytes,theCString,slen)) { return YES; } return NO; } // // // - (BOOL) hasCSuffix: (const char *) theCString { const char *bytes; int len, slen; if (!theCString) { return NO; } bytes = [self bytes]; len = [self length]; slen = strlen(theCString); if (slen > len) { return NO; } if (!strncmp(&bytes[len-slen],theCString,slen)) { return YES; } return NO; } // // // - (BOOL) hasCaseInsensitiveCPrefix: (const char *) theCString { const char *bytes; int len, slen; if (!theCString) { return NO; } bytes = [self bytes]; len = [self length]; slen = strlen(theCString); if ( slen > len) { return NO; } if ( !strncasecmp(bytes,theCString,slen) ) { return YES; } return NO; } // // // - (BOOL) hasCaseInsensitiveCSuffix: (const char *) theCString { const char *bytes; int len, slen; if (!theCString) { return NO; } bytes = [self bytes]; len = [self length]; slen = strlen(theCString); if (slen > len) { return NO; } if (!strncasecmp(&bytes[len-slen],theCString,slen)) { return YES; } return NO; } // // // - (NSComparisonResult) caseInsensitiveCCompare: (const char *) theCString { int slen, len, clen, i; const char *bytes; // Is this ok? if (!theCString) { return NSOrderedDescending; } bytes = [self bytes]; len = [self length]; slen = strlen(theCString); if (slen > len) { clen = len; } else { clen = slen; } i = strncasecmp(bytes,theCString,clen); if (i < 0) { return NSOrderedAscending; } if (i > 0) { return NSOrderedDescending; } if (slen == len) { return NSOrderedSame; } if (slen < len) { return NSOrderedAscending; } return NSOrderedDescending; } // // // - (NSArray *) componentsSeparatedByCString: (const char *) theCString { NSMutableArray *aMutableArray; NSRange r1, r2; int len; aMutableArray = [[NSMutableArray alloc] init]; len = [self length]; r1 = NSMakeRange(0,len); r2 = [self rangeOfCString: theCString options: 0 range: r1]; while (r2.length) { [aMutableArray addObject: [self subdataWithRange: NSMakeRange(r1.location, r2.location - r1.location)]]; r1.location = r2.location + r2.length; r1.length = len - r1.location; r2 = [self rangeOfCString: theCString options: 0 range: r1]; } [aMutableArray addObject: [self subdataWithRange: NSMakeRange(r1.location, len - r1.location)]]; return AUTORELEASE(aMutableArray); } // // // - (NSString *) asciiString { return AUTORELEASE([[NSString alloc] initWithData: self encoding: NSASCIIStringEncoding]); } // // // - (const char *) cString { NSMutableData *aMutableData; aMutableData = [[NSMutableData alloc] init]; AUTORELEASE(aMutableData); [aMutableData appendData: self]; [aMutableData appendBytes: "\0" length: 1]; return [aMutableData mutableBytes]; } // // // - (unichar) characterAtIndex: (int) theIndex { const char *bytes; int i, len; len = [self length]; if (len == 0 || theIndex >= len) { [[NSException exceptionWithName: NSRangeException reason: @"Index out of range." userInfo: nil] raise]; return (unichar)0; } bytes = [self bytes]; for (i = 0; i < theIndex; i++) { bytes++; } return (unichar)*bytes; } // // // - (NSData *) unwrapWithLimit: (int) theQuoteLimit { NSMutableData *aMutableData, *lines; NSData *aLine; int i, len, quote_depth, line_quote_depth, line_start; BOOL is_flowed; len = [self length]; aMutableData = [[NSMutableData alloc] init];//WithCapacity: len]; lines = [[NSMutableData alloc] init]; quote_depth = -1; // We analyse the string until the last character for (i = 0; i < len;) { // We analyse the quote depth of the current line if ([self characterAtIndex: i] == '>') { for (line_quote_depth = 0; i < len && [self characterAtIndex: i] == '>'; i++) { line_quote_depth++; } } else { line_quote_depth = 0; } // If the current quote depth is not defined, set it to quote depth of current line if (quote_depth == -1) { quote_depth = line_quote_depth; } // We verify if the line has been space-stuffed if (i < len && [self characterAtIndex: i] == ' ') { i++; } line_start = i; // We look for the next line break for (; i < len && [self characterAtIndex: i] != '\n'; i++); // We get the actual content of the current line aLine = [self subdataWithRange: NSMakeRange(line_start, i-line_start)]; // We verify if the line ends with a soft break is_flowed = [aLine length] > 0 && [aLine characterAtIndex: [aLine length]-1] == ' '; // We must handle usenet signature as a special case if (is_flowed && [aLine caseInsensitiveCCompare: "-- "] == NSOrderedSame) { is_flowed = NO; } if (is_flowed && quote_depth == line_quote_depth) { // The current line is flowed; // we append it to the buffer without quote characters [lines appendData: aLine]; } else if (is_flowed) { // The current line is flowed but has mis-matched quoting // We first append the previous paragraph to the buffer with the necessary quote characters if (quote_depth) { [lines replaceBytesInRange: NSMakeRange(0, [lines length]) withBytes: [[lines quoteWithLevel: quote_depth wrappingLimit: theQuoteLimit] bytes]]; } [aMutableData appendData: lines]; [aMutableData appendCString: "\n"]; // We initialize the current paragraph with the current line [lines replaceBytesInRange: NSMakeRange(0, [lines length]) withBytes: [aLine bytes]]; // We set the paragraph depth with the current line depth quote_depth = line_quote_depth; } else if (!is_flowed && quote_depth == line_quote_depth) { // The line is fixed, we append it. [lines appendData: aLine]; // We add the necessary quote characters in the paragraph if (quote_depth) { NSData *d; d = [lines quoteWithLevel: quote_depth wrappingLimit: theQuoteLimit]; [lines replaceBytesInRange: NSMakeRange(0, [lines length]) withBytes: [d bytes] length: [d length]]; } // We append the paragraph (if any) if ([lines length]) { [aMutableData appendData: lines]; } [aMutableData appendCString: "\n"]; // We empty the paragraph buffer [lines replaceBytesInRange: NSMakeRange(0,[lines length]) withBytes: NULL length: 0]; // We reset the paragraph depth quote_depth = -1; } else { // The line is fixed but has mis-matched quoting // We first append the previous paragraph (if any) to the buffer with the necessary quote characters if (quote_depth) { [lines replaceBytesInRange: NSMakeRange(0, [lines length]) withBytes: [[lines quoteWithLevel: quote_depth wrappingLimit: theQuoteLimit] bytes]]; } [aMutableData appendData: lines]; [aMutableData appendCString: "\n"]; // We append the fixed line to the buffer with the necessary quote characters if (line_quote_depth) { aLine = [aLine quoteWithLevel: line_quote_depth wrappingLimit: theQuoteLimit]; } [aMutableData appendData: aLine]; [aMutableData appendCString: "\n"]; // We empty the paragraph buffer [lines replaceBytesInRange: NSMakeRange(0,[lines length]) withBytes: NULL length: 0]; // We reset the paragraph depth quote_depth = -1; } // The next iteration must starts after the line break i++; } // We must handle flowed lines that don't have a fixed line break at the end of the message if ([lines length]) { if (quote_depth) { [lines replaceBytesInRange: NSMakeRange(0, [lines length]) withBytes: [[lines quoteWithLevel: quote_depth wrappingLimit: theQuoteLimit] bytes]]; } [aMutableData appendData: lines]; [aMutableData appendCString: "\n"]; } DESTROY(lines); return AUTORELEASE(aMutableData); } // // // - (NSData *) wrapWithLimit: (int) theLimit { NSMutableData *aMutableData; NSData *aLine, *part; NSArray *lines; int i, j, k, split; int depth; // We first verify if the string is valid if ([self length] == 0) { return [NSData data]; } // We then verify if the limit is valid if (theLimit == 0 || theLimit > 998) { theLimit = 998; } // We initialize our local variables aMutableData = [[NSMutableData alloc] init];//WithCapacity: [self length]]; lines = [self componentsSeparatedByCString: "\n"]; // We analyse each line for (i = 0; i < [lines count]; i++) { aLine = [lines objectAtIndex: i]; // We compute the quote depth for (depth = 0; depth < [aLine length] && [aLine characterAtIndex: depth] == '>'; depth++); j = depth; // We remove the leading whitespace if any if (depth && [aLine length] > j && [aLine characterAtIndex: j] == 32) { j++; } aLine = [aLine subdataFromIndex: j]; // If the line is NOT the signature separator, we remove the trailing space(s) if ([aLine caseInsensitiveCCompare: "-- "] != NSOrderedSame) { for (j = [aLine length]; j > 0 && [aLine characterAtIndex: j-1] == 32; j--); if (depth && j < [aLine length]) { // If line is quoted, we preserve a whitespace for the soft-break j++; } aLine = [aLine subdataToIndex: j]; } // If the line is the signature separator or if the line length with the // quote characters and the space-stuffing is lower than the limit, // we directly append the line to the buffer if ([aLine caseInsensitiveCCompare: "-- "] == NSOrderedSame || depth+1+[aLine length] <= theLimit) { // We add the quote characters for (j = 0; j < depth; j++) { [aMutableData appendCString: ">"]; } // We space-stuff the line if necessary. The conditions are: // - the line is quoted or // - the line starts with a quote character or // - the line starts with a whitespace or // - the line starts with the word From. if (depth || ([aLine length] && ([aLine characterAtIndex: 0] == '>' || [aLine characterAtIndex: 0] == ' ' || [aLine hasCPrefix: "From"]))) { [aMutableData appendCString: " "]; } // We append the line to the buffer [aMutableData appendData: aLine]; [aMutableData appendCString: "\n"]; // We jump to the next line continue; } // We look for the right place to split the line for (j = 0; j < [aLine length];) { // We verify if the line after character j has a length lower than the limit if ([aLine length] - j + depth + 1 < theLimit) { split = [aLine length]; } // No it hasn't else { split = j; // We search for the last whitespace before the limit for (k = j; k < [aLine length] && k - j + depth + 1 < theLimit; k++) { if ([aLine characterAtIndex: k] == 32) { split = k; } } /* No good spot; include the entire next word. This isn't really optimal, but the alternative is to split the word, and that would be horribly ugly. Also, it'd mean that deeply quoted text might appear with one letter on each row, which is even uglier and means that the receiver won't be able to reconstruct the text. A proper fix would be to have both parameters for a 'soft' line limit that we _try_ to break before, and a 'hard' line limit that specifies an actual hard limit of a protocol or something. In NNTP, the values would be 72 and 998 respectively. This means that text quoted 70 levels (and yes, I have seen such posts) will appear with one unbroken word on each line (as long as the word is shorter than 928 characters). This is still ugly, but: a. invalid (protocol-wise) lines will never be generated (unless something's quoted >998 levels) b. a MIME decoder that handles format=flowed will be able to reconstruct the text properly (Additionally, it might turn out to be useful to have a lower limit on wrapping length, eg. 20. If the effective line length is shorter than this, wrap to quote-depth+soft-limit (so eg. text quoted 60 times would be wrapped at 60+72 characters instead of 72). This wouldn't make any difference on flowed capable MIME decoders, but might turn out to look better when viewed with non-flowed handling programs. Hopefully, such deeply quoted text won't be common enough to be worth the trouble, so people with non-flowed capable software will simply have to live with the ugly posts in those cases.) */ if (split == j) { // No whitespace found before the limit; // continue farther until a whitespace or the last character of the line for (; k < [aLine length] && [aLine characterAtIndex: k] != 32; k++); split = k; } } // Since the line will be splitted, we must keep a whitespace for // the soft-line break if (split < [aLine length]) { split++; } // Retrieve splitted part of line part = [aLine subdataWithRange: NSMakeRange(j, split - j)]; // We add the quote characters for (k = 0; k < depth; k++) { [aMutableData appendCString: ">"]; } // We space-stuff the line if necesary. if (depth || ([part length] && ([part characterAtIndex: 0] == '>' || [part characterAtIndex: 0] == ' ' || [part hasCPrefix: "From"]))) { [aMutableData appendCString: " "]; } // Append line part to buffer [aMutableData appendData: part]; [aMutableData appendCString: "\n"]; // Next iteration continues where current split occured j = split; } } if (i > 0) { [aMutableData replaceBytesInRange: NSMakeRange([aMutableData length]-1, 1) withBytes: NULL length: 0]; } return AUTORELEASE(aMutableData); } // // // - (NSData *) quoteWithLevel: (int) theLevel wrappingLimit: (int) theLimit { NSMutableData *aMutableData, *aQuotePrefix; NSData *aData, *aLine; NSArray *lines; BOOL isQuoted; int i; // We verify if the wrapping limit is smaller then the quote level if (theLevel > theLimit) { return [NSData data]; } aMutableData = [[NSMutableData alloc] initWithCapacity: [self length]]; aQuotePrefix = [[NSMutableData alloc] initWithCapacity: theLevel]; // We wrap the string to the proper limit aData = [self wrapWithLimit: (theLimit - theLevel)]; lines = [aData componentsSeparatedByCString: "\n"]; // We prepare the line prefix for (i = 0; i < theLevel; i++) { [aQuotePrefix appendCString: ">"]; } // We add the line prefix to each wrapped line for (i = 0; i < [lines count]; i++) { aLine = [lines objectAtIndex: i]; isQuoted = ([aLine length] > 0 && [aLine characterAtIndex: 0] == '>'); [aMutableData appendData: aQuotePrefix]; if (!isQuoted) { [aMutableData appendCString: " "]; } [aMutableData appendData: aLine]; [aMutableData appendCString: "\n"]; } if (i > 0) { [aMutableData replaceBytesInRange: NSMakeRange([aMutableData length]-1, 1) withBytes: NULL length: 0]; } RELEASE(aQuotePrefix); return AUTORELEASE(aMutableData); } @end // // // @implementation NSMutableData (PantomimeExtensions) - (void) appendCFormat: (NSString *) theFormat, ... { NSString *aString; va_list args; va_start(args, theFormat); aString = [[NSString alloc] initWithFormat: theFormat arguments: args]; va_end(args); // We allow lossy conversion to not lose any information / raise an exception [self appendData: [aString dataUsingEncoding: NSASCIIStringEncoding allowLossyConversion: YES]]; RELEASE(aString); } // // // - (void) appendCString: (const char *) theCString { [self appendBytes: theCString length: strlen(theCString)]; } // // // - (void) insertCString: (const char *) theCString atIndex: (int) theIndex { int s_length, length; if (!theCString) { return; } s_length = strlen(theCString); if (s_length == 0) { return; } length = [self length]; // We insert at the beginning of the data if (theIndex <= 0) { NSMutableData *data; data = [NSMutableData dataWithBytes: theCString length: s_length]; [data appendData: self]; [self setData: data]; } // We insert at the end of the data else if (theIndex >= length) { [self appendCString: theCString]; } // We insert somewhere in the middle else { NSMutableData *data; data = [NSMutableData dataWithBytes: [self subdataWithRange: NSMakeRange(0, theIndex)] length: theIndex]; [data appendCString: theCString]; [data appendData: [self subdataWithRange: NSMakeRange(theIndex, length - theIndex)]]; [self setData: data]; } } // // // - (void) replaceCRLFWithLF { unsigned char *bytes, *bi, *bo; int delta, i,length; bytes = [self mutableBytes]; length = [self length]; bi = bo = bytes; for (i = delta = 0; i < length; i++, bi++) { if (i+1 < length && bi[0] == '\r' && bi[1] == '\n') { i++; bi++; delta++; } *bo = *bi; bo++; } [self setLength: length-delta]; } // // // - (NSMutableData *) replaceLFWithCRLF { NSMutableData *aMutableData; unsigned char *bytes, *bi, *bo; int delta, i, length; bi = bytes = [self mutableBytes]; length = [self length]; delta = 0; if (bi[0] == '\n') { delta++; } bi++; for (i = 1; i < length; i++, bi++) { if ((bi[0] == '\n') && (bi[-1] != '\r')) { delta++; } } bi = bytes; aMutableData = [[NSMutableData alloc] initWithLength: (length+delta)]; bo = [aMutableData mutableBytes]; for (i = 0; i < length; i++, bi++, bo++) { if ((i+1 < length) && (bi[0] == '\r') && (bi[1] == '\n')) { *bo = *bi; bo++; bi++; i++; } else if (*bi == '\n') { *bo = '\r'; bo++; } *bo = *bi; } return AUTORELEASE(aMutableData); } @end // // C functions // int getValue(char c) { if (c >= 'A' && c <= 'Z') return (c - 'A'); if (c >= 'a' && c <= 'z') return (c - 'a' + 26); if (c >= '0' && c <= '9') return (c - '0' + 52); if (c == '+') return 62; if (c == '/') return 63; if (c == '=') return 0; return -1; } // // // void nb64ChunkFor3Characters(char *buf, const char *inBuf, int theLength) { if (theLength >= 3) { buf[0] = basis_64[inBuf[0]>>2 & 0x3F]; buf[1] = basis_64[(((inBuf[0] & 0x3)<< 4) | ((inBuf[1] & 0xF0) >> 4)) & 0x3F]; buf[2] = basis_64[(((inBuf[1] & 0xF) << 2) | ((inBuf[2] & 0xC0) >>6)) & 0x3F]; buf[3] = basis_64[inBuf[2] & 0x3F]; } else if(theLength == 2) { buf[0] = basis_64[inBuf[0]>>2 & 0x3F]; buf[1] = basis_64[(((inBuf[0] & 0x3)<< 4) | ((inBuf[1] & 0xF0) >> 4)) & 0x3F]; buf[2] = basis_64[(((inBuf[1] & 0xF) << 2) | ((0 & 0xC0) >>6)) & 0x3F]; buf[3] = '='; } else { buf[0] = basis_64[inBuf[0]>>2 & 0x3F]; buf[1] = basis_64[(((inBuf[0] & 0x3)<< 4) | ((0 & 0xF0) >> 4)) & 0x3F]; buf[2] = '='; buf[3] = '='; } } pantomime1.2-1.2.2+dfsg1/Framework/Pantomime/NSFileManager+Extensions.h000066400000000000000000000032731276751561200255540ustar00rootroot00000000000000/* ** NSFileManager+Extensions.h ** ** Copyright (c) 2004-2007 ** ** Author: Ludovic Marcotte ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** You should have received a copy of the GNU Lesser General Public ** License along with this library; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef _Pantomime_H_NSFileManager_Extensions #define _Pantomime_H_NSFileManager_Extensions #import @class NSString; /*! @category NSFileManager (PantomimeFileManagerExtensions) @abstract Pantomime extensions to NSFileManager. @discussion This category provides useful extensions to the default NSFileManager class. */ @interface NSFileManager (PantomimeFileManagerExtensions) /*! @method enforceMode: atPath: @discussion This method is used to enforce the specified POSIX file permissions at thePath. @param theMode The POSIX file permissions to use. @param thePath The path where to enforce the permissions. */ - (void) enforceMode: (unsigned long) theMode atPath: (NSString *) thePath; @end #endif // _Pantomime_H_NSFileManager_Extensions pantomime1.2-1.2.2+dfsg1/Framework/Pantomime/NSFileManager+Extensions.m000066400000000000000000000034041276751561200255550ustar00rootroot00000000000000/* ** NSFileManager+Extensions.m ** ** Copyright (c) 2004-2007 ** ** Author: Ludovic Marcotte ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** You should have received a copy of the GNU Lesser General Public ** License along with this library; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include #include // // // @implementation NSFileManager (PantomimeFileManagerExtensions) - (void) enforceMode: (unsigned long) theMode atPath: (NSString *) thePath { NSMutableDictionary *currentFileAttributes; unsigned long current_attributes, desired_attributes; currentFileAttributes = [[NSMutableDictionary alloc] initWithDictionary: [self fileAttributesAtPath: thePath traverseLink: YES]]; current_attributes = [currentFileAttributes filePosixPermissions]; desired_attributes = theMode; if (current_attributes != desired_attributes) { [currentFileAttributes setObject: [NSNumber numberWithUnsignedLong: desired_attributes] forKey: NSFilePosixPermissions]; [self changeFileAttributes: currentFileAttributes atPath: thePath]; } [currentFileAttributes release]; } @end pantomime1.2-1.2.2+dfsg1/Framework/Pantomime/NSScanner+Extensions.h000066400000000000000000000030721276751561200247700ustar00rootroot00000000000000/* ** NSScanner+Extensions.h ** ** Copyright (c) 2005 ** ** Author: Ludovic Marcotte ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** You should have received a copy of the GNU Lesser General Public ** License along with this library; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef _Pantomime_H_NSScanner_Extensions #define _Pantomime_H_NSScanner_Extensions #import /*! @category NSScanner (PantomimeScannerExtensions) @abstract Pantomime extensions to NSScanner. @discussion This category provides useful extensions to the default NSScanner class. */ @interface NSScanner (PantomimeScannerExtensions) /*! @method scanUnsignedInt: @discussion This method is used to scan an unsigned int. @param theValue The value in which the unsigned int will be stored. @result YES if we find a decimal unsigned int, no otherwise. */ - (BOOL) scanUnsignedInt: (unsigned int *) theValue; @end #endif // _Pantomime_H_NSFileManager_Extensions pantomime1.2-1.2.2+dfsg1/Framework/Pantomime/NSScanner+Extensions.m000066400000000000000000000032611276751561200247750ustar00rootroot00000000000000/* ** NSScanner+Extensions.m ** ** Copyright (c) 2005 ** ** Author: Ludovic Marcotte ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** You should have received a copy of the GNU Lesser General Public ** License along with this library; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include #include #include // // // @implementation NSScanner (PantomimeScannerExtensions) - (BOOL) scanUnsignedInt: (unsigned int *) theValue { NSString *s; unsigned int d, v, l1, l2, len; l1 = l2 = [self scanLocation]; s = [self string]; len = [s length]; while (l1 < len) { if (isdigit([s characterAtIndex: l1])) { l2 = l1; while (l2 < len && isdigit([s characterAtIndex: l2])) { l2++; } break; } l1++; } if (l2 <= l1) { [self setScanLocation: l1+1]; return NO; } [self setScanLocation: (l2+1 > len ? len : l2+1)]; v = 0; d = 1; l2--; while (l2 >= l1) { v += (([s characterAtIndex: l2]-48)*d); d *= 10; l2--; } *theValue = v; return YES; } @end pantomime1.2-1.2.2+dfsg1/Framework/Pantomime/NSString+Extensions.h000066400000000000000000000246161276751561200246540ustar00rootroot00000000000000/* ** NSString+Extensions.h ** ** Copyright (c) 2001-2007 ** ** Author: Ludovic Marcotte ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** You should have received a copy of the GNU Lesser General Public ** License along with this library; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef _Pantomime_H_NSString_Extensions #define _Pantomime_H_NSString_Extensions #import #import #include @class CWPart; /*! @category NSString (PantomimeStringExtensions) @abstract Pantomime NSString extensions for mail processing. @discussion This category is used to defined useful methods in order to facilitate mail processing. */ @interface NSString (PantomimeStringExtensions) #ifdef MACOSX /*! @method stringByTrimmingWhiteSpaces @discussion This method is used to trim the leading and trailing spaces (space characters, tabs, newlines, carriage returns or other characters with no visible representation) from the receiver. @result The trimmed string. */ - (NSString *) stringByTrimmingWhiteSpaces; #else #define stringByTrimmingWhiteSpaces stringByTrimmingSpaces #endif /*! @method indexOfCharacter: @discussion This method finds the first occurence of the character in the receiver and returns its index (zero-based) @param theCharacter The caracter to be searched for. @result The index of the character, -1 if it's not found in the receiver. */ - (int) indexOfCharacter: (unichar) theCharacter; - (int) indexOfCharacter: (unichar) theCharacter fromIndex: (unsigned int) theIndex; /*! @method hasCaseInsensitivePrefix: @discussion Same as -hasPrefix but the comparison is done in a case-insensitiveness matter. @param thePrefix The prefix to be used. @result YES the there is a match, NO otherwise. */ - (BOOL) hasCaseInsensitivePrefix: (NSString *) thePrefix; /*! @method hasCaseInsensitiveSuffix: @discussion Same as -hasSuffix but the comparison is done in a case-insensitiveness matter. @param theSuffix The suffix to be used. @result YES the there is a match, NO otherwise. */ - (BOOL) hasCaseInsensitiveSuffix: (NSString *) theSuffix; /*! @method stringFromQuotedString @discussion This method returns an unquoted string if the string has a leading AND trailing quote. @result The unquoted string or the original if it does not match the criteria. */ - (NSString *) stringFromQuotedString; /*! @method stringValueOfTransferEncoding: @abstract Get the string value of the specified encoding. @discussion This method is used to return the string value of a specified encoding. If the encoding isn't found, it simply returns the default encoding, which is 7bit. @param theEncoding The int value of the specified encoding. @result Returns a NSString holding the string value of the encoding. */ + (NSString *) stringValueOfTransferEncoding: (int) theEncoding; /*! @method encodingForCharset: @discussion This method is used to obtain a string encoding based on the specified charset. @param theCharset The charset, as NSData. @result The encoding which might not be a NSStringEncoding. */ + (int) encodingForCharset: (NSData *) theCharset; /*! @method encodingForCharset:convertToNSStringEncoding: @discussion This method is used to obtain a string encoding based on the specified charset. @param theCharset The charset, as NSData. @param shouldConvert Set to YES if NSString's en/decoding is going to be used. If set to NO will only be usable for CoreFoundation. @result The encoding which might not be a NSStringEncoding. */ + (int) encodingForCharset: (NSData *) theCharset convertToNSStringEncoding: (BOOL) shouldConvert; /*! @method encodingForPart: @discussion Same as +encodingForCharset: but uses the Part: -defaultCharset or -charset. @param thePart The Part object from which the encoding will be derived from. @result The encoding which might not be a NSStringEncoding. */ + (int) encodingForPart: (CWPart *) thePart; /*! @method encodingForPart:convertToNSStringEncoding: @discussion Same as +encodingForCharset:convertToNSStringEncoding: but uses the Part: -defaultCharset or -charset. @param thePart The Part object from which the encoding will be derived from. @param shouldConvert Set to YES if NSString's en/decoding is going to be used. If set to NO will only be usable for CoreFoundation. @result The encoding which might not be a NSStringEncoding. */ + (int) encodingForPart: (CWPart *) thePart convertToNSStringEncoding: (BOOL) shouldConvert; /*! @method stringWithData:charset: @discussion This method builds a NSString object from the data object, using the specified charset. @param theData The data from which the string will be built. @param theCharset The charset to use when building the string object. @result The string object, nil on error. */ + (NSString *) stringWithData: (NSData *) theData charset: (NSData *) theCharset; /*! @method charset @discussion This method is used to guess the best charset that can be used. @result The best charset, UTF-8 otherwise. */ - (NSString *) charset; /*! @method modifiedUTF7String @discussion This method returns a newly created NSString object which can be converted using the NSASCIIStringEncoding using the modified UTF-7 encoding described in RFC3501. A modified UTF-7 string MUST be used in IMAP for maibox names. @result A modified UTF-7 string. */ - (NSString *) modifiedUTF7String; /*! @method stringFromModifiedUTF7 @discussion This method creates a new string NSString object from the modified UTF-7 string which is 7-bit based. The newly created string can contain Unicode characters. @result An Unicode string object, nil if the conversion failed. */ - (NSString *) stringFromModifiedUTF7; /*! @method hasREPrefix @discussion This method is used to check if the string has a "re:", "re :" and so on prefix. @result YES if such prefix exists, NO otherwise. */ - (BOOL) hasREPrefix; /*! @method stringByReplacingOccurrencesOfCharacter:withCharacter: @discussion This method is used to replace all occurences of theTarget by theReplacement character. @param theTarget The character to be replaced. @param theReplacement The characterthat will be used as the replacement. @result The modified string where all occurences of theTarget are replaced by theReplacement. */ - (NSString *) stringByReplacingOccurrencesOfCharacter: (unichar) theTarget withCharacter: (unichar) theReplacement; /*! @method stringByDeletingLastPathComponentWithSeparator: @discussion This method is used to delete the last path component by using theSeparator as the path separator. For example, some IMAP servers use '.' as the separator. @param theSeparator The separator to use. @result A string without the last path component. */ - (NSString *) stringByDeletingLastPathComponentWithSeparator: (unsigned char) theSeparator; /*! @method stringByDeletingFirstPathSeparator: @discussion This method removes the first occurence of theSeparator from the string. For example "/foo/bar/baz" becomes "foo/bar/baz" and ".a.b.c" becomes "a.b.c". @param theSeparator The separator to use. @result A string without the leading separator. */ - (NSString *) stringByDeletingFirstPathSeparator: (unsigned char) theSeparator; /*! @method is7bitSafe @discussion This method is used to verify if the string contains any character greater than 0x007E. @result YES if it does, NO otherwise. */ - (BOOL) is7bitSafe; /*! @method dataUsingEncodingForPart: @discussion Convenience for dataUsingEncodingForPart:allowLossyConversion: where no lossy conversion is allowed. @param thePart The Part object from which the encoding will be derived from. @result The data. */ - (NSData *) dataUsingEncodingFromPart: (CWPart *) thePart; /*! @method dataUsingEncodingForPart:allowLossyConversion: @discussion Convenience for getting data out of the string in the correct encoding using the Part. @param thePart The Part object from which the encoding will be derived from. @param lossy Indicate if lossy conversion is allowed. @result The data. */ - (NSData *) dataUsingEncodingFromPart: (CWPart *) thePart allowLossyConversion: (BOOL)lossy; /*! @method dataUsingEncodingWithCharset: @discussion Convenience for dataUsingEncodingWithCharset:allowLossyConversion: where no lossy conversion is allowed. @param theCharset The character set that is used for the encoding. @result The data. */ - (NSData *) dataUsingEncodingWithCharset: (NSString *) theCharset; /*! @method dataUsingEncodingWithCharset:allowLossyConversion: @discussion Convenience for getting data out of the string in with the given character set @param theCharset The character set that is used for the encoding. @param lossy Indicate if lossy conversion is allowed. @result The data. */ - (NSData *) dataUsingEncodingWithCharset: (NSString *) theCharset allowLossyConversion: (BOOL)lossy; /*! @method stringFromRecipients: type: @discussion This method is used obtain a string from a list of recipients. The returned addresses are only the ones that match theRecipientType. @param theRecipients A NSArray of InternetAddress instances. @param theRecipientType The type of recipient. @result The formatted string. */ + (NSString *) stringFromRecipients: (NSArray *) theRecipients type: (PantomimeRecipientType) theRecipientType; @end #endif // _Pantomime_H_NSString_Extensions pantomime1.2-1.2.2+dfsg1/Framework/Pantomime/NSString+Extensions.m000066400000000000000000000537131276751561200246610ustar00rootroot00000000000000/* ** NSString+Extensions.m ** ** Copyright (c) 2001-2007 ** 2014 ** ** Author: Ludovic Marcotte ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** You should have received a copy of the GNU Lesser General Public ** License along with this library; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include #include #include #include #include #include #include // // We include the CoreFoundation headers under Mac OS X so we can support // more string encodings. // #ifdef MACOSX #include #include #else #include #endif #include #ifdef HAVE_ICONV #include #if defined (MACOSX) || defined (__NetBSD__) || defined (__FreeBSD__) #define iconv_const_qualifier const #else #define iconv_const_qualifier #endif #endif #define IS_PRINTABLE(c) (isascii(c) && isprint(c)) // // // @implementation NSString (PantomimeStringExtensions) #ifdef MACOSX - (NSString *) stringByTrimmingWhiteSpaces { NSMutableString *aMutableString; aMutableString = [[NSMutableString alloc] initWithString: self]; CFStringTrimWhitespace((CFMutableStringRef)aMutableString); return AUTORELEASE(aMutableString); } #endif // // // - (int) indexOfCharacter: (unichar) theCharacter { return [self indexOfCharacter: theCharacter fromIndex: 0]; } // // // - (int) indexOfCharacter: (unichar) theCharacter fromIndex: (unsigned int) theIndex { int i, len; len = [self length]; for (i = theIndex; i < len; i++) { if ([self characterAtIndex: i] == theCharacter) { return i; } } return -1; } // // // - (BOOL) hasCaseInsensitivePrefix: (NSString *) thePrefix { if (thePrefix) { return [[self uppercaseString] hasPrefix: [thePrefix uppercaseString]]; } return NO; } // // // - (BOOL) hasCaseInsensitiveSuffix: (NSString *) theSuffix { if (theSuffix) { return [[self uppercaseString] hasSuffix: [theSuffix uppercaseString]]; } return NO; } // // // - (NSString *) stringFromQuotedString { int len; len = [self length]; if (len > 1 && [self characterAtIndex: 0] == '"' && [self characterAtIndex: (len-1)] == '"') { return [self substringWithRange: NSMakeRange(1, len-2)]; } return self; } // // // + (NSString *) stringValueOfTransferEncoding: (int) theEncoding { switch (theEncoding) { case PantomimeEncodingNone: break; case PantomimeEncodingQuotedPrintable: return @"quoted-printable"; case PantomimeEncodingBase64: return @"base64"; case PantomimeEncoding8bit: return @"8bit"; case PantomimeEncodingBinary: return @"binary"; default: break; } // PantomimeEncoding7bit will also fall back here. return @"7bit"; } // // // + (int) encodingForCharset: (NSData *) theCharset { return [self encodingForCharset: theCharset convertToNSStringEncoding: YES]; } // // Convenience to be able to use CoreFoundation conversion instead of NSString // + (int) encodingForCharset: (NSData *) theCharset convertToNSStringEncoding: (BOOL) shouldConvert { // We define some aliases for the string encoding. static struct { NSString *name; int encoding; BOOL fromCoreFoundation; } encodings[] = { {@"ascii" ,NSASCIIStringEncoding ,NO}, {@"us-ascii" ,NSASCIIStringEncoding ,NO}, {@"default" ,NSASCIIStringEncoding ,NO}, // Ah... spammers. {@"utf-8" ,NSUTF8StringEncoding ,NO}, {@"iso-8859-1" ,NSISOLatin1StringEncoding ,NO}, {@"x-user-defined",NSISOLatin1StringEncoding ,NO}, // To prevent a lame bug in Outlook. {@"unknown" ,NSISOLatin1StringEncoding ,NO}, // Once more, blame Outlook. {@"x-unknown" ,NSISOLatin1StringEncoding ,NO}, // To prevent a lame bug in Pine 4.21. {@"unknown-8bit" ,NSISOLatin1StringEncoding ,NO}, // To prevent a lame bug in Mutt/1.3.28i {@"0" ,NSISOLatin1StringEncoding ,NO}, // To prevent a lame bug in QUALCOMM Windows Eudora Version 6.0.1.1 {@"" ,NSISOLatin1StringEncoding ,NO}, // To prevent a lame bug in Ximian Evolution {@"iso8859_1" ,NSISOLatin1StringEncoding ,NO}, // To prevent a lame bug in Openwave WebEngine {@"iso-8859-2" ,NSISOLatin2StringEncoding ,NO}, #ifndef MACOSX {@"iso-8859-3" ,NSISOLatin3StringEncoding ,NO}, {@"iso-8859-4" ,NSISOLatin4StringEncoding ,NO}, {@"iso-8859-5" ,NSISOCyrillicStringEncoding ,NO}, {@"iso-8859-6" ,NSISOArabicStringEncoding ,NO}, {@"iso-8859-7" ,NSISOGreekStringEncoding ,NO}, {@"iso-8859-8" ,NSISOHebrewStringEncoding ,NO}, {@"iso-8859-9" ,NSISOLatin5StringEncoding ,NO}, {@"iso-8859-10" ,NSISOLatin6StringEncoding ,NO}, {@"iso-8859-11" ,NSISOThaiStringEncoding ,NO}, {@"iso-8859-13" ,NSISOLatin7StringEncoding ,NO}, {@"iso-8859-14" ,NSISOLatin8StringEncoding ,NO}, {@"iso-8859-15" ,NSISOLatin9StringEncoding ,NO}, {@"koi8-r" ,NSKOI8RStringEncoding ,NO}, {@"big5" ,NSBIG5StringEncoding ,NO}, {@"gb2312" ,NSGB2312StringEncoding ,NO}, {@"utf-7" ,NSUTF7StringEncoding ,NO}, {@"unicode-1-1-utf-7", NSUTF7StringEncoding ,NO}, // To prever a bug (sort of) in MS Hotmail #endif {@"windows-1250" ,NSWindowsCP1250StringEncoding ,NO}, {@"windows-1251" ,NSWindowsCP1251StringEncoding ,NO}, {@"cyrillic (windows-1251)", NSWindowsCP1251StringEncoding ,NO}, // To prevent a bug in MS Hotmail {@"windows-1252" ,NSWindowsCP1252StringEncoding ,NO}, {@"windows-1253" ,NSWindowsCP1253StringEncoding ,NO}, {@"windows-1254" ,NSWindowsCP1254StringEncoding ,NO}, {@"iso-2022-jp" ,NSISO2022JPStringEncoding ,NO}, {@"euc-jp" ,NSJapaneseEUCStringEncoding ,NO}, }; NSString *name; int i; name = [[NSString stringWithCString: [theCharset bytes] length: [theCharset length]] lowercaseString]; for (i = 0; i < sizeof(encodings)/sizeof(encodings[0]); i++) { if ([name isEqualToString: encodings[i].name]) { int enc = encodings[i].encoding; // Under OS X, we use CoreFoundation if necessary to convert the encoding // to a NSString encoding. #ifdef MACOSX if (encodings[i].fromCoreFoundation) { if (shouldConvert) { return CFStringConvertEncodingToNSStringEncoding(enc); } else { return enc; } } else { if (!shouldConvert) { return CFStringConvertNSStringEncodingToEncoding(enc); } else { return enc; } } #else return enc; #endif } } #ifdef MACOSX // Last resort: try using CoreFoundation... CFStringEncoding enc; enc = CFStringConvertIANACharSetNameToEncoding((CFStringRef)name); if (kCFStringEncodingInvalidId != enc) { if (shouldConvert) { return CFStringConvertEncodingToNSStringEncoding(enc); } else { return enc; } } #endif return -1; } // // // + (int) encodingForPart: (CWPart *) thePart { return [self encodingForPart: thePart convertToNSStringEncoding: YES]; } // // Convenience to be able to use CoreFoundation conversion instead of NSString // + (int) encodingForPart: (CWPart *) thePart convertToNSStringEncoding: (BOOL) shouldConvert { int encoding; // We get the encoding we are gonna use. We always favor the default encoding. if ([thePart defaultCharset]) { encoding = [self encodingForCharset: [[thePart defaultCharset] dataUsingEncoding: NSASCIIStringEncoding] convertToNSStringEncoding: shouldConvert]; } else if ([thePart charset]) { encoding = [self encodingForCharset: [[thePart charset] dataUsingEncoding: NSASCIIStringEncoding] convertToNSStringEncoding: shouldConvert]; } else { encoding = [NSString defaultCStringEncoding]; } if (encoding == -1 || encoding == NSASCIIStringEncoding) { encoding = NSISOLatin1StringEncoding; } return encoding; } // // // + (NSString *) stringWithData: (NSData *) theData charset: (NSData *) theCharset { int encoding; if (theData == nil) { return nil; } #ifdef MACOSX encoding = [NSString encodingForCharset: theCharset convertToNSStringEncoding: NO]; #else encoding = [NSString encodingForCharset: theCharset]; #endif if (encoding == -1) { #ifdef HAVE_ICONV NSString *aString; const char *i_bytes, *from_code; char *o_bytes; size_t i_length, o_length, ret; int total_length; iconv_t conv; // Instead of calling cString directly on theCharset, we first try // to obtain the ASCII string of the data object. from_code = [[theCharset asciiString] cString]; if (!from_code) { return nil; } conv = iconv_open("UTF-8", from_code); if (conv == (iconv_t)-1) { // Let's assume we got US-ASCII here. return AUTORELEASE([[NSString alloc] initWithData: theData encoding: NSASCIIStringEncoding]); } i_bytes = [theData bytes]; i_length = [theData length]; total_length = o_length = sizeof(unichar)*i_length; o_bytes = (char *)malloc(o_length); if (o_bytes == NULL) return nil; while (i_length > 0) { ret = iconv(conv, (iconv_const_qualifier char **)&i_bytes, &i_length, &o_bytes, &o_length); if (ret == (size_t)-1) { iconv_close(conv); total_length = total_length - o_length; o_bytes -= total_length; free(o_bytes); return nil; } } total_length = total_length - o_length; o_bytes -= total_length; // If we haven't used all our allocated buffer, we shrink it. if (o_length > 0 && total_length > 0) { if (realloc(o_bytes, total_length) == NULL) { NSLog(@"stringWithData, realloc() failed, returning nil"); iconv_close(conv); return nil; } } aString = [[NSString alloc] initWithData: [NSData dataWithBytesNoCopy: o_bytes length: total_length] encoding: NSUTF8StringEncoding]; iconv_close(conv); return AUTORELEASE(aString); #else return nil; #endif } #ifdef MACOSX return AUTORELEASE((NSString *)CFStringCreateFromExternalRepresentation(NULL, (CFDataRef)theData, encoding)); #else return AUTORELEASE([[NSString alloc] initWithData: theData encoding: encoding]); #endif } // // // #warning return Charset instead? - (NSString *) charset { NSMutableArray *aMutableArray; NSString *aString; CWCharset *aCharset; unsigned int i, j; aMutableArray = [[NSMutableArray alloc] initWithCapacity: 21]; [aMutableArray addObject: [CWCharset charsetForName: @"iso-8859-1"]]; [aMutableArray addObject: [CWCharset charsetForName: @"iso-8859-2"]]; [aMutableArray addObject: [CWCharset charsetForName: @"iso-8859-3"]]; [aMutableArray addObject: [CWCharset charsetForName: @"iso-8859-4"]]; [aMutableArray addObject: [CWCharset charsetForName: @"iso-8859-5"]]; [aMutableArray addObject: [CWCharset charsetForName: @"iso-8859-6"]]; [aMutableArray addObject: [CWCharset charsetForName: @"iso-8859-7"]]; [aMutableArray addObject: [CWCharset charsetForName: @"iso-8859-8"]]; [aMutableArray addObject: [CWCharset charsetForName: @"iso-8859-9"]]; [aMutableArray addObject: [CWCharset charsetForName: @"iso-8859-10"]]; [aMutableArray addObject: [CWCharset charsetForName: @"iso-8859-11"]]; [aMutableArray addObject: [CWCharset charsetForName: @"iso-8859-13"]]; [aMutableArray addObject: [CWCharset charsetForName: @"iso-8859-14"]]; [aMutableArray addObject: [CWCharset charsetForName: @"iso-8859-15"]]; [aMutableArray addObject: [CWCharset charsetForName: @"koi8-r"]]; [aMutableArray addObject: [CWCharset charsetForName: @"koi8-u"]]; [aMutableArray addObject: [CWCharset charsetForName: @"windows-1250"]]; [aMutableArray addObject: [CWCharset charsetForName: @"windows-1251"]]; [aMutableArray addObject: [CWCharset charsetForName: @"windows-1252"]]; [aMutableArray addObject: [CWCharset charsetForName: @"windows-1253"]]; [aMutableArray addObject: [CWCharset charsetForName: @"windows-1254"]]; for (i = 0; i < [self length]; i++) { for (j = 0; j < [aMutableArray count]; j++) { if (![[aMutableArray objectAtIndex: j] characterIsInCharset: [self characterAtIndex: i]]) { // Character is not in the charset [aMutableArray removeObjectAtIndex: j]; j--; } } // FIXME: can't break even if there is only one left. First we have to check // whether that encoding will actually work for the entire string. If it // doesn't we'll need to fall back to utf-8 (or something else that can encode // _everything_). // // Intelligent string splitting would help, of course // if ([aMutableArray count] < 1) { // We have zero or one charset break; } } if ([aMutableArray count]) { aCharset = [aMutableArray objectAtIndex: 0]; [aMutableArray removeAllObjects]; aString = [aCharset name]; } else { // We have no charset, we try to "guess" a default charset if ([self canBeConvertedToEncoding: NSISO2022JPStringEncoding]) { // ISO-2022-JP is the standard of Japanese character encoding aString = @"iso-2022-jp"; } else { // We have no charset, we return a default charset aString = @"utf-8"; } } RELEASE(aMutableArray); return aString; } // // // - (NSString *) modifiedUTF7String { #ifndef MACOSX NSMutableData *aMutableData, *modifiedData; NSString *aString; const char *b; BOOL escaped; unichar ch; int i, len; // // We UTF-7 encode _only_ the non-ASCII parts. // aMutableData = [[NSMutableData alloc] init]; AUTORELEASE(aMutableData); len = [self length]; for (i = 0; i < len; i++) { ch = [self characterAtIndex: i]; if (IS_PRINTABLE(ch)) { [aMutableData appendCFormat: @"%c", ch]; } else { int j; j = i+1; // We got a non-ASCII character, let's get the substring and encode it using UTF-7. while (j < len && !IS_PRINTABLE([self characterAtIndex: j])) { j++; } // Get the substring. [aMutableData appendData: [[self substringWithRange: NSMakeRange(i,j-i)] dataUsingEncoding: NSUTF7StringEncoding]]; i = j-1; } } b = [aMutableData bytes]; len = [aMutableData length]; escaped = NO; // // We replace: // // & -> &- // + -> & // +- -> + // / -> , // // in order to produce our modified UTF-7 string. // modifiedData = [[NSMutableData alloc] init]; AUTORELEASE(modifiedData); for (i = 0; i < len; i++, b++) { if (!escaped && *b == '&') { [modifiedData appendCString: "&-"]; } else if (!escaped && *b == '+') { if (*(b+1) == '-') { [modifiedData appendCString: "+"]; } else { [modifiedData appendCString: "&"]; // We enter the escaped mode. escaped = YES; } } else if (escaped && *b == '/') { [modifiedData appendCString: ","]; } else if (escaped && *b == '-') { [modifiedData appendCString: "-"]; // We leave the escaped mode. escaped = NO; } else { [modifiedData appendCFormat: @"%c", *b]; } } // If we're still in the escaped mode we haven't added our trailing -, // let's add it right now. if (escaped) { [modifiedData appendCString: "-"]; } aString = AUTORELEASE([[NSString alloc] initWithData: modifiedData encoding: NSASCIIStringEncoding]); return (aString != nil ? aString : self); #else return self; #endif } // // // - (NSString *) stringFromModifiedUTF7 { #ifndef MACOSX NSMutableData *aMutableData; BOOL escaped; unichar ch; int i, len; aMutableData = [[NSMutableData alloc] init]; AUTORELEASE(aMutableData); len = [self length]; escaped = NO; // // We replace: // // & -> + // &- -> & // , -> / // // If we are in escaped mode. That is, between a &....- // for (i = 0; i < len; i++) { ch = [self characterAtIndex: i]; if (!escaped && ch == '&') { if ( (i+1) < len && [self characterAtIndex: (i+1)] != '-' ) { [aMutableData appendCString: "+"]; // We enter the escaped mode. escaped = YES; } else { // We replace &- by & [aMutableData appendCString: "&"]; i++; } } else if (escaped && ch == ',') { [aMutableData appendCString: "/"]; } else if (escaped && ch == '-') { [aMutableData appendCString: "-"]; // We leave the escaped mode. escaped = NO; } else { [aMutableData appendCFormat: @"%c", ch]; } } return AUTORELEASE([[NSString alloc] initWithData: aMutableData encoding: NSUTF7StringEncoding]); #else return nil; #endif } // // // - (BOOL) hasREPrefix { if ([self hasCaseInsensitivePrefix: @"re:"] || [self hasCaseInsensitivePrefix: @"re :"] || [self hasCaseInsensitivePrefix: _(@"PantomimeReferencePrefix")] || [self hasCaseInsensitivePrefix: _(@"PantomimeResponsePrefix")]) { return YES; } return NO; } // // // - (NSString *) stringByReplacingOccurrencesOfCharacter: (unichar) theTarget withCharacter: (unichar) theReplacement { NSMutableString *aMutableString; int len, i; unichar c; if (!theTarget || !theReplacement || theTarget == theReplacement) { return self; } len = [self length]; aMutableString = [NSMutableString stringWithCapacity: len]; for (i = 0; i < len; i++) { c = [self characterAtIndex: i]; if (c == theTarget) { [aMutableString appendFormat: @"%c", theReplacement]; } else { [aMutableString appendFormat: @"%c", c]; } } return aMutableString; } // // // - (NSString *) stringByDeletingLastPathComponentWithSeparator: (unsigned char) theSeparator { int i, c; c = [self length]; for (i = c-1; i >= 0; i--) { if ([self characterAtIndex: i] == theSeparator) { return [self substringToIndex: i]; } } return @""; } // // // - (NSString *) stringByDeletingFirstPathSeparator: (unsigned char) theSeparator { if ([self length] && [self characterAtIndex: 0] == theSeparator) { return [self substringFromIndex: 1]; } return self; } // // // - (BOOL) is7bitSafe { int i, len; // We search for a non-ASCII character. len = [self length]; for (i = 0; i < len; i++) { if ([self characterAtIndex: i] > 0x007E) { return NO; } } return YES; } // // // - (NSData *) dataUsingEncodingFromPart: (CWPart *) thePart { return [self dataUsingEncodingFromPart: thePart allowLossyConversion: NO]; } // // // - (NSData *) dataUsingEncodingFromPart: (CWPart *) thePart allowLossyConversion: (BOOL) lossy { #ifdef MACOSX // Use the CF decoding to get the data, bypassing Foundation... CFStringEncoding enc; NSData *data; enc = [isa encodingForPart: thePart convertToNSStringEncoding: NO]; data = (NSData *)CFStringCreateExternalRepresentation(NULL, (CFStringRef)self, enc, (lossy) ? '?' : 0); return [data autorelease]; #else return [self dataUsingEncoding: [object_getClass(self) encodingForPart: thePart] allowLossyConversion: lossy]; #endif } // // // - (NSData *) dataUsingEncodingWithCharset: (NSString *) theCharset { return [self dataUsingEncodingWithCharset: theCharset allowLossyConversion: NO]; } // // // - (NSData *) dataUsingEncodingWithCharset: (NSString *) theCharset allowLossyConversion: (BOOL)lossy { #ifdef MACOSX // Use the CF decoding to get the data, bypassing Foundation... CFStringEncoding enc; NSData *data; enc = [isa encodingForCharset: [theCharset dataUsingEncoding: NSASCIIStringEncoding] convertToNSStringEncoding: NO]; data = (NSData *)CFStringCreateExternalRepresentation(NULL, (CFStringRef)self, enc, (lossy) ? '?' : 0); return [data autorelease]; #else return [self dataUsingEncoding: [object_getClass(self) encodingForCharset: [theCharset dataUsingEncoding: NSASCIIStringEncoding]] allowLossyConversion: lossy]; #endif } // // // + (NSString *) stringFromRecipients: (NSArray *) theRecipients type: (PantomimeRecipientType) theRecipientType { CWInternetAddress *anInternetAddress; NSMutableString *aMutableString; int i, count; aMutableString = [[NSMutableString alloc] init]; count = [theRecipients count]; for (i = 0; i < count; i++) { anInternetAddress = [theRecipients objectAtIndex: i]; if ([anInternetAddress type] == theRecipientType) { [aMutableString appendFormat: @"%@, ", [anInternetAddress stringValue]]; } } return AUTORELEASE(aMutableString); } @end pantomime1.2-1.2.2+dfsg1/Framework/Pantomime/Pantomime.h000066400000000000000000000064111276751561200227340ustar00rootroot00000000000000/* ** Pantomime.h ** ** Copyright (c) 2001-2007 ** ** Author: Ludovic Marcotte ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** You should have received a copy of the GNU Lesser General Public ** License along with this library; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef _Pantomime_H_Pantomime #define _Pantomime_H_Pantomime #import #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #ifdef MACOSX #include #endif #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #endif // _Pantomime_H_Pantomime pantomime1.2-1.2.2+dfsg1/Framework/Pantomime/io.c000066400000000000000000000115161276751561200214070ustar00rootroot00000000000000/* ** io.c ** ** Copyright (c) 2004-2007 ** 2014 The GNUstep Team ** ** Author: Ludovic Marcotte ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** You should have received a copy of the GNU Lesser General Public ** License along with this library; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include #include #ifdef __MINGW32__ #include // For _read(), _write() and _close() on MinGW #include // For recv() on MinGW #else #include #include #endif #include // For abort() #include #include // For memset() #include // For ntohs() and friends. #include // For read(), write() and close() #ifdef MACOSX #include // For read() and write() on OS X #endif #if !defined(FIONBIO) && !defined(__MINGW32__) #include // For FIONBIO on Solaris #endif // // // ssize_t read_block(int fd, void *buf, size_t count) { ssize_t tot, bytes; tot = bytes = 0; while (tot < count) { #ifdef __MINGW32__ if ((bytes = _read(fd, buf+tot, count-tot)) == -1) #else if ((bytes = read(fd, buf+tot, count-tot)) == -1) #endif { if (errno != EINTR) { return -1; } } else { tot += bytes; } } return tot; } // // // int safe_close(int fd) { int value; #ifdef __MINGW32__ while (value = _close(fd), value == -1 && errno == EINTR); #else while (value = close(fd), value == -1 && errno == EINTR); #endif return value; } // // // ssize_t safe_read(int fd, void *buf, size_t count) { ssize_t value; #ifdef __MINGW32__ while (value = _read(fd, buf, count), value == -1 && errno == EINTR); #else while (value = read(fd, buf, count), value == -1 && errno == EINTR); #endif return value; } // // // ssize_t safe_recv(int fd, void *buf, size_t count, int flags) { ssize_t value; while (value = recv(fd, buf, count, flags), value == -1 && errno == EINTR); return value; } // // // void read_string_memory(unsigned char *m, unsigned char *buf, unsigned short int *count) { unsigned short c0, c1, r; c0 = *m; c1 = *(m+1); #if BYTE_ORDER == BIG_ENDIAN *count = r = ntohs((c0<<8)|c1); #else *count = r = ntohs((c1<<8)|c0); #endif m += 2; while (r--) { *buf++ = *m++; } *buf = 0; } // // // unsigned int read_unsigned_int_memory(unsigned char *m) { unsigned int c0, c1, c2, c3, r; c0 = *m; c1 = *(m+1); c2 = *(m+2); c3 = *(m+3); #if BYTE_ORDER == BIG_ENDIAN r = (c0<<24)|(c1<<16)|(c2<<8)|c3; #else r = (c3<<24)|(c2<<16)|(c1<<8)|c0; #endif //NSLog(@"read r = %d", ntohl(r)); return ntohl(r); } // // // unsigned short read_unsigned_short(int fd) { unsigned short v; if (read(fd, &v, 2) != 2) abort(); return ntohs(v); } // // // void write_unsigned_short(int fd, unsigned short value) { unsigned short int v; v = htons(value); if (write(fd, &v, 2) != 2) { //printf("Error writing cache, aborting."); abort(); } } // // // void read_string(int fd, char *buf, unsigned short int *count) { *count = read_unsigned_short(fd); if (*count) { ssize_t nbytes; nbytes = read(fd, buf, *count); if (nbytes == (ssize_t)*count) return; if (nbytes == 0) { printf("read_string: EOF\n"); } else if (nbytes == -1) { printf("read_string: error\n"); } printf("read_string: read less bytes than expected\n"); abort(); } } // // // void write_string(int fd, unsigned char *s, unsigned short len) { if (s && len > 0) { write_unsigned_short(fd, len); if (write(fd, s, len) != len) { //NSLog(@"FAILED TO WRITE BYTES, ABORT"); abort(); } } else { write_unsigned_short(fd, 0); } } // // // unsigned int read_unsigned_int(int fd) { unsigned int v; int c; if ((c = read(fd, &v, 4)) != 4) { if (c == 0) printf("read_unsinged_int: EOF\n"); // printf("read = %d\n", c); } return ntohl(v); } // // // void write_unsigned_int(int fd, unsigned int value) { unsigned int v; v = htonl(value); //printf("b|%d| a|%d|", value, v); if (write(fd, &v, 4) != 4) { //NSLog(@"ERROR WRITING CACHE."); abort(); } } pantomime1.2-1.2.2+dfsg1/Framework/Pantomime/io.h000066400000000000000000000132701276751561200214130ustar00rootroot00000000000000/* ** io.h ** ** Copyright (c) 2004-2007 ** ** Author: Ludovic Marcotte ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** You should have received a copy of the GNU Lesser General Public ** License along with this library; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef _Pantomime_H_io #define _Pantomime_H_io #include /*! @function read_block @discussion This function is used to read count bytes from fd and store them in buf. This method blocks until it read all bytes or if an error different from EINTR occurs. @param fd The file descriptor to read bytes from. @param buf The buffer where to store the read bytes. @param count The number of bytes to read. @result The number of bytes that have been read. */ ssize_t read_block(int fd, void *buf, size_t count); /*! @function safe_close @discussion This function is used to safely close a file descriptor. This function will block until the file descriptor is close, or if the error is different from EINTR. @param fd The file descriptor to close. @result Returns 0 on success, -1 if an error occurs. */ int safe_close(int fd); /*! @function safe_read @discussion This function is used to read count bytes from fd and store them in buf. This method might not block when reading if there are no bytes available to be read. @param fd The file descriptor to read bytes from. @param buf The buffer where to store the read bytes. @param count The number of bytes to read. @result The number of bytes that have been read. */ ssize_t safe_read(int fd, void *buf, size_t count); /*! @function safe_recv @discussion This function is used to read count bytes from fd and store them in buf. This method might not block when reading if there are no bytes available to be read. Options can be passed through flags. @param fd The file descriptor to read bytes from. @param buf The buffer where to store the read bytes. @param count The number of bytes to read. @param flags The flags to use. @result The number of bytes that have been read. */ ssize_t safe_recv(int fd, void *buf, size_t count, int flags); /*! @function read_string_memory @discussion This function is used to read a string from m into buf and adjust the count on how long the string is. The string will be NULL terminated and must NOT be longer than 65535 bytes. @param m The buffer to read from. @param buf The buffer to write to. @param count The lenght of the string stored in buf */ void read_string_memory(unsigned char *m, unsigned char *buf, unsigned short int *count); /*! @function read_unsigned_int_memory @discussion This function is used to read an unsigned int from the memory in network byte-order. @param m The buffer to read from. @result The unsigned integer read from memory. */ unsigned int read_unsigned_int_memory(unsigned char *m); /*! @function read_unsigned_short @discussion This function is used to read an unsigned short from the file descriptor in network byte-order. @param fd The file descriptor to read from. @result The unsigned short read from the file descriptor. */ unsigned short read_unsigned_short(int fd); /*! @function write_unsigned_short @discussion This function is used to write the specified unsigned short value to the file descriptor fd. The written value is in network byte-order. @param fd The file descriptor to write to. @param value The unsigned value to write. */ void write_unsigned_short(int fd, unsigned short value); /*! @function read_string @discussion This function is used to read a string from a file descriptor, store it into a buffer and adjust the number of bytes that has been read. @param fd The file descriptor to read from. @param buf The buf to write to. @param count The number of bytes that have been read. */ void read_string(int fd, char *buf, unsigned short int *count); /*! @function write_string @discussion This function is used to string a string to a file descriptor. @param fd The file descriptor to write to. @param buf The buf that needs to be written. @param count The number of bytes that we have to write. */ void write_string(int fd, unsigned char *s, unsigned short len); /*! @function read_unsigned_int @discussion This function is used to read an unsigned int from the file descriptor in network byte-order. @param fd The file descriptor to read from. @result The unsigned int read from the file descriptor. */ unsigned int read_unsigned_int(int fd); /*! @function write_unsigned_int @discussion This function is used to write the specified unsigned int value to the file descriptor fd. The written value is in network byte-order. @param fd The file descriptor to write to. @param value The unsigned value to write. */ void write_unsigned_int(int fd, unsigned int value); #endif // _Pantomime_H_io pantomime1.2-1.2.2+dfsg1/GNUmakefile000066400000000000000000000022701276751561200170150ustar00rootroot00000000000000# # GNUstep Makefile for Pantomime Framework # # Copyright (C) 2001-2004 Ludovic Marcotte # 2013 The GNUstep team # # Author: Ludovic Marcotte # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ PACKAGE_NAME = Pantomime VERSION = 1.2.2 MAJOR_VERSION=1 MINOR_VERSION=2 SUBMINOR_VERSION=2 VERSION=${MAJOR_VERSION}.${MINOR_VERSION}.${SUBMINOR_VERSION} include $(GNUSTEP_MAKEFILES)/common.make SUBPROJECTS = Framework/Pantomime include $(GNUSTEP_MAKEFILES)/aggregate.make include GNUmakefile.postamble pantomime1.2-1.2.2+dfsg1/GNUmakefile.postamble000066400000000000000000000016441276751561200210060ustar00rootroot00000000000000# # GNUmakefile.postamble for Pantomime # Copyright (C) 2001, 2002 # # Author: Ludovic Marcotte # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ after-clean:: cd charsets ; ${MAKE} clean after-distclean:: cd charsets ; ${MAKE} distclean pantomime1.2-1.2.2+dfsg1/Info.plist000066400000000000000000000016011276751561200167100ustar00rootroot00000000000000 CFBundleDevelopmentRegion English CFBundleExecutable Pantomime CFBundleGetInfoString 1.2.2 CFBundleIconFile CFBundleIdentifier com.collaboration-world.Pantomime CFBundleInfoDictionaryVersion 6.0 CFBundleName Pantomime CFBundlePackageType FMWK CFBundleShortVersionString 1.2.2 CFBundleSignature PMIM CFBundleVersion 1.2.2 NSPrincipalClass pantomime1.2-1.2.2+dfsg1/Pantomime.xcodeproj/000077500000000000000000000000001276751561200206675ustar00rootroot00000000000000pantomime1.2-1.2.2+dfsg1/Pantomime.xcodeproj/project.pbxproj000066400000000000000000002345311276751561200237530ustar00rootroot00000000000000// !$*UTF8*$! { archiveVersion = 1; classes = { }; objectVersion = 42; objects = { /* Begin PBXBuildFile section */ 82137E5B0B6B8DDD0049FAE9 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 82137E570B6B8DDD0049FAE9 /* InfoPlist.strings */; }; 82137E5C0B6B8DDD0049FAE9 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = 82137E590B6B8DDD0049FAE9 /* Localizable.strings */; }; D92C8BA70A5C66A40015DF49 /* CWCacheManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 43B6E9F607592AAD00A80164 /* CWCacheManager.h */; settings = {ATTRIBUTES = (Public, ); }; }; D92C8BA80A5C66A40015DF49 /* CWCharset.h in Headers */ = {isa = PBXBuildFile; fileRef = 43B6E9F807592AAD00A80164 /* CWCharset.h */; settings = {ATTRIBUTES = (Public, ); }; }; D92C8BA90A5C66A40015DF49 /* CWConnection.h in Headers */ = {isa = PBXBuildFile; fileRef = 43B6E9FA07592AAD00A80164 /* CWConnection.h */; settings = {ATTRIBUTES = (Public, ); }; }; D92C8BAA0A5C66A40015DF49 /* CWConstants.h in Headers */ = {isa = PBXBuildFile; fileRef = 43B6E9FB07592AAD00A80164 /* CWConstants.h */; settings = {ATTRIBUTES = (Public, ); }; }; D92C8BAB0A5C66A40015DF49 /* CWContainer.h in Headers */ = {isa = PBXBuildFile; fileRef = 43B6E9FD07592AAD00A80164 /* CWContainer.h */; settings = {ATTRIBUTES = (Public, ); }; }; D92C8BAC0A5C66A40015DF49 /* CWDNSManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 43B6E9FF07592AAD00A80164 /* CWDNSManager.h */; settings = {ATTRIBUTES = (Public, ); }; }; D92C8BAD0A5C66A40015DF49 /* CWFlags.h in Headers */ = {isa = PBXBuildFile; fileRef = 43B6EA0107592AAD00A80164 /* CWFlags.h */; settings = {ATTRIBUTES = (Public, ); }; }; D92C8BAE0A5C66A40015DF49 /* CWFolder.h in Headers */ = {isa = PBXBuildFile; fileRef = 43B6EA0307592AAD00A80164 /* CWFolder.h */; settings = {ATTRIBUTES = (Public, ); }; }; D92C8BAF0A5C66A40015DF49 /* CWFolderInformation.h in Headers */ = {isa = PBXBuildFile; fileRef = 43B6EA0507592AAD00A80164 /* CWFolderInformation.h */; settings = {ATTRIBUTES = (Public, ); }; }; D92C8BB00A5C66A40015DF49 /* CWIMAPCacheManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 43B6EA0707592AAD00A80164 /* CWIMAPCacheManager.h */; settings = {ATTRIBUTES = (Public, ); }; }; D92C8BB10A5C66A40015DF49 /* CWIMAPFolder.h in Headers */ = {isa = PBXBuildFile; fileRef = 43B6EA0907592AAD00A80164 /* CWIMAPFolder.h */; settings = {ATTRIBUTES = (Public, ); }; }; D92C8BB20A5C66A40015DF49 /* CWIMAPMessage.h in Headers */ = {isa = PBXBuildFile; fileRef = 43B6EA0B07592AAD00A80164 /* CWIMAPMessage.h */; settings = {ATTRIBUTES = (Public, ); }; }; D92C8BB30A5C66A40015DF49 /* CWIMAPStore.h in Headers */ = {isa = PBXBuildFile; fileRef = 43B6EA0D07592AAD00A80164 /* CWIMAPStore.h */; settings = {ATTRIBUTES = (Public, ); }; }; D92C8BB40A5C66A40015DF49 /* CWInternetAddress.h in Headers */ = {isa = PBXBuildFile; fileRef = 43B6EA0F07592AAD00A80164 /* CWInternetAddress.h */; settings = {ATTRIBUTES = (Public, ); }; }; D92C8BB50A5C66A40015DF49 /* CWISO8859_1.h in Headers */ = {isa = PBXBuildFile; fileRef = 43B6EA1107592AAD00A80164 /* CWISO8859_1.h */; settings = {ATTRIBUTES = (Public, ); }; }; D92C8BB60A5C66A40015DF49 /* CWISO8859_2.h in Headers */ = {isa = PBXBuildFile; fileRef = 43B6EA1307592AAD00A80164 /* CWISO8859_2.h */; settings = {ATTRIBUTES = (Public, ); }; }; D92C8BB70A5C66A40015DF49 /* CWISO8859_3.h in Headers */ = {isa = PBXBuildFile; fileRef = 43B6EA1507592AAD00A80164 /* CWISO8859_3.h */; settings = {ATTRIBUTES = (Public, ); }; }; D92C8BB80A5C66A40015DF49 /* CWISO8859_4.h in Headers */ = {isa = PBXBuildFile; fileRef = 43B6EA1707592AAD00A80164 /* CWISO8859_4.h */; settings = {ATTRIBUTES = (Public, ); }; }; D92C8BB90A5C66A40015DF49 /* CWISO8859_5.h in Headers */ = {isa = PBXBuildFile; fileRef = 43B6EA1907592AAD00A80164 /* CWISO8859_5.h */; settings = {ATTRIBUTES = (Public, ); }; }; D92C8BBA0A5C66A40015DF49 /* CWISO8859_6.h in Headers */ = {isa = PBXBuildFile; fileRef = 43B6EA1B07592AAD00A80164 /* CWISO8859_6.h */; settings = {ATTRIBUTES = (Public, ); }; }; D92C8BBB0A5C66A40015DF49 /* CWISO8859_7.h in Headers */ = {isa = PBXBuildFile; fileRef = 43B6EA1D07592AAD00A80164 /* CWISO8859_7.h */; settings = {ATTRIBUTES = (Public, ); }; }; D92C8BBC0A5C66A40015DF49 /* CWISO8859_8.h in Headers */ = {isa = PBXBuildFile; fileRef = 43B6EA1F07592AAD00A80164 /* CWISO8859_8.h */; settings = {ATTRIBUTES = (Public, ); }; }; D92C8BBD0A5C66A40015DF49 /* CWISO8859_9.h in Headers */ = {isa = PBXBuildFile; fileRef = 43B6EA2107592AAD00A80164 /* CWISO8859_9.h */; settings = {ATTRIBUTES = (Public, ); }; }; D92C8BBE0A5C66A40015DF49 /* CWISO8859_10.h in Headers */ = {isa = PBXBuildFile; fileRef = 43B6EA2307592AAD00A80164 /* CWISO8859_10.h */; settings = {ATTRIBUTES = (Public, ); }; }; D92C8BBF0A5C66A40015DF49 /* CWISO8859_11.h in Headers */ = {isa = PBXBuildFile; fileRef = 43B6EA2507592AAD00A80164 /* CWISO8859_11.h */; settings = {ATTRIBUTES = (Public, ); }; }; D92C8BC00A5C66A40015DF49 /* CWISO8859_13.h in Headers */ = {isa = PBXBuildFile; fileRef = 43B6EA2707592AAD00A80164 /* CWISO8859_13.h */; settings = {ATTRIBUTES = (Public, ); }; }; D92C8BC10A5C66A40015DF49 /* CWISO8859_14.h in Headers */ = {isa = PBXBuildFile; fileRef = 43B6EA2907592AAD00A80164 /* CWISO8859_14.h */; settings = {ATTRIBUTES = (Public, ); }; }; D92C8BC20A5C66A40015DF49 /* CWISO8859_15.h in Headers */ = {isa = PBXBuildFile; fileRef = 43B6EA2B07592AAD00A80164 /* CWISO8859_15.h */; settings = {ATTRIBUTES = (Public, ); }; }; D92C8BC30A5C66A40015DF49 /* CWKOI8_R.h in Headers */ = {isa = PBXBuildFile; fileRef = 43B6EA2D07592AAD00A80164 /* CWKOI8_R.h */; settings = {ATTRIBUTES = (Public, ); }; }; D92C8BC40A5C66A40015DF49 /* CWKOI8_U.h in Headers */ = {isa = PBXBuildFile; fileRef = 43B6EA2F07592AAD00A80164 /* CWKOI8_U.h */; settings = {ATTRIBUTES = (Public, ); }; }; D92C8BC50A5C66A40015DF49 /* CWLocalCacheManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 43B6EA3107592AAD00A80164 /* CWLocalCacheManager.h */; settings = {ATTRIBUTES = (Public, ); }; }; D92C8BC60A5C66A40015DF49 /* CWLocalFolder.h in Headers */ = {isa = PBXBuildFile; fileRef = 43B6EA3307592AAD00A80164 /* CWLocalFolder.h */; settings = {ATTRIBUTES = (Public, ); }; }; D92C8BC70A5C66A40015DF49 /* CWLocalFolder+maildir.h in Headers */ = {isa = PBXBuildFile; fileRef = 43B6EA3507592AAD00A80164 /* CWLocalFolder+maildir.h */; settings = {ATTRIBUTES = (Public, ); }; }; D92C8BC80A5C66A40015DF49 /* CWLocalFolder+mbox.h in Headers */ = {isa = PBXBuildFile; fileRef = 43B6EA3707592AAD00A80164 /* CWLocalFolder+mbox.h */; settings = {ATTRIBUTES = (Public, ); }; }; D92C8BC90A5C66A40015DF49 /* CWLocalMessage.h in Headers */ = {isa = PBXBuildFile; fileRef = 43B6EA3907592AAD00A80164 /* CWLocalMessage.h */; settings = {ATTRIBUTES = (Public, ); }; }; D92C8BCA0A5C66A40015DF49 /* CWLocalStore.h in Headers */ = {isa = PBXBuildFile; fileRef = 43B6EA3B07592AAD00A80164 /* CWLocalStore.h */; settings = {ATTRIBUTES = (Public, ); }; }; D92C8BCB0A5C66A40015DF49 /* CWMacOSXGlue.h in Headers */ = {isa = PBXBuildFile; fileRef = 43B6EA3D07592AAD00A80164 /* CWMacOSXGlue.h */; settings = {ATTRIBUTES = (Public, ); }; }; D92C8BCC0A5C66A40015DF49 /* CWMD5.h in Headers */ = {isa = PBXBuildFile; fileRef = 43B6EA3F07592AAD00A80164 /* CWMD5.h */; settings = {ATTRIBUTES = (Public, ); }; }; D92C8BCD0A5C66A40015DF49 /* CWMessage.h in Headers */ = {isa = PBXBuildFile; fileRef = 43B6EA4107592AAD00A80164 /* CWMessage.h */; settings = {ATTRIBUTES = (Public, ); }; }; D92C8BCE0A5C66A40015DF49 /* CWMIMEMultipart.h in Headers */ = {isa = PBXBuildFile; fileRef = 43B6EA4307592AAD00A80164 /* CWMIMEMultipart.h */; settings = {ATTRIBUTES = (Public, ); }; }; D92C8BCF0A5C66A40015DF49 /* CWMIMEUtility.h in Headers */ = {isa = PBXBuildFile; fileRef = 43B6EA4507592AAD00A80164 /* CWMIMEUtility.h */; settings = {ATTRIBUTES = (Public, ); }; }; D92C8BD00A5C66A40015DF49 /* CWParser.h in Headers */ = {isa = PBXBuildFile; fileRef = 43B6EA4707592AAD00A80164 /* CWParser.h */; settings = {ATTRIBUTES = (Public, ); }; }; D92C8BD10A5C66A40015DF49 /* CWPart.h in Headers */ = {isa = PBXBuildFile; fileRef = 43B6EA4907592AAD00A80164 /* CWPart.h */; settings = {ATTRIBUTES = (Public, ); }; }; D92C8BD20A5C66A40015DF49 /* CWPOP3CacheManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 43B6EA4B07592AAD00A80164 /* CWPOP3CacheManager.h */; settings = {ATTRIBUTES = (Public, ); }; }; D92C8BD30A5C66A40015DF49 /* CWPOP3CacheObject.h in Headers */ = {isa = PBXBuildFile; fileRef = 43B6EA4D07592AAD00A80164 /* CWPOP3CacheObject.h */; settings = {ATTRIBUTES = (Public, ); }; }; D92C8BD40A5C66A40015DF49 /* CWPOP3Folder.h in Headers */ = {isa = PBXBuildFile; fileRef = 43B6EA4F07592AAD00A80164 /* CWPOP3Folder.h */; settings = {ATTRIBUTES = (Public, ); }; }; D92C8BD50A5C66A40015DF49 /* CWPOP3Message.h in Headers */ = {isa = PBXBuildFile; fileRef = 43B6EA5107592AAD00A80164 /* CWPOP3Message.h */; settings = {ATTRIBUTES = (Public, ); }; }; D92C8BD60A5C66A40015DF49 /* CWPOP3Store.h in Headers */ = {isa = PBXBuildFile; fileRef = 43B6EA5307592AAD00A80164 /* CWPOP3Store.h */; settings = {ATTRIBUTES = (Public, ); }; }; D92C8BD70A5C66A40015DF49 /* CWRegEx.h in Headers */ = {isa = PBXBuildFile; fileRef = 43B6EA5507592AAD00A80164 /* CWRegEx.h */; settings = {ATTRIBUTES = (Public, ); }; }; D92C8BD80A5C66A40015DF49 /* CWSendmail.h in Headers */ = {isa = PBXBuildFile; fileRef = 43B6EA5707592AAD00A80164 /* CWSendmail.h */; settings = {ATTRIBUTES = (Public, ); }; }; D92C8BD90A5C66A40015DF49 /* CWService.h in Headers */ = {isa = PBXBuildFile; fileRef = 43B6EA5907592AAD00A80164 /* CWService.h */; settings = {ATTRIBUTES = (Public, ); }; }; D92C8BDA0A5C66A40015DF49 /* CWSMTP.h in Headers */ = {isa = PBXBuildFile; fileRef = 43B6EA5B07592AAD00A80164 /* CWSMTP.h */; settings = {ATTRIBUTES = (Public, ); }; }; D92C8BDB0A5C66A40015DF49 /* CWStore.h in Headers */ = {isa = PBXBuildFile; fileRef = 43B6EA5D07592AAD00A80164 /* CWStore.h */; settings = {ATTRIBUTES = (Public, ); }; }; D92C8BDC0A5C66A40015DF49 /* CWTCPConnection.h in Headers */ = {isa = PBXBuildFile; fileRef = 43B6EA5E07592AAD00A80164 /* CWTCPConnection.h */; settings = {ATTRIBUTES = (Public, ); }; }; D92C8BDD0A5C66A40015DF49 /* CWTransport.h in Headers */ = {isa = PBXBuildFile; fileRef = 43B6EA6007592AAD00A80164 /* CWTransport.h */; settings = {ATTRIBUTES = (Public, ); }; }; D92C8BDE0A5C66A40015DF49 /* CWURLName.h in Headers */ = {isa = PBXBuildFile; fileRef = 43B6EA6107592AAD00A80164 /* CWURLName.h */; settings = {ATTRIBUTES = (Public, ); }; }; D92C8BDF0A5C66A40015DF49 /* CWUUFile.h in Headers */ = {isa = PBXBuildFile; fileRef = 43B6EA6307592AAD00A80164 /* CWUUFile.h */; settings = {ATTRIBUTES = (Public, ); }; }; D92C8BE00A5C66A40015DF49 /* CWVirtualFolder.h in Headers */ = {isa = PBXBuildFile; fileRef = 43B6EA6507592AAD00A80164 /* CWVirtualFolder.h */; settings = {ATTRIBUTES = (Public, ); }; }; D92C8BE10A5C66A40015DF49 /* CWWINDOWS_1250.h in Headers */ = {isa = PBXBuildFile; fileRef = 43B6EA6707592AAD00A80164 /* CWWINDOWS_1250.h */; settings = {ATTRIBUTES = (Public, ); }; }; D92C8BE20A5C66A40015DF49 /* CWWINDOWS_1251.h in Headers */ = {isa = PBXBuildFile; fileRef = 43B6EA6907592AAD00A80164 /* CWWINDOWS_1251.h */; settings = {ATTRIBUTES = (Public, ); }; }; D92C8BE30A5C66A40015DF49 /* CWWINDOWS_1252.h in Headers */ = {isa = PBXBuildFile; fileRef = 43B6EA6B07592AAD00A80164 /* CWWINDOWS_1252.h */; settings = {ATTRIBUTES = (Public, ); }; }; D92C8BE40A5C66A40015DF49 /* CWWINDOWS_1253.h in Headers */ = {isa = PBXBuildFile; fileRef = 43B6EA6D07592AAD00A80164 /* CWWINDOWS_1253.h */; settings = {ATTRIBUTES = (Public, ); }; }; D92C8BE50A5C66A40015DF49 /* CWWINDOWS_1254.h in Headers */ = {isa = PBXBuildFile; fileRef = 43B6EA6F07592AAD00A80164 /* CWWINDOWS_1254.h */; settings = {ATTRIBUTES = (Public, ); }; }; D92C8BE80A5C66A40015DF49 /* io.h in Headers */ = {isa = PBXBuildFile; fileRef = 43B6EA7707592AAD00A80164 /* io.h */; settings = {ATTRIBUTES = (Public, ); }; }; D92C8BE90A5C66A40015DF49 /* NSData+Extensions.h in Headers */ = {isa = PBXBuildFile; fileRef = 43B6EA7907592AAD00A80164 /* NSData+Extensions.h */; settings = {ATTRIBUTES = (Public, ); }; }; D92C8BEA0A5C66A40015DF49 /* NSFileManager+Extensions.h in Headers */ = {isa = PBXBuildFile; fileRef = 43B6EA7B07592AAD00A80164 /* NSFileManager+Extensions.h */; settings = {ATTRIBUTES = (Public, ); }; }; D92C8BEB0A5C66A40015DF49 /* NSScanner+Extensions.h in Headers */ = {isa = PBXBuildFile; fileRef = 15D0E2FB07CD7FE300313569 /* NSScanner+Extensions.h */; settings = {ATTRIBUTES = (Public, ); }; }; D92C8BEC0A5C66A40015DF49 /* NSString+Extensions.h in Headers */ = {isa = PBXBuildFile; fileRef = 43B6EA7D07592AAD00A80164 /* NSString+Extensions.h */; settings = {ATTRIBUTES = (Public, ); }; }; D92C8BED0A5C66A40015DF49 /* Pantomime.h in Headers */ = {isa = PBXBuildFile; fileRef = 43B6EA7F07592AAD00A80164 /* Pantomime.h */; settings = {ATTRIBUTES = (Public, ); }; }; D92C8BF40A5C66A40015DF49 /* CWCacheManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 43B6E9F707592AAD00A80164 /* CWCacheManager.m */; }; D92C8BF50A5C66A40015DF49 /* CWCharset.m in Sources */ = {isa = PBXBuildFile; fileRef = 43B6E9F907592AAD00A80164 /* CWCharset.m */; }; D92C8BF60A5C66A40015DF49 /* CWConstants.m in Sources */ = {isa = PBXBuildFile; fileRef = 43B6E9FC07592AAD00A80164 /* CWConstants.m */; }; D92C8BF70A5C66A40015DF49 /* CWContainer.m in Sources */ = {isa = PBXBuildFile; fileRef = 43B6E9FE07592AAD00A80164 /* CWContainer.m */; }; D92C8BF80A5C66A40015DF49 /* CWDNSManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 43B6EA0007592AAD00A80164 /* CWDNSManager.m */; }; D92C8BF90A5C66A40015DF49 /* CWFlags.m in Sources */ = {isa = PBXBuildFile; fileRef = 43B6EA0207592AAD00A80164 /* CWFlags.m */; }; D92C8BFA0A5C66A40015DF49 /* CWFolder.m in Sources */ = {isa = PBXBuildFile; fileRef = 43B6EA0407592AAD00A80164 /* CWFolder.m */; }; D92C8BFB0A5C66A40015DF49 /* CWFolderInformation.m in Sources */ = {isa = PBXBuildFile; fileRef = 43B6EA0607592AAD00A80164 /* CWFolderInformation.m */; }; D92C8BFC0A5C66A40015DF49 /* CWIMAPCacheManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 43B6EA0807592AAD00A80164 /* CWIMAPCacheManager.m */; }; D92C8BFD0A5C66A40015DF49 /* CWIMAPFolder.m in Sources */ = {isa = PBXBuildFile; fileRef = 43B6EA0A07592AAD00A80164 /* CWIMAPFolder.m */; }; D92C8BFE0A5C66A40015DF49 /* CWIMAPMessage.m in Sources */ = {isa = PBXBuildFile; fileRef = 43B6EA0C07592AAD00A80164 /* CWIMAPMessage.m */; }; D92C8BFF0A5C66A40015DF49 /* CWIMAPStore.m in Sources */ = {isa = PBXBuildFile; fileRef = 43B6EA0E07592AAD00A80164 /* CWIMAPStore.m */; }; D92C8C000A5C66A40015DF49 /* CWInternetAddress.m in Sources */ = {isa = PBXBuildFile; fileRef = 43B6EA1007592AAD00A80164 /* CWInternetAddress.m */; }; D92C8C010A5C66A40015DF49 /* CWISO8859_1.m in Sources */ = {isa = PBXBuildFile; fileRef = 43B6EA1207592AAD00A80164 /* CWISO8859_1.m */; }; D92C8C020A5C66A40015DF49 /* CWISO8859_2.m in Sources */ = {isa = PBXBuildFile; fileRef = 43B6EA1407592AAD00A80164 /* CWISO8859_2.m */; }; D92C8C030A5C66A40015DF49 /* CWISO8859_3.m in Sources */ = {isa = PBXBuildFile; fileRef = 43B6EA1607592AAD00A80164 /* CWISO8859_3.m */; }; D92C8C040A5C66A40015DF49 /* CWISO8859_4.m in Sources */ = {isa = PBXBuildFile; fileRef = 43B6EA1807592AAD00A80164 /* CWISO8859_4.m */; }; D92C8C050A5C66A40015DF49 /* CWISO8859_5.m in Sources */ = {isa = PBXBuildFile; fileRef = 43B6EA1A07592AAD00A80164 /* CWISO8859_5.m */; }; D92C8C060A5C66A40015DF49 /* CWISO8859_6.m in Sources */ = {isa = PBXBuildFile; fileRef = 43B6EA1C07592AAD00A80164 /* CWISO8859_6.m */; }; D92C8C070A5C66A40015DF49 /* CWISO8859_7.m in Sources */ = {isa = PBXBuildFile; fileRef = 43B6EA1E07592AAD00A80164 /* CWISO8859_7.m */; }; D92C8C080A5C66A40015DF49 /* CWISO8859_8.m in Sources */ = {isa = PBXBuildFile; fileRef = 43B6EA2007592AAD00A80164 /* CWISO8859_8.m */; }; D92C8C090A5C66A40015DF49 /* CWISO8859_9.m in Sources */ = {isa = PBXBuildFile; fileRef = 43B6EA2207592AAD00A80164 /* CWISO8859_9.m */; }; D92C8C0A0A5C66A40015DF49 /* CWISO8859_10.m in Sources */ = {isa = PBXBuildFile; fileRef = 43B6EA2407592AAD00A80164 /* CWISO8859_10.m */; }; D92C8C0B0A5C66A40015DF49 /* CWISO8859_11.m in Sources */ = {isa = PBXBuildFile; fileRef = 43B6EA2607592AAD00A80164 /* CWISO8859_11.m */; }; D92C8C0C0A5C66A40015DF49 /* CWISO8859_13.m in Sources */ = {isa = PBXBuildFile; fileRef = 43B6EA2807592AAD00A80164 /* CWISO8859_13.m */; }; D92C8C0D0A5C66A40015DF49 /* CWISO8859_14.m in Sources */ = {isa = PBXBuildFile; fileRef = 43B6EA2A07592AAD00A80164 /* CWISO8859_14.m */; }; D92C8C0E0A5C66A40015DF49 /* CWISO8859_15.m in Sources */ = {isa = PBXBuildFile; fileRef = 43B6EA2C07592AAD00A80164 /* CWISO8859_15.m */; }; D92C8C0F0A5C66A40015DF49 /* CWKOI8_R.m in Sources */ = {isa = PBXBuildFile; fileRef = 43B6EA2E07592AAD00A80164 /* CWKOI8_R.m */; }; D92C8C100A5C66A40015DF49 /* CWKOI8_U.m in Sources */ = {isa = PBXBuildFile; fileRef = 43B6EA3007592AAD00A80164 /* CWKOI8_U.m */; }; D92C8C110A5C66A40015DF49 /* CWLocalCacheManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 43B6EA3207592AAD00A80164 /* CWLocalCacheManager.m */; }; D92C8C120A5C66A40015DF49 /* CWLocalFolder.m in Sources */ = {isa = PBXBuildFile; fileRef = 43B6EA3407592AAD00A80164 /* CWLocalFolder.m */; }; D92C8C130A5C66A40015DF49 /* CWLocalFolder+maildir.m in Sources */ = {isa = PBXBuildFile; fileRef = 43B6EA3607592AAD00A80164 /* CWLocalFolder+maildir.m */; }; D92C8C140A5C66A40015DF49 /* CWLocalFolder+mbox.m in Sources */ = {isa = PBXBuildFile; fileRef = 43B6EA3807592AAD00A80164 /* CWLocalFolder+mbox.m */; }; D92C8C150A5C66A40015DF49 /* CWLocalMessage.m in Sources */ = {isa = PBXBuildFile; fileRef = 43B6EA3A07592AAD00A80164 /* CWLocalMessage.m */; }; D92C8C160A5C66A40015DF49 /* CWLocalStore.m in Sources */ = {isa = PBXBuildFile; fileRef = 43B6EA3C07592AAD00A80164 /* CWLocalStore.m */; }; D92C8C170A5C66A40015DF49 /* CWMacOSXGlue.m in Sources */ = {isa = PBXBuildFile; fileRef = 43B6EA3E07592AAD00A80164 /* CWMacOSXGlue.m */; }; D92C8C180A5C66A40015DF49 /* CWMD5.m in Sources */ = {isa = PBXBuildFile; fileRef = 43B6EA4007592AAD00A80164 /* CWMD5.m */; }; D92C8C190A5C66A40015DF49 /* CWMessage.m in Sources */ = {isa = PBXBuildFile; fileRef = 43B6EA4207592AAD00A80164 /* CWMessage.m */; }; D92C8C1A0A5C66A40015DF49 /* CWMIMEMultipart.m in Sources */ = {isa = PBXBuildFile; fileRef = 43B6EA4407592AAD00A80164 /* CWMIMEMultipart.m */; }; D92C8C1B0A5C66A40015DF49 /* CWMIMEUtility.m in Sources */ = {isa = PBXBuildFile; fileRef = 43B6EA4607592AAD00A80164 /* CWMIMEUtility.m */; }; D92C8C1C0A5C66A40015DF49 /* CWParser.m in Sources */ = {isa = PBXBuildFile; fileRef = 43B6EA4807592AAD00A80164 /* CWParser.m */; }; D92C8C1D0A5C66A40015DF49 /* CWPart.m in Sources */ = {isa = PBXBuildFile; fileRef = 43B6EA4A07592AAD00A80164 /* CWPart.m */; }; D92C8C1E0A5C66A40015DF49 /* CWPOP3CacheManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 43B6EA4C07592AAD00A80164 /* CWPOP3CacheManager.m */; }; D92C8C1F0A5C66A40015DF49 /* CWPOP3CacheObject.m in Sources */ = {isa = PBXBuildFile; fileRef = 43B6EA4E07592AAD00A80164 /* CWPOP3CacheObject.m */; }; D92C8C200A5C66A40015DF49 /* CWPOP3Folder.m in Sources */ = {isa = PBXBuildFile; fileRef = 43B6EA5007592AAD00A80164 /* CWPOP3Folder.m */; }; D92C8C210A5C66A40015DF49 /* CWPOP3Message.m in Sources */ = {isa = PBXBuildFile; fileRef = 43B6EA5207592AAD00A80164 /* CWPOP3Message.m */; }; D92C8C220A5C66A40015DF49 /* CWPOP3Store.m in Sources */ = {isa = PBXBuildFile; fileRef = 43B6EA5407592AAD00A80164 /* CWPOP3Store.m */; }; D92C8C230A5C66A40015DF49 /* CWRegEx.m in Sources */ = {isa = PBXBuildFile; fileRef = 43B6EA5607592AAD00A80164 /* CWRegEx.m */; }; D92C8C240A5C66A40015DF49 /* CWSendmail.m in Sources */ = {isa = PBXBuildFile; fileRef = 43B6EA5807592AAD00A80164 /* CWSendmail.m */; }; D92C8C250A5C66A40015DF49 /* CWService.m in Sources */ = {isa = PBXBuildFile; fileRef = 43B6EA5A07592AAD00A80164 /* CWService.m */; }; D92C8C260A5C66A40015DF49 /* CWSMTP.m in Sources */ = {isa = PBXBuildFile; fileRef = 43B6EA5C07592AAD00A80164 /* CWSMTP.m */; }; D92C8C270A5C66A40015DF49 /* CWTCPConnection.m in Sources */ = {isa = PBXBuildFile; fileRef = 43B6EA5F07592AAD00A80164 /* CWTCPConnection.m */; }; D92C8C280A5C66A40015DF49 /* CWURLName.m in Sources */ = {isa = PBXBuildFile; fileRef = 43B6EA6207592AAD00A80164 /* CWURLName.m */; }; D92C8C290A5C66A40015DF49 /* CWUUFile.m in Sources */ = {isa = PBXBuildFile; fileRef = 43B6EA6407592AAD00A80164 /* CWUUFile.m */; }; D92C8C2A0A5C66A40015DF49 /* CWVirtualFolder.m in Sources */ = {isa = PBXBuildFile; fileRef = 43B6EA6607592AAD00A80164 /* CWVirtualFolder.m */; }; D92C8C2B0A5C66A40015DF49 /* CWWINDOWS_1250.m in Sources */ = {isa = PBXBuildFile; fileRef = 43B6EA6807592AAD00A80164 /* CWWINDOWS_1250.m */; }; D92C8C2C0A5C66A40015DF49 /* CWWINDOWS_1251.m in Sources */ = {isa = PBXBuildFile; fileRef = 43B6EA6A07592AAD00A80164 /* CWWINDOWS_1251.m */; }; D92C8C2D0A5C66A40015DF49 /* CWWINDOWS_1252.m in Sources */ = {isa = PBXBuildFile; fileRef = 43B6EA6C07592AAD00A80164 /* CWWINDOWS_1252.m */; }; D92C8C2E0A5C66A40015DF49 /* CWWINDOWS_1253.m in Sources */ = {isa = PBXBuildFile; fileRef = 43B6EA6E07592AAD00A80164 /* CWWINDOWS_1253.m */; }; D92C8C2F0A5C66A40015DF49 /* CWWINDOWS_1254.m in Sources */ = {isa = PBXBuildFile; fileRef = 43B6EA7007592AAD00A80164 /* CWWINDOWS_1254.m */; }; D92C8C320A5C66A40015DF49 /* io.c in Sources */ = {isa = PBXBuildFile; fileRef = 43B6EA7607592AAD00A80164 /* io.c */; }; D92C8C340A5C66A40015DF49 /* NSData+Extensions.m in Sources */ = {isa = PBXBuildFile; fileRef = 43B6EA7A07592AAD00A80164 /* NSData+Extensions.m */; }; D92C8C350A5C66A40015DF49 /* NSFileManager+Extensions.m in Sources */ = {isa = PBXBuildFile; fileRef = 43B6EA7C07592AAD00A80164 /* NSFileManager+Extensions.m */; }; D92C8C360A5C66A40015DF49 /* NSString+Extensions.m in Sources */ = {isa = PBXBuildFile; fileRef = 43B6EA7E07592AAD00A80164 /* NSString+Extensions.m */; }; D92C8C3D0A5C66A40015DF49 /* NSScanner+Extensions.m in Sources */ = {isa = PBXBuildFile; fileRef = 15D0E2FC07CD7FE300313569 /* NSScanner+Extensions.m */; }; D92C8C3F0A5C66A40015DF49 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7B1FEA5585E11CA2CBB /* Cocoa.framework */; }; D92C8C400A5C66A40015DF49 /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F51ECE700269C24D01E31F4F /* CoreFoundation.framework */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ 0867D69BFE84028FC02AAC07 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = ""; }; 0867D6A5FE840307C02AAC07 /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = ""; }; 1058C7B1FEA5585E11CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = ""; }; 15D0E2FB07CD7FE300313569 /* NSScanner+Extensions.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = "NSScanner+Extensions.h"; path = "Framework/Pantomime/NSScanner+Extensions.h"; sourceTree = ""; }; 15D0E2FC07CD7FE300313569 /* NSScanner+Extensions.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = "NSScanner+Extensions.m"; path = "Framework/Pantomime/NSScanner+Extensions.m"; sourceTree = ""; }; 43B6E9F607592AAD00A80164 /* CWCacheManager.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = CWCacheManager.h; path = Framework/Pantomime/CWCacheManager.h; sourceTree = ""; }; 43B6E9F707592AAD00A80164 /* CWCacheManager.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = CWCacheManager.m; path = Framework/Pantomime/CWCacheManager.m; sourceTree = ""; }; 43B6E9F807592AAD00A80164 /* CWCharset.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = CWCharset.h; path = Framework/Pantomime/CWCharset.h; sourceTree = ""; }; 43B6E9F907592AAD00A80164 /* CWCharset.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = CWCharset.m; path = Framework/Pantomime/CWCharset.m; sourceTree = ""; }; 43B6E9FA07592AAD00A80164 /* CWConnection.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = CWConnection.h; path = Framework/Pantomime/CWConnection.h; sourceTree = ""; }; 43B6E9FB07592AAD00A80164 /* CWConstants.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = CWConstants.h; path = Framework/Pantomime/CWConstants.h; sourceTree = ""; }; 43B6E9FC07592AAD00A80164 /* CWConstants.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = CWConstants.m; path = Framework/Pantomime/CWConstants.m; sourceTree = ""; }; 43B6E9FD07592AAD00A80164 /* CWContainer.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = CWContainer.h; path = Framework/Pantomime/CWContainer.h; sourceTree = ""; }; 43B6E9FE07592AAD00A80164 /* CWContainer.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = CWContainer.m; path = Framework/Pantomime/CWContainer.m; sourceTree = ""; }; 43B6E9FF07592AAD00A80164 /* CWDNSManager.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = CWDNSManager.h; path = Framework/Pantomime/CWDNSManager.h; sourceTree = ""; }; 43B6EA0007592AAD00A80164 /* CWDNSManager.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = CWDNSManager.m; path = Framework/Pantomime/CWDNSManager.m; sourceTree = ""; }; 43B6EA0107592AAD00A80164 /* CWFlags.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = CWFlags.h; path = Framework/Pantomime/CWFlags.h; sourceTree = ""; }; 43B6EA0207592AAD00A80164 /* CWFlags.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = CWFlags.m; path = Framework/Pantomime/CWFlags.m; sourceTree = ""; }; 43B6EA0307592AAD00A80164 /* CWFolder.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = CWFolder.h; path = Framework/Pantomime/CWFolder.h; sourceTree = ""; }; 43B6EA0407592AAD00A80164 /* CWFolder.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = CWFolder.m; path = Framework/Pantomime/CWFolder.m; sourceTree = ""; }; 43B6EA0507592AAD00A80164 /* CWFolderInformation.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = CWFolderInformation.h; path = Framework/Pantomime/CWFolderInformation.h; sourceTree = ""; }; 43B6EA0607592AAD00A80164 /* CWFolderInformation.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = CWFolderInformation.m; path = Framework/Pantomime/CWFolderInformation.m; sourceTree = ""; }; 43B6EA0707592AAD00A80164 /* CWIMAPCacheManager.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = CWIMAPCacheManager.h; path = Framework/Pantomime/CWIMAPCacheManager.h; sourceTree = ""; }; 43B6EA0807592AAD00A80164 /* CWIMAPCacheManager.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = CWIMAPCacheManager.m; path = Framework/Pantomime/CWIMAPCacheManager.m; sourceTree = ""; }; 43B6EA0907592AAD00A80164 /* CWIMAPFolder.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = CWIMAPFolder.h; path = Framework/Pantomime/CWIMAPFolder.h; sourceTree = ""; }; 43B6EA0A07592AAD00A80164 /* CWIMAPFolder.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = CWIMAPFolder.m; path = Framework/Pantomime/CWIMAPFolder.m; sourceTree = ""; }; 43B6EA0B07592AAD00A80164 /* CWIMAPMessage.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = CWIMAPMessage.h; path = Framework/Pantomime/CWIMAPMessage.h; sourceTree = ""; }; 43B6EA0C07592AAD00A80164 /* CWIMAPMessage.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = CWIMAPMessage.m; path = Framework/Pantomime/CWIMAPMessage.m; sourceTree = ""; }; 43B6EA0D07592AAD00A80164 /* CWIMAPStore.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = CWIMAPStore.h; path = Framework/Pantomime/CWIMAPStore.h; sourceTree = ""; }; 43B6EA0E07592AAD00A80164 /* CWIMAPStore.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = CWIMAPStore.m; path = Framework/Pantomime/CWIMAPStore.m; sourceTree = ""; }; 43B6EA0F07592AAD00A80164 /* CWInternetAddress.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = CWInternetAddress.h; path = Framework/Pantomime/CWInternetAddress.h; sourceTree = ""; }; 43B6EA1007592AAD00A80164 /* CWInternetAddress.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = CWInternetAddress.m; path = Framework/Pantomime/CWInternetAddress.m; sourceTree = ""; }; 43B6EA1107592AAD00A80164 /* CWISO8859_1.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = CWISO8859_1.h; path = Framework/Pantomime/CWISO8859_1.h; sourceTree = ""; }; 43B6EA1207592AAD00A80164 /* CWISO8859_1.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = CWISO8859_1.m; path = Framework/Pantomime/CWISO8859_1.m; sourceTree = ""; }; 43B6EA1307592AAD00A80164 /* CWISO8859_2.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = CWISO8859_2.h; path = Framework/Pantomime/CWISO8859_2.h; sourceTree = ""; }; 43B6EA1407592AAD00A80164 /* CWISO8859_2.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = CWISO8859_2.m; path = Framework/Pantomime/CWISO8859_2.m; sourceTree = ""; }; 43B6EA1507592AAD00A80164 /* CWISO8859_3.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = CWISO8859_3.h; path = Framework/Pantomime/CWISO8859_3.h; sourceTree = ""; }; 43B6EA1607592AAD00A80164 /* CWISO8859_3.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = CWISO8859_3.m; path = Framework/Pantomime/CWISO8859_3.m; sourceTree = ""; }; 43B6EA1707592AAD00A80164 /* CWISO8859_4.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = CWISO8859_4.h; path = Framework/Pantomime/CWISO8859_4.h; sourceTree = ""; }; 43B6EA1807592AAD00A80164 /* CWISO8859_4.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = CWISO8859_4.m; path = Framework/Pantomime/CWISO8859_4.m; sourceTree = ""; }; 43B6EA1907592AAD00A80164 /* CWISO8859_5.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = CWISO8859_5.h; path = Framework/Pantomime/CWISO8859_5.h; sourceTree = ""; }; 43B6EA1A07592AAD00A80164 /* CWISO8859_5.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = CWISO8859_5.m; path = Framework/Pantomime/CWISO8859_5.m; sourceTree = ""; }; 43B6EA1B07592AAD00A80164 /* CWISO8859_6.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = CWISO8859_6.h; path = Framework/Pantomime/CWISO8859_6.h; sourceTree = ""; }; 43B6EA1C07592AAD00A80164 /* CWISO8859_6.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = CWISO8859_6.m; path = Framework/Pantomime/CWISO8859_6.m; sourceTree = ""; }; 43B6EA1D07592AAD00A80164 /* CWISO8859_7.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = CWISO8859_7.h; path = Framework/Pantomime/CWISO8859_7.h; sourceTree = ""; }; 43B6EA1E07592AAD00A80164 /* CWISO8859_7.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = CWISO8859_7.m; path = Framework/Pantomime/CWISO8859_7.m; sourceTree = ""; }; 43B6EA1F07592AAD00A80164 /* CWISO8859_8.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = CWISO8859_8.h; path = Framework/Pantomime/CWISO8859_8.h; sourceTree = ""; }; 43B6EA2007592AAD00A80164 /* CWISO8859_8.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = CWISO8859_8.m; path = Framework/Pantomime/CWISO8859_8.m; sourceTree = ""; }; 43B6EA2107592AAD00A80164 /* CWISO8859_9.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = CWISO8859_9.h; path = Framework/Pantomime/CWISO8859_9.h; sourceTree = ""; }; 43B6EA2207592AAD00A80164 /* CWISO8859_9.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = CWISO8859_9.m; path = Framework/Pantomime/CWISO8859_9.m; sourceTree = ""; }; 43B6EA2307592AAD00A80164 /* CWISO8859_10.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = CWISO8859_10.h; path = Framework/Pantomime/CWISO8859_10.h; sourceTree = ""; }; 43B6EA2407592AAD00A80164 /* CWISO8859_10.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = CWISO8859_10.m; path = Framework/Pantomime/CWISO8859_10.m; sourceTree = ""; }; 43B6EA2507592AAD00A80164 /* CWISO8859_11.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = CWISO8859_11.h; path = Framework/Pantomime/CWISO8859_11.h; sourceTree = ""; }; 43B6EA2607592AAD00A80164 /* CWISO8859_11.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = CWISO8859_11.m; path = Framework/Pantomime/CWISO8859_11.m; sourceTree = ""; }; 43B6EA2707592AAD00A80164 /* CWISO8859_13.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = CWISO8859_13.h; path = Framework/Pantomime/CWISO8859_13.h; sourceTree = ""; }; 43B6EA2807592AAD00A80164 /* CWISO8859_13.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = CWISO8859_13.m; path = Framework/Pantomime/CWISO8859_13.m; sourceTree = ""; }; 43B6EA2907592AAD00A80164 /* CWISO8859_14.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = CWISO8859_14.h; path = Framework/Pantomime/CWISO8859_14.h; sourceTree = ""; }; 43B6EA2A07592AAD00A80164 /* CWISO8859_14.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = CWISO8859_14.m; path = Framework/Pantomime/CWISO8859_14.m; sourceTree = ""; }; 43B6EA2B07592AAD00A80164 /* CWISO8859_15.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = CWISO8859_15.h; path = Framework/Pantomime/CWISO8859_15.h; sourceTree = ""; }; 43B6EA2C07592AAD00A80164 /* CWISO8859_15.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = CWISO8859_15.m; path = Framework/Pantomime/CWISO8859_15.m; sourceTree = ""; }; 43B6EA2D07592AAD00A80164 /* CWKOI8_R.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = CWKOI8_R.h; path = Framework/Pantomime/CWKOI8_R.h; sourceTree = ""; }; 43B6EA2E07592AAD00A80164 /* CWKOI8_R.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = CWKOI8_R.m; path = Framework/Pantomime/CWKOI8_R.m; sourceTree = ""; }; 43B6EA2F07592AAD00A80164 /* CWKOI8_U.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = CWKOI8_U.h; path = Framework/Pantomime/CWKOI8_U.h; sourceTree = ""; }; 43B6EA3007592AAD00A80164 /* CWKOI8_U.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = CWKOI8_U.m; path = Framework/Pantomime/CWKOI8_U.m; sourceTree = ""; }; 43B6EA3107592AAD00A80164 /* CWLocalCacheManager.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = CWLocalCacheManager.h; path = Framework/Pantomime/CWLocalCacheManager.h; sourceTree = ""; }; 43B6EA3207592AAD00A80164 /* CWLocalCacheManager.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = CWLocalCacheManager.m; path = Framework/Pantomime/CWLocalCacheManager.m; sourceTree = ""; }; 43B6EA3307592AAD00A80164 /* CWLocalFolder.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = CWLocalFolder.h; path = Framework/Pantomime/CWLocalFolder.h; sourceTree = ""; }; 43B6EA3407592AAD00A80164 /* CWLocalFolder.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = CWLocalFolder.m; path = Framework/Pantomime/CWLocalFolder.m; sourceTree = ""; }; 43B6EA3507592AAD00A80164 /* CWLocalFolder+maildir.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = "CWLocalFolder+maildir.h"; path = "Framework/Pantomime/CWLocalFolder+maildir.h"; sourceTree = ""; }; 43B6EA3607592AAD00A80164 /* CWLocalFolder+maildir.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = "CWLocalFolder+maildir.m"; path = "Framework/Pantomime/CWLocalFolder+maildir.m"; sourceTree = ""; }; 43B6EA3707592AAD00A80164 /* CWLocalFolder+mbox.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = "CWLocalFolder+mbox.h"; path = "Framework/Pantomime/CWLocalFolder+mbox.h"; sourceTree = ""; }; 43B6EA3807592AAD00A80164 /* CWLocalFolder+mbox.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = "CWLocalFolder+mbox.m"; path = "Framework/Pantomime/CWLocalFolder+mbox.m"; sourceTree = ""; }; 43B6EA3907592AAD00A80164 /* CWLocalMessage.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = CWLocalMessage.h; path = Framework/Pantomime/CWLocalMessage.h; sourceTree = ""; }; 43B6EA3A07592AAD00A80164 /* CWLocalMessage.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = CWLocalMessage.m; path = Framework/Pantomime/CWLocalMessage.m; sourceTree = ""; }; 43B6EA3B07592AAD00A80164 /* CWLocalStore.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = CWLocalStore.h; path = Framework/Pantomime/CWLocalStore.h; sourceTree = ""; }; 43B6EA3C07592AAD00A80164 /* CWLocalStore.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = CWLocalStore.m; path = Framework/Pantomime/CWLocalStore.m; sourceTree = ""; }; 43B6EA3D07592AAD00A80164 /* CWMacOSXGlue.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = CWMacOSXGlue.h; path = Framework/Pantomime/CWMacOSXGlue.h; sourceTree = ""; }; 43B6EA3E07592AAD00A80164 /* CWMacOSXGlue.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = CWMacOSXGlue.m; path = Framework/Pantomime/CWMacOSXGlue.m; sourceTree = ""; }; 43B6EA3F07592AAD00A80164 /* CWMD5.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = CWMD5.h; path = Framework/Pantomime/CWMD5.h; sourceTree = ""; }; 43B6EA4007592AAD00A80164 /* CWMD5.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = CWMD5.m; path = Framework/Pantomime/CWMD5.m; sourceTree = ""; }; 43B6EA4107592AAD00A80164 /* CWMessage.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = CWMessage.h; path = Framework/Pantomime/CWMessage.h; sourceTree = ""; }; 43B6EA4207592AAD00A80164 /* CWMessage.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = CWMessage.m; path = Framework/Pantomime/CWMessage.m; sourceTree = ""; }; 43B6EA4307592AAD00A80164 /* CWMIMEMultipart.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = CWMIMEMultipart.h; path = Framework/Pantomime/CWMIMEMultipart.h; sourceTree = ""; }; 43B6EA4407592AAD00A80164 /* CWMIMEMultipart.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = CWMIMEMultipart.m; path = Framework/Pantomime/CWMIMEMultipart.m; sourceTree = ""; }; 43B6EA4507592AAD00A80164 /* CWMIMEUtility.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = CWMIMEUtility.h; path = Framework/Pantomime/CWMIMEUtility.h; sourceTree = ""; }; 43B6EA4607592AAD00A80164 /* CWMIMEUtility.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = CWMIMEUtility.m; path = Framework/Pantomime/CWMIMEUtility.m; sourceTree = ""; }; 43B6EA4707592AAD00A80164 /* CWParser.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = CWParser.h; path = Framework/Pantomime/CWParser.h; sourceTree = ""; }; 43B6EA4807592AAD00A80164 /* CWParser.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = CWParser.m; path = Framework/Pantomime/CWParser.m; sourceTree = ""; }; 43B6EA4907592AAD00A80164 /* CWPart.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = CWPart.h; path = Framework/Pantomime/CWPart.h; sourceTree = ""; }; 43B6EA4A07592AAD00A80164 /* CWPart.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = CWPart.m; path = Framework/Pantomime/CWPart.m; sourceTree = ""; }; 43B6EA4B07592AAD00A80164 /* CWPOP3CacheManager.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = CWPOP3CacheManager.h; path = Framework/Pantomime/CWPOP3CacheManager.h; sourceTree = ""; }; 43B6EA4C07592AAD00A80164 /* CWPOP3CacheManager.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = CWPOP3CacheManager.m; path = Framework/Pantomime/CWPOP3CacheManager.m; sourceTree = ""; }; 43B6EA4D07592AAD00A80164 /* CWPOP3CacheObject.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = CWPOP3CacheObject.h; path = Framework/Pantomime/CWPOP3CacheObject.h; sourceTree = ""; }; 43B6EA4E07592AAD00A80164 /* CWPOP3CacheObject.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = CWPOP3CacheObject.m; path = Framework/Pantomime/CWPOP3CacheObject.m; sourceTree = ""; }; 43B6EA4F07592AAD00A80164 /* CWPOP3Folder.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = CWPOP3Folder.h; path = Framework/Pantomime/CWPOP3Folder.h; sourceTree = ""; }; 43B6EA5007592AAD00A80164 /* CWPOP3Folder.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = CWPOP3Folder.m; path = Framework/Pantomime/CWPOP3Folder.m; sourceTree = ""; }; 43B6EA5107592AAD00A80164 /* CWPOP3Message.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = CWPOP3Message.h; path = Framework/Pantomime/CWPOP3Message.h; sourceTree = ""; }; 43B6EA5207592AAD00A80164 /* CWPOP3Message.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = CWPOP3Message.m; path = Framework/Pantomime/CWPOP3Message.m; sourceTree = ""; }; 43B6EA5307592AAD00A80164 /* CWPOP3Store.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = CWPOP3Store.h; path = Framework/Pantomime/CWPOP3Store.h; sourceTree = ""; }; 43B6EA5407592AAD00A80164 /* CWPOP3Store.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = CWPOP3Store.m; path = Framework/Pantomime/CWPOP3Store.m; sourceTree = ""; }; 43B6EA5507592AAD00A80164 /* CWRegEx.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = CWRegEx.h; path = Framework/Pantomime/CWRegEx.h; sourceTree = ""; }; 43B6EA5607592AAD00A80164 /* CWRegEx.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = CWRegEx.m; path = Framework/Pantomime/CWRegEx.m; sourceTree = ""; }; 43B6EA5707592AAD00A80164 /* CWSendmail.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = CWSendmail.h; path = Framework/Pantomime/CWSendmail.h; sourceTree = ""; }; 43B6EA5807592AAD00A80164 /* CWSendmail.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = CWSendmail.m; path = Framework/Pantomime/CWSendmail.m; sourceTree = ""; }; 43B6EA5907592AAD00A80164 /* CWService.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = CWService.h; path = Framework/Pantomime/CWService.h; sourceTree = ""; }; 43B6EA5A07592AAD00A80164 /* CWService.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = CWService.m; path = Framework/Pantomime/CWService.m; sourceTree = ""; }; 43B6EA5B07592AAD00A80164 /* CWSMTP.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = CWSMTP.h; path = Framework/Pantomime/CWSMTP.h; sourceTree = ""; }; 43B6EA5C07592AAD00A80164 /* CWSMTP.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = CWSMTP.m; path = Framework/Pantomime/CWSMTP.m; sourceTree = ""; }; 43B6EA5D07592AAD00A80164 /* CWStore.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = CWStore.h; path = Framework/Pantomime/CWStore.h; sourceTree = ""; }; 43B6EA5E07592AAD00A80164 /* CWTCPConnection.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = CWTCPConnection.h; path = Framework/Pantomime/CWTCPConnection.h; sourceTree = ""; }; 43B6EA5F07592AAD00A80164 /* CWTCPConnection.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = CWTCPConnection.m; path = Framework/Pantomime/CWTCPConnection.m; sourceTree = ""; }; 43B6EA6007592AAD00A80164 /* CWTransport.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = CWTransport.h; path = Framework/Pantomime/CWTransport.h; sourceTree = ""; }; 43B6EA6107592AAD00A80164 /* CWURLName.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = CWURLName.h; path = Framework/Pantomime/CWURLName.h; sourceTree = ""; }; 43B6EA6207592AAD00A80164 /* CWURLName.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = CWURLName.m; path = Framework/Pantomime/CWURLName.m; sourceTree = ""; }; 43B6EA6307592AAD00A80164 /* CWUUFile.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = CWUUFile.h; path = Framework/Pantomime/CWUUFile.h; sourceTree = ""; }; 43B6EA6407592AAD00A80164 /* CWUUFile.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = CWUUFile.m; path = Framework/Pantomime/CWUUFile.m; sourceTree = ""; }; 43B6EA6507592AAD00A80164 /* CWVirtualFolder.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = CWVirtualFolder.h; path = Framework/Pantomime/CWVirtualFolder.h; sourceTree = ""; }; 43B6EA6607592AAD00A80164 /* CWVirtualFolder.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = CWVirtualFolder.m; path = Framework/Pantomime/CWVirtualFolder.m; sourceTree = ""; }; 43B6EA6707592AAD00A80164 /* CWWINDOWS_1250.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = CWWINDOWS_1250.h; path = Framework/Pantomime/CWWINDOWS_1250.h; sourceTree = ""; }; 43B6EA6807592AAD00A80164 /* CWWINDOWS_1250.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = CWWINDOWS_1250.m; path = Framework/Pantomime/CWWINDOWS_1250.m; sourceTree = ""; }; 43B6EA6907592AAD00A80164 /* CWWINDOWS_1251.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = CWWINDOWS_1251.h; path = Framework/Pantomime/CWWINDOWS_1251.h; sourceTree = ""; }; 43B6EA6A07592AAD00A80164 /* CWWINDOWS_1251.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = CWWINDOWS_1251.m; path = Framework/Pantomime/CWWINDOWS_1251.m; sourceTree = ""; }; 43B6EA6B07592AAD00A80164 /* CWWINDOWS_1252.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = CWWINDOWS_1252.h; path = Framework/Pantomime/CWWINDOWS_1252.h; sourceTree = ""; }; 43B6EA6C07592AAD00A80164 /* CWWINDOWS_1252.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = CWWINDOWS_1252.m; path = Framework/Pantomime/CWWINDOWS_1252.m; sourceTree = ""; }; 43B6EA6D07592AAD00A80164 /* CWWINDOWS_1253.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = CWWINDOWS_1253.h; path = Framework/Pantomime/CWWINDOWS_1253.h; sourceTree = ""; }; 43B6EA6E07592AAD00A80164 /* CWWINDOWS_1253.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = CWWINDOWS_1253.m; path = Framework/Pantomime/CWWINDOWS_1253.m; sourceTree = ""; }; 43B6EA6F07592AAD00A80164 /* CWWINDOWS_1254.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = CWWINDOWS_1254.h; path = Framework/Pantomime/CWWINDOWS_1254.h; sourceTree = ""; }; 43B6EA7007592AAD00A80164 /* CWWINDOWS_1254.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = CWWINDOWS_1254.m; path = Framework/Pantomime/CWWINDOWS_1254.m; sourceTree = ""; }; 43B6EA7607592AAD00A80164 /* io.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = io.c; path = Framework/Pantomime/io.c; sourceTree = ""; }; 43B6EA7707592AAD00A80164 /* io.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = io.h; path = Framework/Pantomime/io.h; sourceTree = ""; }; 43B6EA7907592AAD00A80164 /* NSData+Extensions.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = "NSData+Extensions.h"; path = "Framework/Pantomime/NSData+Extensions.h"; sourceTree = ""; }; 43B6EA7A07592AAD00A80164 /* NSData+Extensions.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = "NSData+Extensions.m"; path = "Framework/Pantomime/NSData+Extensions.m"; sourceTree = ""; }; 43B6EA7B07592AAD00A80164 /* NSFileManager+Extensions.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = "NSFileManager+Extensions.h"; path = "Framework/Pantomime/NSFileManager+Extensions.h"; sourceTree = ""; }; 43B6EA7C07592AAD00A80164 /* NSFileManager+Extensions.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = "NSFileManager+Extensions.m"; path = "Framework/Pantomime/NSFileManager+Extensions.m"; sourceTree = ""; }; 43B6EA7D07592AAD00A80164 /* NSString+Extensions.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = "NSString+Extensions.h"; path = "Framework/Pantomime/NSString+Extensions.h"; sourceTree = SOURCE_ROOT; }; 43B6EA7E07592AAD00A80164 /* NSString+Extensions.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = "NSString+Extensions.m"; path = "Framework/Pantomime/NSString+Extensions.m"; sourceTree = ""; }; 43B6EA7F07592AAD00A80164 /* Pantomime.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = Pantomime.h; path = Framework/Pantomime/Pantomime.h; sourceTree = ""; }; 43B6EB1907592AD800A80164 /* AUTHORS */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.html.documentation; name = AUTHORS; path = Documentation/AUTHORS; sourceTree = ""; }; 43B6EB1A07592AD800A80164 /* LICENSE */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.html.documentation; name = LICENSE; path = Documentation/LICENSE; sourceTree = ""; }; 43B6EB1C07592AD800A80164 /* README */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.html.documentation; name = README; path = Documentation/README; sourceTree = ""; }; 43B6EB1D07592AD800A80164 /* TODO */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.html.documentation; name = TODO; path = Documentation/TODO; sourceTree = ""; }; 82137E580B6B8DDD0049FAE9 /* English */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.plist.strings; name = English; path = InfoPlist.strings; sourceTree = ""; }; 82137E5A0B6B8DDD0049FAE9 /* English */ = {isa = PBXFileReference; explicitFileType = text.plist.strings; fileEncoding = 30; name = English; path = Localizable.strings; sourceTree = ""; }; D92C8C460A5C66A40015DF49 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.xml; path = Info.plist; sourceTree = ""; }; D92C8C470A5C66A40015DF49 /* Pantomime.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pantomime.framework; sourceTree = BUILT_PRODUCTS_DIR; }; F51ECE700269C24D01E31F4F /* CoreFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreFoundation.framework; path = /System/Library/Frameworks/CoreFoundation.framework; sourceTree = ""; }; F58529E001C7020E01A80205 /* ChangeLog */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = ChangeLog; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ D92C8C3E0A5C66A40015DF49 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( D92C8C3F0A5C66A40015DF49 /* Cocoa.framework in Frameworks */, D92C8C400A5C66A40015DF49 /* CoreFoundation.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ 034768DFFF38A50411DB9C8B /* Products */ = { isa = PBXGroup; children = ( D92C8C470A5C66A40015DF49 /* Pantomime.framework */, ); name = Products; sourceTree = ""; }; 0867D691FE84028FC02AAC07 /* Pantomime */ = { isa = PBXGroup; children = ( 08FB77AEFE84172EC02AAC07 /* Classes */, 089C1665FE841158C02AAC07 /* Resources */, 0867D69AFE84028FC02AAC07 /* External Frameworks and Libraries */, 034768DFFF38A50411DB9C8B /* Products */, D92C8C460A5C66A40015DF49 /* Info.plist */, ); name = Pantomime; sourceTree = ""; }; 0867D69AFE84028FC02AAC07 /* External Frameworks and Libraries */ = { isa = PBXGroup; children = ( 1058C7B0FEA5585E11CA2CBB /* Linked Frameworks */, 1058C7B2FEA5585E11CA2CBB /* Other Frameworks */, ); name = "External Frameworks and Libraries"; sourceTree = ""; }; 089C1665FE841158C02AAC07 /* Resources */ = { isa = PBXGroup; children = ( 82137E560B6B8DDD0049FAE9 /* English.lproj */, F58529DE01C701E601A80205 /* Documentation */, ); name = Resources; sourceTree = ""; }; 08FB77AEFE84172EC02AAC07 /* Classes */ = { isa = PBXGroup; children = ( 43B6E9F607592AAD00A80164 /* CWCacheManager.h */, 43B6E9F707592AAD00A80164 /* CWCacheManager.m */, 43B6E9F807592AAD00A80164 /* CWCharset.h */, 43B6E9F907592AAD00A80164 /* CWCharset.m */, 43B6E9FA07592AAD00A80164 /* CWConnection.h */, 43B6E9FB07592AAD00A80164 /* CWConstants.h */, 43B6E9FC07592AAD00A80164 /* CWConstants.m */, 43B6E9FD07592AAD00A80164 /* CWContainer.h */, 43B6E9FE07592AAD00A80164 /* CWContainer.m */, 43B6E9FF07592AAD00A80164 /* CWDNSManager.h */, 43B6EA0007592AAD00A80164 /* CWDNSManager.m */, 43B6EA0107592AAD00A80164 /* CWFlags.h */, 43B6EA0207592AAD00A80164 /* CWFlags.m */, 43B6EA0307592AAD00A80164 /* CWFolder.h */, 43B6EA0407592AAD00A80164 /* CWFolder.m */, 43B6EA0507592AAD00A80164 /* CWFolderInformation.h */, 43B6EA0607592AAD00A80164 /* CWFolderInformation.m */, 43B6EA0707592AAD00A80164 /* CWIMAPCacheManager.h */, 43B6EA0807592AAD00A80164 /* CWIMAPCacheManager.m */, 43B6EA0907592AAD00A80164 /* CWIMAPFolder.h */, 43B6EA0A07592AAD00A80164 /* CWIMAPFolder.m */, 43B6EA0B07592AAD00A80164 /* CWIMAPMessage.h */, 43B6EA0C07592AAD00A80164 /* CWIMAPMessage.m */, 43B6EA0D07592AAD00A80164 /* CWIMAPStore.h */, 43B6EA0E07592AAD00A80164 /* CWIMAPStore.m */, 43B6EA0F07592AAD00A80164 /* CWInternetAddress.h */, 43B6EA1007592AAD00A80164 /* CWInternetAddress.m */, 43B6EA1107592AAD00A80164 /* CWISO8859_1.h */, 43B6EA1207592AAD00A80164 /* CWISO8859_1.m */, 43B6EA1307592AAD00A80164 /* CWISO8859_2.h */, 43B6EA1407592AAD00A80164 /* CWISO8859_2.m */, 43B6EA1507592AAD00A80164 /* CWISO8859_3.h */, 43B6EA1607592AAD00A80164 /* CWISO8859_3.m */, 43B6EA1707592AAD00A80164 /* CWISO8859_4.h */, 43B6EA1807592AAD00A80164 /* CWISO8859_4.m */, 43B6EA1907592AAD00A80164 /* CWISO8859_5.h */, 43B6EA1A07592AAD00A80164 /* CWISO8859_5.m */, 43B6EA1B07592AAD00A80164 /* CWISO8859_6.h */, 43B6EA1C07592AAD00A80164 /* CWISO8859_6.m */, 43B6EA1D07592AAD00A80164 /* CWISO8859_7.h */, 43B6EA1E07592AAD00A80164 /* CWISO8859_7.m */, 43B6EA1F07592AAD00A80164 /* CWISO8859_8.h */, 43B6EA2007592AAD00A80164 /* CWISO8859_8.m */, 43B6EA2107592AAD00A80164 /* CWISO8859_9.h */, 43B6EA2207592AAD00A80164 /* CWISO8859_9.m */, 43B6EA2307592AAD00A80164 /* CWISO8859_10.h */, 43B6EA2407592AAD00A80164 /* CWISO8859_10.m */, 43B6EA2507592AAD00A80164 /* CWISO8859_11.h */, 43B6EA2607592AAD00A80164 /* CWISO8859_11.m */, 43B6EA2707592AAD00A80164 /* CWISO8859_13.h */, 43B6EA2807592AAD00A80164 /* CWISO8859_13.m */, 43B6EA2907592AAD00A80164 /* CWISO8859_14.h */, 43B6EA2A07592AAD00A80164 /* CWISO8859_14.m */, 43B6EA2B07592AAD00A80164 /* CWISO8859_15.h */, 43B6EA2C07592AAD00A80164 /* CWISO8859_15.m */, 43B6EA2D07592AAD00A80164 /* CWKOI8_R.h */, 43B6EA2E07592AAD00A80164 /* CWKOI8_R.m */, 43B6EA2F07592AAD00A80164 /* CWKOI8_U.h */, 43B6EA3007592AAD00A80164 /* CWKOI8_U.m */, 43B6EA3107592AAD00A80164 /* CWLocalCacheManager.h */, 43B6EA3207592AAD00A80164 /* CWLocalCacheManager.m */, 43B6EA3307592AAD00A80164 /* CWLocalFolder.h */, 43B6EA3407592AAD00A80164 /* CWLocalFolder.m */, 43B6EA3507592AAD00A80164 /* CWLocalFolder+maildir.h */, 43B6EA3607592AAD00A80164 /* CWLocalFolder+maildir.m */, 43B6EA3707592AAD00A80164 /* CWLocalFolder+mbox.h */, 43B6EA3807592AAD00A80164 /* CWLocalFolder+mbox.m */, 43B6EA3907592AAD00A80164 /* CWLocalMessage.h */, 43B6EA3A07592AAD00A80164 /* CWLocalMessage.m */, 43B6EA3B07592AAD00A80164 /* CWLocalStore.h */, 43B6EA3C07592AAD00A80164 /* CWLocalStore.m */, 43B6EA3D07592AAD00A80164 /* CWMacOSXGlue.h */, 43B6EA3E07592AAD00A80164 /* CWMacOSXGlue.m */, 43B6EA3F07592AAD00A80164 /* CWMD5.h */, 43B6EA4007592AAD00A80164 /* CWMD5.m */, 43B6EA4107592AAD00A80164 /* CWMessage.h */, 43B6EA4207592AAD00A80164 /* CWMessage.m */, 43B6EA4307592AAD00A80164 /* CWMIMEMultipart.h */, 43B6EA4407592AAD00A80164 /* CWMIMEMultipart.m */, 43B6EA4507592AAD00A80164 /* CWMIMEUtility.h */, 43B6EA4607592AAD00A80164 /* CWMIMEUtility.m */, 43B6EA4707592AAD00A80164 /* CWParser.h */, 43B6EA4807592AAD00A80164 /* CWParser.m */, 43B6EA4907592AAD00A80164 /* CWPart.h */, 43B6EA4A07592AAD00A80164 /* CWPart.m */, 43B6EA4B07592AAD00A80164 /* CWPOP3CacheManager.h */, 43B6EA4C07592AAD00A80164 /* CWPOP3CacheManager.m */, 43B6EA4D07592AAD00A80164 /* CWPOP3CacheObject.h */, 43B6EA4E07592AAD00A80164 /* CWPOP3CacheObject.m */, 43B6EA4F07592AAD00A80164 /* CWPOP3Folder.h */, 43B6EA5007592AAD00A80164 /* CWPOP3Folder.m */, 43B6EA5107592AAD00A80164 /* CWPOP3Message.h */, 43B6EA5207592AAD00A80164 /* CWPOP3Message.m */, 43B6EA5307592AAD00A80164 /* CWPOP3Store.h */, 43B6EA5407592AAD00A80164 /* CWPOP3Store.m */, 43B6EA5507592AAD00A80164 /* CWRegEx.h */, 43B6EA5607592AAD00A80164 /* CWRegEx.m */, 43B6EA5707592AAD00A80164 /* CWSendmail.h */, 43B6EA5807592AAD00A80164 /* CWSendmail.m */, 43B6EA5907592AAD00A80164 /* CWService.h */, 43B6EA5A07592AAD00A80164 /* CWService.m */, 43B6EA5B07592AAD00A80164 /* CWSMTP.h */, 43B6EA5C07592AAD00A80164 /* CWSMTP.m */, 43B6EA5D07592AAD00A80164 /* CWStore.h */, 43B6EA5E07592AAD00A80164 /* CWTCPConnection.h */, 43B6EA5F07592AAD00A80164 /* CWTCPConnection.m */, 43B6EA6007592AAD00A80164 /* CWTransport.h */, 43B6EA6107592AAD00A80164 /* CWURLName.h */, 43B6EA6207592AAD00A80164 /* CWURLName.m */, 43B6EA6307592AAD00A80164 /* CWUUFile.h */, 43B6EA6407592AAD00A80164 /* CWUUFile.m */, 43B6EA6507592AAD00A80164 /* CWVirtualFolder.h */, 43B6EA6607592AAD00A80164 /* CWVirtualFolder.m */, 43B6EA6707592AAD00A80164 /* CWWINDOWS_1250.h */, 43B6EA6807592AAD00A80164 /* CWWINDOWS_1250.m */, 43B6EA6907592AAD00A80164 /* CWWINDOWS_1251.h */, 43B6EA6A07592AAD00A80164 /* CWWINDOWS_1251.m */, 43B6EA6B07592AAD00A80164 /* CWWINDOWS_1252.h */, 43B6EA6C07592AAD00A80164 /* CWWINDOWS_1252.m */, 43B6EA6D07592AAD00A80164 /* CWWINDOWS_1253.h */, 43B6EA6E07592AAD00A80164 /* CWWINDOWS_1253.m */, 43B6EA6F07592AAD00A80164 /* CWWINDOWS_1254.h */, 43B6EA7007592AAD00A80164 /* CWWINDOWS_1254.m */, 43B6EA7607592AAD00A80164 /* io.c */, 43B6EA7707592AAD00A80164 /* io.h */, 43B6EA7907592AAD00A80164 /* NSData+Extensions.h */, 43B6EA7A07592AAD00A80164 /* NSData+Extensions.m */, 43B6EA7B07592AAD00A80164 /* NSFileManager+Extensions.h */, 43B6EA7C07592AAD00A80164 /* NSFileManager+Extensions.m */, 15D0E2FB07CD7FE300313569 /* NSScanner+Extensions.h */, 15D0E2FC07CD7FE300313569 /* NSScanner+Extensions.m */, 43B6EA7D07592AAD00A80164 /* NSString+Extensions.h */, 43B6EA7E07592AAD00A80164 /* NSString+Extensions.m */, 43B6EA7F07592AAD00A80164 /* Pantomime.h */, ); name = Classes; sourceTree = ""; }; 1058C7B0FEA5585E11CA2CBB /* Linked Frameworks */ = { isa = PBXGroup; children = ( 1058C7B1FEA5585E11CA2CBB /* Cocoa.framework */, F51ECE700269C24D01E31F4F /* CoreFoundation.framework */, ); name = "Linked Frameworks"; sourceTree = ""; }; 1058C7B2FEA5585E11CA2CBB /* Other Frameworks */ = { isa = PBXGroup; children = ( 0867D69BFE84028FC02AAC07 /* Foundation.framework */, 0867D6A5FE840307C02AAC07 /* AppKit.framework */, ); name = "Other Frameworks"; sourceTree = ""; }; 82137E560B6B8DDD0049FAE9 /* English.lproj */ = { isa = PBXGroup; children = ( 82137E570B6B8DDD0049FAE9 /* InfoPlist.strings */, 82137E590B6B8DDD0049FAE9 /* Localizable.strings */, ); name = English.lproj; path = Resources/English.lproj; sourceTree = ""; }; F58529DE01C701E601A80205 /* Documentation */ = { isa = PBXGroup; children = ( F58529E001C7020E01A80205 /* ChangeLog */, 43B6EB1907592AD800A80164 /* AUTHORS */, 43B6EB1A07592AD800A80164 /* LICENSE */, 43B6EB1C07592AD800A80164 /* README */, 43B6EB1D07592AD800A80164 /* TODO */, ); name = Documentation; sourceTree = ""; }; /* End PBXGroup section */ /* Begin PBXHeadersBuildPhase section */ D92C8BA60A5C66A40015DF49 /* Headers */ = { isa = PBXHeadersBuildPhase; buildActionMask = 2147483647; files = ( D92C8BA70A5C66A40015DF49 /* CWCacheManager.h in Headers */, D92C8BA80A5C66A40015DF49 /* CWCharset.h in Headers */, D92C8BA90A5C66A40015DF49 /* CWConnection.h in Headers */, D92C8BAA0A5C66A40015DF49 /* CWConstants.h in Headers */, D92C8BAB0A5C66A40015DF49 /* CWContainer.h in Headers */, D92C8BAC0A5C66A40015DF49 /* CWDNSManager.h in Headers */, D92C8BAD0A5C66A40015DF49 /* CWFlags.h in Headers */, D92C8BAE0A5C66A40015DF49 /* CWFolder.h in Headers */, D92C8BAF0A5C66A40015DF49 /* CWFolderInformation.h in Headers */, D92C8BB00A5C66A40015DF49 /* CWIMAPCacheManager.h in Headers */, D92C8BB10A5C66A40015DF49 /* CWIMAPFolder.h in Headers */, D92C8BB20A5C66A40015DF49 /* CWIMAPMessage.h in Headers */, D92C8BB30A5C66A40015DF49 /* CWIMAPStore.h in Headers */, D92C8BB40A5C66A40015DF49 /* CWInternetAddress.h in Headers */, D92C8BB50A5C66A40015DF49 /* CWISO8859_1.h in Headers */, D92C8BB60A5C66A40015DF49 /* CWISO8859_2.h in Headers */, D92C8BB70A5C66A40015DF49 /* CWISO8859_3.h in Headers */, D92C8BB80A5C66A40015DF49 /* CWISO8859_4.h in Headers */, D92C8BB90A5C66A40015DF49 /* CWISO8859_5.h in Headers */, D92C8BBA0A5C66A40015DF49 /* CWISO8859_6.h in Headers */, D92C8BBB0A5C66A40015DF49 /* CWISO8859_7.h in Headers */, D92C8BBC0A5C66A40015DF49 /* CWISO8859_8.h in Headers */, D92C8BBD0A5C66A40015DF49 /* CWISO8859_9.h in Headers */, D92C8BBE0A5C66A40015DF49 /* CWISO8859_10.h in Headers */, D92C8BBF0A5C66A40015DF49 /* CWISO8859_11.h in Headers */, D92C8BC00A5C66A40015DF49 /* CWISO8859_13.h in Headers */, D92C8BC10A5C66A40015DF49 /* CWISO8859_14.h in Headers */, D92C8BC20A5C66A40015DF49 /* CWISO8859_15.h in Headers */, D92C8BC30A5C66A40015DF49 /* CWKOI8_R.h in Headers */, D92C8BC40A5C66A40015DF49 /* CWKOI8_U.h in Headers */, D92C8BC50A5C66A40015DF49 /* CWLocalCacheManager.h in Headers */, D92C8BC60A5C66A40015DF49 /* CWLocalFolder.h in Headers */, D92C8BC70A5C66A40015DF49 /* CWLocalFolder+maildir.h in Headers */, D92C8BC80A5C66A40015DF49 /* CWLocalFolder+mbox.h in Headers */, D92C8BC90A5C66A40015DF49 /* CWLocalMessage.h in Headers */, D92C8BCA0A5C66A40015DF49 /* CWLocalStore.h in Headers */, D92C8BCB0A5C66A40015DF49 /* CWMacOSXGlue.h in Headers */, D92C8BCC0A5C66A40015DF49 /* CWMD5.h in Headers */, D92C8BCD0A5C66A40015DF49 /* CWMessage.h in Headers */, D92C8BCE0A5C66A40015DF49 /* CWMIMEMultipart.h in Headers */, D92C8BCF0A5C66A40015DF49 /* CWMIMEUtility.h in Headers */, D92C8BD00A5C66A40015DF49 /* CWParser.h in Headers */, D92C8BD10A5C66A40015DF49 /* CWPart.h in Headers */, D92C8BD20A5C66A40015DF49 /* CWPOP3CacheManager.h in Headers */, D92C8BD30A5C66A40015DF49 /* CWPOP3CacheObject.h in Headers */, D92C8BD40A5C66A40015DF49 /* CWPOP3Folder.h in Headers */, D92C8BD50A5C66A40015DF49 /* CWPOP3Message.h in Headers */, D92C8BD60A5C66A40015DF49 /* CWPOP3Store.h in Headers */, D92C8BD70A5C66A40015DF49 /* CWRegEx.h in Headers */, D92C8BD80A5C66A40015DF49 /* CWSendmail.h in Headers */, D92C8BD90A5C66A40015DF49 /* CWService.h in Headers */, D92C8BDA0A5C66A40015DF49 /* CWSMTP.h in Headers */, D92C8BDB0A5C66A40015DF49 /* CWStore.h in Headers */, D92C8BDC0A5C66A40015DF49 /* CWTCPConnection.h in Headers */, D92C8BDD0A5C66A40015DF49 /* CWTransport.h in Headers */, D92C8BDE0A5C66A40015DF49 /* CWURLName.h in Headers */, D92C8BDF0A5C66A40015DF49 /* CWUUFile.h in Headers */, D92C8BE00A5C66A40015DF49 /* CWVirtualFolder.h in Headers */, D92C8BE10A5C66A40015DF49 /* CWWINDOWS_1250.h in Headers */, D92C8BE20A5C66A40015DF49 /* CWWINDOWS_1251.h in Headers */, D92C8BE30A5C66A40015DF49 /* CWWINDOWS_1252.h in Headers */, D92C8BE40A5C66A40015DF49 /* CWWINDOWS_1253.h in Headers */, D92C8BE50A5C66A40015DF49 /* CWWINDOWS_1254.h in Headers */, D92C8BE80A5C66A40015DF49 /* io.h in Headers */, D92C8BE90A5C66A40015DF49 /* NSData+Extensions.h in Headers */, D92C8BEA0A5C66A40015DF49 /* NSFileManager+Extensions.h in Headers */, D92C8BEB0A5C66A40015DF49 /* NSScanner+Extensions.h in Headers */, D92C8BEC0A5C66A40015DF49 /* NSString+Extensions.h in Headers */, D92C8BED0A5C66A40015DF49 /* Pantomime.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXHeadersBuildPhase section */ /* Begin PBXNativeTarget section */ D92C8BA50A5C66A40015DF49 /* Pantomime */ = { isa = PBXNativeTarget; buildConfigurationList = D92C8C420A5C66A40015DF49 /* Build configuration list for PBXNativeTarget "Pantomime" */; buildPhases = ( D92C8BA60A5C66A40015DF49 /* Headers */, D92C8BEF0A5C66A40015DF49 /* Resources */, D92C8BF20A5C66A40015DF49 /* Sources */, D92C8C3E0A5C66A40015DF49 /* Frameworks */, D92C8C410A5C66A40015DF49 /* Rez */, ); buildRules = ( ); dependencies = ( ); name = Pantomime; productInstallPath = "@executable_path/../Frameworks"; productName = Pantomime; productReference = D92C8C470A5C66A40015DF49 /* Pantomime.framework */; productType = "com.apple.product-type.framework"; }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ 0867D690FE84028FC02AAC07 /* Project object */ = { isa = PBXProject; buildConfigurationList = 827707780A13F07C0009F1A9 /* Build configuration list for PBXProject "Pantomime" */; hasScannedForEncodings = 1; mainGroup = 0867D691FE84028FC02AAC07 /* Pantomime */; productRefGroup = 034768DFFF38A50411DB9C8B /* Products */; projectDirPath = ""; targets = ( D92C8BA50A5C66A40015DF49 /* Pantomime */, ); }; /* End PBXProject section */ /* Begin PBXResourcesBuildPhase section */ D92C8BEF0A5C66A40015DF49 /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( 82137E5B0B6B8DDD0049FAE9 /* InfoPlist.strings in Resources */, 82137E5C0B6B8DDD0049FAE9 /* Localizable.strings in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXResourcesBuildPhase section */ /* Begin PBXRezBuildPhase section */ D92C8C410A5C66A40015DF49 /* Rez */ = { isa = PBXRezBuildPhase; buildActionMask = 2147483647; files = ( ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXRezBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ D92C8BF20A5C66A40015DF49 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( D92C8BF40A5C66A40015DF49 /* CWCacheManager.m in Sources */, D92C8BF50A5C66A40015DF49 /* CWCharset.m in Sources */, D92C8BF60A5C66A40015DF49 /* CWConstants.m in Sources */, D92C8BF70A5C66A40015DF49 /* CWContainer.m in Sources */, D92C8BF80A5C66A40015DF49 /* CWDNSManager.m in Sources */, D92C8BF90A5C66A40015DF49 /* CWFlags.m in Sources */, D92C8BFA0A5C66A40015DF49 /* CWFolder.m in Sources */, D92C8BFB0A5C66A40015DF49 /* CWFolderInformation.m in Sources */, D92C8BFC0A5C66A40015DF49 /* CWIMAPCacheManager.m in Sources */, D92C8BFD0A5C66A40015DF49 /* CWIMAPFolder.m in Sources */, D92C8BFE0A5C66A40015DF49 /* CWIMAPMessage.m in Sources */, D92C8BFF0A5C66A40015DF49 /* CWIMAPStore.m in Sources */, D92C8C000A5C66A40015DF49 /* CWInternetAddress.m in Sources */, D92C8C010A5C66A40015DF49 /* CWISO8859_1.m in Sources */, D92C8C020A5C66A40015DF49 /* CWISO8859_2.m in Sources */, D92C8C030A5C66A40015DF49 /* CWISO8859_3.m in Sources */, D92C8C040A5C66A40015DF49 /* CWISO8859_4.m in Sources */, D92C8C050A5C66A40015DF49 /* CWISO8859_5.m in Sources */, D92C8C060A5C66A40015DF49 /* CWISO8859_6.m in Sources */, D92C8C070A5C66A40015DF49 /* CWISO8859_7.m in Sources */, D92C8C080A5C66A40015DF49 /* CWISO8859_8.m in Sources */, D92C8C090A5C66A40015DF49 /* CWISO8859_9.m in Sources */, D92C8C0A0A5C66A40015DF49 /* CWISO8859_10.m in Sources */, D92C8C0B0A5C66A40015DF49 /* CWISO8859_11.m in Sources */, D92C8C0C0A5C66A40015DF49 /* CWISO8859_13.m in Sources */, D92C8C0D0A5C66A40015DF49 /* CWISO8859_14.m in Sources */, D92C8C0E0A5C66A40015DF49 /* CWISO8859_15.m in Sources */, D92C8C0F0A5C66A40015DF49 /* CWKOI8_R.m in Sources */, D92C8C100A5C66A40015DF49 /* CWKOI8_U.m in Sources */, D92C8C110A5C66A40015DF49 /* CWLocalCacheManager.m in Sources */, D92C8C120A5C66A40015DF49 /* CWLocalFolder.m in Sources */, D92C8C130A5C66A40015DF49 /* CWLocalFolder+maildir.m in Sources */, D92C8C140A5C66A40015DF49 /* CWLocalFolder+mbox.m in Sources */, D92C8C150A5C66A40015DF49 /* CWLocalMessage.m in Sources */, D92C8C160A5C66A40015DF49 /* CWLocalStore.m in Sources */, D92C8C170A5C66A40015DF49 /* CWMacOSXGlue.m in Sources */, D92C8C180A5C66A40015DF49 /* CWMD5.m in Sources */, D92C8C190A5C66A40015DF49 /* CWMessage.m in Sources */, D92C8C1A0A5C66A40015DF49 /* CWMIMEMultipart.m in Sources */, D92C8C1B0A5C66A40015DF49 /* CWMIMEUtility.m in Sources */, D92C8C1C0A5C66A40015DF49 /* CWParser.m in Sources */, D92C8C1D0A5C66A40015DF49 /* CWPart.m in Sources */, D92C8C1E0A5C66A40015DF49 /* CWPOP3CacheManager.m in Sources */, D92C8C1F0A5C66A40015DF49 /* CWPOP3CacheObject.m in Sources */, D92C8C200A5C66A40015DF49 /* CWPOP3Folder.m in Sources */, D92C8C210A5C66A40015DF49 /* CWPOP3Message.m in Sources */, D92C8C220A5C66A40015DF49 /* CWPOP3Store.m in Sources */, D92C8C230A5C66A40015DF49 /* CWRegEx.m in Sources */, D92C8C240A5C66A40015DF49 /* CWSendmail.m in Sources */, D92C8C250A5C66A40015DF49 /* CWService.m in Sources */, D92C8C260A5C66A40015DF49 /* CWSMTP.m in Sources */, D92C8C270A5C66A40015DF49 /* CWTCPConnection.m in Sources */, D92C8C280A5C66A40015DF49 /* CWURLName.m in Sources */, D92C8C290A5C66A40015DF49 /* CWUUFile.m in Sources */, D92C8C2A0A5C66A40015DF49 /* CWVirtualFolder.m in Sources */, D92C8C2B0A5C66A40015DF49 /* CWWINDOWS_1250.m in Sources */, D92C8C2C0A5C66A40015DF49 /* CWWINDOWS_1251.m in Sources */, D92C8C2D0A5C66A40015DF49 /* CWWINDOWS_1252.m in Sources */, D92C8C2E0A5C66A40015DF49 /* CWWINDOWS_1253.m in Sources */, D92C8C2F0A5C66A40015DF49 /* CWWINDOWS_1254.m in Sources */, D92C8C320A5C66A40015DF49 /* io.c in Sources */, D92C8C340A5C66A40015DF49 /* NSData+Extensions.m in Sources */, D92C8C350A5C66A40015DF49 /* NSFileManager+Extensions.m in Sources */, D92C8C360A5C66A40015DF49 /* NSString+Extensions.m in Sources */, D92C8C3D0A5C66A40015DF49 /* NSScanner+Extensions.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXSourcesBuildPhase section */ /* Begin PBXVariantGroup section */ 82137E570B6B8DDD0049FAE9 /* InfoPlist.strings */ = { isa = PBXVariantGroup; children = ( 82137E580B6B8DDD0049FAE9 /* English */, ); name = InfoPlist.strings; sourceTree = ""; }; 82137E590B6B8DDD0049FAE9 /* Localizable.strings */ = { isa = PBXVariantGroup; children = ( 82137E5A0B6B8DDD0049FAE9 /* English */, ); name = Localizable.strings; sourceTree = ""; }; /* End PBXVariantGroup section */ /* Begin XCBuildConfiguration section */ 827707790A13F07C0009F1A9 /* debug */ = { isa = XCBuildConfiguration; buildSettings = { MACOSX_DEPLOYMENT_TARGET = 10.4; MACOSX_DEPLOYMENT_TARGET_i386 = 10.4; MACOSX_DEPLOYMENT_TARGET_ppc = 10.3; SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk; SDKROOT_i386 = /Developer/SDKs/MacOSX10.4u.sdk; SDKROOT_ppc = /Developer/SDKs/MacOSX10.3.9.sdk; }; name = debug; }; 8277077A0A13F07C0009F1A9 /* release */ = { isa = XCBuildConfiguration; buildSettings = { ARCHS = ( ppc, i386, ); MACOSX_DEPLOYMENT_TARGET = 10.4; MACOSX_DEPLOYMENT_TARGET_i386 = 10.4; MACOSX_DEPLOYMENT_TARGET_ppc = 10.3; SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk; SDKROOT_i386 = /Developer/SDKs/MacOSX10.4u.sdk; SDKROOT_ppc = /Developer/SDKs/MacOSX10.3.9.sdk; }; name = release; }; D92C8C430A5C66A40015DF49 /* debug */ = { isa = XCBuildConfiguration; buildSettings = { CONFIGURATION_BUILD_DIR = "$(BUILD_DIR)/$(CONFIGURATION)"; COPY_PHASE_STRIP = NO; DEAD_CODE_STRIPPING = YES; DEPLOYMENT_LOCATION = NO; DEPLOYMENT_POSTPROCESSING = NO; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; FRAMEWORK_VERSION = A; GCC_ENABLE_FIX_AND_CONTINUE = NO; GCC_GENERATE_DEBUGGING_SYMBOLS = YES; GCC_PREPROCESSOR_DEFINITIONS = MACOSX; INFOPLIST_FILE = Info.plist; INSTALL_PATH = "@executable_path/../Frameworks"; OTHER_LDFLAGS = ( "-seg1addr", 0x10000000, "-lssl", "-lcrypto", "-lresolv", ); PREBINDING = NO; PRODUCT_NAME = Pantomime; WARNING_CFLAGS = ( "-Wmost", "-Wno-four-char-constants", "-Wno-unknown-pragmas", ); WRAPPER_EXTENSION = framework; }; name = debug; }; D92C8C440A5C66A40015DF49 /* release */ = { isa = XCBuildConfiguration; buildSettings = { CONFIGURATION_BUILD_DIR = "$(BUILD_DIR)/$(CONFIGURATION)"; COPY_PHASE_STRIP = NO; DEAD_CODE_STRIPPING = YES; DEPLOYMENT_LOCATION = NO; DEPLOYMENT_POSTPROCESSING = NO; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; FRAMEWORK_VERSION = A; GCC_ENABLE_FIX_AND_CONTINUE = NO; GCC_GENERATE_DEBUGGING_SYMBOLS = NO; GCC_PREPROCESSOR_DEFINITIONS = MACOSX; INFOPLIST_FILE = Info.plist; INSTALL_PATH = "@executable_path/../Frameworks"; OTHER_LDFLAGS = ( "-seg1addr", 0x10000000, "-lssl", "-lcrypto", "-lresolv", ); PREBINDING = NO; PRODUCT_NAME = Pantomime; WARNING_CFLAGS = ( "-Wmost", "-Wno-four-char-constants", "-Wno-unknown-pragmas", ); WRAPPER_EXTENSION = framework; }; name = release; }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ 827707780A13F07C0009F1A9 /* Build configuration list for PBXProject "Pantomime" */ = { isa = XCConfigurationList; buildConfigurations = ( 827707790A13F07C0009F1A9 /* debug */, 8277077A0A13F07C0009F1A9 /* release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = release; }; D92C8C420A5C66A40015DF49 /* Build configuration list for PBXNativeTarget "Pantomime" */ = { isa = XCConfigurationList; buildConfigurations = ( D92C8C430A5C66A40015DF49 /* debug */, D92C8C440A5C66A40015DF49 /* release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = release; }; /* End XCConfigurationList section */ }; rootObject = 0867D690FE84028FC02AAC07 /* Project object */; } pantomime1.2-1.2.2+dfsg1/README000066400000000000000000000000321276751561200156150ustar00rootroot00000000000000See Documentation/README. pantomime1.2-1.2.2+dfsg1/Resources/000077500000000000000000000000001276751561200167145ustar00rootroot00000000000000pantomime1.2-1.2.2+dfsg1/Resources/English.lproj/000077500000000000000000000000001276751561200214325ustar00rootroot00000000000000pantomime1.2-1.2.2+dfsg1/Resources/English.lproj/InfoPlist.strings000066400000000000000000000004371276751561200247600ustar00rootroot00000000000000/* Localized versions of Info.plist keys */ CFBundleName = "Pantomime"; CFBundleShortVersionString = "Pantomime version 1.2.0"; CFBundleGetInfoString = "Pantomime version 1.2.0, Copyright 2001-2004 Ludovic Marcotte."; NSHumanReadableCopyright = "Copyright 2001-2004 Ludovic Marcotte."; pantomime1.2-1.2.2+dfsg1/Resources/English.lproj/Localizable.strings000066400000000000000000000061001276751561200252630ustar00rootroot00000000000000/*** English.lproj/Localizable.strings updated by make_strings 2004-11-27 10:18:22 -0500 add comments above this one ***/ "PantomimeReferencePrefix" = "réf. :"; "PantomimeResponsePrefix" = "rép. :"; /*** Unmatched/untranslated keys ***/ /* File: CWCharset.m:158 */ /* Flag: untranslated */ "Western European (ISO Latin 1)" = "Western European (ISO Latin 1)"; /* File: CWCharset.m:159 */ /* Flag: untranslated */ "Western European (ISO Latin 9)" = "Western European (ISO Latin 9)"; /* File: CWCharset.m:160 */ /* Flag: untranslated */ "Western European (Windows Latin 1)" = "Western European (Windows Latin 1)"; /* File: CWCharset.m:162 */ /* Flag: untranslated */ "Japanese (ISO 2022-JP)" = "Japanese (ISO 2022-JP)"; /* File: CWCharset.m:163 */ /* Flag: untranslated */ "Japanese (EUC-JP)" = "Japanese (EUC-JP)"; /* File: CWCharset.m:165 */ /* Flag: untranslated */ "Traditional Chinese (BIG5)" = "Traditional Chinese (BIG5)"; /* File: CWCharset.m:167 */ /* Flag: untranslated */ "Arabic (ISO 8859-6)" = "Arabic (ISO 8859-6)"; /* File: CWCharset.m:169 */ /* Flag: untranslated */ "Greek (ISO 8859-7)" = "Greek (ISO 8859-7)"; /* File: CWCharset.m:170 */ /* Flag: untranslated */ "Greek (Windows)" = "Greek (Windows)"; /* File: CWCharset.m:172 */ /* Flag: untranslated */ "Hebrew (ISO 8859-8)" = "Hebrew (ISO 8859-8)"; /* File: CWCharset.m:174 */ /* Flag: untranslated */ "Cyrillic (ISO 8859-5)" = "Cyrillic (ISO 8859-5)"; /* File: CWCharset.m:175 */ /* Flag: untranslated */ "Cyrillic (KOI8-R)" = "Cyrillic (KOI8-R)"; /* File: CWCharset.m:176 */ /* Flag: untranslated */ "Cyrillic (Windows)" = "Cyrillic (Windows)"; /* File: CWCharset.m:178 */ /* Flag: untranslated */ "Thai (ISO 8859-11)" = "Thai (ISO 8859-11)"; /* File: CWCharset.m:180 */ /* Flag: untranslated */ "Central European (ISO Latin 2)" = "Central European (ISO Latin 2)"; /* File: CWCharset.m:181 */ /* Flag: untranslated */ "Central European (Windows Latin 2)" = "Central European (Windows Latin 2)"; /* File: CWCharset.m:183 */ /* Flag: untranslated */ "Turkish (Latin 5)" = "Turkish (Latin 5)"; /* File: CWCharset.m:184 */ /* Flag: untranslated */ "Turkish (Windows)" = "Turkish (Windows)"; /* File: CWCharset.m:186 */ /* Flag: untranslated */ "South European (ISO Latin 3)" = "South European (ISO Latin 3)"; /* File: CWCharset.m:187 */ /* Flag: untranslated */ "North European (ISO Latin 4)" = "North European (ISO Latin 4)"; /* File: CWCharset.m:189 */ /* Flag: untranslated */ "Nordic (ISO Latin 6)" = "Nordic (ISO Latin 6)"; /* File: CWCharset.m:190 */ /* Flag: untranslated */ "Baltic Rim (ISO Latin 7)" = "Baltic Rim (ISO Latin 7)"; /* File: CWCharset.m:191 */ /* Flag: untranslated */ "Celtic (ISO Latin 8)" = "Celtic (ISO Latin 8)"; /* File: CWCharset.m:193 */ /* Flag: untranslated */ "Simplified Chinese (GB2312)" = "Simplified Chinese (GB2312)"; /* File: CWCharset.m:194 */ /* Flag: untranslated */ "UTF-8" = "UTF-8"; /* File: CWCharset.m:197 */ /* Flag: untranslated */ "Korean (EUC-KR/KS C 5601)" = "Korean (EUC-KR/KS C 5601)"; /* File: CWCharset.m:198 */ /* Flag: untranslated */ "Japanese (Win/Mac)" = "Japanese (Win/Mac)"; pantomime1.2-1.2.2+dfsg1/Resources/German.lproj/000077500000000000000000000000001276751561200212525ustar00rootroot00000000000000pantomime1.2-1.2.2+dfsg1/Resources/German.lproj/InfoPlist.strings000066400000000000000000000004251276751561200245750ustar00rootroot00000000000000/* Localized versions of Info.plist keys */ CFBundleName = "Pantomime"; CFBundleShortVersionString = "Pantomime Version 1.2.0"; CFBundleGetInfoString = "Pantomime Version 1.2.0, © 2001–2004 Ludovic Marcotte."; NSHumanReadableCopyright = "© 2001–2004 Ludovic Marcotte."; pantomime1.2-1.2.2+dfsg1/Resources/German.lproj/Localizable.strings000066400000000000000000000061641276751561200251150ustar00rootroot00000000000000/*** English.lproj/Localizable.strings updated by make_strings 2004-11-27 10:18:22 -0500 add comments above this one ***/ "PantomimeReferencePrefix" = "aw:"; "PantomimeResponsePrefix" = "aw :"; /*** Unmatched/untranslated keys ***/ /* File: CWCharset.m:158 */ /* Flag: untranslated */ "Western European (ISO Latin 1)" = "Westeuropäisch (ISO Latin 1)"; /* File: CWCharset.m:159 */ /* Flag: untranslated */ "Western European (ISO Latin 9)" = "Westeuropäisch (ISO Latin 9)"; /* File: CWCharset.m:160 */ /* Flag: untranslated */ "Western European (Windows Latin 1)" = "Westeuropäisch (Windows Latin 1)"; /* File: CWCharset.m:162 */ /* Flag: untranslated */ "Japanese (ISO 2022-JP)" = "Japanisch (ISO 2022-JP)"; /* File: CWCharset.m:163 */ /* Flag: untranslated */ "Japanese (EUC-JP)" = "Japanisch (EUC-JP)"; /* File: CWCharset.m:165 */ /* Flag: untranslated */ "Traditional Chinese (BIG5)" = "Traditionelles Chinesisch (BIG5)"; /* File: CWCharset.m:167 */ /* Flag: untranslated */ "Arabic (ISO 8859-6)" = "Arabisch (ISO 8859-6)"; /* File: CWCharset.m:169 */ /* Flag: untranslated */ "Greek (ISO 8859-7)" = "Griechisch (ISO 8859-7)"; /* File: CWCharset.m:170 */ /* Flag: untranslated */ "Greek (Windows)" = "Griechisch (Windows)"; /* File: CWCharset.m:172 */ /* Flag: untranslated */ "Hebrew (ISO 8859-8)" = "Hebräisch (ISO 8859-8)"; /* File: CWCharset.m:174 */ /* Flag: untranslated */ "Cyrillic (ISO 8859-5)" = "Kyrillisch (ISO 8859-5)"; /* File: CWCharset.m:175 */ /* Flag: untranslated */ "Cyrillic (KOI8-R)" = "Kyrillisch (KOI8-R)"; /* File: CWCharset.m:176 */ /* Flag: untranslated */ "Cyrillic (Windows)" = "Kyrillisch (Windows)"; /* File: CWCharset.m:178 */ /* Flag: untranslated */ "Thai (ISO 8859-11)" = "Thailändisch (ISO 8859-11)"; /* File: CWCharset.m:180 */ /* Flag: untranslated */ "Central European (ISO Latin 2)" = "Zentraleuropäisch (ISO Latin 2)"; /* File: CWCharset.m:181 */ /* Flag: untranslated */ "Central European (Windows Latin 2)" = "Zentraleuropäisch (Windows Latin 2)"; /* File: CWCharset.m:183 */ /* Flag: untranslated */ "Turkish (Latin 5)" = "Türkisch (Latin 5)"; /* File: CWCharset.m:184 */ /* Flag: untranslated */ "Turkish (Windows)" = "Türkisch (Windows)"; /* File: CWCharset.m:186 */ /* Flag: untranslated */ "South European (ISO Latin 3)" = "Südeuropäisch (ISO Latin 3)"; /* File: CWCharset.m:187 */ /* Flag: untranslated */ "North European (ISO Latin 4)" = "Nordeuropäisch (ISO Latin 4)"; /* File: CWCharset.m:189 */ /* Flag: untranslated */ "Nordic (ISO Latin 6)" = "Nordisch (ISO Latin 6)"; /* File: CWCharset.m:190 */ /* Flag: untranslated */ "Baltic Rim (ISO Latin 7)" = "Baltisch (ISO Latin 7)"; /* File: CWCharset.m:191 */ /* Flag: untranslated */ "Celtic (ISO Latin 8)" = "Keltisch (ISO Latin 8)"; /* File: CWCharset.m:193 */ /* Flag: untranslated */ "Simplified Chinese (GB2312)" = "Vereinfachtes Chinesisch (GB2312)"; /* File: CWCharset.m:194 */ /* Flag: untranslated */ "UTF-8" = "UTF-8"; /* File: CWCharset.m:197 */ /* Flag: untranslated */ "Korean (EUC-KR/KS C 5601)" = "Koreanisch (EUC-KR/KS C 5601)"; /* File: CWCharset.m:198 */ /* Flag: untranslated */ "Japanese (Win/Mac)" = "Japanisch (Win/Mac)"; pantomime1.2-1.2.2+dfsg1/System/000077500000000000000000000000001276751561200162265ustar00rootroot00000000000000pantomime1.2-1.2.2+dfsg1/System/Library/000077500000000000000000000000001276751561200176325ustar00rootroot00000000000000pantomime1.2-1.2.2+dfsg1/System/Library/Makefiles/000077500000000000000000000000001276751561200215325ustar00rootroot00000000000000pantomime1.2-1.2.2+dfsg1/System/Library/Makefiles/tar-exclude-list000066400000000000000000000000121276751561200246340ustar00rootroot00000000000000CVS *.svn pantomime1.2-1.2.2+dfsg1/charsets/000077500000000000000000000000001276751561200165565ustar00rootroot00000000000000pantomime1.2-1.2.2+dfsg1/charsets/CharsetDecoder.h000066400000000000000000000016031276751561200216060ustar00rootroot00000000000000/* ** CharsetDecoder.h ** ** Copyright (c) 2001-2004 ** ** Author: Ludovic Marcotte ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation; either version 2 of the License, or ** (at your option) any later version. ** ** This program is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. ** ** You should have received a copy of the GNU General Public License ** along with this program; if not, write to the Free Software ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #import @interface CharsetDecoder : NSObject @end pantomime1.2-1.2.2+dfsg1/charsets/CharsetDecoder.m000066400000000000000000000045751276751561200216260ustar00rootroot00000000000000/* ** CharsetDecoder.m ** ** Copyright (c) 2001-2004 ** ** Author: Ludovic Marcotte ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation; either version 2 of the License, or ** (at your option) any later version. ** ** This program is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. ** ** You should have received a copy of the GNU General Public License ** along with this program; if not, write to the Free Software ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #import "CharsetDecoder.h" @implementation CharsetDecoder @end int main(int argc, const char *argv[], char *env[]) { CREATE_AUTORELEASE_POOL(pool); FILE *stream; char *aLine; char *basename,*c; char *charsetname; int i; int code; unichar value[2]; char buf[80]; if (argc != 2) { printf("\nUsage: openapp CharsetDecoder.app filename.txt\n\n"); RELEASE(pool); exit(0); } basename=strdup(argv[1]); for (c=basename;*c!='.';c++) { *c=toupper(*c); if (*c=='-') *c='_'; } *c=0; charsetname=strdup(argv[1]); *strchr(charsetname,'.')=0; if (!strncmp(charsetname,"iso",3)) { memmove(&charsetname[4],&charsetname[3],strlen(charsetname)-3+1); charsetname[3]='-'; } aLine = (char*)malloc(sizeof(char)*1024); value[1] = 0; stream = fopen(argv[1], "r"); printf( "#include \n" /* basename */ "\n" "static struct charset_code code_table[]={", basename); i=0; while (fgets(aLine, 128, stream) != NULL) { if (!i++) printf("\n"); if (i==5) i=0; sscanf(aLine, "=%02x\tU+%04x\t%s", &code, value, buf); printf("{0x%02x,0x%04x}, ",code,value[0]); } printf( "};\n" "\n" "@implementation %s\n" /* basename */ "\n" "- (id) init\n" "{\n" "\treturn [super initWithCodeCharTable: code_table length: sizeof(code_table)/sizeof(code_table[0])];\n" "}\n\n" "- (NSString *) name\n" "{\n" "\treturn @\"%s\";\n" /* charsetname */ "}\n" "\n" "@end\n" "\n",basename,charsetname); free(aLine); RELEASE(pool); exit(0); } pantomime1.2-1.2.2+dfsg1/charsets/GNUmakefile000066400000000000000000000022131276751561200206260ustar00rootroot00000000000000# # GNUstep Makefile for the charset decoder/converter # # Copyright (C) 2001-2004 # # Author: Ludovic Marcotte # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ include $(GNUSTEP_MAKEFILES)/common.make # The application to be compiled APP_NAME = CharsetDecoder # The Objective-C source files to be compiled CharsetDecoder_OBJC_FILES = CharsetDecoder.m # The Objective-C headers CharsetDecoder_HEADERS = CharsetDecoder.h include $(GNUSTEP_MAKEFILES)/application.make pantomime1.2-1.2.2+dfsg1/charsets/README000066400000000000000000000004541276751561200174410ustar00rootroot00000000000000Ignore everything in this directory. The little program is used to generate our ISO8859-X, KOI8-X, and WINDOWS-X classes. All the files in this directory are intented for Pantomime developers, and NOT end-users or developers using Pantomime. We can get all the charsets here: http://czyborra.com/ pantomime1.2-1.2.2+dfsg1/charsets/iso8859-1.txt000066400000000000000000000145151276751561200206130ustar00rootroot00000000000000=20 U+0020 SPACE =21 U+0021 EXCLAMATION MARK =22 U+0022 QUOTATION MARK =23 U+0023 NUMBER SIGN =24 U+0024 DOLLAR SIGN =25 U+0025 PERCENT SIGN =26 U+0026 AMPERSAND =27 U+0027 APOSTROPHE =28 U+0028 LEFT PARENTHESIS =29 U+0029 RIGHT PARENTHESIS =2A U+002A ASTERISK =2B U+002B PLUS SIGN =2C U+002C COMMA =2D U+002D HYPHEN-MINUS =2E U+002E FULL STOP =2F U+002F SOLIDUS =30 U+0030 DIGIT ZERO =31 U+0031 DIGIT ONE =32 U+0032 DIGIT TWO =33 U+0033 DIGIT THREE =34 U+0034 DIGIT FOUR =35 U+0035 DIGIT FIVE =36 U+0036 DIGIT SIX =37 U+0037 DIGIT SEVEN =38 U+0038 DIGIT EIGHT =39 U+0039 DIGIT NINE =3A U+003A COLON =3B U+003B SEMICOLON =3C U+003C LESS-THAN SIGN =3D U+003D EQUALS SIGN =3E U+003E GREATER-THAN SIGN =3F U+003F QUESTION MARK =40 U+0040 COMMERCIAL AT =41 U+0041 LATIN CAPITAL LETTER A =42 U+0042 LATIN CAPITAL LETTER B =43 U+0043 LATIN CAPITAL LETTER C =44 U+0044 LATIN CAPITAL LETTER D =45 U+0045 LATIN CAPITAL LETTER E =46 U+0046 LATIN CAPITAL LETTER F =47 U+0047 LATIN CAPITAL LETTER G =48 U+0048 LATIN CAPITAL LETTER H =49 U+0049 LATIN CAPITAL LETTER I =4A U+004A LATIN CAPITAL LETTER J =4B U+004B LATIN CAPITAL LETTER K =4C U+004C LATIN CAPITAL LETTER L =4D U+004D LATIN CAPITAL LETTER M =4E U+004E LATIN CAPITAL LETTER N =4F U+004F LATIN CAPITAL LETTER O =50 U+0050 LATIN CAPITAL LETTER P =51 U+0051 LATIN CAPITAL LETTER Q =52 U+0052 LATIN CAPITAL LETTER R =53 U+0053 LATIN CAPITAL LETTER S =54 U+0054 LATIN CAPITAL LETTER T =55 U+0055 LATIN CAPITAL LETTER U =56 U+0056 LATIN CAPITAL LETTER V =57 U+0057 LATIN CAPITAL LETTER W =58 U+0058 LATIN CAPITAL LETTER X =59 U+0059 LATIN CAPITAL LETTER Y =5A U+005A LATIN CAPITAL LETTER Z =5B U+005B LEFT SQUARE BRACKET =5C U+005C REVERSE SOLIDUS =5D U+005D RIGHT SQUARE BRACKET =5E U+005E CIRCUMFLEX ACCENT =5F U+005F LOW LINE =60 U+0060 GRAVE ACCENT =61 U+0061 LATIN SMALL LETTER A =62 U+0062 LATIN SMALL LETTER B =63 U+0063 LATIN SMALL LETTER C =64 U+0064 LATIN SMALL LETTER D =65 U+0065 LATIN SMALL LETTER E =66 U+0066 LATIN SMALL LETTER F =67 U+0067 LATIN SMALL LETTER G =68 U+0068 LATIN SMALL LETTER H =69 U+0069 LATIN SMALL LETTER I =6A U+006A LATIN SMALL LETTER J =6B U+006B LATIN SMALL LETTER K =6C U+006C LATIN SMALL LETTER L =6D U+006D LATIN SMALL LETTER M =6E U+006E LATIN SMALL LETTER N =6F U+006F LATIN SMALL LETTER O =70 U+0070 LATIN SMALL LETTER P =71 U+0071 LATIN SMALL LETTER Q =72 U+0072 LATIN SMALL LETTER R =73 U+0073 LATIN SMALL LETTER S =74 U+0074 LATIN SMALL LETTER T =75 U+0075 LATIN SMALL LETTER U =76 U+0076 LATIN SMALL LETTER V =77 U+0077 LATIN SMALL LETTER W =78 U+0078 LATIN SMALL LETTER X =79 U+0079 LATIN SMALL LETTER Y =7A U+007A LATIN SMALL LETTER Z =7B U+007B LEFT CURLY BRACKET =7C U+007C VERTICAL LINE =7D U+007D RIGHT CURLY BRACKET =7E U+007E TILDE =A0 U+00A0 NO-BREAK SPACE =A1 U+00A1 INVERTED EXCLAMATION MARK =A2 U+00A2 CENT SIGN =A3 U+00A3 POUND SIGN =A4 U+00A4 CURRENCY SIGN =A5 U+00A5 YEN SIGN =A6 U+00A6 BROKEN BAR =A7 U+00A7 SECTION SIGN =A8 U+00A8 DIAERESIS =A9 U+00A9 COPYRIGHT SIGN =AA U+00AA FEMININE ORDINAL INDICATOR =AB U+00AB LEFT-POINTING DOUBLE ANGLE QUOTATION MARK =AC U+00AC NOT SIGN =AD U+00AD SOFT HYPHEN =AE U+00AE REGISTERED SIGN =AF U+00AF MACRON =B0 U+00B0 DEGREE SIGN =B1 U+00B1 PLUS-MINUS SIGN =B2 U+00B2 SUPERSCRIPT TWO =B3 U+00B3 SUPERSCRIPT THREE =B4 U+00B4 ACUTE ACCENT =B5 U+00B5 MICRO SIGN =B6 U+00B6 PILCROW SIGN =B7 U+00B7 MIDDLE DOT =B8 U+00B8 CEDILLA =B9 U+00B9 SUPERSCRIPT ONE =BA U+00BA MASCULINE ORDINAL INDICATOR =BB U+00BB RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK =BC U+00BC VULGAR FRACTION ONE QUARTER =BD U+00BD VULGAR FRACTION ONE HALF =BE U+00BE VULGAR FRACTION THREE QUARTERS =BF U+00BF INVERTED QUESTION MARK =C0 U+00C0 LATIN CAPITAL LETTER A WITH GRAVE =C1 U+00C1 LATIN CAPITAL LETTER A WITH ACUTE =C2 U+00C2 LATIN CAPITAL LETTER A WITH CIRCUMFLEX =C3 U+00C3 LATIN CAPITAL LETTER A WITH TILDE =C4 U+00C4 LATIN CAPITAL LETTER A WITH DIAERESIS =C5 U+00C5 LATIN CAPITAL LETTER A WITH RING ABOVE =C6 U+00C6 LATIN CAPITAL LETTER AE =C7 U+00C7 LATIN CAPITAL LETTER C WITH CEDILLA =C8 U+00C8 LATIN CAPITAL LETTER E WITH GRAVE =C9 U+00C9 LATIN CAPITAL LETTER E WITH ACUTE =CA U+00CA LATIN CAPITAL LETTER E WITH CIRCUMFLEX =CB U+00CB LATIN CAPITAL LETTER E WITH DIAERESIS =CC U+00CC LATIN CAPITAL LETTER I WITH GRAVE =CD U+00CD LATIN CAPITAL LETTER I WITH ACUTE =CE U+00CE LATIN CAPITAL LETTER I WITH CIRCUMFLEX =CF U+00CF LATIN CAPITAL LETTER I WITH DIAERESIS =D0 U+00D0 LATIN CAPITAL LETTER ETH =D1 U+00D1 LATIN CAPITAL LETTER N WITH TILDE =D2 U+00D2 LATIN CAPITAL LETTER O WITH GRAVE =D3 U+00D3 LATIN CAPITAL LETTER O WITH ACUTE =D4 U+00D4 LATIN CAPITAL LETTER O WITH CIRCUMFLEX =D5 U+00D5 LATIN CAPITAL LETTER O WITH TILDE =D6 U+00D6 LATIN CAPITAL LETTER O WITH DIAERESIS =D7 U+00D7 MULTIPLICATION SIGN =D8 U+00D8 LATIN CAPITAL LETTER O WITH STROKE =D9 U+00D9 LATIN CAPITAL LETTER U WITH GRAVE =DA U+00DA LATIN CAPITAL LETTER U WITH ACUTE =DB U+00DB LATIN CAPITAL LETTER U WITH CIRCUMFLEX =DC U+00DC LATIN CAPITAL LETTER U WITH DIAERESIS =DD U+00DD LATIN CAPITAL LETTER Y WITH ACUTE =DE U+00DE LATIN CAPITAL LETTER THORN =DF U+00DF LATIN SMALL LETTER SHARP S =E0 U+00E0 LATIN SMALL LETTER A WITH GRAVE =E1 U+00E1 LATIN SMALL LETTER A WITH ACUTE =E2 U+00E2 LATIN SMALL LETTER A WITH CIRCUMFLEX =E3 U+00E3 LATIN SMALL LETTER A WITH TILDE =E4 U+00E4 LATIN SMALL LETTER A WITH DIAERESIS =E5 U+00E5 LATIN SMALL LETTER A WITH RING ABOVE =E6 U+00E6 LATIN SMALL LETTER AE =E7 U+00E7 LATIN SMALL LETTER C WITH CEDILLA =E8 U+00E8 LATIN SMALL LETTER E WITH GRAVE =E9 U+00E9 LATIN SMALL LETTER E WITH ACUTE =EA U+00EA LATIN SMALL LETTER E WITH CIRCUMFLEX =EB U+00EB LATIN SMALL LETTER E WITH DIAERESIS =EC U+00EC LATIN SMALL LETTER I WITH GRAVE =ED U+00ED LATIN SMALL LETTER I WITH ACUTE =EE U+00EE LATIN SMALL LETTER I WITH CIRCUMFLEX =EF U+00EF LATIN SMALL LETTER I WITH DIAERESIS =F0 U+00F0 LATIN SMALL LETTER ETH =F1 U+00F1 LATIN SMALL LETTER N WITH TILDE =F2 U+00F2 LATIN SMALL LETTER O WITH GRAVE =F3 U+00F3 LATIN SMALL LETTER O WITH ACUTE =F4 U+00F4 LATIN SMALL LETTER O WITH CIRCUMFLEX =F5 U+00F5 LATIN SMALL LETTER O WITH TILDE =F6 U+00F6 LATIN SMALL LETTER O WITH DIAERESIS =F7 U+00F7 DIVISION SIGN =F8 U+00F8 LATIN SMALL LETTER O WITH STROKE =F9 U+00F9 LATIN SMALL LETTER U WITH GRAVE =FA U+00FA LATIN SMALL LETTER U WITH ACUTE =FB U+00FB LATIN SMALL LETTER U WITH CIRCUMFLEX =FC U+00FC LATIN SMALL LETTER U WITH DIAERESIS =FD U+00FD LATIN SMALL LETTER Y WITH ACUTE =FE U+00FE LATIN SMALL LETTER THORN =FF U+00FF LATIN SMALL LETTER Y WITH DIAERESIS pantomime1.2-1.2.2+dfsg1/charsets/iso8859-10.txt000066400000000000000000000153471276751561200206770ustar00rootroot00000000000000=20 U+0020 SPACE =21 U+0021 EXCLAMATION MARK =22 U+0022 QUOTATION MARK =23 U+0023 NUMBER SIGN =24 U+0024 DOLLAR SIGN =25 U+0025 PERCENT SIGN =26 U+0026 AMPERSAND =27 U+0027 APOSTROPHE =28 U+0028 LEFT PARENTHESIS =29 U+0029 RIGHT PARENTHESIS =2A U+002A ASTERISK =2B U+002B PLUS SIGN =2C U+002C COMMA =2D U+002D HYPHEN-MINUS =2E U+002E FULL STOP =2F U+002F SOLIDUS =30 U+0030 DIGIT ZERO =31 U+0031 DIGIT ONE =32 U+0032 DIGIT TWO =33 U+0033 DIGIT THREE =34 U+0034 DIGIT FOUR =35 U+0035 DIGIT FIVE =36 U+0036 DIGIT SIX =37 U+0037 DIGIT SEVEN =38 U+0038 DIGIT EIGHT =39 U+0039 DIGIT NINE =3A U+003A COLON =3B U+003B SEMICOLON =3C U+003C LESS-THAN SIGN =3D U+003D EQUALS SIGN =3E U+003E GREATER-THAN SIGN =3F U+003F QUESTION MARK =40 U+0040 COMMERCIAL AT =41 U+0041 LATIN CAPITAL LETTER A =42 U+0042 LATIN CAPITAL LETTER B =43 U+0043 LATIN CAPITAL LETTER C =44 U+0044 LATIN CAPITAL LETTER D =45 U+0045 LATIN CAPITAL LETTER E =46 U+0046 LATIN CAPITAL LETTER F =47 U+0047 LATIN CAPITAL LETTER G =48 U+0048 LATIN CAPITAL LETTER H =49 U+0049 LATIN CAPITAL LETTER I =4A U+004A LATIN CAPITAL LETTER J =4B U+004B LATIN CAPITAL LETTER K =4C U+004C LATIN CAPITAL LETTER L =4D U+004D LATIN CAPITAL LETTER M =4E U+004E LATIN CAPITAL LETTER N =4F U+004F LATIN CAPITAL LETTER O =50 U+0050 LATIN CAPITAL LETTER P =51 U+0051 LATIN CAPITAL LETTER Q =52 U+0052 LATIN CAPITAL LETTER R =53 U+0053 LATIN CAPITAL LETTER S =54 U+0054 LATIN CAPITAL LETTER T =55 U+0055 LATIN CAPITAL LETTER U =56 U+0056 LATIN CAPITAL LETTER V =57 U+0057 LATIN CAPITAL LETTER W =58 U+0058 LATIN CAPITAL LETTER X =59 U+0059 LATIN CAPITAL LETTER Y =5A U+005A LATIN CAPITAL LETTER Z =5B U+005B LEFT SQUARE BRACKET =5C U+005C REVERSE SOLIDUS =5D U+005D RIGHT SQUARE BRACKET =5E U+005E CIRCUMFLEX ACCENT =5F U+005F LOW LINE =60 U+0060 GRAVE ACCENT =61 U+0061 LATIN SMALL LETTER A =62 U+0062 LATIN SMALL LETTER B =63 U+0063 LATIN SMALL LETTER C =64 U+0064 LATIN SMALL LETTER D =65 U+0065 LATIN SMALL LETTER E =66 U+0066 LATIN SMALL LETTER F =67 U+0067 LATIN SMALL LETTER G =68 U+0068 LATIN SMALL LETTER H =69 U+0069 LATIN SMALL LETTER I =6A U+006A LATIN SMALL LETTER J =6B U+006B LATIN SMALL LETTER K =6C U+006C LATIN SMALL LETTER L =6D U+006D LATIN SMALL LETTER M =6E U+006E LATIN SMALL LETTER N =6F U+006F LATIN SMALL LETTER O =70 U+0070 LATIN SMALL LETTER P =71 U+0071 LATIN SMALL LETTER Q =72 U+0072 LATIN SMALL LETTER R =73 U+0073 LATIN SMALL LETTER S =74 U+0074 LATIN SMALL LETTER T =75 U+0075 LATIN SMALL LETTER U =76 U+0076 LATIN SMALL LETTER V =77 U+0077 LATIN SMALL LETTER W =78 U+0078 LATIN SMALL LETTER X =79 U+0079 LATIN SMALL LETTER Y =7A U+007A LATIN SMALL LETTER Z =7B U+007B LEFT CURLY BRACKET =7C U+007C VERTICAL LINE =7D U+007D RIGHT CURLY BRACKET =7E U+007E TILDE =A0 U+00A0 NO-BREAK SPACE =A1 U+0104 LATIN CAPITAL LETTER A WITH OGONEK =A2 U+0112 LATIN CAPITAL LETTER E WITH MACRON =A3 U+0122 LATIN CAPITAL LETTER G WITH CEDILLA =A4 U+012A LATIN CAPITAL LETTER I WITH MACRON =A5 U+0128 LATIN CAPITAL LETTER I WITH TILDE =A6 U+0136 LATIN CAPITAL LETTER K WITH CEDILLA =A7 U+00A7 SECTION SIGN =A8 U+013B LATIN CAPITAL LETTER L WITH CEDILLA =A9 U+0110 LATIN CAPITAL LETTER D WITH STROKE =AA U+0160 LATIN CAPITAL LETTER S WITH CARON =AB U+0166 LATIN CAPITAL LETTER T WITH STROKE =AC U+017D LATIN CAPITAL LETTER Z WITH CARON =AD U+00AD SOFT HYPHEN =AE U+016A LATIN CAPITAL LETTER U WITH MACRON =AF U+014A LATIN CAPITAL LETTER ENG =B0 U+00B0 DEGREE SIGN =B1 U+0105 LATIN SMALL LETTER A WITH OGONEK =B2 U+0113 LATIN SMALL LETTER E WITH MACRON =B3 U+0123 LATIN SMALL LETTER G WITH CEDILLA =B4 U+012B LATIN SMALL LETTER I WITH MACRON =B5 U+0129 LATIN SMALL LETTER I WITH TILDE =B6 U+0137 LATIN SMALL LETTER K WITH CEDILLA =B7 U+00B7 MIDDLE DOT =B8 U+013C LATIN SMALL LETTER L WITH CEDILLA =B9 U+0111 LATIN SMALL LETTER D WITH STROKE =BA U+0161 LATIN SMALL LETTER S WITH CARON =BB U+0167 LATIN SMALL LETTER T WITH STROKE =BC U+017E LATIN SMALL LETTER Z WITH CARON =BD U+2015 HORIZONTAL BAR =BE U+016B LATIN SMALL LETTER U WITH MACRON =BF U+014B LATIN SMALL LETTER ENG =C0 U+0100 LATIN CAPITAL LETTER A WITH MACRON =C1 U+00C1 LATIN CAPITAL LETTER A WITH ACUTE =C2 U+00C2 LATIN CAPITAL LETTER A WITH CIRCUMFLEX =C3 U+00C3 LATIN CAPITAL LETTER A WITH TILDE =C4 U+00C4 LATIN CAPITAL LETTER A WITH DIAERESIS =C5 U+00C5 LATIN CAPITAL LETTER A WITH RING ABOVE =C6 U+00C6 LATIN CAPITAL LETTER AE =C7 U+012E LATIN CAPITAL LETTER I WITH OGONEK =C8 U+010C LATIN CAPITAL LETTER C WITH CARON =C9 U+00C9 LATIN CAPITAL LETTER E WITH ACUTE =CA U+0118 LATIN CAPITAL LETTER E WITH OGONEK =CB U+00CB LATIN CAPITAL LETTER E WITH DIAERESIS =CC U+0116 LATIN CAPITAL LETTER E WITH DOT ABOVE =CD U+00CD LATIN CAPITAL LETTER I WITH ACUTE =CE U+00CE LATIN CAPITAL LETTER I WITH CIRCUMFLEX =CF U+00CF LATIN CAPITAL LETTER I WITH DIAERESIS =D0 U+00D0 LATIN CAPITAL LETTER ETH =D1 U+0145 LATIN CAPITAL LETTER N WITH CEDILLA =D2 U+014C LATIN CAPITAL LETTER O WITH MACRON =D3 U+00D3 LATIN CAPITAL LETTER O WITH ACUTE =D4 U+00D4 LATIN CAPITAL LETTER O WITH CIRCUMFLEX =D5 U+00D5 LATIN CAPITAL LETTER O WITH TILDE =D6 U+00D6 LATIN CAPITAL LETTER O WITH DIAERESIS =D7 U+0168 LATIN CAPITAL LETTER U WITH TILDE =D8 U+00D8 LATIN CAPITAL LETTER O WITH STROKE =D9 U+0172 LATIN CAPITAL LETTER U WITH OGONEK =DA U+00DA LATIN CAPITAL LETTER U WITH ACUTE =DB U+00DB LATIN CAPITAL LETTER U WITH CIRCUMFLEX =DC U+00DC LATIN CAPITAL LETTER U WITH DIAERESIS =DD U+00DD LATIN CAPITAL LETTER Y WITH ACUTE =DE U+00DE LATIN CAPITAL LETTER THORN =DF U+00DF LATIN SMALL LETTER SHARP S =E0 U+0101 LATIN SMALL LETTER A WITH MACRON =E1 U+00E1 LATIN SMALL LETTER A WITH ACUTE =E2 U+00E2 LATIN SMALL LETTER A WITH CIRCUMFLEX =E3 U+00E3 LATIN SMALL LETTER A WITH TILDE =E4 U+00E4 LATIN SMALL LETTER A WITH DIAERESIS =E5 U+00E5 LATIN SMALL LETTER A WITH RING ABOVE =E6 U+00E6 LATIN SMALL LETTER AE =E7 U+012F LATIN SMALL LETTER I WITH OGONEK =E8 U+010D LATIN SMALL LETTER C WITH CARON =E9 U+00E9 LATIN SMALL LETTER E WITH ACUTE =EA U+0119 LATIN SMALL LETTER E WITH OGONEK =EB U+00EB LATIN SMALL LETTER E WITH DIAERESIS =EC U+0117 LATIN SMALL LETTER E WITH DOT ABOVE =ED U+00ED LATIN SMALL LETTER I WITH ACUTE =EE U+00EE LATIN SMALL LETTER I WITH CIRCUMFLEX =EF U+00EF LATIN SMALL LETTER I WITH DIAERESIS =F0 U+00F0 LATIN SMALL LETTER ETH =F1 U+0146 LATIN SMALL LETTER N WITH CEDILLA =F2 U+014D LATIN SMALL LETTER O WITH MACRON =F3 U+00F3 LATIN SMALL LETTER O WITH ACUTE =F4 U+00F4 LATIN SMALL LETTER O WITH CIRCUMFLEX =F5 U+00F5 LATIN SMALL LETTER O WITH TILDE =F6 U+00F6 LATIN SMALL LETTER O WITH DIAERESIS =F7 U+0169 LATIN SMALL LETTER U WITH TILDE =F8 U+00F8 LATIN SMALL LETTER O WITH STROKE =F9 U+0173 LATIN SMALL LETTER U WITH OGONEK =FA U+00FA LATIN SMALL LETTER U WITH ACUTE =FB U+00FB LATIN SMALL LETTER U WITH CIRCUMFLEX =FC U+00FC LATIN SMALL LETTER U WITH DIAERESIS =FD U+00FD LATIN SMALL LETTER Y WITH ACUTE =FE U+00FE LATIN SMALL LETTER THORN =FF U+0138 LATIN SMALL LETTER KRA pantomime1.2-1.2.2+dfsg1/charsets/iso8859-11.txt000066400000000000000000000130601276751561200206660ustar00rootroot00000000000000=20 U+0020 SPACE =21 U+0021 EXCLAMATION MARK =22 U+0022 QUOTATION MARK =23 U+0023 NUMBER SIGN =24 U+0024 DOLLAR SIGN =25 U+0025 PERCENT SIGN =26 U+0026 AMPERSAND =27 U+0027 APOSTROPHE =28 U+0028 LEFT PARENTHESIS =29 U+0029 RIGHT PARENTHESIS =2A U+002A ASTERISK =2B U+002B PLUS SIGN =2C U+002C COMMA =2D U+002D HYPHEN-MINUS =2E U+002E FULL STOP =2F U+002F SOLIDUS =30 U+0030 DIGIT ZERO =31 U+0031 DIGIT ONE =32 U+0032 DIGIT TWO =33 U+0033 DIGIT THREE =34 U+0034 DIGIT FOUR =35 U+0035 DIGIT FIVE =36 U+0036 DIGIT SIX =37 U+0037 DIGIT SEVEN =38 U+0038 DIGIT EIGHT =39 U+0039 DIGIT NINE =3A U+003A COLON =3B U+003B SEMICOLON =3C U+003C LESS-THAN SIGN =3D U+003D EQUALS SIGN =3E U+003E GREATER-THAN SIGN =3F U+003F QUESTION MARK =40 U+0040 COMMERCIAL AT =41 U+0041 LATIN CAPITAL LETTER A =42 U+0042 LATIN CAPITAL LETTER B =43 U+0043 LATIN CAPITAL LETTER C =44 U+0044 LATIN CAPITAL LETTER D =45 U+0045 LATIN CAPITAL LETTER E =46 U+0046 LATIN CAPITAL LETTER F =47 U+0047 LATIN CAPITAL LETTER G =48 U+0048 LATIN CAPITAL LETTER H =49 U+0049 LATIN CAPITAL LETTER I =4A U+004A LATIN CAPITAL LETTER J =4B U+004B LATIN CAPITAL LETTER K =4C U+004C LATIN CAPITAL LETTER L =4D U+004D LATIN CAPITAL LETTER M =4E U+004E LATIN CAPITAL LETTER N =4F U+004F LATIN CAPITAL LETTER O =50 U+0050 LATIN CAPITAL LETTER P =51 U+0051 LATIN CAPITAL LETTER Q =52 U+0052 LATIN CAPITAL LETTER R =53 U+0053 LATIN CAPITAL LETTER S =54 U+0054 LATIN CAPITAL LETTER T =55 U+0055 LATIN CAPITAL LETTER U =56 U+0056 LATIN CAPITAL LETTER V =57 U+0057 LATIN CAPITAL LETTER W =58 U+0058 LATIN CAPITAL LETTER X =59 U+0059 LATIN CAPITAL LETTER Y =5A U+005A LATIN CAPITAL LETTER Z =5B U+005B LEFT SQUARE BRACKET =5C U+005C REVERSE SOLIDUS =5D U+005D RIGHT SQUARE BRACKET =5E U+005E CIRCUMFLEX ACCENT =5F U+005F LOW LINE =60 U+0060 GRAVE ACCENT =61 U+0061 LATIN SMALL LETTER A =62 U+0062 LATIN SMALL LETTER B =63 U+0063 LATIN SMALL LETTER C =64 U+0064 LATIN SMALL LETTER D =65 U+0065 LATIN SMALL LETTER E =66 U+0066 LATIN SMALL LETTER F =67 U+0067 LATIN SMALL LETTER G =68 U+0068 LATIN SMALL LETTER H =69 U+0069 LATIN SMALL LETTER I =6A U+006A LATIN SMALL LETTER J =6B U+006B LATIN SMALL LETTER K =6C U+006C LATIN SMALL LETTER L =6D U+006D LATIN SMALL LETTER M =6E U+006E LATIN SMALL LETTER N =6F U+006F LATIN SMALL LETTER O =70 U+0070 LATIN SMALL LETTER P =71 U+0071 LATIN SMALL LETTER Q =72 U+0072 LATIN SMALL LETTER R =73 U+0073 LATIN SMALL LETTER S =74 U+0074 LATIN SMALL LETTER T =75 U+0075 LATIN SMALL LETTER U =76 U+0076 LATIN SMALL LETTER V =77 U+0077 LATIN SMALL LETTER W =78 U+0078 LATIN SMALL LETTER X =79 U+0079 LATIN SMALL LETTER Y =7A U+007A LATIN SMALL LETTER Z =7B U+007B LEFT CURLY BRACKET =7C U+007C VERTICAL LINE =7D U+007D RIGHT CURLY BRACKET =7E U+007E TILDE =A1 U+0E01 THAI CHARACTER KO KAI =A2 U+0E02 THAI CHARACTER KHO KHAI =A3 U+0E03 THAI CHARACTER KHO KHUAT =A4 U+0E04 THAI CHARACTER KHO KHWAI =A5 U+0E05 THAI CHARACTER KHO KHON =A6 U+0E06 THAI CHARACTER KHO RAKHANG =A7 U+0E07 THAI CHARACTER NGO NGU =A8 U+0E08 THAI CHARACTER CHO CHAN =A9 U+0E09 THAI CHARACTER CHO CHING =AA U+0E0A THAI CHARACTER CHO CHANG =AB U+0E0B THAI CHARACTER SO SO =AC U+0E0C THAI CHARACTER CHO CHOE =AD U+0E0D THAI CHARACTER YO YING =AE U+0E0E THAI CHARACTER DO CHADA =AF U+0E0F THAI CHARACTER TO PATAK =B0 U+0E10 THAI CHARACTER THO THAN =B1 U+0E11 THAI CHARACTER THO NANGMONTHO =B2 U+0E12 THAI CHARACTER THO PHUTHAO =B3 U+0E13 THAI CHARACTER NO NEN =B4 U+0E14 THAI CHARACTER DO DEK =B5 U+0E15 THAI CHARACTER TO TAO =B6 U+0E16 THAI CHARACTER THO THUNG =B7 U+0E17 THAI CHARACTER THO THAHAN =B8 U+0E18 THAI CHARACTER THO THONG =B9 U+0E19 THAI CHARACTER NO NU =BA U+0E1A THAI CHARACTER BO BAIMAI =BB U+0E1B THAI CHARACTER PO PLA =BC U+0E1C THAI CHARACTER PHO PHUNG =BD U+0E1D THAI CHARACTER FO FA =BE U+0E1E THAI CHARACTER PHO PHAN =BF U+0E1F THAI CHARACTER FO FAN =C0 U+0E20 THAI CHARACTER PHO SAMPHAO =C1 U+0E21 THAI CHARACTER MO MA =C2 U+0E22 THAI CHARACTER YO YAK =C3 U+0E23 THAI CHARACTER RO RUA =C4 U+0E24 THAI CHARACTER RU =C5 U+0E25 THAI CHARACTER LO LING =C6 U+0E26 THAI CHARACTER LU =C7 U+0E27 THAI CHARACTER WO WAEN =C8 U+0E28 THAI CHARACTER SO SALA =C9 U+0E29 THAI CHARACTER SO RUSI =CA U+0E2A THAI CHARACTER SO SUA =CB U+0E2B THAI CHARACTER HO HIP =CC U+0E2C THAI CHARACTER LO CHULA =CD U+0E2D THAI CHARACTER O ANG =CE U+0E2E THAI CHARACTER HO NOKHUK =CF U+0E2F THAI CHARACTER PAIYANNOI =D0 U+0E30 THAI CHARACTER SARA A =D1 U+0E31 THAI CHARACTER MAI HAN-AKAT =D2 U+0E32 THAI CHARACTER SARA AA =D3 U+0E33 THAI CHARACTER SARA AM =D4 U+0E34 THAI CHARACTER SARA I =D5 U+0E35 THAI CHARACTER SARA II =D6 U+0E36 THAI CHARACTER SARA UE =D7 U+0E37 THAI CHARACTER SARA UEE =D8 U+0E38 THAI CHARACTER SARA U =D9 U+0E39 THAI CHARACTER SARA UU =DA U+0E3A THAI CHARACTER PHINTHU =DF U+0E3F THAI CURRENCY SYMBOL BAHT =E0 U+0E40 THAI CHARACTER SARA E =E1 U+0E41 THAI CHARACTER SARA AE =E2 U+0E42 THAI CHARACTER SARA O =E3 U+0E43 THAI CHARACTER SARA AI MAIMUAN =E4 U+0E44 THAI CHARACTER SARA AI MAIMALAI =E5 U+0E45 THAI CHARACTER LAKKHANGYAO =E6 U+0E46 THAI CHARACTER MAIYAMOK =E7 U+0E47 THAI CHARACTER MAITAIKHU =E8 U+0E48 THAI CHARACTER MAI EK =E9 U+0E49 THAI CHARACTER MAI THO =EA U+0E4A THAI CHARACTER MAI TRI =EB U+0E4B THAI CHARACTER MAI CHATTAWA =EC U+0E4C THAI CHARACTER THANTHAKHAT =ED U+0E4D THAI CHARACTER NIKHAHIT =EE U+0E4E THAI CHARACTER YAMAKKAN =EF U+0E4F THAI CHARACTER FONGMAN =F0 U+0E50 THAI DIGIT ZERO =F1 U+0E51 THAI DIGIT ONE =F2 U+0E52 THAI DIGIT TWO =F3 U+0E53 THAI DIGIT THREE =F4 U+0E54 THAI DIGIT FOUR =F5 U+0E55 THAI DIGIT FIVE =F6 U+0E56 THAI DIGIT SIX =F7 U+0E57 THAI DIGIT SEVEN =F8 U+0E58 THAI DIGIT EIGHT =F9 U+0E59 THAI DIGIT NINE =FA U+0E5A THAI CHARACTER ANGKHANKHU =FB U+0E5B THAI CHARACTER KHOMUT pantomime1.2-1.2.2+dfsg1/charsets/iso8859-13.txt000066400000000000000000000147311276751561200206760ustar00rootroot00000000000000=20 U+0020 SPACE =21 U+0021 EXCLAMATION MARK =22 U+0022 QUOTATION MARK =23 U+0023 NUMBER SIGN =24 U+0024 DOLLAR SIGN =25 U+0025 PERCENT SIGN =26 U+0026 AMPERSAND =27 U+0027 APOSTROPHE =28 U+0028 LEFT PARENTHESIS =29 U+0029 RIGHT PARENTHESIS =2A U+002A ASTERISK =2B U+002B PLUS SIGN =2C U+002C COMMA =2D U+002D HYPHEN-MINUS =2E U+002E FULL STOP =2F U+002F SOLIDUS =30 U+0030 DIGIT ZERO =31 U+0031 DIGIT ONE =32 U+0032 DIGIT TWO =33 U+0033 DIGIT THREE =34 U+0034 DIGIT FOUR =35 U+0035 DIGIT FIVE =36 U+0036 DIGIT SIX =37 U+0037 DIGIT SEVEN =38 U+0038 DIGIT EIGHT =39 U+0039 DIGIT NINE =3A U+003A COLON =3B U+003B SEMICOLON =3C U+003C LESS-THAN SIGN =3D U+003D EQUALS SIGN =3E U+003E GREATER-THAN SIGN =3F U+003F QUESTION MARK =40 U+0040 COMMERCIAL AT =41 U+0041 LATIN CAPITAL LETTER A =42 U+0042 LATIN CAPITAL LETTER B =43 U+0043 LATIN CAPITAL LETTER C =44 U+0044 LATIN CAPITAL LETTER D =45 U+0045 LATIN CAPITAL LETTER E =46 U+0046 LATIN CAPITAL LETTER F =47 U+0047 LATIN CAPITAL LETTER G =48 U+0048 LATIN CAPITAL LETTER H =49 U+0049 LATIN CAPITAL LETTER I =4A U+004A LATIN CAPITAL LETTER J =4B U+004B LATIN CAPITAL LETTER K =4C U+004C LATIN CAPITAL LETTER L =4D U+004D LATIN CAPITAL LETTER M =4E U+004E LATIN CAPITAL LETTER N =4F U+004F LATIN CAPITAL LETTER O =50 U+0050 LATIN CAPITAL LETTER P =51 U+0051 LATIN CAPITAL LETTER Q =52 U+0052 LATIN CAPITAL LETTER R =53 U+0053 LATIN CAPITAL LETTER S =54 U+0054 LATIN CAPITAL LETTER T =55 U+0055 LATIN CAPITAL LETTER U =56 U+0056 LATIN CAPITAL LETTER V =57 U+0057 LATIN CAPITAL LETTER W =58 U+0058 LATIN CAPITAL LETTER X =59 U+0059 LATIN CAPITAL LETTER Y =5A U+005A LATIN CAPITAL LETTER Z =5B U+005B LEFT SQUARE BRACKET =5C U+005C REVERSE SOLIDUS =5D U+005D RIGHT SQUARE BRACKET =5E U+005E CIRCUMFLEX ACCENT =5F U+005F LOW LINE =60 U+0060 GRAVE ACCENT =61 U+0061 LATIN SMALL LETTER A =62 U+0062 LATIN SMALL LETTER B =63 U+0063 LATIN SMALL LETTER C =64 U+0064 LATIN SMALL LETTER D =65 U+0065 LATIN SMALL LETTER E =66 U+0066 LATIN SMALL LETTER F =67 U+0067 LATIN SMALL LETTER G =68 U+0068 LATIN SMALL LETTER H =69 U+0069 LATIN SMALL LETTER I =6A U+006A LATIN SMALL LETTER J =6B U+006B LATIN SMALL LETTER K =6C U+006C LATIN SMALL LETTER L =6D U+006D LATIN SMALL LETTER M =6E U+006E LATIN SMALL LETTER N =6F U+006F LATIN SMALL LETTER O =70 U+0070 LATIN SMALL LETTER P =71 U+0071 LATIN SMALL LETTER Q =72 U+0072 LATIN SMALL LETTER R =73 U+0073 LATIN SMALL LETTER S =74 U+0074 LATIN SMALL LETTER T =75 U+0075 LATIN SMALL LETTER U =76 U+0076 LATIN SMALL LETTER V =77 U+0077 LATIN SMALL LETTER W =78 U+0078 LATIN SMALL LETTER X =79 U+0079 LATIN SMALL LETTER Y =7A U+007A LATIN SMALL LETTER Z =7B U+007B LEFT CURLY BRACKET =7C U+007C VERTICAL LINE =7D U+007D RIGHT CURLY BRACKET =7E U+007E TILDE =A0 U+00A0 NO-BREAK SPACE =A1 U+201D RIGHT DOUBLE QUOTATION MARK =A2 U+00A2 CENT SIGN =A3 U+00A3 POUND SIGN =A4 U+00A4 CURRENCY SIGN =A5 U+201E DOUBLE LOW-9 QUOTATION MARK =A6 U+00A6 BROKEN BAR =A7 U+00A7 SECTION SIGN =A8 U+00D8 LATIN CAPITAL LETTER O WITH STROKE =A9 U+00A9 COPYRIGHT SIGN =AA U+0156 LATIN CAPITAL LETTER R WITH CEDILLA =AB U+00AB LEFT-POINTING DOUBLE ANGLE QUOTATION MARK =AC U+00AC NOT SIGN =AD U+00AD SOFT HYPHEN =AE U+00AE REGISTERED SIGN =AF U+00C6 LATIN CAPITAL LETTER AE =B0 U+00B0 DEGREE SIGN =B1 U+00B1 PLUS-MINUS SIGN =B2 U+00B2 SUPERSCRIPT TWO =B3 U+00B3 SUPERSCRIPT THREE =B4 U+201C LEFT DOUBLE QUOTATION MARK =B5 U+00B5 MICRO SIGN =B6 U+00B6 PILCROW SIGN =B7 U+00B7 MIDDLE DOT =B8 U+00F8 LATIN SMALL LETTER O WITH STROKE =B9 U+00B9 SUPERSCRIPT ONE =BA U+0157 LATIN SMALL LETTER R WITH CEDILLA =BB U+00BB RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK =BC U+00BC VULGAR FRACTION ONE QUARTER =BD U+00BD VULGAR FRACTION ONE HALF =BE U+00BE VULGAR FRACTION THREE QUARTERS =BF U+00E6 LATIN SMALL LETTER AE =C0 U+0104 LATIN CAPITAL LETTER A WITH OGONEK =C1 U+012E LATIN CAPITAL LETTER I WITH OGONEK =C2 U+0100 LATIN CAPITAL LETTER A WITH MACRON =C3 U+0106 LATIN CAPITAL LETTER C WITH ACUTE =C4 U+00C4 LATIN CAPITAL LETTER A WITH DIAERESIS =C5 U+00C5 LATIN CAPITAL LETTER A WITH RING ABOVE =C6 U+0118 LATIN CAPITAL LETTER E WITH OGONEK =C7 U+0112 LATIN CAPITAL LETTER E WITH MACRON =C8 U+010C LATIN CAPITAL LETTER C WITH CARON =C9 U+00C9 LATIN CAPITAL LETTER E WITH ACUTE =CA U+0179 LATIN CAPITAL LETTER Z WITH ACUTE =CB U+0116 LATIN CAPITAL LETTER E WITH DOT ABOVE =CC U+0122 LATIN CAPITAL LETTER G WITH CEDILLA =CD U+0136 LATIN CAPITAL LETTER K WITH CEDILLA =CE U+012A LATIN CAPITAL LETTER I WITH MACRON =CF U+013B LATIN CAPITAL LETTER L WITH CEDILLA =D0 U+0160 LATIN CAPITAL LETTER S WITH CARON =D1 U+0143 LATIN CAPITAL LETTER N WITH ACUTE =D2 U+0145 LATIN CAPITAL LETTER N WITH CEDILLA =D3 U+00D3 LATIN CAPITAL LETTER O WITH ACUTE =D4 U+014C LATIN CAPITAL LETTER O WITH MACRON =D5 U+00D5 LATIN CAPITAL LETTER O WITH TILDE =D6 U+00D6 LATIN CAPITAL LETTER O WITH DIAERESIS =D7 U+00D7 MULTIPLICATION SIGN =D8 U+0172 LATIN CAPITAL LETTER U WITH OGONEK =D9 U+0141 LATIN CAPITAL LETTER L WITH STROKE =DA U+015A LATIN CAPITAL LETTER S WITH ACUTE =DB U+016A LATIN CAPITAL LETTER U WITH MACRON =DC U+00DC LATIN CAPITAL LETTER U WITH DIAERESIS =DD U+017B LATIN CAPITAL LETTER Z WITH DOT ABOVE =DE U+017D LATIN CAPITAL LETTER Z WITH CARON =DF U+00DF LATIN SMALL LETTER SHARP S =E0 U+0105 LATIN SMALL LETTER A WITH OGONEK =E1 U+012F LATIN SMALL LETTER I WITH OGONEK =E2 U+0101 LATIN SMALL LETTER A WITH MACRON =E3 U+0107 LATIN SMALL LETTER C WITH ACUTE =E4 U+00E4 LATIN SMALL LETTER A WITH DIAERESIS =E5 U+00E5 LATIN SMALL LETTER A WITH RING ABOVE =E6 U+0119 LATIN SMALL LETTER E WITH OGONEK =E7 U+0113 LATIN SMALL LETTER E WITH MACRON =E8 U+010D LATIN SMALL LETTER C WITH CARON =E9 U+00E9 LATIN SMALL LETTER E WITH ACUTE =EA U+017A LATIN SMALL LETTER Z WITH ACUTE =EB U+0117 LATIN SMALL LETTER E WITH DOT ABOVE =EC U+0123 LATIN SMALL LETTER G WITH CEDILLA =ED U+0137 LATIN SMALL LETTER K WITH CEDILLA =EE U+012B LATIN SMALL LETTER I WITH MACRON =EF U+013C LATIN SMALL LETTER L WITH CEDILLA =F0 U+0161 LATIN SMALL LETTER S WITH CARON =F1 U+0144 LATIN SMALL LETTER N WITH ACUTE =F2 U+0146 LATIN SMALL LETTER N WITH CEDILLA =F3 U+00F3 LATIN SMALL LETTER O WITH ACUTE =F4 U+014D LATIN SMALL LETTER O WITH MACRON =F5 U+00F5 LATIN SMALL LETTER O WITH TILDE =F6 U+00F6 LATIN SMALL LETTER O WITH DIAERESIS =F7 U+00F7 DIVISION SIGN =F8 U+0173 LATIN SMALL LETTER U WITH OGONEK =F9 U+0142 LATIN SMALL LETTER L WITH STROKE =FA U+015B LATIN SMALL LETTER S WITH ACUTE =FB U+016B LATIN SMALL LETTER U WITH MACRON =FC U+00FC LATIN SMALL LETTER U WITH DIAERESIS =FD U+017C LATIN SMALL LETTER Z WITH DOT ABOVE =FE U+017E LATIN SMALL LETTER Z WITH CARON =FF U+2019 RIGHT SINGLE QUOTATION MARK pantomime1.2-1.2.2+dfsg1/charsets/iso8859-14.txt000066400000000000000000000155371276751561200207040ustar00rootroot00000000000000=20 U+0020 SPACE =21 U+0021 EXCLAMATION MARK =22 U+0022 QUOTATION MARK =23 U+0023 NUMBER SIGN =24 U+0024 DOLLAR SIGN =25 U+0025 PERCENT SIGN =26 U+0026 AMPERSAND =27 U+0027 APOSTROPHE =28 U+0028 LEFT PARENTHESIS =29 U+0029 RIGHT PARENTHESIS =2A U+002A ASTERISK =2B U+002B PLUS SIGN =2C U+002C COMMA =2D U+002D HYPHEN-MINUS =2E U+002E FULL STOP =2F U+002F SOLIDUS =30 U+0030 DIGIT ZERO =31 U+0031 DIGIT ONE =32 U+0032 DIGIT TWO =33 U+0033 DIGIT THREE =34 U+0034 DIGIT FOUR =35 U+0035 DIGIT FIVE =36 U+0036 DIGIT SIX =37 U+0037 DIGIT SEVEN =38 U+0038 DIGIT EIGHT =39 U+0039 DIGIT NINE =3A U+003A COLON =3B U+003B SEMICOLON =3C U+003C LESS-THAN SIGN =3D U+003D EQUALS SIGN =3E U+003E GREATER-THAN SIGN =3F U+003F QUESTION MARK =40 U+0040 COMMERCIAL AT =41 U+0041 LATIN CAPITAL LETTER A =42 U+0042 LATIN CAPITAL LETTER B =43 U+0043 LATIN CAPITAL LETTER C =44 U+0044 LATIN CAPITAL LETTER D =45 U+0045 LATIN CAPITAL LETTER E =46 U+0046 LATIN CAPITAL LETTER F =47 U+0047 LATIN CAPITAL LETTER G =48 U+0048 LATIN CAPITAL LETTER H =49 U+0049 LATIN CAPITAL LETTER I =4A U+004A LATIN CAPITAL LETTER J =4B U+004B LATIN CAPITAL LETTER K =4C U+004C LATIN CAPITAL LETTER L =4D U+004D LATIN CAPITAL LETTER M =4E U+004E LATIN CAPITAL LETTER N =4F U+004F LATIN CAPITAL LETTER O =50 U+0050 LATIN CAPITAL LETTER P =51 U+0051 LATIN CAPITAL LETTER Q =52 U+0052 LATIN CAPITAL LETTER R =53 U+0053 LATIN CAPITAL LETTER S =54 U+0054 LATIN CAPITAL LETTER T =55 U+0055 LATIN CAPITAL LETTER U =56 U+0056 LATIN CAPITAL LETTER V =57 U+0057 LATIN CAPITAL LETTER W =58 U+0058 LATIN CAPITAL LETTER X =59 U+0059 LATIN CAPITAL LETTER Y =5A U+005A LATIN CAPITAL LETTER Z =5B U+005B LEFT SQUARE BRACKET =5C U+005C REVERSE SOLIDUS =5D U+005D RIGHT SQUARE BRACKET =5E U+005E CIRCUMFLEX ACCENT =5F U+005F LOW LINE =60 U+0060 GRAVE ACCENT =61 U+0061 LATIN SMALL LETTER A =62 U+0062 LATIN SMALL LETTER B =63 U+0063 LATIN SMALL LETTER C =64 U+0064 LATIN SMALL LETTER D =65 U+0065 LATIN SMALL LETTER E =66 U+0066 LATIN SMALL LETTER F =67 U+0067 LATIN SMALL LETTER G =68 U+0068 LATIN SMALL LETTER H =69 U+0069 LATIN SMALL LETTER I =6A U+006A LATIN SMALL LETTER J =6B U+006B LATIN SMALL LETTER K =6C U+006C LATIN SMALL LETTER L =6D U+006D LATIN SMALL LETTER M =6E U+006E LATIN SMALL LETTER N =6F U+006F LATIN SMALL LETTER O =70 U+0070 LATIN SMALL LETTER P =71 U+0071 LATIN SMALL LETTER Q =72 U+0072 LATIN SMALL LETTER R =73 U+0073 LATIN SMALL LETTER S =74 U+0074 LATIN SMALL LETTER T =75 U+0075 LATIN SMALL LETTER U =76 U+0076 LATIN SMALL LETTER V =77 U+0077 LATIN SMALL LETTER W =78 U+0078 LATIN SMALL LETTER X =79 U+0079 LATIN SMALL LETTER Y =7A U+007A LATIN SMALL LETTER Z =7B U+007B LEFT CURLY BRACKET =7C U+007C VERTICAL LINE =7D U+007D RIGHT CURLY BRACKET =7E U+007E TILDE =A0 U+00A0 NO-BREAK SPACE =A1 U+1E02 LATIN CAPITAL LETTER B WITH DOT ABOVE =A2 U+1E03 LATIN SMALL LETTER B WITH DOT ABOVE =A3 U+00A3 POUND SIGN =A4 U+010A LATIN CAPITAL LETTER C WITH DOT ABOVE =A5 U+010B LATIN SMALL LETTER C WITH DOT ABOVE =A6 U+1E0A LATIN CAPITAL LETTER D WITH DOT ABOVE =A7 U+00A7 SECTION SIGN =A8 U+1E80 LATIN CAPITAL LETTER W WITH GRAVE =A9 U+00A9 COPYRIGHT SIGN =AA U+1E82 LATIN CAPITAL LETTER W WITH ACUTE =AB U+1E0B LATIN SMALL LETTER D WITH DOT ABOVE =AC U+1EF2 LATIN CAPITAL LETTER Y WITH GRAVE =AD U+00AD SOFT HYPHEN =AE U+00AE REGISTERED SIGN =AF U+0178 LATIN CAPITAL LETTER Y WITH DIAERESIS =B0 U+1E1E LATIN CAPITAL LETTER F WITH DOT ABOVE =B1 U+1E1F LATIN SMALL LETTER F WITH DOT ABOVE =B2 U+0120 LATIN CAPITAL LETTER G WITH DOT ABOVE =B3 U+0121 LATIN SMALL LETTER G WITH DOT ABOVE =B4 U+1E40 LATIN CAPITAL LETTER M WITH DOT ABOVE =B5 U+1E41 LATIN SMALL LETTER M WITH DOT ABOVE =B6 U+00B6 PILCROW SIGN =B7 U+1E56 LATIN CAPITAL LETTER P WITH DOT ABOVE =B8 U+1E81 LATIN SMALL LETTER W WITH GRAVE =B9 U+1E57 LATIN SMALL LETTER P WITH DOT ABOVE =BA U+1E83 LATIN SMALL LETTER W WITH ACUTE =BB U+1E60 LATIN CAPITAL LETTER S WITH DOT ABOVE =BC U+1EF3 LATIN SMALL LETTER Y WITH GRAVE =BD U+1E84 LATIN CAPITAL LETTER W WITH DIAERESIS =BE U+1E85 LATIN SMALL LETTER W WITH DIAERESIS =BF U+1E61 LATIN SMALL LETTER S WITH DOT ABOVE =C0 U+00C0 LATIN CAPITAL LETTER A WITH GRAVE =C1 U+00C1 LATIN CAPITAL LETTER A WITH ACUTE =C2 U+00C2 LATIN CAPITAL LETTER A WITH CIRCUMFLEX =C3 U+00C3 LATIN CAPITAL LETTER A WITH TILDE =C4 U+00C4 LATIN CAPITAL LETTER A WITH DIAERESIS =C5 U+00C5 LATIN CAPITAL LETTER A WITH RING ABOVE =C6 U+00C6 LATIN CAPITAL LETTER AE =C7 U+00C7 LATIN CAPITAL LETTER C WITH CEDILLA =C8 U+00C8 LATIN CAPITAL LETTER E WITH GRAVE =C9 U+00C9 LATIN CAPITAL LETTER E WITH ACUTE =CA U+00CA LATIN CAPITAL LETTER E WITH CIRCUMFLEX =CB U+00CB LATIN CAPITAL LETTER E WITH DIAERESIS =CC U+00CC LATIN CAPITAL LETTER I WITH GRAVE =CD U+00CD LATIN CAPITAL LETTER I WITH ACUTE =CE U+00CE LATIN CAPITAL LETTER I WITH CIRCUMFLEX =CF U+00CF LATIN CAPITAL LETTER I WITH DIAERESIS =D0 U+0174 LATIN CAPITAL LETTER W WITH CIRCUMFLEX =D1 U+00D1 LATIN CAPITAL LETTER N WITH TILDE =D2 U+00D2 LATIN CAPITAL LETTER O WITH GRAVE =D3 U+00D3 LATIN CAPITAL LETTER O WITH ACUTE =D4 U+00D4 LATIN CAPITAL LETTER O WITH CIRCUMFLEX =D5 U+00D5 LATIN CAPITAL LETTER O WITH TILDE =D6 U+00D6 LATIN CAPITAL LETTER O WITH DIAERESIS =D7 U+1E6A LATIN CAPITAL LETTER T WITH DOT ABOVE =D8 U+00D8 LATIN CAPITAL LETTER O WITH STROKE =D9 U+00D9 LATIN CAPITAL LETTER U WITH GRAVE =DA U+00DA LATIN CAPITAL LETTER U WITH ACUTE =DB U+00DB LATIN CAPITAL LETTER U WITH CIRCUMFLEX =DC U+00DC LATIN CAPITAL LETTER U WITH DIAERESIS =DD U+00DD LATIN CAPITAL LETTER Y WITH ACUTE =DE U+0176 LATIN CAPITAL LETTER Y WITH CIRCUMFLEX =DF U+00DF LATIN SMALL LETTER SHARP S =E0 U+00E0 LATIN SMALL LETTER A WITH GRAVE =E1 U+00E1 LATIN SMALL LETTER A WITH ACUTE =E2 U+00E2 LATIN SMALL LETTER A WITH CIRCUMFLEX =E3 U+00E3 LATIN SMALL LETTER A WITH TILDE =E4 U+00E4 LATIN SMALL LETTER A WITH DIAERESIS =E5 U+00E5 LATIN SMALL LETTER A WITH RING ABOVE =E6 U+00E6 LATIN SMALL LETTER AE =E7 U+00E7 LATIN SMALL LETTER C WITH CEDILLA =E8 U+00E8 LATIN SMALL LETTER E WITH GRAVE =E9 U+00E9 LATIN SMALL LETTER E WITH ACUTE =EA U+00EA LATIN SMALL LETTER E WITH CIRCUMFLEX =EB U+00EB LATIN SMALL LETTER E WITH DIAERESIS =EC U+00EC LATIN SMALL LETTER I WITH GRAVE =ED U+00ED LATIN SMALL LETTER I WITH ACUTE =EE U+00EE LATIN SMALL LETTER I WITH CIRCUMFLEX =EF U+00EF LATIN SMALL LETTER I WITH DIAERESIS =F0 U+0175 LATIN SMALL LETTER W WITH CIRCUMFLEX =F1 U+00F1 LATIN SMALL LETTER N WITH TILDE =F2 U+00F2 LATIN SMALL LETTER O WITH GRAVE =F3 U+00F3 LATIN SMALL LETTER O WITH ACUTE =F4 U+00F4 LATIN SMALL LETTER O WITH CIRCUMFLEX =F5 U+00F5 LATIN SMALL LETTER O WITH TILDE =F6 U+00F6 LATIN SMALL LETTER O WITH DIAERESIS =F7 U+1E6B LATIN SMALL LETTER T WITH DOT ABOVE =F8 U+00F8 LATIN SMALL LETTER O WITH STROKE =F9 U+00F9 LATIN SMALL LETTER U WITH GRAVE =FA U+00FA LATIN SMALL LETTER U WITH ACUTE =FB U+00FB LATIN SMALL LETTER U WITH CIRCUMFLEX =FC U+00FC LATIN SMALL LETTER U WITH DIAERESIS =FD U+00FD LATIN SMALL LETTER Y WITH ACUTE =FE U+0177 LATIN SMALL LETTER Y WITH CIRCUMFLEX =FF U+00FF LATIN SMALL LETTER Y WITH DIAERESIS pantomime1.2-1.2.2+dfsg1/charsets/iso8859-15.txt000066400000000000000000000146471276751561200207060ustar00rootroot00000000000000=20 U+0020 SPACE =21 U+0021 EXCLAMATION MARK =22 U+0022 QUOTATION MARK =23 U+0023 NUMBER SIGN =24 U+0024 DOLLAR SIGN =25 U+0025 PERCENT SIGN =26 U+0026 AMPERSAND =27 U+0027 APOSTROPHE =28 U+0028 LEFT PARENTHESIS =29 U+0029 RIGHT PARENTHESIS =2A U+002A ASTERISK =2B U+002B PLUS SIGN =2C U+002C COMMA =2D U+002D HYPHEN-MINUS =2E U+002E FULL STOP =2F U+002F SOLIDUS =30 U+0030 DIGIT ZERO =31 U+0031 DIGIT ONE =32 U+0032 DIGIT TWO =33 U+0033 DIGIT THREE =34 U+0034 DIGIT FOUR =35 U+0035 DIGIT FIVE =36 U+0036 DIGIT SIX =37 U+0037 DIGIT SEVEN =38 U+0038 DIGIT EIGHT =39 U+0039 DIGIT NINE =3A U+003A COLON =3B U+003B SEMICOLON =3C U+003C LESS-THAN SIGN =3D U+003D EQUALS SIGN =3E U+003E GREATER-THAN SIGN =3F U+003F QUESTION MARK =40 U+0040 COMMERCIAL AT =41 U+0041 LATIN CAPITAL LETTER A =42 U+0042 LATIN CAPITAL LETTER B =43 U+0043 LATIN CAPITAL LETTER C =44 U+0044 LATIN CAPITAL LETTER D =45 U+0045 LATIN CAPITAL LETTER E =46 U+0046 LATIN CAPITAL LETTER F =47 U+0047 LATIN CAPITAL LETTER G =48 U+0048 LATIN CAPITAL LETTER H =49 U+0049 LATIN CAPITAL LETTER I =4A U+004A LATIN CAPITAL LETTER J =4B U+004B LATIN CAPITAL LETTER K =4C U+004C LATIN CAPITAL LETTER L =4D U+004D LATIN CAPITAL LETTER M =4E U+004E LATIN CAPITAL LETTER N =4F U+004F LATIN CAPITAL LETTER O =50 U+0050 LATIN CAPITAL LETTER P =51 U+0051 LATIN CAPITAL LETTER Q =52 U+0052 LATIN CAPITAL LETTER R =53 U+0053 LATIN CAPITAL LETTER S =54 U+0054 LATIN CAPITAL LETTER T =55 U+0055 LATIN CAPITAL LETTER U =56 U+0056 LATIN CAPITAL LETTER V =57 U+0057 LATIN CAPITAL LETTER W =58 U+0058 LATIN CAPITAL LETTER X =59 U+0059 LATIN CAPITAL LETTER Y =5A U+005A LATIN CAPITAL LETTER Z =5B U+005B LEFT SQUARE BRACKET =5C U+005C REVERSE SOLIDUS =5D U+005D RIGHT SQUARE BRACKET =5E U+005E CIRCUMFLEX ACCENT =5F U+005F LOW LINE =60 U+0060 GRAVE ACCENT =61 U+0061 LATIN SMALL LETTER A =62 U+0062 LATIN SMALL LETTER B =63 U+0063 LATIN SMALL LETTER C =64 U+0064 LATIN SMALL LETTER D =65 U+0065 LATIN SMALL LETTER E =66 U+0066 LATIN SMALL LETTER F =67 U+0067 LATIN SMALL LETTER G =68 U+0068 LATIN SMALL LETTER H =69 U+0069 LATIN SMALL LETTER I =6A U+006A LATIN SMALL LETTER J =6B U+006B LATIN SMALL LETTER K =6C U+006C LATIN SMALL LETTER L =6D U+006D LATIN SMALL LETTER M =6E U+006E LATIN SMALL LETTER N =6F U+006F LATIN SMALL LETTER O =70 U+0070 LATIN SMALL LETTER P =71 U+0071 LATIN SMALL LETTER Q =72 U+0072 LATIN SMALL LETTER R =73 U+0073 LATIN SMALL LETTER S =74 U+0074 LATIN SMALL LETTER T =75 U+0075 LATIN SMALL LETTER U =76 U+0076 LATIN SMALL LETTER V =77 U+0077 LATIN SMALL LETTER W =78 U+0078 LATIN SMALL LETTER X =79 U+0079 LATIN SMALL LETTER Y =7A U+007A LATIN SMALL LETTER Z =7B U+007B LEFT CURLY BRACKET =7C U+007C VERTICAL LINE =7D U+007D RIGHT CURLY BRACKET =7E U+007E TILDE =A0 U+00A0 NO-BREAK SPACE =A1 U+00A1 INVERTED EXCLAMATION MARK =A2 U+00A2 CENT SIGN =A3 U+00A3 POUND SIGN =A4 U+20AC EURO SIGN =A5 U+00A5 YEN SIGN =A6 U+0160 LATIN CAPITAL LETTER S WITH CARON =A7 U+00A7 SECTION SIGN =A8 U+0161 LATIN SMALL LETTER S WITH CARON =A9 U+00A9 COPYRIGHT SIGN =AA U+00AA FEMININE ORDINAL INDICATOR =AB U+00AB LEFT-POINTING DOUBLE ANGLE QUOTATION MARK =AC U+00AC NOT SIGN =AD U+00AD SOFT HYPHEN =AE U+00AE REGISTERED SIGN =AF U+00AF MACRON =B0 U+00B0 DEGREE SIGN =B1 U+00B1 PLUS-MINUS SIGN =B2 U+00B2 SUPERSCRIPT TWO =B3 U+00B3 SUPERSCRIPT THREE =B4 U+017D LATIN CAPITAL LETTER Z WITH CARON =B5 U+00B5 MICRO SIGN =B6 U+00B6 PILCROW SIGN =B7 U+00B7 MIDDLE DOT =B8 U+017E LATIN SMALL LETTER Z WITH CARON =B9 U+00B9 SUPERSCRIPT ONE =BA U+00BA MASCULINE ORDINAL INDICATOR =BB U+00BB RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK =BC U+0152 LATIN CAPITAL LIGATURE OE =BD U+0153 LATIN SMALL LIGATURE OE =BE U+0178 LATIN CAPITAL LETTER Y WITH DIAERESIS =BF U+00BF INVERTED QUESTION MARK =C0 U+00C0 LATIN CAPITAL LETTER A WITH GRAVE =C1 U+00C1 LATIN CAPITAL LETTER A WITH ACUTE =C2 U+00C2 LATIN CAPITAL LETTER A WITH CIRCUMFLEX =C3 U+00C3 LATIN CAPITAL LETTER A WITH TILDE =C4 U+00C4 LATIN CAPITAL LETTER A WITH DIAERESIS =C5 U+00C5 LATIN CAPITAL LETTER A WITH RING ABOVE =C6 U+00C6 LATIN CAPITAL LETTER AE =C7 U+00C7 LATIN CAPITAL LETTER C WITH CEDILLA =C8 U+00C8 LATIN CAPITAL LETTER E WITH GRAVE =C9 U+00C9 LATIN CAPITAL LETTER E WITH ACUTE =CA U+00CA LATIN CAPITAL LETTER E WITH CIRCUMFLEX =CB U+00CB LATIN CAPITAL LETTER E WITH DIAERESIS =CC U+00CC LATIN CAPITAL LETTER I WITH GRAVE =CD U+00CD LATIN CAPITAL LETTER I WITH ACUTE =CE U+00CE LATIN CAPITAL LETTER I WITH CIRCUMFLEX =CF U+00CF LATIN CAPITAL LETTER I WITH DIAERESIS =D0 U+00D0 LATIN CAPITAL LETTER ETH =D1 U+00D1 LATIN CAPITAL LETTER N WITH TILDE =D2 U+00D2 LATIN CAPITAL LETTER O WITH GRAVE =D3 U+00D3 LATIN CAPITAL LETTER O WITH ACUTE =D4 U+00D4 LATIN CAPITAL LETTER O WITH CIRCUMFLEX =D5 U+00D5 LATIN CAPITAL LETTER O WITH TILDE =D6 U+00D6 LATIN CAPITAL LETTER O WITH DIAERESIS =D7 U+00D7 MULTIPLICATION SIGN =D8 U+00D8 LATIN CAPITAL LETTER O WITH STROKE =D9 U+00D9 LATIN CAPITAL LETTER U WITH GRAVE =DA U+00DA LATIN CAPITAL LETTER U WITH ACUTE =DB U+00DB LATIN CAPITAL LETTER U WITH CIRCUMFLEX =DC U+00DC LATIN CAPITAL LETTER U WITH DIAERESIS =DD U+00DD LATIN CAPITAL LETTER Y WITH ACUTE =DE U+00DE LATIN CAPITAL LETTER THORN =DF U+00DF LATIN SMALL LETTER SHARP S =E0 U+00E0 LATIN SMALL LETTER A WITH GRAVE =E1 U+00E1 LATIN SMALL LETTER A WITH ACUTE =E2 U+00E2 LATIN SMALL LETTER A WITH CIRCUMFLEX =E3 U+00E3 LATIN SMALL LETTER A WITH TILDE =E4 U+00E4 LATIN SMALL LETTER A WITH DIAERESIS =E5 U+00E5 LATIN SMALL LETTER A WITH RING ABOVE =E6 U+00E6 LATIN SMALL LETTER AE =E7 U+00E7 LATIN SMALL LETTER C WITH CEDILLA =E8 U+00E8 LATIN SMALL LETTER E WITH GRAVE =E9 U+00E9 LATIN SMALL LETTER E WITH ACUTE =EA U+00EA LATIN SMALL LETTER E WITH CIRCUMFLEX =EB U+00EB LATIN SMALL LETTER E WITH DIAERESIS =EC U+00EC LATIN SMALL LETTER I WITH GRAVE =ED U+00ED LATIN SMALL LETTER I WITH ACUTE =EE U+00EE LATIN SMALL LETTER I WITH CIRCUMFLEX =EF U+00EF LATIN SMALL LETTER I WITH DIAERESIS =F0 U+00F0 LATIN SMALL LETTER ETH =F1 U+00F1 LATIN SMALL LETTER N WITH TILDE =F2 U+00F2 LATIN SMALL LETTER O WITH GRAVE =F3 U+00F3 LATIN SMALL LETTER O WITH ACUTE =F4 U+00F4 LATIN SMALL LETTER O WITH CIRCUMFLEX =F5 U+00F5 LATIN SMALL LETTER O WITH TILDE =F6 U+00F6 LATIN SMALL LETTER O WITH DIAERESIS =F7 U+00F7 DIVISION SIGN =F8 U+00F8 LATIN SMALL LETTER O WITH STROKE =F9 U+00F9 LATIN SMALL LETTER U WITH GRAVE =FA U+00FA LATIN SMALL LETTER U WITH ACUTE =FB U+00FB LATIN SMALL LETTER U WITH CIRCUMFLEX =FC U+00FC LATIN SMALL LETTER U WITH DIAERESIS =FD U+00FD LATIN SMALL LETTER Y WITH ACUTE =FE U+00FE LATIN SMALL LETTER THORN =FF U+00FF LATIN SMALL LETTER Y WITH DIAERESIS pantomime1.2-1.2.2+dfsg1/charsets/iso8859-2.txt000066400000000000000000000151521276751561200206120ustar00rootroot00000000000000=20 U+0020 SPACE =21 U+0021 EXCLAMATION MARK =22 U+0022 QUOTATION MARK =23 U+0023 NUMBER SIGN =24 U+0024 DOLLAR SIGN =25 U+0025 PERCENT SIGN =26 U+0026 AMPERSAND =27 U+0027 APOSTROPHE =28 U+0028 LEFT PARENTHESIS =29 U+0029 RIGHT PARENTHESIS =2A U+002A ASTERISK =2B U+002B PLUS SIGN =2C U+002C COMMA =2D U+002D HYPHEN-MINUS =2E U+002E FULL STOP =2F U+002F SOLIDUS =30 U+0030 DIGIT ZERO =31 U+0031 DIGIT ONE =32 U+0032 DIGIT TWO =33 U+0033 DIGIT THREE =34 U+0034 DIGIT FOUR =35 U+0035 DIGIT FIVE =36 U+0036 DIGIT SIX =37 U+0037 DIGIT SEVEN =38 U+0038 DIGIT EIGHT =39 U+0039 DIGIT NINE =3A U+003A COLON =3B U+003B SEMICOLON =3C U+003C LESS-THAN SIGN =3D U+003D EQUALS SIGN =3E U+003E GREATER-THAN SIGN =3F U+003F QUESTION MARK =40 U+0040 COMMERCIAL AT =41 U+0041 LATIN CAPITAL LETTER A =42 U+0042 LATIN CAPITAL LETTER B =43 U+0043 LATIN CAPITAL LETTER C =44 U+0044 LATIN CAPITAL LETTER D =45 U+0045 LATIN CAPITAL LETTER E =46 U+0046 LATIN CAPITAL LETTER F =47 U+0047 LATIN CAPITAL LETTER G =48 U+0048 LATIN CAPITAL LETTER H =49 U+0049 LATIN CAPITAL LETTER I =4A U+004A LATIN CAPITAL LETTER J =4B U+004B LATIN CAPITAL LETTER K =4C U+004C LATIN CAPITAL LETTER L =4D U+004D LATIN CAPITAL LETTER M =4E U+004E LATIN CAPITAL LETTER N =4F U+004F LATIN CAPITAL LETTER O =50 U+0050 LATIN CAPITAL LETTER P =51 U+0051 LATIN CAPITAL LETTER Q =52 U+0052 LATIN CAPITAL LETTER R =53 U+0053 LATIN CAPITAL LETTER S =54 U+0054 LATIN CAPITAL LETTER T =55 U+0055 LATIN CAPITAL LETTER U =56 U+0056 LATIN CAPITAL LETTER V =57 U+0057 LATIN CAPITAL LETTER W =58 U+0058 LATIN CAPITAL LETTER X =59 U+0059 LATIN CAPITAL LETTER Y =5A U+005A LATIN CAPITAL LETTER Z =5B U+005B LEFT SQUARE BRACKET =5C U+005C REVERSE SOLIDUS =5D U+005D RIGHT SQUARE BRACKET =5E U+005E CIRCUMFLEX ACCENT =5F U+005F LOW LINE =60 U+0060 GRAVE ACCENT =61 U+0061 LATIN SMALL LETTER A =62 U+0062 LATIN SMALL LETTER B =63 U+0063 LATIN SMALL LETTER C =64 U+0064 LATIN SMALL LETTER D =65 U+0065 LATIN SMALL LETTER E =66 U+0066 LATIN SMALL LETTER F =67 U+0067 LATIN SMALL LETTER G =68 U+0068 LATIN SMALL LETTER H =69 U+0069 LATIN SMALL LETTER I =6A U+006A LATIN SMALL LETTER J =6B U+006B LATIN SMALL LETTER K =6C U+006C LATIN SMALL LETTER L =6D U+006D LATIN SMALL LETTER M =6E U+006E LATIN SMALL LETTER N =6F U+006F LATIN SMALL LETTER O =70 U+0070 LATIN SMALL LETTER P =71 U+0071 LATIN SMALL LETTER Q =72 U+0072 LATIN SMALL LETTER R =73 U+0073 LATIN SMALL LETTER S =74 U+0074 LATIN SMALL LETTER T =75 U+0075 LATIN SMALL LETTER U =76 U+0076 LATIN SMALL LETTER V =77 U+0077 LATIN SMALL LETTER W =78 U+0078 LATIN SMALL LETTER X =79 U+0079 LATIN SMALL LETTER Y =7A U+007A LATIN SMALL LETTER Z =7B U+007B LEFT CURLY BRACKET =7C U+007C VERTICAL LINE =7D U+007D RIGHT CURLY BRACKET =7E U+007E TILDE =A0 U+00A0 NO-BREAK SPACE =A1 U+0104 LATIN CAPITAL LETTER A WITH OGONEK =A2 U+02D8 BREVE =A3 U+0141 LATIN CAPITAL LETTER L WITH STROKE =A4 U+00A4 CURRENCY SIGN =A5 U+013D LATIN CAPITAL LETTER L WITH CARON =A6 U+015A LATIN CAPITAL LETTER S WITH ACUTE =A7 U+00A7 SECTION SIGN =A8 U+00A8 DIAERESIS =A9 U+0160 LATIN CAPITAL LETTER S WITH CARON =AA U+015E LATIN CAPITAL LETTER S WITH CEDILLA =AB U+0164 LATIN CAPITAL LETTER T WITH CARON =AC U+0179 LATIN CAPITAL LETTER Z WITH ACUTE =AD U+00AD SOFT HYPHEN =AE U+017D LATIN CAPITAL LETTER Z WITH CARON =AF U+017B LATIN CAPITAL LETTER Z WITH DOT ABOVE =B0 U+00B0 DEGREE SIGN =B1 U+0105 LATIN SMALL LETTER A WITH OGONEK =B2 U+02DB OGONEK =B3 U+0142 LATIN SMALL LETTER L WITH STROKE =B4 U+00B4 ACUTE ACCENT =B5 U+013E LATIN SMALL LETTER L WITH CARON =B6 U+015B LATIN SMALL LETTER S WITH ACUTE =B7 U+02C7 CARON =B8 U+00B8 CEDILLA =B9 U+0161 LATIN SMALL LETTER S WITH CARON =BA U+015F LATIN SMALL LETTER S WITH CEDILLA =BB U+0165 LATIN SMALL LETTER T WITH CARON =BC U+017A LATIN SMALL LETTER Z WITH ACUTE =BD U+02DD DOUBLE ACUTE ACCENT =BE U+017E LATIN SMALL LETTER Z WITH CARON =BF U+017C LATIN SMALL LETTER Z WITH DOT ABOVE =C0 U+0154 LATIN CAPITAL LETTER R WITH ACUTE =C1 U+00C1 LATIN CAPITAL LETTER A WITH ACUTE =C2 U+00C2 LATIN CAPITAL LETTER A WITH CIRCUMFLEX =C3 U+0102 LATIN CAPITAL LETTER A WITH BREVE =C4 U+00C4 LATIN CAPITAL LETTER A WITH DIAERESIS =C5 U+0139 LATIN CAPITAL LETTER L WITH ACUTE =C6 U+0106 LATIN CAPITAL LETTER C WITH ACUTE =C7 U+00C7 LATIN CAPITAL LETTER C WITH CEDILLA =C8 U+010C LATIN CAPITAL LETTER C WITH CARON =C9 U+00C9 LATIN CAPITAL LETTER E WITH ACUTE =CA U+0118 LATIN CAPITAL LETTER E WITH OGONEK =CB U+00CB LATIN CAPITAL LETTER E WITH DIAERESIS =CC U+011A LATIN CAPITAL LETTER E WITH CARON =CD U+00CD LATIN CAPITAL LETTER I WITH ACUTE =CE U+00CE LATIN CAPITAL LETTER I WITH CIRCUMFLEX =CF U+010E LATIN CAPITAL LETTER D WITH CARON =D0 U+0110 LATIN CAPITAL LETTER D WITH STROKE =D1 U+0143 LATIN CAPITAL LETTER N WITH ACUTE =D2 U+0147 LATIN CAPITAL LETTER N WITH CARON =D3 U+00D3 LATIN CAPITAL LETTER O WITH ACUTE =D4 U+00D4 LATIN CAPITAL LETTER O WITH CIRCUMFLEX =D5 U+0150 LATIN CAPITAL LETTER O WITH DOUBLE ACUTE =D6 U+00D6 LATIN CAPITAL LETTER O WITH DIAERESIS =D7 U+00D7 MULTIPLICATION SIGN =D8 U+0158 LATIN CAPITAL LETTER R WITH CARON =D9 U+016E LATIN CAPITAL LETTER U WITH RING ABOVE =DA U+00DA LATIN CAPITAL LETTER U WITH ACUTE =DB U+0170 LATIN CAPITAL LETTER U WITH DOUBLE ACUTE =DC U+00DC LATIN CAPITAL LETTER U WITH DIAERESIS =DD U+00DD LATIN CAPITAL LETTER Y WITH ACUTE =DE U+0162 LATIN CAPITAL LETTER T WITH CEDILLA =DF U+00DF LATIN SMALL LETTER SHARP S =E0 U+0155 LATIN SMALL LETTER R WITH ACUTE =E1 U+00E1 LATIN SMALL LETTER A WITH ACUTE =E2 U+00E2 LATIN SMALL LETTER A WITH CIRCUMFLEX =E3 U+0103 LATIN SMALL LETTER A WITH BREVE =E4 U+00E4 LATIN SMALL LETTER A WITH DIAERESIS =E5 U+013A LATIN SMALL LETTER L WITH ACUTE =E6 U+0107 LATIN SMALL LETTER C WITH ACUTE =E7 U+00E7 LATIN SMALL LETTER C WITH CEDILLA =E8 U+010D LATIN SMALL LETTER C WITH CARON =E9 U+00E9 LATIN SMALL LETTER E WITH ACUTE =EA U+0119 LATIN SMALL LETTER E WITH OGONEK =EB U+00EB LATIN SMALL LETTER E WITH DIAERESIS =EC U+011B LATIN SMALL LETTER E WITH CARON =ED U+00ED LATIN SMALL LETTER I WITH ACUTE =EE U+00EE LATIN SMALL LETTER I WITH CIRCUMFLEX =EF U+010F LATIN SMALL LETTER D WITH CARON =F0 U+0111 LATIN SMALL LETTER D WITH STROKE =F1 U+0144 LATIN SMALL LETTER N WITH ACUTE =F2 U+0148 LATIN SMALL LETTER N WITH CARON =F3 U+00F3 LATIN SMALL LETTER O WITH ACUTE =F4 U+00F4 LATIN SMALL LETTER O WITH CIRCUMFLEX =F5 U+0151 LATIN SMALL LETTER O WITH DOUBLE ACUTE =F6 U+00F6 LATIN SMALL LETTER O WITH DIAERESIS =F7 U+00F7 DIVISION SIGN =F8 U+0159 LATIN SMALL LETTER R WITH CARON =F9 U+016F LATIN SMALL LETTER U WITH RING ABOVE =FA U+00FA LATIN SMALL LETTER U WITH ACUTE =FB U+0171 LATIN SMALL LETTER U WITH DOUBLE ACUTE =FC U+00FC LATIN SMALL LETTER U WITH DIAERESIS =FD U+00FD LATIN SMALL LETTER Y WITH ACUTE =FE U+0163 LATIN SMALL LETTER T WITH CEDILLA =FF U+02D9 DOT ABOVE pantomime1.2-1.2.2+dfsg1/charsets/iso8859-3.txt000066400000000000000000000144751276751561200206220ustar00rootroot00000000000000=20 U+0020 SPACE =21 U+0021 EXCLAMATION MARK =22 U+0022 QUOTATION MARK =23 U+0023 NUMBER SIGN =24 U+0024 DOLLAR SIGN =25 U+0025 PERCENT SIGN =26 U+0026 AMPERSAND =27 U+0027 APOSTROPHE =28 U+0028 LEFT PARENTHESIS =29 U+0029 RIGHT PARENTHESIS =2A U+002A ASTERISK =2B U+002B PLUS SIGN =2C U+002C COMMA =2D U+002D HYPHEN-MINUS =2E U+002E FULL STOP =2F U+002F SOLIDUS =30 U+0030 DIGIT ZERO =31 U+0031 DIGIT ONE =32 U+0032 DIGIT TWO =33 U+0033 DIGIT THREE =34 U+0034 DIGIT FOUR =35 U+0035 DIGIT FIVE =36 U+0036 DIGIT SIX =37 U+0037 DIGIT SEVEN =38 U+0038 DIGIT EIGHT =39 U+0039 DIGIT NINE =3A U+003A COLON =3B U+003B SEMICOLON =3C U+003C LESS-THAN SIGN =3D U+003D EQUALS SIGN =3E U+003E GREATER-THAN SIGN =3F U+003F QUESTION MARK =40 U+0040 COMMERCIAL AT =41 U+0041 LATIN CAPITAL LETTER A =42 U+0042 LATIN CAPITAL LETTER B =43 U+0043 LATIN CAPITAL LETTER C =44 U+0044 LATIN CAPITAL LETTER D =45 U+0045 LATIN CAPITAL LETTER E =46 U+0046 LATIN CAPITAL LETTER F =47 U+0047 LATIN CAPITAL LETTER G =48 U+0048 LATIN CAPITAL LETTER H =49 U+0049 LATIN CAPITAL LETTER I =4A U+004A LATIN CAPITAL LETTER J =4B U+004B LATIN CAPITAL LETTER K =4C U+004C LATIN CAPITAL LETTER L =4D U+004D LATIN CAPITAL LETTER M =4E U+004E LATIN CAPITAL LETTER N =4F U+004F LATIN CAPITAL LETTER O =50 U+0050 LATIN CAPITAL LETTER P =51 U+0051 LATIN CAPITAL LETTER Q =52 U+0052 LATIN CAPITAL LETTER R =53 U+0053 LATIN CAPITAL LETTER S =54 U+0054 LATIN CAPITAL LETTER T =55 U+0055 LATIN CAPITAL LETTER U =56 U+0056 LATIN CAPITAL LETTER V =57 U+0057 LATIN CAPITAL LETTER W =58 U+0058 LATIN CAPITAL LETTER X =59 U+0059 LATIN CAPITAL LETTER Y =5A U+005A LATIN CAPITAL LETTER Z =5B U+005B LEFT SQUARE BRACKET =5C U+005C REVERSE SOLIDUS =5D U+005D RIGHT SQUARE BRACKET =5E U+005E CIRCUMFLEX ACCENT =5F U+005F LOW LINE =60 U+0060 GRAVE ACCENT =61 U+0061 LATIN SMALL LETTER A =62 U+0062 LATIN SMALL LETTER B =63 U+0063 LATIN SMALL LETTER C =64 U+0064 LATIN SMALL LETTER D =65 U+0065 LATIN SMALL LETTER E =66 U+0066 LATIN SMALL LETTER F =67 U+0067 LATIN SMALL LETTER G =68 U+0068 LATIN SMALL LETTER H =69 U+0069 LATIN SMALL LETTER I =6A U+006A LATIN SMALL LETTER J =6B U+006B LATIN SMALL LETTER K =6C U+006C LATIN SMALL LETTER L =6D U+006D LATIN SMALL LETTER M =6E U+006E LATIN SMALL LETTER N =6F U+006F LATIN SMALL LETTER O =70 U+0070 LATIN SMALL LETTER P =71 U+0071 LATIN SMALL LETTER Q =72 U+0072 LATIN SMALL LETTER R =73 U+0073 LATIN SMALL LETTER S =74 U+0074 LATIN SMALL LETTER T =75 U+0075 LATIN SMALL LETTER U =76 U+0076 LATIN SMALL LETTER V =77 U+0077 LATIN SMALL LETTER W =78 U+0078 LATIN SMALL LETTER X =79 U+0079 LATIN SMALL LETTER Y =7A U+007A LATIN SMALL LETTER Z =7B U+007B LEFT CURLY BRACKET =7C U+007C VERTICAL LINE =7D U+007D RIGHT CURLY BRACKET =7E U+007E TILDE =A0 U+00A0 NO-BREAK SPACE =A1 U+0126 LATIN CAPITAL LETTER H WITH STROKE =A2 U+02D8 BREVE =A3 U+00A3 POUND SIGN =A4 U+00A4 CURRENCY SIGN =A6 U+0124 LATIN CAPITAL LETTER H WITH CIRCUMFLEX =A7 U+00A7 SECTION SIGN =A8 U+00A8 DIAERESIS =A9 U+0130 LATIN CAPITAL LETTER I WITH DOT ABOVE =AA U+015E LATIN CAPITAL LETTER S WITH CEDILLA =AB U+011E LATIN CAPITAL LETTER G WITH BREVE =AC U+0134 LATIN CAPITAL LETTER J WITH CIRCUMFLEX =AD U+00AD SOFT HYPHEN =AF U+017B LATIN CAPITAL LETTER Z WITH DOT ABOVE =B0 U+00B0 DEGREE SIGN =B1 U+0127 LATIN SMALL LETTER H WITH STROKE =B2 U+00B2 SUPERSCRIPT TWO =B3 U+00B3 SUPERSCRIPT THREE =B4 U+00B4 ACUTE ACCENT =B5 U+00B5 MICRO SIGN =B6 U+0125 LATIN SMALL LETTER H WITH CIRCUMFLEX =B7 U+00B7 MIDDLE DOT =B8 U+00B8 CEDILLA =B9 U+0131 LATIN SMALL LETTER DOTLESS I =BA U+015F LATIN SMALL LETTER S WITH CEDILLA =BB U+011F LATIN SMALL LETTER G WITH BREVE =BC U+0135 LATIN SMALL LETTER J WITH CIRCUMFLEX =BD U+00BD VULGAR FRACTION ONE HALF =BF U+017C LATIN SMALL LETTER Z WITH DOT ABOVE =C0 U+00C0 LATIN CAPITAL LETTER A WITH GRAVE =C1 U+00C1 LATIN CAPITAL LETTER A WITH ACUTE =C2 U+00C2 LATIN CAPITAL LETTER A WITH CIRCUMFLEX =C4 U+00C4 LATIN CAPITAL LETTER A WITH DIAERESIS =C5 U+010A LATIN CAPITAL LETTER C WITH DOT ABOVE =C6 U+0108 LATIN CAPITAL LETTER C WITH CIRCUMFLEX =C7 U+00C7 LATIN CAPITAL LETTER C WITH CEDILLA =C8 U+00C8 LATIN CAPITAL LETTER E WITH GRAVE =C9 U+00C9 LATIN CAPITAL LETTER E WITH ACUTE =CA U+00CA LATIN CAPITAL LETTER E WITH CIRCUMFLEX =CB U+00CB LATIN CAPITAL LETTER E WITH DIAERESIS =CC U+00CC LATIN CAPITAL LETTER I WITH GRAVE =CD U+00CD LATIN CAPITAL LETTER I WITH ACUTE =CE U+00CE LATIN CAPITAL LETTER I WITH CIRCUMFLEX =CF U+00CF LATIN CAPITAL LETTER I WITH DIAERESIS =D1 U+00D1 LATIN CAPITAL LETTER N WITH TILDE =D2 U+00D2 LATIN CAPITAL LETTER O WITH GRAVE =D3 U+00D3 LATIN CAPITAL LETTER O WITH ACUTE =D4 U+00D4 LATIN CAPITAL LETTER O WITH CIRCUMFLEX =D5 U+0120 LATIN CAPITAL LETTER G WITH DOT ABOVE =D6 U+00D6 LATIN CAPITAL LETTER O WITH DIAERESIS =D7 U+00D7 MULTIPLICATION SIGN =D8 U+011C LATIN CAPITAL LETTER G WITH CIRCUMFLEX =D9 U+00D9 LATIN CAPITAL LETTER U WITH GRAVE =DA U+00DA LATIN CAPITAL LETTER U WITH ACUTE =DB U+00DB LATIN CAPITAL LETTER U WITH CIRCUMFLEX =DC U+00DC LATIN CAPITAL LETTER U WITH DIAERESIS =DD U+016C LATIN CAPITAL LETTER U WITH BREVE =DE U+015C LATIN CAPITAL LETTER S WITH CIRCUMFLEX =DF U+00DF LATIN SMALL LETTER SHARP S =E0 U+00E0 LATIN SMALL LETTER A WITH GRAVE =E1 U+00E1 LATIN SMALL LETTER A WITH ACUTE =E2 U+00E2 LATIN SMALL LETTER A WITH CIRCUMFLEX =E4 U+00E4 LATIN SMALL LETTER A WITH DIAERESIS =E5 U+010B LATIN SMALL LETTER C WITH DOT ABOVE =E6 U+0109 LATIN SMALL LETTER C WITH CIRCUMFLEX =E7 U+00E7 LATIN SMALL LETTER C WITH CEDILLA =E8 U+00E8 LATIN SMALL LETTER E WITH GRAVE =E9 U+00E9 LATIN SMALL LETTER E WITH ACUTE =EA U+00EA LATIN SMALL LETTER E WITH CIRCUMFLEX =EB U+00EB LATIN SMALL LETTER E WITH DIAERESIS =EC U+00EC LATIN SMALL LETTER I WITH GRAVE =ED U+00ED LATIN SMALL LETTER I WITH ACUTE =EE U+00EE LATIN SMALL LETTER I WITH CIRCUMFLEX =EF U+00EF LATIN SMALL LETTER I WITH DIAERESIS =F1 U+00F1 LATIN SMALL LETTER N WITH TILDE =F2 U+00F2 LATIN SMALL LETTER O WITH GRAVE =F3 U+00F3 LATIN SMALL LETTER O WITH ACUTE =F4 U+00F4 LATIN SMALL LETTER O WITH CIRCUMFLEX =F5 U+0121 LATIN SMALL LETTER G WITH DOT ABOVE =F6 U+00F6 LATIN SMALL LETTER O WITH DIAERESIS =F7 U+00F7 DIVISION SIGN =F8 U+011D LATIN SMALL LETTER G WITH CIRCUMFLEX =F9 U+00F9 LATIN SMALL LETTER U WITH GRAVE =FA U+00FA LATIN SMALL LETTER U WITH ACUTE =FB U+00FB LATIN SMALL LETTER U WITH CIRCUMFLEX =FC U+00FC LATIN SMALL LETTER U WITH DIAERESIS =FD U+016D LATIN SMALL LETTER U WITH BREVE =FE U+015D LATIN SMALL LETTER S WITH CIRCUMFLEX =FF U+02D9 DOT ABOVE pantomime1.2-1.2.2+dfsg1/charsets/iso8859-4.txt000066400000000000000000000151161276751561200206140ustar00rootroot00000000000000=20 U+0020 SPACE =21 U+0021 EXCLAMATION MARK =22 U+0022 QUOTATION MARK =23 U+0023 NUMBER SIGN =24 U+0024 DOLLAR SIGN =25 U+0025 PERCENT SIGN =26 U+0026 AMPERSAND =27 U+0027 APOSTROPHE =28 U+0028 LEFT PARENTHESIS =29 U+0029 RIGHT PARENTHESIS =2A U+002A ASTERISK =2B U+002B PLUS SIGN =2C U+002C COMMA =2D U+002D HYPHEN-MINUS =2E U+002E FULL STOP =2F U+002F SOLIDUS =30 U+0030 DIGIT ZERO =31 U+0031 DIGIT ONE =32 U+0032 DIGIT TWO =33 U+0033 DIGIT THREE =34 U+0034 DIGIT FOUR =35 U+0035 DIGIT FIVE =36 U+0036 DIGIT SIX =37 U+0037 DIGIT SEVEN =38 U+0038 DIGIT EIGHT =39 U+0039 DIGIT NINE =3A U+003A COLON =3B U+003B SEMICOLON =3C U+003C LESS-THAN SIGN =3D U+003D EQUALS SIGN =3E U+003E GREATER-THAN SIGN =3F U+003F QUESTION MARK =40 U+0040 COMMERCIAL AT =41 U+0041 LATIN CAPITAL LETTER A =42 U+0042 LATIN CAPITAL LETTER B =43 U+0043 LATIN CAPITAL LETTER C =44 U+0044 LATIN CAPITAL LETTER D =45 U+0045 LATIN CAPITAL LETTER E =46 U+0046 LATIN CAPITAL LETTER F =47 U+0047 LATIN CAPITAL LETTER G =48 U+0048 LATIN CAPITAL LETTER H =49 U+0049 LATIN CAPITAL LETTER I =4A U+004A LATIN CAPITAL LETTER J =4B U+004B LATIN CAPITAL LETTER K =4C U+004C LATIN CAPITAL LETTER L =4D U+004D LATIN CAPITAL LETTER M =4E U+004E LATIN CAPITAL LETTER N =4F U+004F LATIN CAPITAL LETTER O =50 U+0050 LATIN CAPITAL LETTER P =51 U+0051 LATIN CAPITAL LETTER Q =52 U+0052 LATIN CAPITAL LETTER R =53 U+0053 LATIN CAPITAL LETTER S =54 U+0054 LATIN CAPITAL LETTER T =55 U+0055 LATIN CAPITAL LETTER U =56 U+0056 LATIN CAPITAL LETTER V =57 U+0057 LATIN CAPITAL LETTER W =58 U+0058 LATIN CAPITAL LETTER X =59 U+0059 LATIN CAPITAL LETTER Y =5A U+005A LATIN CAPITAL LETTER Z =5B U+005B LEFT SQUARE BRACKET =5C U+005C REVERSE SOLIDUS =5D U+005D RIGHT SQUARE BRACKET =5E U+005E CIRCUMFLEX ACCENT =5F U+005F LOW LINE =60 U+0060 GRAVE ACCENT =61 U+0061 LATIN SMALL LETTER A =62 U+0062 LATIN SMALL LETTER B =63 U+0063 LATIN SMALL LETTER C =64 U+0064 LATIN SMALL LETTER D =65 U+0065 LATIN SMALL LETTER E =66 U+0066 LATIN SMALL LETTER F =67 U+0067 LATIN SMALL LETTER G =68 U+0068 LATIN SMALL LETTER H =69 U+0069 LATIN SMALL LETTER I =6A U+006A LATIN SMALL LETTER J =6B U+006B LATIN SMALL LETTER K =6C U+006C LATIN SMALL LETTER L =6D U+006D LATIN SMALL LETTER M =6E U+006E LATIN SMALL LETTER N =6F U+006F LATIN SMALL LETTER O =70 U+0070 LATIN SMALL LETTER P =71 U+0071 LATIN SMALL LETTER Q =72 U+0072 LATIN SMALL LETTER R =73 U+0073 LATIN SMALL LETTER S =74 U+0074 LATIN SMALL LETTER T =75 U+0075 LATIN SMALL LETTER U =76 U+0076 LATIN SMALL LETTER V =77 U+0077 LATIN SMALL LETTER W =78 U+0078 LATIN SMALL LETTER X =79 U+0079 LATIN SMALL LETTER Y =7A U+007A LATIN SMALL LETTER Z =7B U+007B LEFT CURLY BRACKET =7C U+007C VERTICAL LINE =7D U+007D RIGHT CURLY BRACKET =7E U+007E TILDE =A0 U+00A0 NO-BREAK SPACE =A1 U+0104 LATIN CAPITAL LETTER A WITH OGONEK =A2 U+0138 LATIN SMALL LETTER KRA =A3 U+0156 LATIN CAPITAL LETTER R WITH CEDILLA =A4 U+00A4 CURRENCY SIGN =A5 U+0128 LATIN CAPITAL LETTER I WITH TILDE =A6 U+013B LATIN CAPITAL LETTER L WITH CEDILLA =A7 U+00A7 SECTION SIGN =A8 U+00A8 DIAERESIS =A9 U+0160 LATIN CAPITAL LETTER S WITH CARON =AA U+0112 LATIN CAPITAL LETTER E WITH MACRON =AB U+0122 LATIN CAPITAL LETTER G WITH CEDILLA =AC U+0166 LATIN CAPITAL LETTER T WITH STROKE =AD U+00AD SOFT HYPHEN =AE U+017D LATIN CAPITAL LETTER Z WITH CARON =AF U+00AF MACRON =B0 U+00B0 DEGREE SIGN =B1 U+0105 LATIN SMALL LETTER A WITH OGONEK =B2 U+02DB OGONEK =B3 U+0157 LATIN SMALL LETTER R WITH CEDILLA =B4 U+00B4 ACUTE ACCENT =B5 U+0129 LATIN SMALL LETTER I WITH TILDE =B6 U+013C LATIN SMALL LETTER L WITH CEDILLA =B7 U+02C7 CARON =B8 U+00B8 CEDILLA =B9 U+0161 LATIN SMALL LETTER S WITH CARON =BA U+0113 LATIN SMALL LETTER E WITH MACRON =BB U+0123 LATIN SMALL LETTER G WITH CEDILLA =BC U+0167 LATIN SMALL LETTER T WITH STROKE =BD U+014A LATIN CAPITAL LETTER ENG =BE U+017E LATIN SMALL LETTER Z WITH CARON =BF U+014B LATIN SMALL LETTER ENG =C0 U+0100 LATIN CAPITAL LETTER A WITH MACRON =C1 U+00C1 LATIN CAPITAL LETTER A WITH ACUTE =C2 U+00C2 LATIN CAPITAL LETTER A WITH CIRCUMFLEX =C3 U+00C3 LATIN CAPITAL LETTER A WITH TILDE =C4 U+00C4 LATIN CAPITAL LETTER A WITH DIAERESIS =C5 U+00C5 LATIN CAPITAL LETTER A WITH RING ABOVE =C6 U+00C6 LATIN CAPITAL LETTER AE =C7 U+012E LATIN CAPITAL LETTER I WITH OGONEK =C8 U+010C LATIN CAPITAL LETTER C WITH CARON =C9 U+00C9 LATIN CAPITAL LETTER E WITH ACUTE =CA U+0118 LATIN CAPITAL LETTER E WITH OGONEK =CB U+00CB LATIN CAPITAL LETTER E WITH DIAERESIS =CC U+0116 LATIN CAPITAL LETTER E WITH DOT ABOVE =CD U+00CD LATIN CAPITAL LETTER I WITH ACUTE =CE U+00CE LATIN CAPITAL LETTER I WITH CIRCUMFLEX =CF U+012A LATIN CAPITAL LETTER I WITH MACRON =D0 U+0110 LATIN CAPITAL LETTER D WITH STROKE =D1 U+0145 LATIN CAPITAL LETTER N WITH CEDILLA =D2 U+014C LATIN CAPITAL LETTER O WITH MACRON =D3 U+0136 LATIN CAPITAL LETTER K WITH CEDILLA =D4 U+00D4 LATIN CAPITAL LETTER O WITH CIRCUMFLEX =D5 U+00D5 LATIN CAPITAL LETTER O WITH TILDE =D6 U+00D6 LATIN CAPITAL LETTER O WITH DIAERESIS =D7 U+00D7 MULTIPLICATION SIGN =D8 U+00D8 LATIN CAPITAL LETTER O WITH STROKE =D9 U+0172 LATIN CAPITAL LETTER U WITH OGONEK =DA U+00DA LATIN CAPITAL LETTER U WITH ACUTE =DB U+00DB LATIN CAPITAL LETTER U WITH CIRCUMFLEX =DC U+00DC LATIN CAPITAL LETTER U WITH DIAERESIS =DD U+0168 LATIN CAPITAL LETTER U WITH TILDE =DE U+016A LATIN CAPITAL LETTER U WITH MACRON =DF U+00DF LATIN SMALL LETTER SHARP S =E0 U+0101 LATIN SMALL LETTER A WITH MACRON =E1 U+00E1 LATIN SMALL LETTER A WITH ACUTE =E2 U+00E2 LATIN SMALL LETTER A WITH CIRCUMFLEX =E3 U+00E3 LATIN SMALL LETTER A WITH TILDE =E4 U+00E4 LATIN SMALL LETTER A WITH DIAERESIS =E5 U+00E5 LATIN SMALL LETTER A WITH RING ABOVE =E6 U+00E6 LATIN SMALL LETTER AE =E7 U+012F LATIN SMALL LETTER I WITH OGONEK =E8 U+010D LATIN SMALL LETTER C WITH CARON =E9 U+00E9 LATIN SMALL LETTER E WITH ACUTE =EA U+0119 LATIN SMALL LETTER E WITH OGONEK =EB U+00EB LATIN SMALL LETTER E WITH DIAERESIS =EC U+0117 LATIN SMALL LETTER E WITH DOT ABOVE =ED U+00ED LATIN SMALL LETTER I WITH ACUTE =EE U+00EE LATIN SMALL LETTER I WITH CIRCUMFLEX =EF U+012B LATIN SMALL LETTER I WITH MACRON =F0 U+0111 LATIN SMALL LETTER D WITH STROKE =F1 U+0146 LATIN SMALL LETTER N WITH CEDILLA =F2 U+014D LATIN SMALL LETTER O WITH MACRON =F3 U+0137 LATIN SMALL LETTER K WITH CEDILLA =F4 U+00F4 LATIN SMALL LETTER O WITH CIRCUMFLEX =F5 U+00F5 LATIN SMALL LETTER O WITH TILDE =F6 U+00F6 LATIN SMALL LETTER O WITH DIAERESIS =F7 U+00F7 DIVISION SIGN =F8 U+00F8 LATIN SMALL LETTER O WITH STROKE =F9 U+0173 LATIN SMALL LETTER U WITH OGONEK =FA U+00FA LATIN SMALL LETTER U WITH ACUTE =FB U+00FB LATIN SMALL LETTER U WITH CIRCUMFLEX =FC U+00FC LATIN SMALL LETTER U WITH DIAERESIS =FD U+0169 LATIN SMALL LETTER U WITH TILDE =FE U+016B LATIN SMALL LETTER U WITH MACRON =FF U+02D9 DOT ABOVE pantomime1.2-1.2.2+dfsg1/charsets/iso8859-5.txt000066400000000000000000000143451276751561200206200ustar00rootroot00000000000000=20 U+0020 SPACE =21 U+0021 EXCLAMATION MARK =22 U+0022 QUOTATION MARK =23 U+0023 NUMBER SIGN =24 U+0024 DOLLAR SIGN =25 U+0025 PERCENT SIGN =26 U+0026 AMPERSAND =27 U+0027 APOSTROPHE =28 U+0028 LEFT PARENTHESIS =29 U+0029 RIGHT PARENTHESIS =2A U+002A ASTERISK =2B U+002B PLUS SIGN =2C U+002C COMMA =2D U+002D HYPHEN-MINUS =2E U+002E FULL STOP =2F U+002F SOLIDUS =30 U+0030 DIGIT ZERO =31 U+0031 DIGIT ONE =32 U+0032 DIGIT TWO =33 U+0033 DIGIT THREE =34 U+0034 DIGIT FOUR =35 U+0035 DIGIT FIVE =36 U+0036 DIGIT SIX =37 U+0037 DIGIT SEVEN =38 U+0038 DIGIT EIGHT =39 U+0039 DIGIT NINE =3A U+003A COLON =3B U+003B SEMICOLON =3C U+003C LESS-THAN SIGN =3D U+003D EQUALS SIGN =3E U+003E GREATER-THAN SIGN =3F U+003F QUESTION MARK =40 U+0040 COMMERCIAL AT =41 U+0041 LATIN CAPITAL LETTER A =42 U+0042 LATIN CAPITAL LETTER B =43 U+0043 LATIN CAPITAL LETTER C =44 U+0044 LATIN CAPITAL LETTER D =45 U+0045 LATIN CAPITAL LETTER E =46 U+0046 LATIN CAPITAL LETTER F =47 U+0047 LATIN CAPITAL LETTER G =48 U+0048 LATIN CAPITAL LETTER H =49 U+0049 LATIN CAPITAL LETTER I =4A U+004A LATIN CAPITAL LETTER J =4B U+004B LATIN CAPITAL LETTER K =4C U+004C LATIN CAPITAL LETTER L =4D U+004D LATIN CAPITAL LETTER M =4E U+004E LATIN CAPITAL LETTER N =4F U+004F LATIN CAPITAL LETTER O =50 U+0050 LATIN CAPITAL LETTER P =51 U+0051 LATIN CAPITAL LETTER Q =52 U+0052 LATIN CAPITAL LETTER R =53 U+0053 LATIN CAPITAL LETTER S =54 U+0054 LATIN CAPITAL LETTER T =55 U+0055 LATIN CAPITAL LETTER U =56 U+0056 LATIN CAPITAL LETTER V =57 U+0057 LATIN CAPITAL LETTER W =58 U+0058 LATIN CAPITAL LETTER X =59 U+0059 LATIN CAPITAL LETTER Y =5A U+005A LATIN CAPITAL LETTER Z =5B U+005B LEFT SQUARE BRACKET =5C U+005C REVERSE SOLIDUS =5D U+005D RIGHT SQUARE BRACKET =5E U+005E CIRCUMFLEX ACCENT =5F U+005F LOW LINE =60 U+0060 GRAVE ACCENT =61 U+0061 LATIN SMALL LETTER A =62 U+0062 LATIN SMALL LETTER B =63 U+0063 LATIN SMALL LETTER C =64 U+0064 LATIN SMALL LETTER D =65 U+0065 LATIN SMALL LETTER E =66 U+0066 LATIN SMALL LETTER F =67 U+0067 LATIN SMALL LETTER G =68 U+0068 LATIN SMALL LETTER H =69 U+0069 LATIN SMALL LETTER I =6A U+006A LATIN SMALL LETTER J =6B U+006B LATIN SMALL LETTER K =6C U+006C LATIN SMALL LETTER L =6D U+006D LATIN SMALL LETTER M =6E U+006E LATIN SMALL LETTER N =6F U+006F LATIN SMALL LETTER O =70 U+0070 LATIN SMALL LETTER P =71 U+0071 LATIN SMALL LETTER Q =72 U+0072 LATIN SMALL LETTER R =73 U+0073 LATIN SMALL LETTER S =74 U+0074 LATIN SMALL LETTER T =75 U+0075 LATIN SMALL LETTER U =76 U+0076 LATIN SMALL LETTER V =77 U+0077 LATIN SMALL LETTER W =78 U+0078 LATIN SMALL LETTER X =79 U+0079 LATIN SMALL LETTER Y =7A U+007A LATIN SMALL LETTER Z =7B U+007B LEFT CURLY BRACKET =7C U+007C VERTICAL LINE =7D U+007D RIGHT CURLY BRACKET =7E U+007E TILDE =A0 U+00A0 NO-BREAK SPACE =A1 U+0401 CYRILLIC CAPITAL LETTER IO =A2 U+0402 CYRILLIC CAPITAL LETTER DJE =A3 U+0403 CYRILLIC CAPITAL LETTER GJE =A4 U+0404 CYRILLIC CAPITAL LETTER UKRAINIAN IE =A5 U+0405 CYRILLIC CAPITAL LETTER DZE =A6 U+0406 CYRILLIC CAPITAL LETTER BYELORUSSIAN-UKRAINIAN I =A7 U+0407 CYRILLIC CAPITAL LETTER YI =A8 U+0408 CYRILLIC CAPITAL LETTER JE =A9 U+0409 CYRILLIC CAPITAL LETTER LJE =AA U+040A CYRILLIC CAPITAL LETTER NJE =AB U+040B CYRILLIC CAPITAL LETTER TSHE =AC U+040C CYRILLIC CAPITAL LETTER KJE =AD U+00AD SOFT HYPHEN =AE U+040E CYRILLIC CAPITAL LETTER SHORT U =AF U+040F CYRILLIC CAPITAL LETTER DZHE =B0 U+0410 CYRILLIC CAPITAL LETTER A =B1 U+0411 CYRILLIC CAPITAL LETTER BE =B2 U+0412 CYRILLIC CAPITAL LETTER VE =B3 U+0413 CYRILLIC CAPITAL LETTER GHE =B4 U+0414 CYRILLIC CAPITAL LETTER DE =B5 U+0415 CYRILLIC CAPITAL LETTER IE =B6 U+0416 CYRILLIC CAPITAL LETTER ZHE =B7 U+0417 CYRILLIC CAPITAL LETTER ZE =B8 U+0418 CYRILLIC CAPITAL LETTER I =B9 U+0419 CYRILLIC CAPITAL LETTER SHORT I =BA U+041A CYRILLIC CAPITAL LETTER KA =BB U+041B CYRILLIC CAPITAL LETTER EL =BC U+041C CYRILLIC CAPITAL LETTER EM =BD U+041D CYRILLIC CAPITAL LETTER EN =BE U+041E CYRILLIC CAPITAL LETTER O =BF U+041F CYRILLIC CAPITAL LETTER PE =C0 U+0420 CYRILLIC CAPITAL LETTER ER =C1 U+0421 CYRILLIC CAPITAL LETTER ES =C2 U+0422 CYRILLIC CAPITAL LETTER TE =C3 U+0423 CYRILLIC CAPITAL LETTER U =C4 U+0424 CYRILLIC CAPITAL LETTER EF =C5 U+0425 CYRILLIC CAPITAL LETTER HA =C6 U+0426 CYRILLIC CAPITAL LETTER TSE =C7 U+0427 CYRILLIC CAPITAL LETTER CHE =C8 U+0428 CYRILLIC CAPITAL LETTER SHA =C9 U+0429 CYRILLIC CAPITAL LETTER SHCHA =CA U+042A CYRILLIC CAPITAL LETTER HARD SIGN =CB U+042B CYRILLIC CAPITAL LETTER YERU =CC U+042C CYRILLIC CAPITAL LETTER SOFT SIGN =CD U+042D CYRILLIC CAPITAL LETTER E =CE U+042E CYRILLIC CAPITAL LETTER YU =CF U+042F CYRILLIC CAPITAL LETTER YA =D0 U+0430 CYRILLIC SMALL LETTER A =D1 U+0431 CYRILLIC SMALL LETTER BE =D2 U+0432 CYRILLIC SMALL LETTER VE =D3 U+0433 CYRILLIC SMALL LETTER GHE =D4 U+0434 CYRILLIC SMALL LETTER DE =D5 U+0435 CYRILLIC SMALL LETTER IE =D6 U+0436 CYRILLIC SMALL LETTER ZHE =D7 U+0437 CYRILLIC SMALL LETTER ZE =D8 U+0438 CYRILLIC SMALL LETTER I =D9 U+0439 CYRILLIC SMALL LETTER SHORT I =DA U+043A CYRILLIC SMALL LETTER KA =DB U+043B CYRILLIC SMALL LETTER EL =DC U+043C CYRILLIC SMALL LETTER EM =DD U+043D CYRILLIC SMALL LETTER EN =DE U+043E CYRILLIC SMALL LETTER O =DF U+043F CYRILLIC SMALL LETTER PE =E0 U+0440 CYRILLIC SMALL LETTER ER =E1 U+0441 CYRILLIC SMALL LETTER ES =E2 U+0442 CYRILLIC SMALL LETTER TE =E3 U+0443 CYRILLIC SMALL LETTER U =E4 U+0444 CYRILLIC SMALL LETTER EF =E5 U+0445 CYRILLIC SMALL LETTER HA =E6 U+0446 CYRILLIC SMALL LETTER TSE =E7 U+0447 CYRILLIC SMALL LETTER CHE =E8 U+0448 CYRILLIC SMALL LETTER SHA =E9 U+0449 CYRILLIC SMALL LETTER SHCHA =EA U+044A CYRILLIC SMALL LETTER HARD SIGN =EB U+044B CYRILLIC SMALL LETTER YERU =EC U+044C CYRILLIC SMALL LETTER SOFT SIGN =ED U+044D CYRILLIC SMALL LETTER E =EE U+044E CYRILLIC SMALL LETTER YU =EF U+044F CYRILLIC SMALL LETTER YA =F0 U+2116 NUMERO SIGN =F1 U+0451 CYRILLIC SMALL LETTER IO =F2 U+0452 CYRILLIC SMALL LETTER DJE =F3 U+0453 CYRILLIC SMALL LETTER GJE =F4 U+0454 CYRILLIC SMALL LETTER UKRAINIAN IE =F5 U+0455 CYRILLIC SMALL LETTER DZE =F6 U+0456 CYRILLIC SMALL LETTER BYELORUSSIAN-UKRAINIAN I =F7 U+0457 CYRILLIC SMALL LETTER YI =F8 U+0458 CYRILLIC SMALL LETTER JE =F9 U+0459 CYRILLIC SMALL LETTER LJE =FA U+045A CYRILLIC SMALL LETTER NJE =FB U+045B CYRILLIC SMALL LETTER TSHE =FC U+045C CYRILLIC SMALL LETTER KJE =FD U+00A7 SECTION SIGN =FE U+045E CYRILLIC SMALL LETTER SHORT U =FF U+045F CYRILLIC SMALL LETTER DZHE pantomime1.2-1.2.2+dfsg1/charsets/iso8859-6.txt000066400000000000000000000102711276751561200206130ustar00rootroot00000000000000=20 U+0020 SPACE =21 U+0021 EXCLAMATION MARK =22 U+0022 QUOTATION MARK =23 U+0023 NUMBER SIGN =24 U+0024 DOLLAR SIGN =25 U+0025 PERCENT SIGN =26 U+0026 AMPERSAND =27 U+0027 APOSTROPHE =28 U+0028 LEFT PARENTHESIS =29 U+0029 RIGHT PARENTHESIS =2A U+002A ASTERISK =2B U+002B PLUS SIGN =2C U+002C COMMA =2D U+002D HYPHEN-MINUS =2E U+002E FULL STOP =2F U+002F SOLIDUS =30 U+0030 DIGIT ZERO =31 U+0031 DIGIT ONE =32 U+0032 DIGIT TWO =33 U+0033 DIGIT THREE =34 U+0034 DIGIT FOUR =35 U+0035 DIGIT FIVE =36 U+0036 DIGIT SIX =37 U+0037 DIGIT SEVEN =38 U+0038 DIGIT EIGHT =39 U+0039 DIGIT NINE =3A U+003A COLON =3B U+003B SEMICOLON =3C U+003C LESS-THAN SIGN =3D U+003D EQUALS SIGN =3E U+003E GREATER-THAN SIGN =3F U+003F QUESTION MARK =40 U+0040 COMMERCIAL AT =41 U+0041 LATIN CAPITAL LETTER A =42 U+0042 LATIN CAPITAL LETTER B =43 U+0043 LATIN CAPITAL LETTER C =44 U+0044 LATIN CAPITAL LETTER D =45 U+0045 LATIN CAPITAL LETTER E =46 U+0046 LATIN CAPITAL LETTER F =47 U+0047 LATIN CAPITAL LETTER G =48 U+0048 LATIN CAPITAL LETTER H =49 U+0049 LATIN CAPITAL LETTER I =4A U+004A LATIN CAPITAL LETTER J =4B U+004B LATIN CAPITAL LETTER K =4C U+004C LATIN CAPITAL LETTER L =4D U+004D LATIN CAPITAL LETTER M =4E U+004E LATIN CAPITAL LETTER N =4F U+004F LATIN CAPITAL LETTER O =50 U+0050 LATIN CAPITAL LETTER P =51 U+0051 LATIN CAPITAL LETTER Q =52 U+0052 LATIN CAPITAL LETTER R =53 U+0053 LATIN CAPITAL LETTER S =54 U+0054 LATIN CAPITAL LETTER T =55 U+0055 LATIN CAPITAL LETTER U =56 U+0056 LATIN CAPITAL LETTER V =57 U+0057 LATIN CAPITAL LETTER W =58 U+0058 LATIN CAPITAL LETTER X =59 U+0059 LATIN CAPITAL LETTER Y =5A U+005A LATIN CAPITAL LETTER Z =5B U+005B LEFT SQUARE BRACKET =5C U+005C REVERSE SOLIDUS =5D U+005D RIGHT SQUARE BRACKET =5E U+005E CIRCUMFLEX ACCENT =5F U+005F LOW LINE =60 U+0060 GRAVE ACCENT =61 U+0061 LATIN SMALL LETTER A =62 U+0062 LATIN SMALL LETTER B =63 U+0063 LATIN SMALL LETTER C =64 U+0064 LATIN SMALL LETTER D =65 U+0065 LATIN SMALL LETTER E =66 U+0066 LATIN SMALL LETTER F =67 U+0067 LATIN SMALL LETTER G =68 U+0068 LATIN SMALL LETTER H =69 U+0069 LATIN SMALL LETTER I =6A U+006A LATIN SMALL LETTER J =6B U+006B LATIN SMALL LETTER K =6C U+006C LATIN SMALL LETTER L =6D U+006D LATIN SMALL LETTER M =6E U+006E LATIN SMALL LETTER N =6F U+006F LATIN SMALL LETTER O =70 U+0070 LATIN SMALL LETTER P =71 U+0071 LATIN SMALL LETTER Q =72 U+0072 LATIN SMALL LETTER R =73 U+0073 LATIN SMALL LETTER S =74 U+0074 LATIN SMALL LETTER T =75 U+0075 LATIN SMALL LETTER U =76 U+0076 LATIN SMALL LETTER V =77 U+0077 LATIN SMALL LETTER W =78 U+0078 LATIN SMALL LETTER X =79 U+0079 LATIN SMALL LETTER Y =7A U+007A LATIN SMALL LETTER Z =7B U+007B LEFT CURLY BRACKET =7C U+007C VERTICAL LINE =7D U+007D RIGHT CURLY BRACKET =7E U+007E TILDE =A0 U+00A0 NO-BREAK SPACE =A4 U+00A4 CURRENCY SIGN =AC U+060C ARABIC COMMA =AD U+00AD SOFT HYPHEN =BB U+061B ARABIC SEMICOLON =BF U+061F ARABIC QUESTION MARK =C1 U+0621 ARABIC LETTER HAMZA =C2 U+0622 ARABIC LETTER ALEF WITH MADDA ABOVE =C3 U+0623 ARABIC LETTER ALEF WITH HAMZA ABOVE =C4 U+0624 ARABIC LETTER WAW WITH HAMZA ABOVE =C5 U+0625 ARABIC LETTER ALEF WITH HAMZA BELOW =C6 U+0626 ARABIC LETTER YEH WITH HAMZA ABOVE =C7 U+0627 ARABIC LETTER ALEF =C8 U+0628 ARABIC LETTER BEH =C9 U+0629 ARABIC LETTER TEH MARBUTA =CA U+062A ARABIC LETTER TEH =CB U+062B ARABIC LETTER THEH =CC U+062C ARABIC LETTER JEEM =CD U+062D ARABIC LETTER HAH =CE U+062E ARABIC LETTER KHAH =CF U+062F ARABIC LETTER DAL =D0 U+0630 ARABIC LETTER THAL =D1 U+0631 ARABIC LETTER REH =D2 U+0632 ARABIC LETTER ZAIN =D3 U+0633 ARABIC LETTER SEEN =D4 U+0634 ARABIC LETTER SHEEN =D5 U+0635 ARABIC LETTER SAD =D6 U+0636 ARABIC LETTER DAD =D7 U+0637 ARABIC LETTER TAH =D8 U+0638 ARABIC LETTER ZAH =D9 U+0639 ARABIC LETTER AIN =DA U+063A ARABIC LETTER GHAIN =E0 U+0640 ARABIC TATWEEL =E1 U+0641 ARABIC LETTER FEH =E2 U+0642 ARABIC LETTER QAF =E3 U+0643 ARABIC LETTER KAF =E4 U+0644 ARABIC LETTER LAM =E5 U+0645 ARABIC LETTER MEEM =E6 U+0646 ARABIC LETTER NOON =E7 U+0647 ARABIC LETTER HEH =E8 U+0648 ARABIC LETTER WAW =E9 U+0649 ARABIC LETTER ALEF MAKSURA =EA U+064A ARABIC LETTER YEH =EB U+064B ARABIC FATHATAN =EC U+064C ARABIC DAMMATAN =ED U+064D ARABIC KASRATAN =EE U+064E ARABIC FATHA =EF U+064F ARABIC DAMMA =F0 U+0650 ARABIC KASRA =F1 U+0651 ARABIC SHADDA =F2 U+0652 ARABIC SUKUN pantomime1.2-1.2.2+dfsg1/charsets/iso8859-7.txt000066400000000000000000000137671276751561200206310ustar00rootroot00000000000000=20 U+0020 SPACE =21 U+0021 EXCLAMATION MARK =22 U+0022 QUOTATION MARK =23 U+0023 NUMBER SIGN =24 U+0024 DOLLAR SIGN =25 U+0025 PERCENT SIGN =26 U+0026 AMPERSAND =27 U+0027 APOSTROPHE =28 U+0028 LEFT PARENTHESIS =29 U+0029 RIGHT PARENTHESIS =2A U+002A ASTERISK =2B U+002B PLUS SIGN =2C U+002C COMMA =2D U+002D HYPHEN-MINUS =2E U+002E FULL STOP =2F U+002F SOLIDUS =30 U+0030 DIGIT ZERO =31 U+0031 DIGIT ONE =32 U+0032 DIGIT TWO =33 U+0033 DIGIT THREE =34 U+0034 DIGIT FOUR =35 U+0035 DIGIT FIVE =36 U+0036 DIGIT SIX =37 U+0037 DIGIT SEVEN =38 U+0038 DIGIT EIGHT =39 U+0039 DIGIT NINE =3A U+003A COLON =3B U+003B SEMICOLON =3C U+003C LESS-THAN SIGN =3D U+003D EQUALS SIGN =3E U+003E GREATER-THAN SIGN =3F U+003F QUESTION MARK =40 U+0040 COMMERCIAL AT =41 U+0041 LATIN CAPITAL LETTER A =42 U+0042 LATIN CAPITAL LETTER B =43 U+0043 LATIN CAPITAL LETTER C =44 U+0044 LATIN CAPITAL LETTER D =45 U+0045 LATIN CAPITAL LETTER E =46 U+0046 LATIN CAPITAL LETTER F =47 U+0047 LATIN CAPITAL LETTER G =48 U+0048 LATIN CAPITAL LETTER H =49 U+0049 LATIN CAPITAL LETTER I =4A U+004A LATIN CAPITAL LETTER J =4B U+004B LATIN CAPITAL LETTER K =4C U+004C LATIN CAPITAL LETTER L =4D U+004D LATIN CAPITAL LETTER M =4E U+004E LATIN CAPITAL LETTER N =4F U+004F LATIN CAPITAL LETTER O =50 U+0050 LATIN CAPITAL LETTER P =51 U+0051 LATIN CAPITAL LETTER Q =52 U+0052 LATIN CAPITAL LETTER R =53 U+0053 LATIN CAPITAL LETTER S =54 U+0054 LATIN CAPITAL LETTER T =55 U+0055 LATIN CAPITAL LETTER U =56 U+0056 LATIN CAPITAL LETTER V =57 U+0057 LATIN CAPITAL LETTER W =58 U+0058 LATIN CAPITAL LETTER X =59 U+0059 LATIN CAPITAL LETTER Y =5A U+005A LATIN CAPITAL LETTER Z =5B U+005B LEFT SQUARE BRACKET =5C U+005C REVERSE SOLIDUS =5D U+005D RIGHT SQUARE BRACKET =5E U+005E CIRCUMFLEX ACCENT =5F U+005F LOW LINE =60 U+0060 GRAVE ACCENT =61 U+0061 LATIN SMALL LETTER A =62 U+0062 LATIN SMALL LETTER B =63 U+0063 LATIN SMALL LETTER C =64 U+0064 LATIN SMALL LETTER D =65 U+0065 LATIN SMALL LETTER E =66 U+0066 LATIN SMALL LETTER F =67 U+0067 LATIN SMALL LETTER G =68 U+0068 LATIN SMALL LETTER H =69 U+0069 LATIN SMALL LETTER I =6A U+006A LATIN SMALL LETTER J =6B U+006B LATIN SMALL LETTER K =6C U+006C LATIN SMALL LETTER L =6D U+006D LATIN SMALL LETTER M =6E U+006E LATIN SMALL LETTER N =6F U+006F LATIN SMALL LETTER O =70 U+0070 LATIN SMALL LETTER P =71 U+0071 LATIN SMALL LETTER Q =72 U+0072 LATIN SMALL LETTER R =73 U+0073 LATIN SMALL LETTER S =74 U+0074 LATIN SMALL LETTER T =75 U+0075 LATIN SMALL LETTER U =76 U+0076 LATIN SMALL LETTER V =77 U+0077 LATIN SMALL LETTER W =78 U+0078 LATIN SMALL LETTER X =79 U+0079 LATIN SMALL LETTER Y =7A U+007A LATIN SMALL LETTER Z =7B U+007B LEFT CURLY BRACKET =7C U+007C VERTICAL LINE =7D U+007D RIGHT CURLY BRACKET =7E U+007E TILDE =A0 U+00A0 NO-BREAK SPACE =A1 U+02BD MODIFIER LETTER REVERSED COMMA =A2 U+02BC MODIFIER LETTER APOSTROPHE =A3 U+00A3 POUND SIGN =A6 U+00A6 BROKEN BAR =A7 U+00A7 SECTION SIGN =A8 U+00A8 DIAERESIS =A9 U+00A9 COPYRIGHT SIGN =AB U+00AB LEFT-POINTING DOUBLE ANGLE QUOTATION MARK =AC U+00AC NOT SIGN =AD U+00AD SOFT HYPHEN =AF U+2015 HORIZONTAL BAR =B0 U+00B0 DEGREE SIGN =B1 U+00B1 PLUS-MINUS SIGN =B2 U+00B2 SUPERSCRIPT TWO =B3 U+00B3 SUPERSCRIPT THREE =B4 U+0384 GREEK TONOS =B5 U+0385 GREEK DIALYTIKA TONOS =B6 U+0386 GREEK CAPITAL LETTER ALPHA WITH TONOS =B7 U+00B7 MIDDLE DOT =B8 U+0388 GREEK CAPITAL LETTER EPSILON WITH TONOS =B9 U+0389 GREEK CAPITAL LETTER ETA WITH TONOS =BA U+038A GREEK CAPITAL LETTER IOTA WITH TONOS =BB U+00BB RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK =BC U+038C GREEK CAPITAL LETTER OMICRON WITH TONOS =BD U+00BD VULGAR FRACTION ONE HALF =BE U+038E GREEK CAPITAL LETTER UPSILON WITH TONOS =BF U+038F GREEK CAPITAL LETTER OMEGA WITH TONOS =C0 U+0390 GREEK SMALL LETTER IOTA WITH DIALYTIKA AND TONOS =C1 U+0391 GREEK CAPITAL LETTER ALPHA =C2 U+0392 GREEK CAPITAL LETTER BETA =C3 U+0393 GREEK CAPITAL LETTER GAMMA =C4 U+0394 GREEK CAPITAL LETTER DELTA =C5 U+0395 GREEK CAPITAL LETTER EPSILON =C6 U+0396 GREEK CAPITAL LETTER ZETA =C7 U+0397 GREEK CAPITAL LETTER ETA =C8 U+0398 GREEK CAPITAL LETTER THETA =C9 U+0399 GREEK CAPITAL LETTER IOTA =CA U+039A GREEK CAPITAL LETTER KAPPA =CB U+039B GREEK CAPITAL LETTER LAMDA =CC U+039C GREEK CAPITAL LETTER MU =CD U+039D GREEK CAPITAL LETTER NU =CE U+039E GREEK CAPITAL LETTER XI =CF U+039F GREEK CAPITAL LETTER OMICRON =D0 U+03A0 GREEK CAPITAL LETTER PI =D1 U+03A1 GREEK CAPITAL LETTER RHO =D3 U+03A3 GREEK CAPITAL LETTER SIGMA =D4 U+03A4 GREEK CAPITAL LETTER TAU =D5 U+03A5 GREEK CAPITAL LETTER UPSILON =D6 U+03A6 GREEK CAPITAL LETTER PHI =D7 U+03A7 GREEK CAPITAL LETTER CHI =D8 U+03A8 GREEK CAPITAL LETTER PSI =D9 U+03A9 GREEK CAPITAL LETTER OMEGA =DA U+03AA GREEK CAPITAL LETTER IOTA WITH DIALYTIKA =DB U+03AB GREEK CAPITAL LETTER UPSILON WITH DIALYTIKA =DC U+03AC GREEK SMALL LETTER ALPHA WITH TONOS =DD U+03AD GREEK SMALL LETTER EPSILON WITH TONOS =DE U+03AE GREEK SMALL LETTER ETA WITH TONOS =DF U+03AF GREEK SMALL LETTER IOTA WITH TONOS =E0 U+03B0 GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND TONOS =E1 U+03B1 GREEK SMALL LETTER ALPHA =E2 U+03B2 GREEK SMALL LETTER BETA =E3 U+03B3 GREEK SMALL LETTER GAMMA =E4 U+03B4 GREEK SMALL LETTER DELTA =E5 U+03B5 GREEK SMALL LETTER EPSILON =E6 U+03B6 GREEK SMALL LETTER ZETA =E7 U+03B7 GREEK SMALL LETTER ETA =E8 U+03B8 GREEK SMALL LETTER THETA =E9 U+03B9 GREEK SMALL LETTER IOTA =EA U+03BA GREEK SMALL LETTER KAPPA =EB U+03BB GREEK SMALL LETTER LAMDA =EC U+03BC GREEK SMALL LETTER MU =ED U+03BD GREEK SMALL LETTER NU =EE U+03BE GREEK SMALL LETTER XI =EF U+03BF GREEK SMALL LETTER OMICRON =F0 U+03C0 GREEK SMALL LETTER PI =F1 U+03C1 GREEK SMALL LETTER RHO =F2 U+03C2 GREEK SMALL LETTER FINAL SIGMA =F3 U+03C3 GREEK SMALL LETTER SIGMA =F4 U+03C4 GREEK SMALL LETTER TAU =F5 U+03C5 GREEK SMALL LETTER UPSILON =F6 U+03C6 GREEK SMALL LETTER PHI =F7 U+03C7 GREEK SMALL LETTER CHI =F8 U+03C8 GREEK SMALL LETTER PSI =F9 U+03C9 GREEK SMALL LETTER OMEGA =FA U+03CA GREEK SMALL LETTER IOTA WITH DIALYTIKA =FB U+03CB GREEK SMALL LETTER UPSILON WITH DIALYTIKA =FC U+03CC GREEK SMALL LETTER OMICRON WITH TONOS =FD U+03CD GREEK SMALL LETTER UPSILON WITH TONOS =FE U+03CE GREEK SMALL LETTER OMEGA WITH TONOS pantomime1.2-1.2.2+dfsg1/charsets/iso8859-8.txt000066400000000000000000000104701276751561200206160ustar00rootroot00000000000000=20 U+0020 SPACE =21 U+0021 EXCLAMATION MARK =22 U+0022 QUOTATION MARK =23 U+0023 NUMBER SIGN =24 U+0024 DOLLAR SIGN =25 U+0025 PERCENT SIGN =26 U+0026 AMPERSAND =27 U+0027 APOSTROPHE =28 U+0028 LEFT PARENTHESIS =29 U+0029 RIGHT PARENTHESIS =2A U+002A ASTERISK =2B U+002B PLUS SIGN =2C U+002C COMMA =2D U+002D HYPHEN-MINUS =2E U+002E FULL STOP =2F U+002F SOLIDUS =30 U+0030 DIGIT ZERO =31 U+0031 DIGIT ONE =32 U+0032 DIGIT TWO =33 U+0033 DIGIT THREE =34 U+0034 DIGIT FOUR =35 U+0035 DIGIT FIVE =36 U+0036 DIGIT SIX =37 U+0037 DIGIT SEVEN =38 U+0038 DIGIT EIGHT =39 U+0039 DIGIT NINE =3A U+003A COLON =3B U+003B SEMICOLON =3C U+003C LESS-THAN SIGN =3D U+003D EQUALS SIGN =3E U+003E GREATER-THAN SIGN =3F U+003F QUESTION MARK =40 U+0040 COMMERCIAL AT =41 U+0041 LATIN CAPITAL LETTER A =42 U+0042 LATIN CAPITAL LETTER B =43 U+0043 LATIN CAPITAL LETTER C =44 U+0044 LATIN CAPITAL LETTER D =45 U+0045 LATIN CAPITAL LETTER E =46 U+0046 LATIN CAPITAL LETTER F =47 U+0047 LATIN CAPITAL LETTER G =48 U+0048 LATIN CAPITAL LETTER H =49 U+0049 LATIN CAPITAL LETTER I =4A U+004A LATIN CAPITAL LETTER J =4B U+004B LATIN CAPITAL LETTER K =4C U+004C LATIN CAPITAL LETTER L =4D U+004D LATIN CAPITAL LETTER M =4E U+004E LATIN CAPITAL LETTER N =4F U+004F LATIN CAPITAL LETTER O =50 U+0050 LATIN CAPITAL LETTER P =51 U+0051 LATIN CAPITAL LETTER Q =52 U+0052 LATIN CAPITAL LETTER R =53 U+0053 LATIN CAPITAL LETTER S =54 U+0054 LATIN CAPITAL LETTER T =55 U+0055 LATIN CAPITAL LETTER U =56 U+0056 LATIN CAPITAL LETTER V =57 U+0057 LATIN CAPITAL LETTER W =58 U+0058 LATIN CAPITAL LETTER X =59 U+0059 LATIN CAPITAL LETTER Y =5A U+005A LATIN CAPITAL LETTER Z =5B U+005B LEFT SQUARE BRACKET =5C U+005C REVERSE SOLIDUS =5D U+005D RIGHT SQUARE BRACKET =5E U+005E CIRCUMFLEX ACCENT =5F U+005F LOW LINE =60 U+0060 GRAVE ACCENT =61 U+0061 LATIN SMALL LETTER A =62 U+0062 LATIN SMALL LETTER B =63 U+0063 LATIN SMALL LETTER C =64 U+0064 LATIN SMALL LETTER D =65 U+0065 LATIN SMALL LETTER E =66 U+0066 LATIN SMALL LETTER F =67 U+0067 LATIN SMALL LETTER G =68 U+0068 LATIN SMALL LETTER H =69 U+0069 LATIN SMALL LETTER I =6A U+006A LATIN SMALL LETTER J =6B U+006B LATIN SMALL LETTER K =6C U+006C LATIN SMALL LETTER L =6D U+006D LATIN SMALL LETTER M =6E U+006E LATIN SMALL LETTER N =6F U+006F LATIN SMALL LETTER O =70 U+0070 LATIN SMALL LETTER P =71 U+0071 LATIN SMALL LETTER Q =72 U+0072 LATIN SMALL LETTER R =73 U+0073 LATIN SMALL LETTER S =74 U+0074 LATIN SMALL LETTER T =75 U+0075 LATIN SMALL LETTER U =76 U+0076 LATIN SMALL LETTER V =77 U+0077 LATIN SMALL LETTER W =78 U+0078 LATIN SMALL LETTER X =79 U+0079 LATIN SMALL LETTER Y =7A U+007A LATIN SMALL LETTER Z =7B U+007B LEFT CURLY BRACKET =7C U+007C VERTICAL LINE =7D U+007D RIGHT CURLY BRACKET =7E U+007E TILDE =A0 U+00A0 NO-BREAK SPACE =A2 U+00A2 CENT SIGN =A3 U+00A3 POUND SIGN =A4 U+00A4 CURRENCY SIGN =A5 U+00A5 YEN SIGN =A6 U+00A6 BROKEN BAR =A7 U+00A7 SECTION SIGN =A8 U+00A8 DIAERESIS =A9 U+00A9 COPYRIGHT SIGN =AA U+00D7 MULTIPLICATION SIGN =AB U+00AB LEFT-POINTING DOUBLE ANGLE QUOTATION MARK =AC U+00AC NOT SIGN =AD U+00AD SOFT HYPHEN =AE U+00AE REGISTERED SIGN =AF U+203E OVERLINE =B0 U+00B0 DEGREE SIGN =B1 U+00B1 PLUS-MINUS SIGN =B2 U+00B2 SUPERSCRIPT TWO =B3 U+00B3 SUPERSCRIPT THREE =B4 U+00B4 ACUTE ACCENT =B5 U+00B5 MICRO SIGN =B6 U+00B6 PILCROW SIGN =B7 U+00B7 MIDDLE DOT =B8 U+00B8 CEDILLA =B9 U+00B9 SUPERSCRIPT ONE =BA U+00F7 DIVISION SIGN =BB U+00BB RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK =BC U+00BC VULGAR FRACTION ONE QUARTER =BD U+00BD VULGAR FRACTION ONE HALF =BE U+00BE VULGAR FRACTION THREE QUARTERS =DF U+2017 DOUBLE LOW LINE =E0 U+05D0 HEBREW LETTER ALEF =E1 U+05D1 HEBREW LETTER BET =E2 U+05D2 HEBREW LETTER GIMEL =E3 U+05D3 HEBREW LETTER DALET =E4 U+05D4 HEBREW LETTER HE =E5 U+05D5 HEBREW LETTER VAV =E6 U+05D6 HEBREW LETTER ZAYIN =E7 U+05D7 HEBREW LETTER HET =E8 U+05D8 HEBREW LETTER TET =E9 U+05D9 HEBREW LETTER YOD =EA U+05DA HEBREW LETTER FINAL KAF =EB U+05DB HEBREW LETTER KAF =EC U+05DC HEBREW LETTER LAMED =ED U+05DD HEBREW LETTER FINAL MEM =EE U+05DE HEBREW LETTER MEM =EF U+05DF HEBREW LETTER FINAL NUN =F0 U+05E0 HEBREW LETTER NUN =F1 U+05E1 HEBREW LETTER SAMEKH =F2 U+05E2 HEBREW LETTER AYIN =F3 U+05E3 HEBREW LETTER FINAL PE =F4 U+05E4 HEBREW LETTER PE =F5 U+05E5 HEBREW LETTER FINAL TSADI =F6 U+05E6 HEBREW LETTER TSADI =F7 U+05E7 HEBREW LETTER QOF =F8 U+05E8 HEBREW LETTER RESH =F9 U+05E9 HEBREW LETTER SHIN =FA U+05EA HEBREW LETTER TAV pantomime1.2-1.2.2+dfsg1/charsets/iso8859-9.txt000066400000000000000000000145621276751561200206250ustar00rootroot00000000000000=20 U+0020 SPACE =21 U+0021 EXCLAMATION MARK =22 U+0022 QUOTATION MARK =23 U+0023 NUMBER SIGN =24 U+0024 DOLLAR SIGN =25 U+0025 PERCENT SIGN =26 U+0026 AMPERSAND =27 U+0027 APOSTROPHE =28 U+0028 LEFT PARENTHESIS =29 U+0029 RIGHT PARENTHESIS =2A U+002A ASTERISK =2B U+002B PLUS SIGN =2C U+002C COMMA =2D U+002D HYPHEN-MINUS =2E U+002E FULL STOP =2F U+002F SOLIDUS =30 U+0030 DIGIT ZERO =31 U+0031 DIGIT ONE =32 U+0032 DIGIT TWO =33 U+0033 DIGIT THREE =34 U+0034 DIGIT FOUR =35 U+0035 DIGIT FIVE =36 U+0036 DIGIT SIX =37 U+0037 DIGIT SEVEN =38 U+0038 DIGIT EIGHT =39 U+0039 DIGIT NINE =3A U+003A COLON =3B U+003B SEMICOLON =3C U+003C LESS-THAN SIGN =3D U+003D EQUALS SIGN =3E U+003E GREATER-THAN SIGN =3F U+003F QUESTION MARK =40 U+0040 COMMERCIAL AT =41 U+0041 LATIN CAPITAL LETTER A =42 U+0042 LATIN CAPITAL LETTER B =43 U+0043 LATIN CAPITAL LETTER C =44 U+0044 LATIN CAPITAL LETTER D =45 U+0045 LATIN CAPITAL LETTER E =46 U+0046 LATIN CAPITAL LETTER F =47 U+0047 LATIN CAPITAL LETTER G =48 U+0048 LATIN CAPITAL LETTER H =49 U+0049 LATIN CAPITAL LETTER I =4A U+004A LATIN CAPITAL LETTER J =4B U+004B LATIN CAPITAL LETTER K =4C U+004C LATIN CAPITAL LETTER L =4D U+004D LATIN CAPITAL LETTER M =4E U+004E LATIN CAPITAL LETTER N =4F U+004F LATIN CAPITAL LETTER O =50 U+0050 LATIN CAPITAL LETTER P =51 U+0051 LATIN CAPITAL LETTER Q =52 U+0052 LATIN CAPITAL LETTER R =53 U+0053 LATIN CAPITAL LETTER S =54 U+0054 LATIN CAPITAL LETTER T =55 U+0055 LATIN CAPITAL LETTER U =56 U+0056 LATIN CAPITAL LETTER V =57 U+0057 LATIN CAPITAL LETTER W =58 U+0058 LATIN CAPITAL LETTER X =59 U+0059 LATIN CAPITAL LETTER Y =5A U+005A LATIN CAPITAL LETTER Z =5B U+005B LEFT SQUARE BRACKET =5C U+005C REVERSE SOLIDUS =5D U+005D RIGHT SQUARE BRACKET =5E U+005E CIRCUMFLEX ACCENT =5F U+005F LOW LINE =60 U+0060 GRAVE ACCENT =61 U+0061 LATIN SMALL LETTER A =62 U+0062 LATIN SMALL LETTER B =63 U+0063 LATIN SMALL LETTER C =64 U+0064 LATIN SMALL LETTER D =65 U+0065 LATIN SMALL LETTER E =66 U+0066 LATIN SMALL LETTER F =67 U+0067 LATIN SMALL LETTER G =68 U+0068 LATIN SMALL LETTER H =69 U+0069 LATIN SMALL LETTER I =6A U+006A LATIN SMALL LETTER J =6B U+006B LATIN SMALL LETTER K =6C U+006C LATIN SMALL LETTER L =6D U+006D LATIN SMALL LETTER M =6E U+006E LATIN SMALL LETTER N =6F U+006F LATIN SMALL LETTER O =70 U+0070 LATIN SMALL LETTER P =71 U+0071 LATIN SMALL LETTER Q =72 U+0072 LATIN SMALL LETTER R =73 U+0073 LATIN SMALL LETTER S =74 U+0074 LATIN SMALL LETTER T =75 U+0075 LATIN SMALL LETTER U =76 U+0076 LATIN SMALL LETTER V =77 U+0077 LATIN SMALL LETTER W =78 U+0078 LATIN SMALL LETTER X =79 U+0079 LATIN SMALL LETTER Y =7A U+007A LATIN SMALL LETTER Z =7B U+007B LEFT CURLY BRACKET =7C U+007C VERTICAL LINE =7D U+007D RIGHT CURLY BRACKET =7E U+007E TILDE =A0 U+00A0 NO-BREAK SPACE =A1 U+00A1 INVERTED EXCLAMATION MARK =A2 U+00A2 CENT SIGN =A3 U+00A3 POUND SIGN =A4 U+00A4 CURRENCY SIGN =A5 U+00A5 YEN SIGN =A6 U+00A6 BROKEN BAR =A7 U+00A7 SECTION SIGN =A8 U+00A8 DIAERESIS =A9 U+00A9 COPYRIGHT SIGN =AA U+00AA FEMININE ORDINAL INDICATOR =AB U+00AB LEFT-POINTING DOUBLE ANGLE QUOTATION MARK =AC U+00AC NOT SIGN =AD U+00AD SOFT HYPHEN =AE U+00AE REGISTERED SIGN =AF U+00AF MACRON =B0 U+00B0 DEGREE SIGN =B1 U+00B1 PLUS-MINUS SIGN =B2 U+00B2 SUPERSCRIPT TWO =B3 U+00B3 SUPERSCRIPT THREE =B4 U+00B4 ACUTE ACCENT =B5 U+00B5 MICRO SIGN =B6 U+00B6 PILCROW SIGN =B7 U+00B7 MIDDLE DOT =B8 U+00B8 CEDILLA =B9 U+00B9 SUPERSCRIPT ONE =BA U+00BA MASCULINE ORDINAL INDICATOR =BB U+00BB RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK =BC U+00BC VULGAR FRACTION ONE QUARTER =BD U+00BD VULGAR FRACTION ONE HALF =BE U+00BE VULGAR FRACTION THREE QUARTERS =BF U+00BF INVERTED QUESTION MARK =C0 U+00C0 LATIN CAPITAL LETTER A WITH GRAVE =C1 U+00C1 LATIN CAPITAL LETTER A WITH ACUTE =C2 U+00C2 LATIN CAPITAL LETTER A WITH CIRCUMFLEX =C3 U+00C3 LATIN CAPITAL LETTER A WITH TILDE =C4 U+00C4 LATIN CAPITAL LETTER A WITH DIAERESIS =C5 U+00C5 LATIN CAPITAL LETTER A WITH RING ABOVE =C6 U+00C6 LATIN CAPITAL LETTER AE =C7 U+00C7 LATIN CAPITAL LETTER C WITH CEDILLA =C8 U+00C8 LATIN CAPITAL LETTER E WITH GRAVE =C9 U+00C9 LATIN CAPITAL LETTER E WITH ACUTE =CA U+00CA LATIN CAPITAL LETTER E WITH CIRCUMFLEX =CB U+00CB LATIN CAPITAL LETTER E WITH DIAERESIS =CC U+00CC LATIN CAPITAL LETTER I WITH GRAVE =CD U+00CD LATIN CAPITAL LETTER I WITH ACUTE =CE U+00CE LATIN CAPITAL LETTER I WITH CIRCUMFLEX =CF U+00CF LATIN CAPITAL LETTER I WITH DIAERESIS =D0 U+011E LATIN CAPITAL LETTER G WITH BREVE =D1 U+00D1 LATIN CAPITAL LETTER N WITH TILDE =D2 U+00D2 LATIN CAPITAL LETTER O WITH GRAVE =D3 U+00D3 LATIN CAPITAL LETTER O WITH ACUTE =D4 U+00D4 LATIN CAPITAL LETTER O WITH CIRCUMFLEX =D5 U+00D5 LATIN CAPITAL LETTER O WITH TILDE =D6 U+00D6 LATIN CAPITAL LETTER O WITH DIAERESIS =D7 U+00D7 MULTIPLICATION SIGN =D8 U+00D8 LATIN CAPITAL LETTER O WITH STROKE =D9 U+00D9 LATIN CAPITAL LETTER U WITH GRAVE =DA U+00DA LATIN CAPITAL LETTER U WITH ACUTE =DB U+00DB LATIN CAPITAL LETTER U WITH CIRCUMFLEX =DC U+00DC LATIN CAPITAL LETTER U WITH DIAERESIS =DD U+0130 LATIN CAPITAL LETTER I WITH DOT ABOVE =DE U+015E LATIN CAPITAL LETTER S WITH CEDILLA =DF U+00DF LATIN SMALL LETTER SHARP S =E0 U+00E0 LATIN SMALL LETTER A WITH GRAVE =E1 U+00E1 LATIN SMALL LETTER A WITH ACUTE =E2 U+00E2 LATIN SMALL LETTER A WITH CIRCUMFLEX =E3 U+00E3 LATIN SMALL LETTER A WITH TILDE =E4 U+00E4 LATIN SMALL LETTER A WITH DIAERESIS =E5 U+00E5 LATIN SMALL LETTER A WITH RING ABOVE =E6 U+00E6 LATIN SMALL LETTER AE =E7 U+00E7 LATIN SMALL LETTER C WITH CEDILLA =E8 U+00E8 LATIN SMALL LETTER E WITH GRAVE =E9 U+00E9 LATIN SMALL LETTER E WITH ACUTE =EA U+00EA LATIN SMALL LETTER E WITH CIRCUMFLEX =EB U+00EB LATIN SMALL LETTER E WITH DIAERESIS =EC U+00EC LATIN SMALL LETTER I WITH GRAVE =ED U+00ED LATIN SMALL LETTER I WITH ACUTE =EE U+00EE LATIN SMALL LETTER I WITH CIRCUMFLEX =EF U+00EF LATIN SMALL LETTER I WITH DIAERESIS =F0 U+011F LATIN SMALL LETTER G WITH BREVE =F1 U+00F1 LATIN SMALL LETTER N WITH TILDE =F2 U+00F2 LATIN SMALL LETTER O WITH GRAVE =F3 U+00F3 LATIN SMALL LETTER O WITH ACUTE =F4 U+00F4 LATIN SMALL LETTER O WITH CIRCUMFLEX =F5 U+00F5 LATIN SMALL LETTER O WITH TILDE =F6 U+00F6 LATIN SMALL LETTER O WITH DIAERESIS =F7 U+00F7 DIVISION SIGN =F8 U+00F8 LATIN SMALL LETTER O WITH STROKE =F9 U+00F9 LATIN SMALL LETTER U WITH GRAVE =FA U+00FA LATIN SMALL LETTER U WITH ACUTE =FB U+00FB LATIN SMALL LETTER U WITH CIRCUMFLEX =FC U+00FC LATIN SMALL LETTER U WITH DIAERESIS =FD U+0131 LATIN SMALL LETTER DOTLESS I =FE U+015F LATIN SMALL LETTER S WITH CEDILLA =FF U+00FF LATIN SMALL LETTER Y WITH DIAERESIS pantomime1.2-1.2.2+dfsg1/charsets/koi8-r.txt000066400000000000000000000172321276751561200204350ustar00rootroot00000000000000=20 U+0020 SPACE =21 U+0021 EXCLAMATION MARK =22 U+0022 QUOTATION MARK =23 U+0023 NUMBER SIGN =24 U+0024 DOLLAR SIGN =25 U+0025 PERCENT SIGN =26 U+0026 AMPERSAND =27 U+0027 APOSTROPHE =28 U+0028 LEFT PARENTHESIS =29 U+0029 RIGHT PARENTHESIS =2A U+002A ASTERISK =2B U+002B PLUS SIGN =2C U+002C COMMA =2D U+002D HYPHEN-MINUS =2E U+002E FULL STOP =2F U+002F SOLIDUS =30 U+0030 DIGIT ZERO =31 U+0031 DIGIT ONE =32 U+0032 DIGIT TWO =33 U+0033 DIGIT THREE =34 U+0034 DIGIT FOUR =35 U+0035 DIGIT FIVE =36 U+0036 DIGIT SIX =37 U+0037 DIGIT SEVEN =38 U+0038 DIGIT EIGHT =39 U+0039 DIGIT NINE =3A U+003A COLON =3B U+003B SEMICOLON =3C U+003C LESS-THAN SIGN =3D U+003D EQUALS SIGN =3E U+003E GREATER-THAN SIGN =3F U+003F QUESTION MARK =40 U+0040 COMMERCIAL AT =41 U+0041 LATIN CAPITAL LETTER A =42 U+0042 LATIN CAPITAL LETTER B =43 U+0043 LATIN CAPITAL LETTER C =44 U+0044 LATIN CAPITAL LETTER D =45 U+0045 LATIN CAPITAL LETTER E =46 U+0046 LATIN CAPITAL LETTER F =47 U+0047 LATIN CAPITAL LETTER G =48 U+0048 LATIN CAPITAL LETTER H =49 U+0049 LATIN CAPITAL LETTER I =4A U+004A LATIN CAPITAL LETTER J =4B U+004B LATIN CAPITAL LETTER K =4C U+004C LATIN CAPITAL LETTER L =4D U+004D LATIN CAPITAL LETTER M =4E U+004E LATIN CAPITAL LETTER N =4F U+004F LATIN CAPITAL LETTER O =50 U+0050 LATIN CAPITAL LETTER P =51 U+0051 LATIN CAPITAL LETTER Q =52 U+0052 LATIN CAPITAL LETTER R =53 U+0053 LATIN CAPITAL LETTER S =54 U+0054 LATIN CAPITAL LETTER T =55 U+0055 LATIN CAPITAL LETTER U =56 U+0056 LATIN CAPITAL LETTER V =57 U+0057 LATIN CAPITAL LETTER W =58 U+0058 LATIN CAPITAL LETTER X =59 U+0059 LATIN CAPITAL LETTER Y =5A U+005A LATIN CAPITAL LETTER Z =5B U+005B LEFT SQUARE BRACKET =5C U+005C REVERSE SOLIDUS =5D U+005D RIGHT SQUARE BRACKET =5E U+005E CIRCUMFLEX ACCENT =5F U+005F LOW LINE =60 U+0060 GRAVE ACCENT =61 U+0061 LATIN SMALL LETTER A =62 U+0062 LATIN SMALL LETTER B =63 U+0063 LATIN SMALL LETTER C =64 U+0064 LATIN SMALL LETTER D =65 U+0065 LATIN SMALL LETTER E =66 U+0066 LATIN SMALL LETTER F =67 U+0067 LATIN SMALL LETTER G =68 U+0068 LATIN SMALL LETTER H =69 U+0069 LATIN SMALL LETTER I =6A U+006A LATIN SMALL LETTER J =6B U+006B LATIN SMALL LETTER K =6C U+006C LATIN SMALL LETTER L =6D U+006D LATIN SMALL LETTER M =6E U+006E LATIN SMALL LETTER N =6F U+006F LATIN SMALL LETTER O =70 U+0070 LATIN SMALL LETTER P =71 U+0071 LATIN SMALL LETTER Q =72 U+0072 LATIN SMALL LETTER R =73 U+0073 LATIN SMALL LETTER S =74 U+0074 LATIN SMALL LETTER T =75 U+0075 LATIN SMALL LETTER U =76 U+0076 LATIN SMALL LETTER V =77 U+0077 LATIN SMALL LETTER W =78 U+0078 LATIN SMALL LETTER X =79 U+0079 LATIN SMALL LETTER Y =7A U+007A LATIN SMALL LETTER Z =7B U+007B LEFT CURLY BRACKET =7C U+007C VERTICAL LINE =7D U+007D RIGHT CURLY BRACKET =7E U+007E TILDE =7F U+007F DELETE (DEL) =80 U+2500 BOX DRAWINGS LIGHT HORIZONTAL =81 U+2502 BOX DRAWINGS LIGHT VERTICAL =82 U+250C BOX DRAWINGS LIGHT DOWN AND RIGHT =83 U+2510 BOX DRAWINGS LIGHT DOWN AND LEFT =84 U+2514 BOX DRAWINGS LIGHT UP AND RIGHT =85 U+2518 BOX DRAWINGS LIGHT UP AND LEFT =86 U+251C BOX DRAWINGS LIGHT VERTICAL AND RIGHT =87 U+2524 BOX DRAWINGS LIGHT VERTICAL AND LEFT =88 U+252C BOX DRAWINGS LIGHT DOWN AND HORIZONTAL =89 U+2534 BOX DRAWINGS LIGHT UP AND HORIZONTAL =8A U+253C BOX DRAWINGS LIGHT VERTICAL AND HORIZONTAL =8B U+2580 UPPER HALF BLOCK =8C U+2584 LOWER HALF BLOCK =8D U+2588 FULL BLOCK =8E U+258C LEFT HALF BLOCK =8F U+2590 RIGHT HALF BLOCK =90 U+2591 LIGHT SHADE =91 U+2592 MEDIUM SHADE =92 U+2593 DARK SHADE =93 U+2320 TOP HALF INTEGRAL =94 U+25A0 BLACK SQUARE =95 U+2219 BULLET OPERATOR =96 U+221A SQUARE ROOT =97 U+2248 ALMOST EQUAL TO =98 U+2264 LESS-THAN OR EQUAL TO =99 U+2265 GREATER-THAN OR EQUAL TO =9A U+00A0 NO-BREAK SPACE =9B U+2321 BOTTOM HALF INTEGRAL =9C U+00B0 DEGREE SIGN =9D U+00B2 SUPERSCRIPT TWO =9E U+00B7 MIDDLE DOT =9F U+00F7 DIVISION SIGN =A0 U+2550 BOX DRAWINGS DOUBLE HORIZONTAL =A1 U+2551 BOX DRAWINGS DOUBLE VERTICAL =A2 U+2552 BOX DRAWINGS DOWN SINGLE AND RIGHT DOUBLE =A3 U+0451 CYRILLIC SMALL LETTER IO =A4 U+2553 BOX DRAWINGS DOWN DOUBLE AND RIGHT SINGLE =A5 U+2554 BOX DRAWINGS DOUBLE DOWN AND RIGHT =A6 U+2555 BOX DRAWINGS DOWN SINGLE AND LEFT DOUBLE =A7 U+2556 BOX DRAWINGS DOWN DOUBLE AND LEFT SINGLE =A8 U+2557 BOX DRAWINGS DOUBLE DOWN AND LEFT =A9 U+2558 BOX DRAWINGS UP SINGLE AND RIGHT DOUBLE =AA U+2559 BOX DRAWINGS UP DOUBLE AND RIGHT SINGLE =AB U+255A BOX DRAWINGS DOUBLE UP AND RIGHT =AC U+255B BOX DRAWINGS UP SINGLE AND LEFT DOUBLE =AD U+255C BOX DRAWINGS UP DOUBLE AND LEFT SINGLE =AE U+255D BOX DRAWINGS DOUBLE UP AND LEFT =AF U+255E BOX DRAWINGS VERTICAL SINGLE AND RIGHT DOUBLE =B0 U+255F BOX DRAWINGS VERTICAL DOUBLE AND RIGHT SINGLE =B1 U+2560 BOX DRAWINGS DOUBLE VERTICAL AND RIGHT =B2 U+2561 BOX DRAWINGS VERTICAL SINGLE AND LEFT DOUBLE =B3 U+0401 CYRILLIC CAPITAL LETTER IO =B4 U+2562 BOX DRAWINGS VERTICAL DOUBLE AND LEFT SINGLE =B5 U+2563 BOX DRAWINGS DOUBLE VERTICAL AND LEFT =B6 U+2564 BOX DRAWINGS DOWN SINGLE AND HORIZONTAL DOUBLE =B7 U+2565 BOX DRAWINGS DOWN DOUBLE AND HORIZONTAL SINGLE =B8 U+2566 BOX DRAWINGS DOUBLE DOWN AND HORIZONTAL =B9 U+2567 BOX DRAWINGS UP SINGLE AND HORIZONTAL DOUBLE =BA U+2568 BOX DRAWINGS UP DOUBLE AND HORIZONTAL SINGLE =BB U+2569 BOX DRAWINGS DOUBLE UP AND HORIZONTAL =BC U+256A BOX DRAWINGS VERTICAL SINGLE AND HORIZONTAL DOUBLE =BD U+256B BOX DRAWINGS VERTICAL DOUBLE AND HORIZONTAL SINGLE =BE U+256C BOX DRAWINGS DOUBLE VERTICAL AND HORIZONTAL =BF U+00A9 COPYRIGHT SIGN =C0 U+044E CYRILLIC SMALL LETTER YU =C1 U+0430 CYRILLIC SMALL LETTER A =C2 U+0431 CYRILLIC SMALL LETTER BE =C3 U+0446 CYRILLIC SMALL LETTER TSE =C4 U+0434 CYRILLIC SMALL LETTER DE =C5 U+0435 CYRILLIC SMALL LETTER IE =C6 U+0444 CYRILLIC SMALL LETTER EF =C7 U+0433 CYRILLIC SMALL LETTER GHE =C8 U+0445 CYRILLIC SMALL LETTER HA =C9 U+0438 CYRILLIC SMALL LETTER I =CA U+0439 CYRILLIC SMALL LETTER SHORT I =CB U+043A CYRILLIC SMALL LETTER KA =CC U+043B CYRILLIC SMALL LETTER EL =CD U+043C CYRILLIC SMALL LETTER EM =CE U+043D CYRILLIC SMALL LETTER EN =CF U+043E CYRILLIC SMALL LETTER O =D0 U+043F CYRILLIC SMALL LETTER PE =D1 U+044F CYRILLIC SMALL LETTER YA =D2 U+0440 CYRILLIC SMALL LETTER ER =D3 U+0441 CYRILLIC SMALL LETTER ES =D4 U+0442 CYRILLIC SMALL LETTER TE =D5 U+0443 CYRILLIC SMALL LETTER U =D6 U+0436 CYRILLIC SMALL LETTER ZHE =D7 U+0432 CYRILLIC SMALL LETTER VE =D8 U+044C CYRILLIC SMALL LETTER SOFT SIGN =D9 U+044B CYRILLIC SMALL LETTER YERU =DA U+0437 CYRILLIC SMALL LETTER ZE =DB U+0448 CYRILLIC SMALL LETTER SHA =DC U+044D CYRILLIC SMALL LETTER E =DD U+0449 CYRILLIC SMALL LETTER SHCHA =DE U+0447 CYRILLIC SMALL LETTER CHE =DF U+044A CYRILLIC SMALL LETTER HARD SIGN =E0 U+042E CYRILLIC CAPITAL LETTER YU =E1 U+0410 CYRILLIC CAPITAL LETTER A =E2 U+0411 CYRILLIC CAPITAL LETTER BE =E3 U+0426 CYRILLIC CAPITAL LETTER TSE =E4 U+0414 CYRILLIC CAPITAL LETTER DE =E5 U+0415 CYRILLIC CAPITAL LETTER IE =E6 U+0424 CYRILLIC CAPITAL LETTER EF =E7 U+0413 CYRILLIC CAPITAL LETTER GHE =E8 U+0425 CYRILLIC CAPITAL LETTER HA =E9 U+0418 CYRILLIC CAPITAL LETTER I =EA U+0419 CYRILLIC CAPITAL LETTER SHORT I =EB U+041A CYRILLIC CAPITAL LETTER KA =EC U+041B CYRILLIC CAPITAL LETTER EL =ED U+041C CYRILLIC CAPITAL LETTER EM =EE U+041D CYRILLIC CAPITAL LETTER EN =EF U+041E CYRILLIC CAPITAL LETTER O =F0 U+041F CYRILLIC CAPITAL LETTER PE =F1 U+042F CYRILLIC CAPITAL LETTER YA =F2 U+0420 CYRILLIC CAPITAL LETTER ER =F3 U+0421 CYRILLIC CAPITAL LETTER ES =F4 U+0422 CYRILLIC CAPITAL LETTER TE =F5 U+0423 CYRILLIC CAPITAL LETTER U =F6 U+0416 CYRILLIC CAPITAL LETTER ZHE =F7 U+0412 CYRILLIC CAPITAL LETTER VE =F8 U+042C CYRILLIC CAPITAL LETTER SOFT SIGN =F9 U+042B CYRILLIC CAPITAL LETTER YERU =FA U+0417 CYRILLIC CAPITAL LETTER ZE =FB U+0428 CYRILLIC CAPITAL LETTER SHA =FC U+042D CYRILLIC CAPITAL LETTER E =FD U+0429 CYRILLIC CAPITAL LETTER SHCHA =FE U+0427 CYRILLIC CAPITAL LETTER CHE =FF U+042A CYRILLIC CAPITAL LETTER HARD SIGN pantomime1.2-1.2.2+dfsg1/charsets/koi8-u.txt000066400000000000000000000171661276751561200204460ustar00rootroot00000000000000=20 U+0020 SPACE =21 U+0021 EXCLAMATION MARK =22 U+0022 QUOTATION MARK =23 U+0023 NUMBER SIGN =24 U+0024 DOLLAR SIGN =25 U+0025 PERCENT SIGN =26 U+0026 AMPERSAND =27 U+0027 APOSTROPHE =28 U+0028 LEFT PARENTHESIS =29 U+0029 RIGHT PARENTHESIS =2A U+002A ASTERISK =2B U+002B PLUS SIGN =2C U+002C COMMA =2D U+002D HYPHEN-MINUS =2E U+002E FULL STOP =2F U+002F SOLIDUS =30 U+0030 DIGIT ZERO =31 U+0031 DIGIT ONE =32 U+0032 DIGIT TWO =33 U+0033 DIGIT THREE =34 U+0034 DIGIT FOUR =35 U+0035 DIGIT FIVE =36 U+0036 DIGIT SIX =37 U+0037 DIGIT SEVEN =38 U+0038 DIGIT EIGHT =39 U+0039 DIGIT NINE =3A U+003A COLON =3B U+003B SEMICOLON =3C U+003C LESS-THAN SIGN =3D U+003D EQUALS SIGN =3E U+003E GREATER-THAN SIGN =3F U+003F QUESTION MARK =40 U+0040 COMMERCIAL AT =41 U+0041 LATIN CAPITAL LETTER A =42 U+0042 LATIN CAPITAL LETTER B =43 U+0043 LATIN CAPITAL LETTER C =44 U+0044 LATIN CAPITAL LETTER D =45 U+0045 LATIN CAPITAL LETTER E =46 U+0046 LATIN CAPITAL LETTER F =47 U+0047 LATIN CAPITAL LETTER G =48 U+0048 LATIN CAPITAL LETTER H =49 U+0049 LATIN CAPITAL LETTER I =4A U+004A LATIN CAPITAL LETTER J =4B U+004B LATIN CAPITAL LETTER K =4C U+004C LATIN CAPITAL LETTER L =4D U+004D LATIN CAPITAL LETTER M =4E U+004E LATIN CAPITAL LETTER N =4F U+004F LATIN CAPITAL LETTER O =50 U+0050 LATIN CAPITAL LETTER P =51 U+0051 LATIN CAPITAL LETTER Q =52 U+0052 LATIN CAPITAL LETTER R =53 U+0053 LATIN CAPITAL LETTER S =54 U+0054 LATIN CAPITAL LETTER T =55 U+0055 LATIN CAPITAL LETTER U =56 U+0056 LATIN CAPITAL LETTER V =57 U+0057 LATIN CAPITAL LETTER W =58 U+0058 LATIN CAPITAL LETTER X =59 U+0059 LATIN CAPITAL LETTER Y =5A U+005A LATIN CAPITAL LETTER Z =5B U+005B LEFT SQUARE BRACKET =5C U+005C REVERSE SOLIDUS =5D U+005D RIGHT SQUARE BRACKET =5E U+005E CIRCUMFLEX ACCENT =5F U+005F LOW LINE =60 U+0060 GRAVE ACCENT =61 U+0061 LATIN SMALL LETTER A =62 U+0062 LATIN SMALL LETTER B =63 U+0063 LATIN SMALL LETTER C =64 U+0064 LATIN SMALL LETTER D =65 U+0065 LATIN SMALL LETTER E =66 U+0066 LATIN SMALL LETTER F =67 U+0067 LATIN SMALL LETTER G =68 U+0068 LATIN SMALL LETTER H =69 U+0069 LATIN SMALL LETTER I =6A U+006A LATIN SMALL LETTER J =6B U+006B LATIN SMALL LETTER K =6C U+006C LATIN SMALL LETTER L =6D U+006D LATIN SMALL LETTER M =6E U+006E LATIN SMALL LETTER N =6F U+006F LATIN SMALL LETTER O =70 U+0070 LATIN SMALL LETTER P =71 U+0071 LATIN SMALL LETTER Q =72 U+0072 LATIN SMALL LETTER R =73 U+0073 LATIN SMALL LETTER S =74 U+0074 LATIN SMALL LETTER T =75 U+0075 LATIN SMALL LETTER U =76 U+0076 LATIN SMALL LETTER V =77 U+0077 LATIN SMALL LETTER W =78 U+0078 LATIN SMALL LETTER X =79 U+0079 LATIN SMALL LETTER Y =7A U+007A LATIN SMALL LETTER Z =7B U+007B LEFT CURLY BRACKET =7C U+007C VERTICAL LINE =7D U+007D RIGHT CURLY BRACKET =7E U+007E TILDE =7F U+007F DELETE (DEL) =80 U+2500 BOX DRAWINGS LIGHT HORIZONTAL =81 U+2502 BOX DRAWINGS LIGHT VERTICAL =82 U+250C BOX DRAWINGS LIGHT DOWN AND RIGHT =83 U+2510 BOX DRAWINGS LIGHT DOWN AND LEFT =84 U+2514 BOX DRAWINGS LIGHT UP AND RIGHT =85 U+2518 BOX DRAWINGS LIGHT UP AND LEFT =86 U+251C BOX DRAWINGS LIGHT VERTICAL AND RIGHT =87 U+2524 BOX DRAWINGS LIGHT VERTICAL AND LEFT =88 U+252C BOX DRAWINGS LIGHT DOWN AND HORIZONTAL =89 U+2534 BOX DRAWINGS LIGHT UP AND HORIZONTAL =8A U+253C BOX DRAWINGS LIGHT VERTICAL AND HORIZONTAL =8B U+2580 UPPER HALF BLOCK =8C U+2584 LOWER HALF BLOCK =8D U+2588 FULL BLOCK =8E U+258C LEFT HALF BLOCK =8F U+2590 RIGHT HALF BLOCK =90 U+2591 LIGHT SHADE =91 U+2592 MEDIUM SHADE =92 U+2593 DARK SHADE =93 U+2320 TOP HALF INTEGRAL =94 U+25A0 BLACK SQUARE =95 U+2219 BULLET OPERATOR =96 U+221A SQUARE ROOT =97 U+2248 ALMOST EQUAL TO =98 U+2264 LESS THAN OR EQUAL TO =99 U+2265 GREATER THAN OR EQUAL TO =9A U+00A0 NO-BREAK SPACE =9B U+2321 BOTTOM HALF INTEGRAL =9C U+00B0 DEGREE SIGN =9D U+00B2 SUPERSCRIPT DIGIT TWO =9E U+00B7 MIDDLE DOT =9F U+00F7 DIVISION SIGN =A0 U+2550 BOX DRAWINGS DOUBLE HORIZONTAL =A1 U+2551 BOX DRAWINGS DOUBLE VERTICAL =A2 U+2552 BOX DRAWINGS DOWN SINGLE AND RIGHT DOUBLE =A3 U+0451 CYRILLIC SMALL LETTER IO =A4 U+0454 CYRILLIC SMALL LETTER UKRAINIAN IE =A5 U+2554 BOX DRAWINGS DOUBLE DOWN AND RIGHT =A6 U+0456 CYRILLIC SMALL LETTER BYELORUSSIAN-UKRAINIAN I =A7 U+0457 CYRILLIC SMALL LETTER YI (Ukrainian) =A8 U+2557 BOX DRAWINGS DOUBLE DOWN AND LEFT =A9 U+2558 BOX DRAWINGS UP SINGLE AND RIGHT DOUBLE =AA U+2559 BOX DRAWINGS UP DOUBLE AND RIGHT SINGLE =AB U+255A BOX DRAWINGS DOUBLE UP AND RIGHT =AC U+255B BOX DRAWINGS UP SINGLE AND LEFT DOUBLE =AD U+0491 CYRILLIC SMALL LETTER GHE WITH UPTURN =AE U+255D BOX DRAWINGS DOUBLE UP AND LEFT =AF U+255E BOX DRAWINGS VERTICAL SINGLE AND RIGHT DOUBLE =B0 U+255F BOX DRAWINGS VERTICAL DOUBLE AND RIGHT SINGLE =B1 U+2560 BOX DRAWINGS DOUBLE VERTICAL AND RIGHT =B2 U+2561 BOX DRAWINGS VERTICAL SINGLE AND LEFT DOUBLE =B3 U+0401 CYRILLIC CAPITAL LETTER IO =B4 U+0404 CYRILLIC CAPITAL LETTER UKRAINIAN IE =B5 U+2563 DOUBLE VERTICAL AND LEFT =B6 U+0406 CYRILLIC CAPITAL LETTER BYELORUSSIAN-UKRAINIAN I =B7 U+0407 CYRILLIC CAPITAL LETTER YI (Ukrainian) =B8 U+2566 BOX DRAWINGS DOUBLE DOWN AND HORIZONTAL =B9 U+2567 BOX DRAWINGS UP SINGLE AND HORIZONTAL DOUBLE =BA U+2568 BOX DRAWINGS UP DOUBLE AND HORIZONTAL SINGLE =BB U+2569 BOX DRAWINGS DOUBLE UP AND HORIZONTAL =BC U+256A BOX DRAWINGS VERTICAL SINGLE AND HORIZONTAL DOUBLE =BD U+0490 CYRILLIC CAPITAL LETTER GHE WITH UPTURN =BE U+256C BOX DRAWINGS DOUBLE VERTICAL AND HORIZONTAL =BF U+00A9 COPYRIGHT SIGN =C0 U+044E CYRILLIC SMALL LETTER YU =C1 U+0430 CYRILLIC SMALL LETTER A =C2 U+0431 CYRILLIC SMALL LETTER BE =C3 U+0446 CYRILLIC SMALL LETTER TSE =C4 U+0434 CYRILLIC SMALL LETTER DE =C5 U+0435 CYRILLIC SMALL LETTER IE =C6 U+0444 CYRILLIC SMALL LETTER EF =C7 U+0433 CYRILLIC SMALL LETTER GHE =C8 U+0445 CYRILLIC SMALL LETTER HA =C9 U+0438 CYRILLIC SMALL LETTER I =CA U+0439 CYRILLIC SMALL LETTER SHORT I =CB U+043A CYRILLIC SMALL LETTER KA =CC U+043B CYRILLIC SMALL LETTER EL =CD U+043C CYRILLIC SMALL LETTER EM =CE U+043D CYRILLIC SMALL LETTER EN =CF U+043E CYRILLIC SMALL LETTER O =D0 U+043F CYRILLIC SMALL LETTER PE =D1 U+044F CYRILLIC SMALL LETTER YA =D2 U+0440 CYRILLIC SMALL LETTER ER =D3 U+0441 CYRILLIC SMALL LETTER ES =D4 U+0442 CYRILLIC SMALL LETTER TE =D5 U+0443 CYRILLIC SMALL LETTER U =D6 U+0436 CYRILLIC SMALL LETTER ZHE =D7 U+0432 CYRILLIC SMALL LETTER VE =D8 U+044C CYRILLIC SMALL LETTER SOFT SIGN =D9 U+044B CYRILLIC SMALL LETTER YERU =DA U+0437 CYRILLIC SMALL LETTER ZE =DB U+0448 CYRILLIC SMALL LETTER SHA =DC U+044D CYRILLIC SMALL LETTER E =DD U+0449 CYRILLIC SMALL LETTER SHCHA =DE U+0447 CYRILLIC SMALL LETTER CHE =DF U+044A CYRILLIC SMALL LETTER HARD SIGN =E0 U+042E CYRILLIC CAPITAL LETTER YU =E1 U+0410 CYRILLIC CAPITAL LETTER A =E2 U+0411 CYRILLIC CAPITAL LETTER BE =E3 U+0426 CYRILLIC CAPITAL LETTER TSE =E4 U+0414 CYRILLIC CAPITAL LETTER DE =E5 U+0415 CYRILLIC CAPITAL LETTER IE =E6 U+0424 CYRILLIC CAPITAL LETTER EF =E7 U+0413 CYRILLIC CAPITAL LETTER GHE =E8 U+0425 CYRILLIC CAPITAL LETTER HA =E9 U+0418 CYRILLIC CAPITAL LETTER I =EA U+0419 CYRILLIC CAPITAL LETTER SHORT I =EB U+041A CYRILLIC CAPITAL LETTER KA =EC U+041B CYRILLIC CAPITAL LETTER EL =ED U+041C CYRILLIC CAPITAL LETTER EM =EE U+041D CYRILLIC CAPITAL LETTER EN =EF U+041E CYRILLIC CAPITAL LETTER O =F0 U+041F CYRILLIC CAPITAL LETTER PE =F1 U+042F CYRILLIC CAPITAL LETTER YA =F2 U+0420 CYRILLIC CAPITAL LETTER ER =F3 U+0421 CYRILLIC CAPITAL LETTER ES =F4 U+0422 CYRILLIC CAPITAL LETTER TE =F5 U+0423 CYRILLIC CAPITAL LETTER U =F6 U+0416 CYRILLIC CAPITAL LETTER ZHE =F7 U+0412 CYRILLIC CAPITAL LETTER VE =F8 U+042C CYRILLIC CAPITAL LETTER SOFT SIGN =F9 U+042B CYRILLIC CAPITAL LETTER YERU =FA U+0417 CYRILLIC CAPITAL LETTER ZE =FB U+0428 CYRILLIC CAPITAL LETTER SHA =FC U+042D CYRILLIC CAPITAL LETTER E =FD U+0429 CYRILLIC CAPITAL LETTER SHCHA =FE U+0427 CYRILLIC CAPITAL LETTER CHE =FF U+042A CYRILLIC CAPITAL LETTER HARD SIGN pantomime1.2-1.2.2+dfsg1/charsets/update_sets.sh000077500000000000000000000002071276751561200214340ustar00rootroot00000000000000for I in *.txt; do echo $I openapp CharsetDecoder.app $I > `echo $I | tr a-z- A-Z_ | sed "s:\(.*\).TXT:../Source/\1.m:g"` done pantomime1.2-1.2.2+dfsg1/charsets/windows-1250.txt000066400000000000000000000166361276751561200214120ustar00rootroot00000000000000=20 U+0020 SPACE =21 U+0021 EXCLAMATION MARK =22 U+0022 QUOTATION MARK =23 U+0023 NUMBER SIGN =24 U+0024 DOLLAR SIGN =25 U+0025 PERCENT SIGN =26 U+0026 AMPERSAND =27 U+0027 APOSTROPHE =28 U+0028 LEFT PARENTHESIS =29 U+0029 RIGHT PARENTHESIS =2A U+002A ASTERISK =2B U+002B PLUS SIGN =2C U+002C COMMA =2D U+002D HYPHEN-MINUS =2E U+002E FULL STOP =2F U+002F SOLIDUS =30 U+0030 DIGIT ZERO =31 U+0031 DIGIT ONE =32 U+0032 DIGIT TWO =33 U+0033 DIGIT THREE =34 U+0034 DIGIT FOUR =35 U+0035 DIGIT FIVE =36 U+0036 DIGIT SIX =37 U+0037 DIGIT SEVEN =38 U+0038 DIGIT EIGHT =39 U+0039 DIGIT NINE =3A U+003A COLON =3B U+003B SEMICOLON =3C U+003C LESS-THAN SIGN =3D U+003D EQUALS SIGN =3E U+003E GREATER-THAN SIGN =3F U+003F QUESTION MARK =40 U+0040 COMMERCIAL AT =41 U+0041 LATIN CAPITAL LETTER A =42 U+0042 LATIN CAPITAL LETTER B =43 U+0043 LATIN CAPITAL LETTER C =44 U+0044 LATIN CAPITAL LETTER D =45 U+0045 LATIN CAPITAL LETTER E =46 U+0046 LATIN CAPITAL LETTER F =47 U+0047 LATIN CAPITAL LETTER G =48 U+0048 LATIN CAPITAL LETTER H =49 U+0049 LATIN CAPITAL LETTER I =4A U+004A LATIN CAPITAL LETTER J =4B U+004B LATIN CAPITAL LETTER K =4C U+004C LATIN CAPITAL LETTER L =4D U+004D LATIN CAPITAL LETTER M =4E U+004E LATIN CAPITAL LETTER N =4F U+004F LATIN CAPITAL LETTER O =50 U+0050 LATIN CAPITAL LETTER P =51 U+0051 LATIN CAPITAL LETTER Q =52 U+0052 LATIN CAPITAL LETTER R =53 U+0053 LATIN CAPITAL LETTER S =54 U+0054 LATIN CAPITAL LETTER T =55 U+0055 LATIN CAPITAL LETTER U =56 U+0056 LATIN CAPITAL LETTER V =57 U+0057 LATIN CAPITAL LETTER W =58 U+0058 LATIN CAPITAL LETTER X =59 U+0059 LATIN CAPITAL LETTER Y =5A U+005A LATIN CAPITAL LETTER Z =5B U+005B LEFT SQUARE BRACKET =5C U+005C REVERSE SOLIDUS =5D U+005D RIGHT SQUARE BRACKET =5E U+005E CIRCUMFLEX ACCENT =5F U+005F LOW LINE =60 U+0060 GRAVE ACCENT =61 U+0061 LATIN SMALL LETTER A =62 U+0062 LATIN SMALL LETTER B =63 U+0063 LATIN SMALL LETTER C =64 U+0064 LATIN SMALL LETTER D =65 U+0065 LATIN SMALL LETTER E =66 U+0066 LATIN SMALL LETTER F =67 U+0067 LATIN SMALL LETTER G =68 U+0068 LATIN SMALL LETTER H =69 U+0069 LATIN SMALL LETTER I =6A U+006A LATIN SMALL LETTER J =6B U+006B LATIN SMALL LETTER K =6C U+006C LATIN SMALL LETTER L =6D U+006D LATIN SMALL LETTER M =6E U+006E LATIN SMALL LETTER N =6F U+006F LATIN SMALL LETTER O =70 U+0070 LATIN SMALL LETTER P =71 U+0071 LATIN SMALL LETTER Q =72 U+0072 LATIN SMALL LETTER R =73 U+0073 LATIN SMALL LETTER S =74 U+0074 LATIN SMALL LETTER T =75 U+0075 LATIN SMALL LETTER U =76 U+0076 LATIN SMALL LETTER V =77 U+0077 LATIN SMALL LETTER W =78 U+0078 LATIN SMALL LETTER X =79 U+0079 LATIN SMALL LETTER Y =7A U+007A LATIN SMALL LETTER Z =7B U+007B LEFT CURLY BRACKET =7C U+007C VERTICAL LINE =7D U+007D RIGHT CURLY BRACKET =7E U+007E TILDE =80 U+20AC EURO SIGN =82 U+201A SINGLE LOW-9 QUOTATION MARK =84 U+201E DOUBLE LOW-9 QUOTATION MARK =85 U+2026 HORIZONTAL ELLIPSIS =86 U+2020 DAGGER =87 U+2021 DOUBLE DAGGER =89 U+2030 PER MILLE SIGN =8A U+0160 LATIN CAPITAL LETTER S WITH CARON =8B U+2039 SINGLE LEFT-POINTING ANGLE QUOTATION MARK =8C U+015A LATIN CAPITAL LETTER S WITH ACUTE =8D U+0164 LATIN CAPITAL LETTER T WITH CARON =8E U+017D LATIN CAPITAL LETTER Z WITH CARON =8F U+0179 LATIN CAPITAL LETTER Z WITH ACUTE =91 U+2018 LEFT SINGLE QUOTATION MARK =92 U+2019 RIGHT SINGLE QUOTATION MARK =93 U+201C LEFT DOUBLE QUOTATION MARK =94 U+201D RIGHT DOUBLE QUOTATION MARK =95 U+2022 BULLET =96 U+2013 EN DASH =97 U+2014 EM DASH =99 U+2122 TRADE MARK SIGN =9A U+0161 LATIN SMALL LETTER S WITH CARON =9B U+203A SINGLE RIGHT-POINTING ANGLE QUOTATION MARK =9C U+015B LATIN SMALL LETTER S WITH ACUTE =9D U+0165 LATIN SMALL LETTER T WITH CARON =9E U+017E LATIN SMALL LETTER Z WITH CARON =9F U+017A LATIN SMALL LETTER Z WITH ACUTE =A0 U+00A0 NO-BREAK SPACE =A1 U+02C7 CARON =A2 U+02D8 BREVE =A3 U+0141 LATIN CAPITAL LETTER L WITH STROKE =A4 U+00A4 CURRENCY SIGN =A5 U+0104 LATIN CAPITAL LETTER A WITH OGONEK =A6 U+00A6 BROKEN BAR =A7 U+00A7 SECTION SIGN =A8 U+00A8 DIAERESIS =A9 U+00A9 COPYRIGHT SIGN =AA U+015E LATIN CAPITAL LETTER S WITH CEDILLA =AB U+00AB LEFT-POINTING DOUBLE ANGLE QUOTATION MARK =AD U+00AD SOFT HYPHEN =AE U+00AE REGISTERED SIGN =AF U+017B LATIN CAPITAL LETTER Z WITH DOT ABOVE =B0 U+00B0 DEGREE SIGN =B1 U+00B1 PLUS-MINUS SIGN =B2 U+02DB OGONEK =B3 U+0142 LATIN SMALL LETTER L WITH STROKE =B4 U+00B4 ACUTE ACCENT =B5 U+00B5 MICRO SIGN =B6 U+00B6 PILCROW SIGN =B7 U+00B7 MIDDLE DOT =B8 U+00B8 CEDILLA =B9 U+0105 LATIN SMALL LETTER A WITH OGONEK =BA U+015F LATIN SMALL LETTER S WITH CEDILLA =BB U+00BB RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK =BC U+013D LATIN CAPITAL LETTER L WITH CARON =BD U+02DD DOUBLE ACUTE ACCENT =BE U+013E LATIN SMALL LETTER L WITH CARON =BF U+017C LATIN SMALL LETTER Z WITH DOT ABOVE =C0 U+0154 LATIN CAPITAL LETTER R WITH ACUTE =C1 U+00C1 LATIN CAPITAL LETTER A WITH ACUTE =C2 U+00C2 LATIN CAPITAL LETTER A WITH CIRCUMFLEX =C3 U+0102 LATIN CAPITAL LETTER A WITH BREVE =C4 U+00C4 LATIN CAPITAL LETTER A WITH DIAERESIS =C5 U+0139 LATIN CAPITAL LETTER L WITH ACUTE =C6 U+0106 LATIN CAPITAL LETTER C WITH ACUTE =C7 U+00C7 LATIN CAPITAL LETTER C WITH CEDILLA =C8 U+010C LATIN CAPITAL LETTER C WITH CARON =C9 U+00C9 LATIN CAPITAL LETTER E WITH ACUTE =CA U+0118 LATIN CAPITAL LETTER E WITH OGONEK =CB U+00CB LATIN CAPITAL LETTER E WITH DIAERESIS =CC U+011A LATIN CAPITAL LETTER E WITH CARON =CD U+00CD LATIN CAPITAL LETTER I WITH ACUTE =CE U+00CE LATIN CAPITAL LETTER I WITH CIRCUMFLEX =CF U+010E LATIN CAPITAL LETTER D WITH CARON =D0 U+0110 LATIN CAPITAL LETTER D WITH STROKE =D1 U+0143 LATIN CAPITAL LETTER N WITH ACUTE =D2 U+0147 LATIN CAPITAL LETTER N WITH CARON =D3 U+00D3 LATIN CAPITAL LETTER O WITH ACUTE =D4 U+00D4 LATIN CAPITAL LETTER O WITH CIRCUMFLEX =D5 U+0150 LATIN CAPITAL LETTER O WITH DOUBLE ACUTE =D6 U+00D6 LATIN CAPITAL LETTER O WITH DIAERESIS =D7 U+00D7 MULTIPLICATION SIGN =D8 U+0158 LATIN CAPITAL LETTER R WITH CARON =D9 U+016E LATIN CAPITAL LETTER U WITH RING ABOVE =DA U+00DA LATIN CAPITAL LETTER U WITH ACUTE =DB U+0170 LATIN CAPITAL LETTER U WITH DOUBLE ACUTE =DC U+00DC LATIN CAPITAL LETTER U WITH DIAERESIS =DD U+00DD LATIN CAPITAL LETTER Y WITH ACUTE =DE U+0162 LATIN CAPITAL LETTER T WITH CEDILLA =DF U+00DF LATIN SMALL LETTER SHARP S =E0 U+0155 LATIN SMALL LETTER R WITH ACUTE =E1 U+00E1 LATIN SMALL LETTER A WITH ACUTE =E2 U+00E2 LATIN SMALL LETTER A WITH CIRCUMFLEX =E3 U+0103 LATIN SMALL LETTER A WITH BREVE =E4 U+00E4 LATIN SMALL LETTER A WITH DIAERESIS =E5 U+013A LATIN SMALL LETTER L WITH ACUTE =E6 U+0107 LATIN SMALL LETTER C WITH ACUTE =E7 U+00E7 LATIN SMALL LETTER C WITH CEDILLA =E8 U+010D LATIN SMALL LETTER C WITH CARON =E9 U+00E9 LATIN SMALL LETTER E WITH ACUTE =EA U+0119 LATIN SMALL LETTER E WITH OGONEK =EB U+00EB LATIN SMALL LETTER E WITH DIAERESIS =EC U+011B LATIN SMALL LETTER E WITH CARON =ED U+00ED LATIN SMALL LETTER I WITH ACUTE =EE U+00EE LATIN SMALL LETTER I WITH CIRCUMFLEX =EF U+010F LATIN SMALL LETTER D WITH CARON =F0 U+0111 LATIN SMALL LETTER D WITH STROKE =F1 U+0144 LATIN SMALL LETTER N WITH ACUTE =F2 U+0148 LATIN SMALL LETTER N WITH CARON =F3 U+00F3 LATIN SMALL LETTER O WITH ACUTE =F4 U+00F4 LATIN SMALL LETTER O WITH CIRCUMFLEX =F5 U+0151 LATIN SMALL LETTER O WITH DOUBLE ACUTE =F6 U+00F6 LATIN SMALL LETTER O WITH DIAERESIS =F7 U+00F7 DIVISION SIGN =F8 U+0159 LATIN SMALL LETTER R WITH CARON =F9 U+016F LATIN SMALL LETTER U WITH RING ABOVE =FA U+00FA LATIN SMALL LETTER U WITH ACUTE =FB U+0171 LATIN SMALL LETTER U WITH DOUBLE ACUTE =FC U+00FC LATIN SMALL LETTER U WITH DIAERESIS =FD U+00FD LATIN SMALL LETTER Y WITH ACUTE =FE U+0163 LATIN SMALL LETTER T WITH CEDILLA =FF U+02D9 DOT ABOVE pantomime1.2-1.2.2+dfsg1/charsets/windows-1251.txt000066400000000000000000000165171276751561200214110ustar00rootroot00000000000000=20 U+0020 SPACE =21 U+0021 EXCLAMATION MARK =22 U+0022 QUOTATION MARK =23 U+0023 NUMBER SIGN =24 U+0024 DOLLAR SIGN =25 U+0025 PERCENT SIGN =26 U+0026 AMPERSAND =27 U+0027 APOSTROPHE =28 U+0028 LEFT PARENTHESIS =29 U+0029 RIGHT PARENTHESIS =2A U+002A ASTERISK =2B U+002B PLUS SIGN =2C U+002C COMMA =2D U+002D HYPHEN-MINUS =2E U+002E FULL STOP =2F U+002F SOLIDUS =30 U+0030 DIGIT ZERO =31 U+0031 DIGIT ONE =32 U+0032 DIGIT TWO =33 U+0033 DIGIT THREE =34 U+0034 DIGIT FOUR =35 U+0035 DIGIT FIVE =36 U+0036 DIGIT SIX =37 U+0037 DIGIT SEVEN =38 U+0038 DIGIT EIGHT =39 U+0039 DIGIT NINE =3A U+003A COLON =3B U+003B SEMICOLON =3C U+003C LESS-THAN SIGN =3D U+003D EQUALS SIGN =3E U+003E GREATER-THAN SIGN =3F U+003F QUESTION MARK =40 U+0040 COMMERCIAL AT =41 U+0041 LATIN CAPITAL LETTER A =42 U+0042 LATIN CAPITAL LETTER B =43 U+0043 LATIN CAPITAL LETTER C =44 U+0044 LATIN CAPITAL LETTER D =45 U+0045 LATIN CAPITAL LETTER E =46 U+0046 LATIN CAPITAL LETTER F =47 U+0047 LATIN CAPITAL LETTER G =48 U+0048 LATIN CAPITAL LETTER H =49 U+0049 LATIN CAPITAL LETTER I =4A U+004A LATIN CAPITAL LETTER J =4B U+004B LATIN CAPITAL LETTER K =4C U+004C LATIN CAPITAL LETTER L =4D U+004D LATIN CAPITAL LETTER M =4E U+004E LATIN CAPITAL LETTER N =4F U+004F LATIN CAPITAL LETTER O =50 U+0050 LATIN CAPITAL LETTER P =51 U+0051 LATIN CAPITAL LETTER Q =52 U+0052 LATIN CAPITAL LETTER R =53 U+0053 LATIN CAPITAL LETTER S =54 U+0054 LATIN CAPITAL LETTER T =55 U+0055 LATIN CAPITAL LETTER U =56 U+0056 LATIN CAPITAL LETTER V =57 U+0057 LATIN CAPITAL LETTER W =58 U+0058 LATIN CAPITAL LETTER X =59 U+0059 LATIN CAPITAL LETTER Y =5A U+005A LATIN CAPITAL LETTER Z =5B U+005B LEFT SQUARE BRACKET =5C U+005C REVERSE SOLIDUS =5D U+005D RIGHT SQUARE BRACKET =5E U+005E CIRCUMFLEX ACCENT =5F U+005F LOW LINE =60 U+0060 GRAVE ACCENT =61 U+0061 LATIN SMALL LETTER A =62 U+0062 LATIN SMALL LETTER B =63 U+0063 LATIN SMALL LETTER C =64 U+0064 LATIN SMALL LETTER D =65 U+0065 LATIN SMALL LETTER E =66 U+0066 LATIN SMALL LETTER F =67 U+0067 LATIN SMALL LETTER G =68 U+0068 LATIN SMALL LETTER H =69 U+0069 LATIN SMALL LETTER I =6A U+006A LATIN SMALL LETTER J =6B U+006B LATIN SMALL LETTER K =6C U+006C LATIN SMALL LETTER L =6D U+006D LATIN SMALL LETTER M =6E U+006E LATIN SMALL LETTER N =6F U+006F LATIN SMALL LETTER O =70 U+0070 LATIN SMALL LETTER P =71 U+0071 LATIN SMALL LETTER Q =72 U+0072 LATIN SMALL LETTER R =73 U+0073 LATIN SMALL LETTER S =74 U+0074 LATIN SMALL LETTER T =75 U+0075 LATIN SMALL LETTER U =76 U+0076 LATIN SMALL LETTER V =77 U+0077 LATIN SMALL LETTER W =78 U+0078 LATIN SMALL LETTER X =79 U+0079 LATIN SMALL LETTER Y =7A U+007A LATIN SMALL LETTER Z =7B U+007B LEFT CURLY BRACKET =7C U+007C VERTICAL LINE =7D U+007D RIGHT CURLY BRACKET =7E U+007E TILDE =7F U+007F DELETE (DEL) =80 U+0402 CYRILLIC CAPITAL LETTER DJE (Serbocroatian) =81 U+0403 CYRILLIC CAPITAL LETTER GJE =82 U+201A SINGLE LOW-9 QUOTATION MARK =83 U+0453 CYRILLIC SMALL LETTER GJE =84 U+201E DOUBLE LOW-9 QUOTATION MARK =85 U+2026 HORIZONTAL ELLIPSIS =86 U+2020 DAGGER =87 U+2021 DOUBLE DAGGER =88 U+20AC EURO SIGN =89 U+2030 PER MILLE SIGN =8A U+0409 CYRILLIC CAPITAL LETTER LJE =8B U+2039 SINGLE LEFT-POINTING ANGLE QUOTATION MARK =8C U+040A CYRILLIC CAPITAL LETTER NJE =8D U+040C CYRILLIC CAPITAL LETTER KJE =8E U+040B CYRILLIC CAPITAL LETTER TSHE (Serbocroatian) =8F U+040F CYRILLIC CAPITAL LETTER DZHE =90 U+0452 CYRILLIC SMALL LETTER DJE (Serbocroatian) =91 U+2018 LEFT SINGLE QUOTATION MARK =92 U+2019 RIGHT SINGLE QUOTATION MARK =93 U+201C LEFT DOUBLE QUOTATION MARK =94 U+201D RIGHT DOUBLE QUOTATION MARK =95 U+2022 BULLET =96 U+2013 EN DASH =97 U+2014 EM DASH =99 U+2122 TRADE MARK SIGN =9A U+0459 CYRILLIC SMALL LETTER LJE =9B U+203A SINGLE RIGHT-POINTING ANGLE QUOTATION MARK =9C U+045A CYRILLIC SMALL LETTER NJE =9D U+045C CYRILLIC SMALL LETTER KJE =9E U+045B CYRILLIC SMALL LETTER TSHE (Serbocroatian) =9F U+045F CYRILLIC SMALL LETTER DZHE =A0 U+00A0 NO-BREAK SPACE =A1 U+040E CYRILLIC CAPITAL LETTER SHORT U (Byelorussian) =A2 U+045E CYRILLIC SMALL LETTER SHORT U (Byelorussian) =A3 U+0408 CYRILLIC CAPITAL LETTER JE =A4 U+00A4 CURRENCY SIGN =A5 U+0490 CYRILLIC CAPITAL LETTER GHE WITH UPTURN =A6 U+00A6 BROKEN BAR =A7 U+00A7 SECTION SIGN =A8 U+0401 CYRILLIC CAPITAL LETTER IO =A9 U+00A9 COPYRIGHT SIGN =AA U+0404 CYRILLIC CAPITAL LETTER UKRAINIAN IE =AB U+00AB LEFT-POINTING DOUBLE ANGLE QUOTATION MARK =AC U+00AC NOT SIGN =AD U+00AD SOFT HYPHEN =AE U+00AE REGISTERED SIGN =AF U+0407 CYRILLIC CAPITAL LETTER YI (Ukrainian) =B0 U+00B0 DEGREE SIGN =B1 U+00B1 PLUS-MINUS SIGN =B2 U+0406 CYRILLIC CAPITAL LETTER BYELORUSSIAN-UKRAINIAN I =B3 U+0456 CYRILLIC SMALL LETTER BYELORUSSIAN-UKRAINIAN I =B4 U+0491 CYRILLIC SMALL LETTER GHE WITH UPTURN =B5 U+00B5 MICRO SIGN =B6 U+00B6 PILCROW SIGN =B7 U+00B7 MIDDLE DOT =B8 U+0451 CYRILLIC SMALL LETTER IO =B9 U+2116 NUMERO SIGN =BA U+0454 CYRILLIC SMALL LETTER UKRAINIAN IE =BB U+00BB RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK =BC U+0458 CYRILLIC SMALL LETTER JE =BD U+0405 CYRILLIC CAPITAL LETTER DZE =BE U+0455 CYRILLIC SMALL LETTER DZE =BF U+0457 CYRILLIC SMALL LETTER YI (Ukrainian) =C0 U+0410 CYRILLIC CAPITAL LETTER A =C1 U+0411 CYRILLIC CAPITAL LETTER BE =C2 U+0412 CYRILLIC CAPITAL LETTER VE =C3 U+0413 CYRILLIC CAPITAL LETTER GHE =C4 U+0414 CYRILLIC CAPITAL LETTER DE =C5 U+0415 CYRILLIC CAPITAL LETTER IE =C6 U+0416 CYRILLIC CAPITAL LETTER ZHE =C7 U+0417 CYRILLIC CAPITAL LETTER ZE =C8 U+0418 CYRILLIC CAPITAL LETTER I =C9 U+0419 CYRILLIC CAPITAL LETTER SHORT I =CA U+041A CYRILLIC CAPITAL LETTER KA =CB U+041B CYRILLIC CAPITAL LETTER EL =CC U+041C CYRILLIC CAPITAL LETTER EM =CD U+041D CYRILLIC CAPITAL LETTER EN =CE U+041E CYRILLIC CAPITAL LETTER O =CF U+041F CYRILLIC CAPITAL LETTER PE =D0 U+0420 CYRILLIC CAPITAL LETTER ER =D1 U+0421 CYRILLIC CAPITAL LETTER ES =D2 U+0422 CYRILLIC CAPITAL LETTER TE =D3 U+0423 CYRILLIC CAPITAL LETTER U =D4 U+0424 CYRILLIC CAPITAL LETTER EF =D5 U+0425 CYRILLIC CAPITAL LETTER HA =D6 U+0426 CYRILLIC CAPITAL LETTER TSE =D7 U+0427 CYRILLIC CAPITAL LETTER CHE =D8 U+0428 CYRILLIC CAPITAL LETTER SHA =D9 U+0429 CYRILLIC CAPITAL LETTER SHCHA =DA U+042A CYRILLIC CAPITAL LETTER HARD SIGN =DB U+042B CYRILLIC CAPITAL LETTER YERU =DC U+042C CYRILLIC CAPITAL LETTER SOFT SIGN =DD U+042D CYRILLIC CAPITAL LETTER E =DE U+042E CYRILLIC CAPITAL LETTER YU =DF U+042F CYRILLIC CAPITAL LETTER YA =E0 U+0430 CYRILLIC SMALL LETTER A =E1 U+0431 CYRILLIC SMALL LETTER BE =E2 U+0432 CYRILLIC SMALL LETTER VE =E3 U+0433 CYRILLIC SMALL LETTER GHE =E4 U+0434 CYRILLIC SMALL LETTER DE =E5 U+0435 CYRILLIC SMALL LETTER IE =E6 U+0436 CYRILLIC SMALL LETTER ZHE =E7 U+0437 CYRILLIC SMALL LETTER ZE =E8 U+0438 CYRILLIC SMALL LETTER I =E9 U+0439 CYRILLIC SMALL LETTER SHORT I =EA U+043A CYRILLIC SMALL LETTER KA =EB U+043B CYRILLIC SMALL LETTER EL =EC U+043C CYRILLIC SMALL LETTER EM =ED U+043D CYRILLIC SMALL LETTER EN =EE U+043E CYRILLIC SMALL LETTER O =EF U+043F CYRILLIC SMALL LETTER PE =F0 U+0440 CYRILLIC SMALL LETTER ER =F1 U+0441 CYRILLIC SMALL LETTER ES =F2 U+0442 CYRILLIC SMALL LETTER TE =F3 U+0443 CYRILLIC SMALL LETTER U =F4 U+0444 CYRILLIC SMALL LETTER EF =F5 U+0445 CYRILLIC SMALL LETTER HA =F6 U+0446 CYRILLIC SMALL LETTER TSE =F7 U+0447 CYRILLIC SMALL LETTER CHE =F8 U+0448 CYRILLIC SMALL LETTER SHA =F9 U+0449 CYRILLIC SMALL LETTER SHCHA =FA U+044A CYRILLIC SMALL LETTER HARD SIGN =FB U+044B CYRILLIC SMALL LETTER YERU =FC U+044C CYRILLIC SMALL LETTER SOFT SIGN =FD U+044D CYRILLIC SMALL LETTER E =FE U+044E CYRILLIC SMALL LETTER YU =FF U+044F CYRILLIC SMALL LETTER YA pantomime1.2-1.2.2+dfsg1/charsets/windows-1252.txt000066400000000000000000000164031276751561200214040ustar00rootroot00000000000000=20 U+0020 SPACE =21 U+0021 EXCLAMATION MARK =22 U+0022 QUOTATION MARK =23 U+0023 NUMBER SIGN =24 U+0024 DOLLAR SIGN =25 U+0025 PERCENT SIGN =26 U+0026 AMPERSAND =27 U+0027 APOSTROPHE =28 U+0028 LEFT PARENTHESIS =29 U+0029 RIGHT PARENTHESIS =2A U+002A ASTERISK =2B U+002B PLUS SIGN =2C U+002C COMMA =2D U+002D HYPHEN-MINUS =2E U+002E FULL STOP =2F U+002F SOLIDUS =30 U+0030 DIGIT ZERO =31 U+0031 DIGIT ONE =32 U+0032 DIGIT TWO =33 U+0033 DIGIT THREE =34 U+0034 DIGIT FOUR =35 U+0035 DIGIT FIVE =36 U+0036 DIGIT SIX =37 U+0037 DIGIT SEVEN =38 U+0038 DIGIT EIGHT =39 U+0039 DIGIT NINE =3A U+003A COLON =3B U+003B SEMICOLON =3C U+003C LESS-THAN SIGN =3D U+003D EQUALS SIGN =3E U+003E GREATER-THAN SIGN =3F U+003F QUESTION MARK =40 U+0040 COMMERCIAL AT =41 U+0041 LATIN CAPITAL LETTER A =42 U+0042 LATIN CAPITAL LETTER B =43 U+0043 LATIN CAPITAL LETTER C =44 U+0044 LATIN CAPITAL LETTER D =45 U+0045 LATIN CAPITAL LETTER E =46 U+0046 LATIN CAPITAL LETTER F =47 U+0047 LATIN CAPITAL LETTER G =48 U+0048 LATIN CAPITAL LETTER H =49 U+0049 LATIN CAPITAL LETTER I =4A U+004A LATIN CAPITAL LETTER J =4B U+004B LATIN CAPITAL LETTER K =4C U+004C LATIN CAPITAL LETTER L =4D U+004D LATIN CAPITAL LETTER M =4E U+004E LATIN CAPITAL LETTER N =4F U+004F LATIN CAPITAL LETTER O =50 U+0050 LATIN CAPITAL LETTER P =51 U+0051 LATIN CAPITAL LETTER Q =52 U+0052 LATIN CAPITAL LETTER R =53 U+0053 LATIN CAPITAL LETTER S =54 U+0054 LATIN CAPITAL LETTER T =55 U+0055 LATIN CAPITAL LETTER U =56 U+0056 LATIN CAPITAL LETTER V =57 U+0057 LATIN CAPITAL LETTER W =58 U+0058 LATIN CAPITAL LETTER X =59 U+0059 LATIN CAPITAL LETTER Y =5A U+005A LATIN CAPITAL LETTER Z =5B U+005B LEFT SQUARE BRACKET =5C U+005C REVERSE SOLIDUS =5D U+005D RIGHT SQUARE BRACKET =5E U+005E CIRCUMFLEX ACCENT =5F U+005F LOW LINE =60 U+0060 GRAVE ACCENT =61 U+0061 LATIN SMALL LETTER A =62 U+0062 LATIN SMALL LETTER B =63 U+0063 LATIN SMALL LETTER C =64 U+0064 LATIN SMALL LETTER D =65 U+0065 LATIN SMALL LETTER E =66 U+0066 LATIN SMALL LETTER F =67 U+0067 LATIN SMALL LETTER G =68 U+0068 LATIN SMALL LETTER H =69 U+0069 LATIN SMALL LETTER I =6A U+006A LATIN SMALL LETTER J =6B U+006B LATIN SMALL LETTER K =6C U+006C LATIN SMALL LETTER L =6D U+006D LATIN SMALL LETTER M =6E U+006E LATIN SMALL LETTER N =6F U+006F LATIN SMALL LETTER O =70 U+0070 LATIN SMALL LETTER P =71 U+0071 LATIN SMALL LETTER Q =72 U+0072 LATIN SMALL LETTER R =73 U+0073 LATIN SMALL LETTER S =74 U+0074 LATIN SMALL LETTER T =75 U+0075 LATIN SMALL LETTER U =76 U+0076 LATIN SMALL LETTER V =77 U+0077 LATIN SMALL LETTER W =78 U+0078 LATIN SMALL LETTER X =79 U+0079 LATIN SMALL LETTER Y =7A U+007A LATIN SMALL LETTER Z =7B U+007B LEFT CURLY BRACKET =7C U+007C VERTICAL LINE =7D U+007D RIGHT CURLY BRACKET =7E U+007E TILDE =80 U+20AC EURO SIGN =82 U+201A SINGLE LOW-9 QUOTATION MARK =83 U+0192 LATIN SMALL LETTER F WITH HOOK =84 U+201E DOUBLE LOW-9 QUOTATION MARK =85 U+2026 HORIZONTAL ELLIPSIS =86 U+2020 DAGGER =87 U+2021 DOUBLE DAGGER =88 U+02C6 MODIFIER LETTER CIRCUMFLEX ACCENT =89 U+2030 PER MILLE SIGN =8A U+0160 LATIN CAPITAL LETTER S WITH CARON =8B U+2039 SINGLE LEFT-POINTING ANGLE QUOTATION MARK =8C U+0152 LATIN CAPITAL LIGATURE OE =8E U+017D LATIN CAPITAL LETTER Z WITH CARON =91 U+2018 LEFT SINGLE QUOTATION MARK =92 U+2019 RIGHT SINGLE QUOTATION MARK =93 U+201C LEFT DOUBLE QUOTATION MARK =94 U+201D RIGHT DOUBLE QUOTATION MARK =95 U+2022 BULLET =96 U+2013 EN DASH =97 U+2014 EM DASH =98 U+02DC SMALL TILDE =99 U+2122 TRADE MARK SIGN =9A U+0161 LATIN SMALL LETTER S WITH CARON =9B U+203A SINGLE RIGHT-POINTING ANGLE QUOTATION MARK =9C U+0153 LATIN SMALL LIGATURE OE =9E U+017E LATIN SMALL LETTER Z WITH CARON =9F U+0178 LATIN CAPITAL LETTER Y WITH DIAERESIS =A0 U+00A0 NO-BREAK SPACE =A1 U+00A1 INVERTED EXCLAMATION MARK =A2 U+00A2 CENT SIGN =A3 U+00A3 POUND SIGN =A4 U+00A4 CURRENCY SIGN =A5 U+00A5 YEN SIGN =A6 U+00A6 BROKEN BAR =A7 U+00A7 SECTION SIGN =A8 U+00A8 DIAERESIS =A9 U+00A9 COPYRIGHT SIGN =AA U+00AA FEMININE ORDINAL INDICATOR =AB U+00AB LEFT-POINTING DOUBLE ANGLE QUOTATION MARK =AC U+00AC NOT SIGN =AD U+00AD SOFT HYPHEN =AE U+00AE REGISTERED SIGN =AF U+00AF MACRON =B0 U+00B0 DEGREE SIGN =B1 U+00B1 PLUS-MINUS SIGN =B2 U+00B2 SUPERSCRIPT TWO =B3 U+00B3 SUPERSCRIPT THREE =B4 U+00B4 ACUTE ACCENT =B5 U+00B5 MICRO SIGN =B6 U+00B6 PILCROW SIGN =B7 U+00B7 MIDDLE DOT =B8 U+00B8 CEDILLA =B9 U+00B9 SUPERSCRIPT ONE =BA U+00BA MASCULINE ORDINAL INDICATOR =BB U+00BB RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK =BC U+00BC VULGAR FRACTION ONE QUARTER =BD U+00BD VULGAR FRACTION ONE HALF =BE U+00BE VULGAR FRACTION THREE QUARTERS =BF U+00BF INVERTED QUESTION MARK =C0 U+00C0 LATIN CAPITAL LETTER A WITH GRAVE =C1 U+00C1 LATIN CAPITAL LETTER A WITH ACUTE =C2 U+00C2 LATIN CAPITAL LETTER A WITH CIRCUMFLEX =C3 U+00C3 LATIN CAPITAL LETTER A WITH TILDE =C4 U+00C4 LATIN CAPITAL LETTER A WITH DIAERESIS =C5 U+00C5 LATIN CAPITAL LETTER A WITH RING ABOVE =C6 U+00C6 LATIN CAPITAL LETTER AE =C7 U+00C7 LATIN CAPITAL LETTER C WITH CEDILLA =C8 U+00C8 LATIN CAPITAL LETTER E WITH GRAVE =C9 U+00C9 LATIN CAPITAL LETTER E WITH ACUTE =CA U+00CA LATIN CAPITAL LETTER E WITH CIRCUMFLEX =CB U+00CB LATIN CAPITAL LETTER E WITH DIAERESIS =CC U+00CC LATIN CAPITAL LETTER I WITH GRAVE =CD U+00CD LATIN CAPITAL LETTER I WITH ACUTE =CE U+00CE LATIN CAPITAL LETTER I WITH CIRCUMFLEX =CF U+00CF LATIN CAPITAL LETTER I WITH DIAERESIS =D0 U+00D0 LATIN CAPITAL LETTER ETH =D1 U+00D1 LATIN CAPITAL LETTER N WITH TILDE =D2 U+00D2 LATIN CAPITAL LETTER O WITH GRAVE =D3 U+00D3 LATIN CAPITAL LETTER O WITH ACUTE =D4 U+00D4 LATIN CAPITAL LETTER O WITH CIRCUMFLEX =D5 U+00D5 LATIN CAPITAL LETTER O WITH TILDE =D6 U+00D6 LATIN CAPITAL LETTER O WITH DIAERESIS =D7 U+00D7 MULTIPLICATION SIGN =D8 U+00D8 LATIN CAPITAL LETTER O WITH STROKE =D9 U+00D9 LATIN CAPITAL LETTER U WITH GRAVE =DA U+00DA LATIN CAPITAL LETTER U WITH ACUTE =DB U+00DB LATIN CAPITAL LETTER U WITH CIRCUMFLEX =DC U+00DC LATIN CAPITAL LETTER U WITH DIAERESIS =DD U+00DD LATIN CAPITAL LETTER Y WITH ACUTE =DE U+00DE LATIN CAPITAL LETTER THORN =DF U+00DF LATIN SMALL LETTER SHARP S =E0 U+00E0 LATIN SMALL LETTER A WITH GRAVE =E1 U+00E1 LATIN SMALL LETTER A WITH ACUTE =E2 U+00E2 LATIN SMALL LETTER A WITH CIRCUMFLEX =E3 U+00E3 LATIN SMALL LETTER A WITH TILDE =E4 U+00E4 LATIN SMALL LETTER A WITH DIAERESIS =E5 U+00E5 LATIN SMALL LETTER A WITH RING ABOVE =E6 U+00E6 LATIN SMALL LETTER AE =E7 U+00E7 LATIN SMALL LETTER C WITH CEDILLA =E8 U+00E8 LATIN SMALL LETTER E WITH GRAVE =E9 U+00E9 LATIN SMALL LETTER E WITH ACUTE =EA U+00EA LATIN SMALL LETTER E WITH CIRCUMFLEX =EB U+00EB LATIN SMALL LETTER E WITH DIAERESIS =EC U+00EC LATIN SMALL LETTER I WITH GRAVE =ED U+00ED LATIN SMALL LETTER I WITH ACUTE =EE U+00EE LATIN SMALL LETTER I WITH CIRCUMFLEX =EF U+00EF LATIN SMALL LETTER I WITH DIAERESIS =F0 U+00F0 LATIN SMALL LETTER ETH =F1 U+00F1 LATIN SMALL LETTER N WITH TILDE =F2 U+00F2 LATIN SMALL LETTER O WITH GRAVE =F3 U+00F3 LATIN SMALL LETTER O WITH ACUTE =F4 U+00F4 LATIN SMALL LETTER O WITH CIRCUMFLEX =F5 U+00F5 LATIN SMALL LETTER O WITH TILDE =F6 U+00F6 LATIN SMALL LETTER O WITH DIAERESIS =F7 U+00F7 DIVISION SIGN =F8 U+00F8 LATIN SMALL LETTER O WITH STROKE =F9 U+00F9 LATIN SMALL LETTER U WITH GRAVE =FA U+00FA LATIN SMALL LETTER U WITH ACUTE =FB U+00FB LATIN SMALL LETTER U WITH CIRCUMFLEX =FC U+00FC LATIN SMALL LETTER U WITH DIAERESIS =FD U+00FD LATIN SMALL LETTER Y WITH ACUTE =FE U+00FE LATIN SMALL LETTER THORN =FF U+00FF LATIN SMALL LETTER Y WITH DIAERESIS pantomime1.2-1.2.2+dfsg1/charsets/windows-1253.txt000066400000000000000000000151461276751561200214100ustar00rootroot00000000000000=20 U+0020 SPACE =21 U+0021 EXCLAMATION MARK =22 U+0022 QUOTATION MARK =23 U+0023 NUMBER SIGN =24 U+0024 DOLLAR SIGN =25 U+0025 PERCENT SIGN =26 U+0026 AMPERSAND =27 U+0027 APOSTROPHE =28 U+0028 LEFT PARENTHESIS =29 U+0029 RIGHT PARENTHESIS =2A U+002A ASTERISK =2B U+002B PLUS SIGN =2C U+002C COMMA =2D U+002D HYPHEN-MINUS =2E U+002E FULL STOP =2F U+002F SOLIDUS =30 U+0030 DIGIT ZERO =31 U+0031 DIGIT ONE =32 U+0032 DIGIT TWO =33 U+0033 DIGIT THREE =34 U+0034 DIGIT FOUR =35 U+0035 DIGIT FIVE =36 U+0036 DIGIT SIX =37 U+0037 DIGIT SEVEN =38 U+0038 DIGIT EIGHT =39 U+0039 DIGIT NINE =3A U+003A COLON =3B U+003B SEMICOLON =3C U+003C LESS-THAN SIGN =3D U+003D EQUALS SIGN =3E U+003E GREATER-THAN SIGN =3F U+003F QUESTION MARK =40 U+0040 COMMERCIAL AT =41 U+0041 LATIN CAPITAL LETTER A =42 U+0042 LATIN CAPITAL LETTER B =43 U+0043 LATIN CAPITAL LETTER C =44 U+0044 LATIN CAPITAL LETTER D =45 U+0045 LATIN CAPITAL LETTER E =46 U+0046 LATIN CAPITAL LETTER F =47 U+0047 LATIN CAPITAL LETTER G =48 U+0048 LATIN CAPITAL LETTER H =49 U+0049 LATIN CAPITAL LETTER I =4A U+004A LATIN CAPITAL LETTER J =4B U+004B LATIN CAPITAL LETTER K =4C U+004C LATIN CAPITAL LETTER L =4D U+004D LATIN CAPITAL LETTER M =4E U+004E LATIN CAPITAL LETTER N =4F U+004F LATIN CAPITAL LETTER O =50 U+0050 LATIN CAPITAL LETTER P =51 U+0051 LATIN CAPITAL LETTER Q =52 U+0052 LATIN CAPITAL LETTER R =53 U+0053 LATIN CAPITAL LETTER S =54 U+0054 LATIN CAPITAL LETTER T =55 U+0055 LATIN CAPITAL LETTER U =56 U+0056 LATIN CAPITAL LETTER V =57 U+0057 LATIN CAPITAL LETTER W =58 U+0058 LATIN CAPITAL LETTER X =59 U+0059 LATIN CAPITAL LETTER Y =5A U+005A LATIN CAPITAL LETTER Z =5B U+005B LEFT SQUARE BRACKET =5C U+005C REVERSE SOLIDUS =5D U+005D RIGHT SQUARE BRACKET =5E U+005E CIRCUMFLEX ACCENT =5F U+005F LOW LINE =60 U+0060 GRAVE ACCENT =61 U+0061 LATIN SMALL LETTER A =62 U+0062 LATIN SMALL LETTER B =63 U+0063 LATIN SMALL LETTER C =64 U+0064 LATIN SMALL LETTER D =65 U+0065 LATIN SMALL LETTER E =66 U+0066 LATIN SMALL LETTER F =67 U+0067 LATIN SMALL LETTER G =68 U+0068 LATIN SMALL LETTER H =69 U+0069 LATIN SMALL LETTER I =6A U+006A LATIN SMALL LETTER J =6B U+006B LATIN SMALL LETTER K =6C U+006C LATIN SMALL LETTER L =6D U+006D LATIN SMALL LETTER M =6E U+006E LATIN SMALL LETTER N =6F U+006F LATIN SMALL LETTER O =70 U+0070 LATIN SMALL LETTER P =71 U+0071 LATIN SMALL LETTER Q =72 U+0072 LATIN SMALL LETTER R =73 U+0073 LATIN SMALL LETTER S =74 U+0074 LATIN SMALL LETTER T =75 U+0075 LATIN SMALL LETTER U =76 U+0076 LATIN SMALL LETTER V =77 U+0077 LATIN SMALL LETTER W =78 U+0078 LATIN SMALL LETTER X =79 U+0079 LATIN SMALL LETTER Y =7A U+007A LATIN SMALL LETTER Z =7B U+007B LEFT CURLY BRACKET =7C U+007C VERTICAL LINE =7D U+007D RIGHT CURLY BRACKET =7E U+007E TILDE =80 U+20AC EURO SIGN =82 U+201A SINGLE LOW-9 QUOTATION MARK =83 U+0192 LATIN SMALL LETTER F WITH HOOK =84 U+201E DOUBLE LOW-9 QUOTATION MARK =85 U+2026 HORIZONTAL ELLIPSIS =86 U+2020 DAGGER =87 U+2021 DOUBLE DAGGER =89 U+2030 PER MILLE SIGN =8B U+2039 SINGLE LEFT-POINTING ANGLE QUOTATION MARK =91 U+2018 LEFT SINGLE QUOTATION MARK =92 U+2019 RIGHT SINGLE QUOTATION MARK =93 U+201C LEFT DOUBLE QUOTATION MARK =94 U+201D RIGHT DOUBLE QUOTATION MARK =95 U+2022 BULLET =96 U+2013 EN DASH =97 U+2014 EM DASH =99 U+2122 TRADE MARK SIGN =9B U+203A SINGLE RIGHT-POINTING ANGLE QUOTATION MARK =A0 U+00A0 NO-BREAK SPACE =A1 U+0385 GREEK DIALYTIKA TONOS =A2 U+0386 GREEK CAPITAL LETTER ALPHA WITH TONOS =A3 U+00A3 POUND SIGN =A4 U+00A4 CURRENCY SIGN =A5 U+00A5 YEN SIGN =A6 U+00A6 BROKEN BAR =A7 U+00A7 SECTION SIGN =A8 U+00A8 DIAERESIS =A9 U+00A9 COPYRIGHT SIGN =AB U+00AB LEFT-POINTING DOUBLE ANGLE QUOTATION MARK =AC U+00AC NOT SIGN =AD U+00AD SOFT HYPHEN =AE U+00AE REGISTERED SIGN =AF U+2015 HORIZONTAL BAR =B0 U+00B0 DEGREE SIGN =B1 U+00B1 PLUS-MINUS SIGN =B2 U+00B2 SUPERSCRIPT TWO =B3 U+00B3 SUPERSCRIPT THREE =B4 U+0384 GREEK TONOS =B5 U+00B5 MICRO SIGN =B6 U+00B6 PILCROW SIGN =B7 U+00B7 MIDDLE DOT =B8 U+0388 GREEK CAPITAL LETTER EPSILON WITH TONOS =B9 U+0389 GREEK CAPITAL LETTER ETA WITH TONOS =BA U+038A GREEK CAPITAL LETTER IOTA WITH TONOS =BB U+00BB RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK =BC U+038C GREEK CAPITAL LETTER OMICRON WITH TONOS =BD U+00BD VULGAR FRACTION ONE HALF =BE U+038E GREEK CAPITAL LETTER UPSILON WITH TONOS =BF U+038F GREEK CAPITAL LETTER OMEGA WITH TONOS =C0 U+0390 GREEK SMALL LETTER IOTA WITH DIALYTIKA AND TONOS =C1 U+0391 GREEK CAPITAL LETTER ALPHA =C2 U+0392 GREEK CAPITAL LETTER BETA =C3 U+0393 GREEK CAPITAL LETTER GAMMA =C4 U+0394 GREEK CAPITAL LETTER DELTA =C5 U+0395 GREEK CAPITAL LETTER EPSILON =C6 U+0396 GREEK CAPITAL LETTER ZETA =C7 U+0397 GREEK CAPITAL LETTER ETA =C8 U+0398 GREEK CAPITAL LETTER THETA =C9 U+0399 GREEK CAPITAL LETTER IOTA =CA U+039A GREEK CAPITAL LETTER KAPPA =CB U+039B GREEK CAPITAL LETTER LAMDA =CC U+039C GREEK CAPITAL LETTER MU =CD U+039D GREEK CAPITAL LETTER NU =CE U+039E GREEK CAPITAL LETTER XI =CF U+039F GREEK CAPITAL LETTER OMICRON =D0 U+03A0 GREEK CAPITAL LETTER PI =D1 U+03A1 GREEK CAPITAL LETTER RHO =D3 U+03A3 GREEK CAPITAL LETTER SIGMA =D4 U+03A4 GREEK CAPITAL LETTER TAU =D5 U+03A5 GREEK CAPITAL LETTER UPSILON =D6 U+03A6 GREEK CAPITAL LETTER PHI =D7 U+03A7 GREEK CAPITAL LETTER CHI =D8 U+03A8 GREEK CAPITAL LETTER PSI =D9 U+03A9 GREEK CAPITAL LETTER OMEGA =DA U+03AA GREEK CAPITAL LETTER IOTA WITH DIALYTIKA =DB U+03AB GREEK CAPITAL LETTER UPSILON WITH DIALYTIKA =DC U+03AC GREEK SMALL LETTER ALPHA WITH TONOS =DD U+03AD GREEK SMALL LETTER EPSILON WITH TONOS =DE U+03AE GREEK SMALL LETTER ETA WITH TONOS =DF U+03AF GREEK SMALL LETTER IOTA WITH TONOS =E0 U+03B0 GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND TONOS =E1 U+03B1 GREEK SMALL LETTER ALPHA =E2 U+03B2 GREEK SMALL LETTER BETA =E3 U+03B3 GREEK SMALL LETTER GAMMA =E4 U+03B4 GREEK SMALL LETTER DELTA =E5 U+03B5 GREEK SMALL LETTER EPSILON =E6 U+03B6 GREEK SMALL LETTER ZETA =E7 U+03B7 GREEK SMALL LETTER ETA =E8 U+03B8 GREEK SMALL LETTER THETA =E9 U+03B9 GREEK SMALL LETTER IOTA =EA U+03BA GREEK SMALL LETTER KAPPA =EB U+03BB GREEK SMALL LETTER LAMDA =EC U+03BC GREEK SMALL LETTER MU =ED U+03BD GREEK SMALL LETTER NU =EE U+03BE GREEK SMALL LETTER XI =EF U+03BF GREEK SMALL LETTER OMICRON =F0 U+03C0 GREEK SMALL LETTER PI =F1 U+03C1 GREEK SMALL LETTER RHO =F2 U+03C2 GREEK SMALL LETTER FINAL SIGMA =F3 U+03C3 GREEK SMALL LETTER SIGMA =F4 U+03C4 GREEK SMALL LETTER TAU =F5 U+03C5 GREEK SMALL LETTER UPSILON =F6 U+03C6 GREEK SMALL LETTER PHI =F7 U+03C7 GREEK SMALL LETTER CHI =F8 U+03C8 GREEK SMALL LETTER PSI =F9 U+03C9 GREEK SMALL LETTER OMEGA =FA U+03CA GREEK SMALL LETTER IOTA WITH DIALYTIKA =FB U+03CB GREEK SMALL LETTER UPSILON WITH DIALYTIKA =FC U+03CC GREEK SMALL LETTER OMICRON WITH TONOS =FD U+03CD GREEK SMALL LETTER UPSILON WITH TONOS =FE U+03CE GREEK SMALL LETTER OMEGA WITH TONOS pantomime1.2-1.2.2+dfsg1/charsets/windows-1254.txt000066400000000000000000000163201276751561200214040ustar00rootroot00000000000000=20 U+0020 SPACE =21 U+0021 EXCLAMATION MARK =22 U+0022 QUOTATION MARK =23 U+0023 NUMBER SIGN =24 U+0024 DOLLAR SIGN =25 U+0025 PERCENT SIGN =26 U+0026 AMPERSAND =27 U+0027 APOSTROPHE =28 U+0028 LEFT PARENTHESIS =29 U+0029 RIGHT PARENTHESIS =2A U+002A ASTERISK =2B U+002B PLUS SIGN =2C U+002C COMMA =2D U+002D HYPHEN-MINUS =2E U+002E FULL STOP =2F U+002F SOLIDUS =30 U+0030 DIGIT ZERO =31 U+0031 DIGIT ONE =32 U+0032 DIGIT TWO =33 U+0033 DIGIT THREE =34 U+0034 DIGIT FOUR =35 U+0035 DIGIT FIVE =36 U+0036 DIGIT SIX =37 U+0037 DIGIT SEVEN =38 U+0038 DIGIT EIGHT =39 U+0039 DIGIT NINE =3A U+003A COLON =3B U+003B SEMICOLON =3C U+003C LESS-THAN SIGN =3D U+003D EQUALS SIGN =3E U+003E GREATER-THAN SIGN =3F U+003F QUESTION MARK =40 U+0040 COMMERCIAL AT =41 U+0041 LATIN CAPITAL LETTER A =42 U+0042 LATIN CAPITAL LETTER B =43 U+0043 LATIN CAPITAL LETTER C =44 U+0044 LATIN CAPITAL LETTER D =45 U+0045 LATIN CAPITAL LETTER E =46 U+0046 LATIN CAPITAL LETTER F =47 U+0047 LATIN CAPITAL LETTER G =48 U+0048 LATIN CAPITAL LETTER H =49 U+0049 LATIN CAPITAL LETTER I =4A U+004A LATIN CAPITAL LETTER J =4B U+004B LATIN CAPITAL LETTER K =4C U+004C LATIN CAPITAL LETTER L =4D U+004D LATIN CAPITAL LETTER M =4E U+004E LATIN CAPITAL LETTER N =4F U+004F LATIN CAPITAL LETTER O =50 U+0050 LATIN CAPITAL LETTER P =51 U+0051 LATIN CAPITAL LETTER Q =52 U+0052 LATIN CAPITAL LETTER R =53 U+0053 LATIN CAPITAL LETTER S =54 U+0054 LATIN CAPITAL LETTER T =55 U+0055 LATIN CAPITAL LETTER U =56 U+0056 LATIN CAPITAL LETTER V =57 U+0057 LATIN CAPITAL LETTER W =58 U+0058 LATIN CAPITAL LETTER X =59 U+0059 LATIN CAPITAL LETTER Y =5A U+005A LATIN CAPITAL LETTER Z =5B U+005B LEFT SQUARE BRACKET =5C U+005C REVERSE SOLIDUS =5D U+005D RIGHT SQUARE BRACKET =5E U+005E CIRCUMFLEX ACCENT =5F U+005F LOW LINE =60 U+0060 GRAVE ACCENT =61 U+0061 LATIN SMALL LETTER A =62 U+0062 LATIN SMALL LETTER B =63 U+0063 LATIN SMALL LETTER C =64 U+0064 LATIN SMALL LETTER D =65 U+0065 LATIN SMALL LETTER E =66 U+0066 LATIN SMALL LETTER F =67 U+0067 LATIN SMALL LETTER G =68 U+0068 LATIN SMALL LETTER H =69 U+0069 LATIN SMALL LETTER I =6A U+006A LATIN SMALL LETTER J =6B U+006B LATIN SMALL LETTER K =6C U+006C LATIN SMALL LETTER L =6D U+006D LATIN SMALL LETTER M =6E U+006E LATIN SMALL LETTER N =6F U+006F LATIN SMALL LETTER O =70 U+0070 LATIN SMALL LETTER P =71 U+0071 LATIN SMALL LETTER Q =72 U+0072 LATIN SMALL LETTER R =73 U+0073 LATIN SMALL LETTER S =74 U+0074 LATIN SMALL LETTER T =75 U+0075 LATIN SMALL LETTER U =76 U+0076 LATIN SMALL LETTER V =77 U+0077 LATIN SMALL LETTER W =78 U+0078 LATIN SMALL LETTER X =79 U+0079 LATIN SMALL LETTER Y =7A U+007A LATIN SMALL LETTER Z =7B U+007B LEFT CURLY BRACKET =7C U+007C VERTICAL LINE =7D U+007D RIGHT CURLY BRACKET =7E U+007E TILDE =80 U+20AC EURO SIGN =82 U+201A SINGLE LOW-9 QUOTATION MARK =83 U+0192 LATIN SMALL LETTER F WITH HOOK =84 U+201E DOUBLE LOW-9 QUOTATION MARK =85 U+2026 HORIZONTAL ELLIPSIS =86 U+2020 DAGGER =87 U+2021 DOUBLE DAGGER =88 U+02C6 MODIFIER LETTER CIRCUMFLEX ACCENT =89 U+2030 PER MILLE SIGN =8A U+0160 LATIN CAPITAL LETTER S WITH CARON =8B U+2039 SINGLE LEFT-POINTING ANGLE QUOTATION MARK =8C U+0152 LATIN CAPITAL LIGATURE OE =91 U+2018 LEFT SINGLE QUOTATION MARK =92 U+2019 RIGHT SINGLE QUOTATION MARK =93 U+201C LEFT DOUBLE QUOTATION MARK =94 U+201D RIGHT DOUBLE QUOTATION MARK =95 U+2022 BULLET =96 U+2013 EN DASH =97 U+2014 EM DASH =98 U+02DC SMALL TILDE =99 U+2122 TRADE MARK SIGN =9A U+0161 LATIN SMALL LETTER S WITH CARON =9B U+203A SINGLE RIGHT-POINTING ANGLE QUOTATION MARK =9C U+0153 LATIN SMALL LIGATURE OE =9F U+0178 LATIN CAPITAL LETTER Y WITH DIAERESIS =A0 U+00A0 NO-BREAK SPACE =A1 U+00A1 INVERTED EXCLAMATION MARK =A2 U+00A2 CENT SIGN =A3 U+00A3 POUND SIGN =A4 U+00A4 CURRENCY SIGN =A5 U+00A5 YEN SIGN =A6 U+00A6 BROKEN BAR =A7 U+00A7 SECTION SIGN =A8 U+00A8 DIAERESIS =A9 U+00A9 COPYRIGHT SIGN =AA U+00AA FEMININE ORDINAL INDICATOR =AB U+00AB LEFT-POINTING DOUBLE ANGLE QUOTATION MARK =AC U+00AC NOT SIGN =AD U+00AD SOFT HYPHEN =AE U+00AE REGISTERED SIGN =AF U+00AF MACRON =B0 U+00B0 DEGREE SIGN =B1 U+00B1 PLUS-MINUS SIGN =B2 U+00B2 SUPERSCRIPT TWO =B3 U+00B3 SUPERSCRIPT THREE =B4 U+00B4 ACUTE ACCENT =B5 U+00B5 MICRO SIGN =B6 U+00B6 PILCROW SIGN =B7 U+00B7 MIDDLE DOT =B8 U+00B8 CEDILLA =B9 U+00B9 SUPERSCRIPT ONE =BA U+00BA MASCULINE ORDINAL INDICATOR =BB U+00BB RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK =BC U+00BC VULGAR FRACTION ONE QUARTER =BD U+00BD VULGAR FRACTION ONE HALF =BE U+00BE VULGAR FRACTION THREE QUARTERS =BF U+00BF INVERTED QUESTION MARK =C0 U+00C0 LATIN CAPITAL LETTER A WITH GRAVE =C1 U+00C1 LATIN CAPITAL LETTER A WITH ACUTE =C2 U+00C2 LATIN CAPITAL LETTER A WITH CIRCUMFLEX =C3 U+00C3 LATIN CAPITAL LETTER A WITH TILDE =C4 U+00C4 LATIN CAPITAL LETTER A WITH DIAERESIS =C5 U+00C5 LATIN CAPITAL LETTER A WITH RING ABOVE =C6 U+00C6 LATIN CAPITAL LETTER AE =C7 U+00C7 LATIN CAPITAL LETTER C WITH CEDILLA =C8 U+00C8 LATIN CAPITAL LETTER E WITH GRAVE =C9 U+00C9 LATIN CAPITAL LETTER E WITH ACUTE =CA U+00CA LATIN CAPITAL LETTER E WITH CIRCUMFLEX =CB U+00CB LATIN CAPITAL LETTER E WITH DIAERESIS =CC U+00CC LATIN CAPITAL LETTER I WITH GRAVE =CD U+00CD LATIN CAPITAL LETTER I WITH ACUTE =CE U+00CE LATIN CAPITAL LETTER I WITH CIRCUMFLEX =CF U+00CF LATIN CAPITAL LETTER I WITH DIAERESIS =D0 U+011E LATIN CAPITAL LETTER G WITH BREVE =D1 U+00D1 LATIN CAPITAL LETTER N WITH TILDE =D2 U+00D2 LATIN CAPITAL LETTER O WITH GRAVE =D3 U+00D3 LATIN CAPITAL LETTER O WITH ACUTE =D4 U+00D4 LATIN CAPITAL LETTER O WITH CIRCUMFLEX =D5 U+00D5 LATIN CAPITAL LETTER O WITH TILDE =D6 U+00D6 LATIN CAPITAL LETTER O WITH DIAERESIS =D7 U+00D7 MULTIPLICATION SIGN =D8 U+00D8 LATIN CAPITAL LETTER O WITH STROKE =D9 U+00D9 LATIN CAPITAL LETTER U WITH GRAVE =DA U+00DA LATIN CAPITAL LETTER U WITH ACUTE =DB U+00DB LATIN CAPITAL LETTER U WITH CIRCUMFLEX =DC U+00DC LATIN CAPITAL LETTER U WITH DIAERESIS =DD U+0130 LATIN CAPITAL LETTER I WITH DOT ABOVE =DE U+015E LATIN CAPITAL LETTER S WITH CEDILLA =DF U+00DF LATIN SMALL LETTER SHARP S =E0 U+00E0 LATIN SMALL LETTER A WITH GRAVE =E1 U+00E1 LATIN SMALL LETTER A WITH ACUTE =E2 U+00E2 LATIN SMALL LETTER A WITH CIRCUMFLEX =E3 U+00E3 LATIN SMALL LETTER A WITH TILDE =E4 U+00E4 LATIN SMALL LETTER A WITH DIAERESIS =E5 U+00E5 LATIN SMALL LETTER A WITH RING ABOVE =E6 U+00E6 LATIN SMALL LETTER AE =E7 U+00E7 LATIN SMALL LETTER C WITH CEDILLA =E8 U+00E8 LATIN SMALL LETTER E WITH GRAVE =E9 U+00E9 LATIN SMALL LETTER E WITH ACUTE =EA U+00EA LATIN SMALL LETTER E WITH CIRCUMFLEX =EB U+00EB LATIN SMALL LETTER E WITH DIAERESIS =EC U+00EC LATIN SMALL LETTER I WITH GRAVE =ED U+00ED LATIN SMALL LETTER I WITH ACUTE =EE U+00EE LATIN SMALL LETTER I WITH CIRCUMFLEX =EF U+00EF LATIN SMALL LETTER I WITH DIAERESIS =F0 U+011F LATIN SMALL LETTER G WITH BREVE =F1 U+00F1 LATIN SMALL LETTER N WITH TILDE =F2 U+00F2 LATIN SMALL LETTER O WITH GRAVE =F3 U+00F3 LATIN SMALL LETTER O WITH ACUTE =F4 U+00F4 LATIN SMALL LETTER O WITH CIRCUMFLEX =F5 U+00F5 LATIN SMALL LETTER O WITH TILDE =F6 U+00F6 LATIN SMALL LETTER O WITH DIAERESIS =F7 U+00F7 DIVISION SIGN =F8 U+00F8 LATIN SMALL LETTER O WITH STROKE =F9 U+00F9 LATIN SMALL LETTER U WITH GRAVE =FA U+00FA LATIN SMALL LETTER U WITH ACUTE =FB U+00FB LATIN SMALL LETTER U WITH CIRCUMFLEX =FC U+00FC LATIN SMALL LETTER U WITH DIAERESIS =FD U+0131 LATIN SMALL LETTER DOTLESS I =FE U+015F LATIN SMALL LETTER S WITH CEDILLA =FF U+00FF LATIN SMALL LETTER Y WITH DIAERESIS