Class Recipient.

Inherits Garbage

The Recipient class holds information about a particular recipient, collected during a delivery attempt and optionally used for sending DSNs.

Recipient::Recipient( Address * a, Mailbox * m )

Constructs a Recipient object whose finalRecipient() is set to a and whose mailbox() is set to m. This function is provided only as a convenience.

Recipient::Recipient( Mailbox * m )

Constructs a Recipient object whose mailbox() is set to m. This function is provided for the convenience of code that creates an Injector.


Constructs a Recipient containing no data. The object must be completed using e.g. setFinalRecipient().

Reimplements Garbage::Garbage().

Action Recipient::action() const

Returns the action recorded by setAction().

EString Recipient::diagnosticCode() const

Records the diagnostic code recorded by setDiagnosticCode().

EString Recipient::dsnParagraph() const

Returns a paragraph containin the DSN for this Recipient. The returned string contains a series of LF-separated lines, but no trailing LF.

EString Recipient::finalLogId() const

Returns whatever was set by setFinalLogId(), or an empty string if setFinalLogId() has not been called.

Address * Recipient::finalRecipient() const

Returns a pointer to the final recipient's address, or a the originalRecipient() if none is recorded. If neither setFinalRecipient() nor setOriginalRecipient() has been called, finalRecipient() returns null.

Date * Recipient::lastAttempt() const

Returns the last attempt date for this recipient, or a null pointer if no deliveries have been attempted.

Mailbox * Recipient::mailbox() const

Returns a pointer to this Recipient's mailbox, or 0 if one hasn't been set with setMailbox().

bool Recipient::operator<=( const Recipient & b )

This function is defined so that SMTP and the Injector may create a SortedList of Recipients. It compares this Recipient to b based on the mailbox() id. If either Recipient has no mailbox() defined, the results are meaningless.

Address * Recipient::originalRecipient() const

Returns a pointer to the original recipient's address, or a null pointer if none is recorded.

EString Recipient::plainTextParagraph() const

Returns a pararaph (as single line) describing the fate of this Recipient.

EString Recipient::remoteMTA() const

Returns the MTA recorded by setRemoteMTA().

void Recipient::setAction( Action a, const EString & s )

Records that a is the action taken wrt. this recipient, and the resulting status s . The initial action() is Unknown and the initial status() an empty string.

s must be a string containing three numbers separated by dots, e.g. "1.2.3" or "1000.2000.3000". The meaning of the numbers is as defined in RFC 3463.

void Recipient::setDiagnosticCode( const EString & code )

Records that code is the diagnostic code resulting from the last delivery attempt. This must be an SMTP code (ie. the RFC 3464 diagnostic-type is always smtp), and if empty, it means that there is no such code. The initial value is empty.

void Recipient::setFinalLogId( const EString & id )

Records that during the last delivery attempt, the remote server issued id as its final log ID. If id is empty, no ID was reported and none will be reported by Recipient.

void Recipient::setFinalRecipient( Address * a )

Records that the message was finally sent to a.

Calling both setFinalRecipient() and setOriginalRecipient() with the same address is discouraged.

void Recipient::setLastAttempt( Date * date )

Records that the last delivery attempt for this recipient happened at date. The initial value, null, means that no deliveries have been attempted.

void Recipient::setMailbox( Mailbox * m )

Sets this recipient's mailbox to m.

void Recipient::setOriginalRecipient( Address * a )

Records that the message was originally sent to a.

void Recipient::setRemoteMTA( const EString & mta )

Records that mta is the MTA to which we attempted to deliver this message the last time. The initial value is empty, which means that we didn't try to deliver the message to any remote MTA.

EString Recipient::status() const

Returns the status recorded by setAction().

bool Recipient::valid() const

Returns true if this Recipient has enough data to return a dsnParagraph() and a plainTextParagraph(), and false if not.

This web page based on source code belonging to The Archiveopteryx Developers. All rights reserved.