VMime: C++ Mail Library

Development

Entries feed - Comments feed

Thursday, Aug 5 2010

Connection time out

By popular demand, it is now possible to handle time out during connection to IMAP, POP3 and SMTP servers.

There is nothing to change in your code to enjoy this new feature, at least if you already set a time out handler on the store (vmime::net::store::setTimeoutHandler). The same time out handler is used for connection and for data exchange after the connection has been opened.

Please note: for now, this is only available in VMime SVN, revision 559, and for POSIX platforms (this feature is not yet supported on Windows).

Tuesday, May 18 2010

New feature: get parsed message from store

Hi VMime users!

Let's focus today on a new feature in VMime 0.9. Until now, when you wanted to "explore" the contents of a vmime::net::message (that is, a message hosted on a IMAP or a POP3 store), you had to extract it entirely, or to use low-level fetch() and extract() functions on the message object.

Since the current development release of May 18th, there is a new helper function that will let you access the remote message like a "normal" vmime::message, and actually download the message data only when it is required (this only works for IMAP).

   // Connect to the IMAP store
vmime::ref <vmime::net::session> sess = vmime::create <vmime::net::session>();

   vmime::utility::url storeURL("imap://username:password@imap.example.com");

vmime::ref <vmime::net::store> store = sess->getStore(storeURL);
   store->connect();

// Open the INBOX
   vmime::ref <vmime::net::folder> folder = store->getDefaultFolder();
   folder->open(vmime::net::folder::MODE_READ_WRITE);

// Get the first message in the INBOX
vmime::ref <vmime::net::message> msg = f->getMessage(1);

// Construct the parsed message (a few data, header and structure,
// is actually downloaded from the IMAP server)
   vmime::ref <vmime::message> parsedMsg = msg->getParsedMessage();

// Here, extract() will actually download message data from the server

vmime::utility::outputStreamAdapter out(std::cout);
parsedMsg->getBody()->extract(out);

That's all folks! Update your source tree to the latest SVN head to enjoy this new feature.

Tuesday, November 3 2009

Major bug fixes

Hello VMime users!

Thanks to László Vadócz, a possible segfault in stringUtils::countASCIIchars() has been fixed. A patch is available.

There was another major issue with body contents not generating when using streamContentHandler: EOF condition was not reset correctly when stream::reset() was called. The patch is available here.

Saturday, Jun 13 2009

Build against libgnutls >= 2.8

VMime 0.9.0 autoconf build process uses the libgnutls-config script to search for GNU TLS (by using AM_PATH_LIBGNUTLS). This script is deprecated and not shipped in gnutls 2.8.0 and later; pkg-config should now be used. Andreas Metzler provided a patch for fixing this.

Tuesday, Jul 8 2008

Is VMime thread-safe?

VMime is thread-safe in the sense you can have multiple threads running VMime code at the same time.

What you may NOT do is to share VMime objects (for writing) between threads. For example, you should NOT modify the same bodyPart object from two threads at the same time (reading is OK) unless you write your own synchronization mechanism between the calls.

If you are using the messaging module, it is OK to access multiple mailboxes (store objects) from multiple threads (each thread accesses one mailbox).

The rest of the code (parser, utils, etc.) is thread-safe as long as (again...) you don't share the objects (body parts, mailboxes, etc.) between multiple threads.

There are some singleton objects in VMime. There is absolutely no problem when instanciating a VMime singleton for the first time within multi-threaded code. Instanciation of all singletons is forced when VMime is initialized (static code, executed before your main()).

Current Version

0.9.0 (2008/10/19)

Download
ChangeLog