geary/src/engine/imap-engine/imap-engine-generic-sent-mail-folder.vala
Charles Lindsay cce04b814f Add option to save sent mail
This adds the ability for Geary to push sent mail up to the account's
Sent Mail folder (if available).  There's an accompanying account option
that defaults to on (meaning: push sent mail).

The current implementation will leave messages in the Outbox (though
they won't be sent again) if they fail to be pushed to Sent Mail.  This
isn't the best solution, but it at least means you have a way of seeing
the problem and hopefully copying the data elsewhere manually if you
need to save it.

Note that Geary might not always recognize an account's Sent Mail
folder.  This is the case for any "Other" accounts that don't support
the "special use" or "xlist" IMAP extensions.  In this case, Geary will
either throw an error and leave messages in the Outbox, or erase the
message from the Outbox when it's sent, depending on the value of the
account's save sent mail option.  Better support for detecting the Sent
Mail folder in every case is coming soon.

Closes: bgo #713263
2014-01-29 18:18:31 -08:00

22 lines
1.1 KiB
Vala

/* Copyright 2012-2013 Yorba Foundation
*
* This software is licensed under the GNU Lesser General Public License
* (version 2.1 or later). See the COPYING file in this distribution.
*/
// Sent Mail generally is the same as other mail folders, but it doesn't support key features,
// like archiving (since sent messages are in the archive). Instead, it supports appending.
//
// Service-specific accounts can use this or subclass it for further customization
private class Geary.ImapEngine.GenericSentMailFolder : GenericFolder, Geary.FolderSupport.Create {
public GenericSentMailFolder(GenericAccount account, Imap.Account remote, ImapDB.Account local,
ImapDB.Folder local_folder, SpecialFolderType special_folder_type) {
base (account, remote, local, local_folder, special_folder_type);
}
public new async Geary.EmailIdentifier? create_email_async(RFC822.Message message, Geary.EmailFlags? flags,
DateTime? date_received, Geary.EmailIdentifier? id, Cancellable? cancellable) throws Error {
return yield base.create_email_async(message, flags, date_received, id, cancellable);
}
}