VMime
transport Class Referenceabstract
Inheritance diagram for transport:
Collaboration diagram for transport:

Public Member Functions

virtual void send (shared_ptr< vmime::message > msg, utility::progressListener *progress=NULL)
 
virtual void send (const mailbox &expeditor, const mailboxList &recipients, utility::inputStream &is, const size_t size, utility::progressListener *progress=NULL, const mailbox &sender=mailbox())=0
 
virtual void send (shared_ptr< vmime::message > msg, const mailbox &expeditor, const mailboxList &recipients, utility::progressListener *progress=NULL, const mailbox &sender=mailbox())
 
Type getType () const
 
- Public Member Functions inherited from service
virtual ~service ()
 
virtual const string getProtocolName () const =0
 
shared_ptr< const sessiongetSession () const
 
shared_ptr< sessiongetSession ()
 
virtual const serviceInfosgetInfos () const =0
 
virtual void connect ()=0
 
virtual void disconnect ()=0
 
virtual bool isConnected () const =0
 
virtual void noop ()=0
 
shared_ptr< const
security::authenticator
getAuthenticator () const
 
shared_ptr
< security::authenticator
getAuthenticator ()
 
void setAuthenticator (shared_ptr< security::authenticator > auth)
 
void setCertificateVerifier (shared_ptr< security::cert::certificateVerifier > cv)
 
shared_ptr
< security::cert::certificateVerifier
getCertificateVerifier ()
 
void setSocketFactory (shared_ptr< socketFactory > sf)
 
shared_ptr< socketFactorygetSocketFactory ()
 
void setTimeoutHandlerFactory (shared_ptr< timeoutHandlerFactory > thf)
 
shared_ptr< timeoutHandlerFactorygetTimeoutHandlerFactory ()
 
void setTracerFactory (shared_ptr< tracerFactory > tf)
 
shared_ptr< tracerFactorygetTracerFactory ()
 
template<typename TYPE >
void setProperty (const string &name, const TYPE &value)
 
virtual bool isSecuredConnection () const =0
 
virtual shared_ptr
< connectionInfos
getConnectionInfos () const =0
 

Protected Member Functions

 transport (shared_ptr< session > sess, const serviceInfos &infos, shared_ptr< security::authenticator > auth)
 
shared_ptr< headerFieldprocessHeaderField (shared_ptr< headerField > field)
 
void processHeader (shared_ptr< header > header)
 
- Protected Member Functions inherited from service
 service (shared_ptr< session > sess, const serviceInfos &infos, shared_ptr< security::authenticator > auth)
 
- Protected Member Functions inherited from object
 object ()
 
 object (const object &)
 
objectoperator= (const object &)
 
virtual ~object ()
 

Additional Inherited Members

- Public Types inherited from service
enum  Type { TYPE_STORE = 0, TYPE_TRANSPORT }
 

Detailed Description

A transport service.

Encapsulate protocols that can send messages.

Constructor & Destructor Documentation

transport ( shared_ptr< session sess,
const serviceInfos infos,
shared_ptr< security::authenticator auth 
)
protected

Member Function Documentation

transport::Type getType ( ) const
virtual

Return the type of service.

Returns
type of service

Implements service.

References service::TYPE_TRANSPORT.

void processHeader ( shared_ptr< header header)
protected

Prepares the header before transmitting the message.

Removes headers that should not be present (eg. "Bcc", "Return-Path"), or adds missing headers that are required/recommended by the RFCs. The header is modified inline.

Parameters
headerheaders to process

References vmime::fields::DATE, messageId::generateId(), vmime::fields::MESSAGE_ID, vmime::fields::MIME_VERSION, datetime::now(), transport::processHeaderField(), and vmime::SUPPORTED_MIME_VERSION.

Referenced by transport::send().

shared_ptr< headerField > processHeaderField ( shared_ptr< headerField field)
protected

Called by processHeader().

Decides what to do with the specified header field.

Returns
NULL if the header should be removed, a reference to a new headerField if the field is to be replaced, or a reference to the same headerField that was passed if the field should be left as is

References vmime::fields::BCC, stringUtils::isStringEqualNoCase(), vmime::fields::ORIGINAL_RECIPIENT, and vmime::fields::RETURN_PATH.

Referenced by transport::processHeader().

void send ( shared_ptr< vmime::message msg,
utility::progressListener progress = NULL 
)
virtual

Send a message over this transport service.

The default implementation simply generates the whole message into a string buffer and "streams" it via a inputStreamStringAdapter.

Parameters
msgmessage to send
progressprogress listener, or NULL if not used

References vmime::fields::BCC, vmime::fields::CC, vmime::clone(), vmime::fields::FROM, transport::processHeader(), vmime::fields::SENDER, and vmime::fields::TO.

virtual void send ( const mailbox expeditor,
const mailboxList recipients,
utility::inputStream is,
const size_t  size,
utility::progressListener progress = NULL,
const mailbox sender = mailbox() 
)
pure virtual

Send a message over this transport service.

Parameters
expeditorexpeditor mailbox
recipientslist of recipient mailboxes
isinput stream providing message data (header + body)
sizesize of the message data
progressprogress listener, or NULL if not used
senderenvelope sender (if empty, expeditor will be used)

Implemented in SMTPTransport, and sendmailTransport.

void send ( shared_ptr< vmime::message msg,
const mailbox expeditor,
const mailboxList recipients,
utility::progressListener progress = NULL,
const mailbox sender = mailbox() 
)
virtual

Send a message over this transport service.

The default implementation simply generates the whole message into a string buffer and "streams" it via a inputStreamStringAdapter.

Parameters
msgmessage to send
expeditorexpeditor mailbox
recipientslist of recipient mailboxes
progressprogress listener, or NULL if not used
senderenvelope sender (if empty, expeditor will be used)

Reimplemented in SMTPTransport.


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