VMime
MDNHelper Class Reference

Static Public Member Functions

static void attachMDNRequest (shared_ptr< message > msg, const mailboxList &mailboxes)
 
static void attachMDNRequest (shared_ptr< message > msg, const mailbox &mbox)
 
static const std::vector
< sendableMDNInfos
getPossibleMDNs (const shared_ptr< const message > msg)
 
static bool isMDN (const shared_ptr< const message > msg)
 
static receivedMDNInfos getReceivedMDN (const shared_ptr< const message > msg)
 
static bool needConfirmation (const shared_ptr< const message > msg)
 
static shared_ptr< messagebuildMDN (const sendableMDNInfos &mdnInfos, const string &text, const charset &ch, const mailbox &expeditor, const disposition &dispo, const string &reportingUA=NULL_STRING, const std::vector< string > &reportingUAProducts=std::vector< string >(), const std::map< string, string > &fields=(std::map< string, string >()))
 

Detailed Description

Helper for creating or extracting Message Disposition Notifications (MDN), as defined in RFC-3798.

Member Function Documentation

void attachMDNRequest ( shared_ptr< message msg,
const mailboxList mailboxes 
)
static

Attach a MDN request to the specified message.

Parameters
msgmessage in which to add a MDN request
mailboxeslist of mailboxes to which the MDN will be sent

Referenced by MDNHelper::attachMDNRequest().

void attachMDNRequest ( shared_ptr< message msg,
const mailbox mbox 
)
static

Attach a MDN request to the specified message.

Parameters
msgmessage in which to add a MDN request
mboxmailbox to which the MDN will be sent

References mailboxList::appendMailbox(), MDNHelper::attachMDNRequest(), and vmime::clone().

shared_ptr< message > buildMDN ( const sendableMDNInfos mdnInfos,
const string text,
const charset ch,
const mailbox expeditor,
const disposition dispo,
const string reportingUA = NULL_STRING,
const std::vector< string > &  reportingUAProducts = std::vector <string>(),
const std::map< string, string > &  fields = (std::map <stringstring>()) 
)
static

Build a new MDN for the message.

The resulting MDN can then be sent over SMTP transport service.

Parameters
mdnInfosinformation about the MDN to construct
texthuman readable message. The purpose of this message is to provide an easily-understood description of the condition(s) that caused the report to be generated.
chcharset of the text
expeditorexpeditor of the MDN
dispodisposition information
reportingUAname of reporting user-agent (optional)
reportingUAProductslist of products in the reporting user-agent (optional)
fieldsadditional MDN fields, like "Error", "Warning" or "Failure" (optional)
Returns
a new message object containing the MDN

References addressList::appendAddress(), sendableMDNInfos::getRecipient(), vmime::mediaTypes::MULTIPART, vmime::mediaTypes::MULTIPART_REPORT, datetime::now(), and vmime::SUPPORTED_MIME_VERSION.

const std::vector< sendableMDNInfos > getPossibleMDNs ( const shared_ptr< const message msg)
static

Return a list of possible MDNs that can be generated for the specified message.

Parameters
msgmessage for which to send a MDN
Returns
list of possible MDNs

References vmime::fields::DISPOSITION_NOTIFICATION_TO, mailboxList::getMailboxAt(), and mailboxList::getMailboxCount().

receivedMDNInfos getReceivedMDN ( const shared_ptr< const message msg)
static

If the specified message is a MDN, return information about it.

Parameters
msgmessage
Exceptions
exceptions::invalid_argumentif the message is not a MDN
Returns
information about the MDN

References MDNHelper::isMDN().

bool isMDN ( const shared_ptr< const message msg)
static

Test whether the specified message is a MDN.

Parameters
msgmessage
Returns
true if the message is a MDN, false otherwise

References vmime::fields::CONTENT_TYPE, contentTypeField::getReportType(), headerField::getValue(), parameterizedHeaderField::hasParameter(), vmime::mediaTypes::MULTIPART, and vmime::mediaTypes::MULTIPART_REPORT.

Referenced by MDNHelper::getReceivedMDN().

bool needConfirmation ( const shared_ptr< const message msg)
static

Check whether we need user confirmation for sending a MDN even if he/she explicitely allowed automatic send of MDNs.

This can happen in some situations, described in RFC-3798.

Parameters
msgmessage for which to send a MDN
Returns
true if user confirmation should be asked, false otherwise

References vmime::fields::DISPOSITION_NOTIFICATION_TO, path::getDomain(), mailbox::getEmail(), path::getLocalPart(), mailboxList::getMailboxAt(), mailboxList::getMailboxCount(), and vmime::fields::RETURN_PATH.


The documentation for this class was generated from the following files: