Attachment mode
This commit is contained in:
@ -54,7 +54,7 @@ namespace kaz {
|
||||
//static const vector<const string> stringsToUpdate;
|
||||
static vector<string> stringsToUpdate;
|
||||
/*! mime tokens */
|
||||
static const string contentTypeToken, contentDispositionToken, contentTransferEncodingToken, base64Token, quotedPrintableToken, contentIDToken, PLAIN, HTML, RELATED, ALTERNATIVE;
|
||||
static const string contentTypeToken, contentDispositionToken, contentTransferEncodingToken, base64Token, quotedPrintableToken, contentIDToken, PLAIN, HTML, RELATED, ALTERNATIVE, KAZ_ATTACH_NAME;
|
||||
/*! pattern to extract mime values */
|
||||
static const regex nameRegEx, nameCharsetRegEx, boundaryRegEx, cidDefRegEx, textRegEx, multiRegEx;
|
||||
|
||||
@ -100,7 +100,7 @@ namespace kaz {
|
||||
/*! char position of attachment content */
|
||||
streamoff contentPos, endPos;
|
||||
/*! properties of the attachment */
|
||||
bool toExtract, toUpdate, toDisclaim;
|
||||
bool toExtract, toUpdate, toDisclaim, isKazAttachment;
|
||||
/*! id of an image embedded in mbox */
|
||||
string cid;
|
||||
/*! url to replace the attachment */
|
||||
|
@ -44,6 +44,13 @@ namespace kaz {
|
||||
namespace bfs = boost::filesystem;
|
||||
|
||||
// ================================================================================
|
||||
/*! place to add download link (footer, attachment or both) */
|
||||
enum AttachMode { NONE = 0, FOOTER = 1, ATTACHMENT = 2, BOTH = (FOOTER|ATTACHMENT) };
|
||||
extern const string attachModeLabels[];
|
||||
extern const map<string, AttachMode> attachModeMap;
|
||||
ostream &operator << (ostream &out, const AttachMode &attachMode);
|
||||
istream &operator >> (istream &in, AttachMode &attachMode);
|
||||
|
||||
/*! root level of e-mail structure */
|
||||
class MainAttachment : public Attachment {
|
||||
public:
|
||||
@ -83,8 +90,10 @@ namespace kaz {
|
||||
bfs::path extractDir;
|
||||
/*! URL for download archives */
|
||||
string archiveDownloadURL;
|
||||
/*! no main text in email can be use to add disclaim */
|
||||
bool forceMainText;
|
||||
/*! if no main text in email can be used to add disclaim */
|
||||
bool emptyEMail;
|
||||
/*! if contain previous kaz attachment */
|
||||
bool previousKazAttachment;
|
||||
|
||||
/*! subset in the tree of all attachments to be consider for extraction or modification */
|
||||
vector<Attachment *> allMarkedPtrs;
|
||||
@ -115,7 +124,7 @@ namespace kaz {
|
||||
/*! extract big attachments in mbox to extractDir and write to stdout le dirname of each extraction */
|
||||
void extract (ifstream &mbox, const SizeArg &minSize) const;
|
||||
/*! substitute big attachments by the url give in stdin */
|
||||
void substitute (ifstream &mbox, ofstream &outbox, const SizeArg &minSize);
|
||||
void substitute (ifstream &mbox, ofstream &outbox, const SizeArg &minSize, const AttachMode &attachMode);
|
||||
};
|
||||
|
||||
// ================================================================================
|
||||
|
Reference in New Issue
Block a user