Inheritance diagram for Stamp:

The "Received" header field provides information that may be helpful in resolving mail delivery problems. In practice, though, the most recent time stamp is often used by email client applications to obtain the time that the message was received by that client's mail server. The other information provided in the "Received" header field is optional and inconsistent between implementations. Some implementations do not provide much of the optional information, while other implementations provide it in non-standard forms.
The following is a sample time stamp line, which shows all the optional information:
Received: from xyz.net by mx.org via TELENET with SMTP
id M12345 for smith@aol.com ; Tue, 6 Oct 1998 09:23:59 -0700Stamp provides access to all the information provided in a "Received" header field body, including sending host ("xyz.net"), receiving host ("mx.org"), physical mechanism ("TELENET"), protocol ("SMTP"), internal message identifier ("M12345"), original addressee ("smith\@aol.com"), and date/time the message was received ("Tue, 6 Oct 1998 09:23:59 -0700"). If an optional field is not present, then the "getter" function for that field returns an empty string.
Stamp follows the protocol for parse() and assemble() as required by Node.
Note: Because of inconsistencies in many server implementations, the parsing may not be reliable enough for applications to depend on. The only parsed information that you should probably rely on is the final date/time stamp. RFC 2821 suggests that the "Received" header field is intended mostly for inspection by mail system administrators to resolve mail delivery problems.
Public Member Functions | |
| Stamp () | |
| Default constructor. | |
| Stamp (const Stamp &other) | |
| Copy constructor. | |
| Stamp (const String &str, Node *parent=0) | |
| Constructor that takes an initial string and parent node. | |
| virtual | ~Stamp () |
| Destructor. | |
| const Stamp & | operator= (const Stamp &other) |
| Assignment operator. | |
| virtual void | parse () |
| Parses the string representation. | |
| virtual void | assemble () |
| Assembles the string representation. | |
| virtual Node * | clone () const |
| Creates a copy of this object. | |
| const String & | from () const |
| Gets the sending host. | |
| void | setFrom (const String &sendingHost) |
| Sets the sending host. | |
| const String & | by () const |
| Gets the receiving host. | |
| void | setBy (const String &receivingHost) |
| Sets the receiving host. | |
| const String & | via () const |
| Gets the physical mechanism. | |
| void | setVia (const String &mechanism) |
| Sets the physical mechanism. | |
| const String & | with () const |
| Gets the protocol. | |
| void | setWith (const String &protocol) |
| Sets the protocol. | |
| const String & | id () const |
| Gets the internal message identifier. | |
| void | setId (const String &id) |
| Sets the internal message identifier. | |
| const String & | for_ () const |
| Gets the original addressee. | |
| void | setFor (const String &addressee) |
| Sets the original addressee. | |
| DateTime & | date () |
| Gets the date and time. | |
| void | setDate (const DateTime &date) |
| Sets the date and time. | |
Static Public Member Functions | |
| Stamp * | newStamp () |
| Creates a new instance. | |
Static Public Attributes | |
| Stamp *(* | sNewStamp )() |
| Provides a class factory hook. | |
|
|
This constructor sets the Stamp object's string representation to the empty string and sets its parent node to NULL. |
|
|
This constructor performs a deep copy of its argument. The parent node of the new Stamp object is set to NULL.
|
|
||||||||||||
|
This constructor sets the Stamp object's string representation to str and sets its parent node to parent. Normally, you call the virtual function parse() immediately after this constructor to create the broken-down representation.
|
|
|
Destructor |
|
|
This virtual function, inherited from Node, executes the assemble operation for Stamp objects. The assemble operation creates or updates the string representation from the broken-down representation. For Stamp objects, the assemble operation builds the string representation from the Stamp object's attributes. Before it builds the string representation, this member function first calls the assemble() member function of the object's contained DateTime object. You should call this member function after you set or modify any of the attributes of this Stamp object, and before you retrieve the string representation. This function clears the is-modified flag. Reimplemented from FieldBody. |
|
|
Gets the receiving host. The receiving host is the host that added this field to the message headers. In the "Received" header field, the receiving host follows the "by" keyword. If the receiving host is not present, this function returns an empty string.
|
|
|
This virtual function, inherited from Node, creates a new Stamp object that has the same value as this Stamp object. The parent node of the new Stamp object is set to NULL.
Reimplemented from FieldBody. |
|
|
Gets the date and time that the message was received. This information is the only required information in the "Received" header field.
|
|
|
Gets the original addressee. This information may be important if some kind of address translation occurs. In the "Received" header field, the addressee follows the "for" keyword. If the original addressee is not present, this function returns an empty string.
|
|
|
Gets the sending host. In the "Received" header field, the sending host follows the "from" keyword. If the sending host is not present, this function returns an empty string.
|
|
|
Gets the internal message identifier. This is a value that is meaningful to the receiving host, such as the name of a file that was used to temporarily store the message. In the "Received" header field, the identifier follows the "id" keyword. If the identifier is not present, this function returns an empty string.
|
|
|
Creates a new Stamp object. If the static data member sNewStamp is NULL, this member function creates a new Stamp object and returns it. Otherwise, newStamp() calls the user-supplied function that sNewStamp points to and returns the object created by that function.
|
|
|
Performs a deep copy of its argument. The parent node of this Stamp object is not changed.
|
|
|
This virtual function, inherited from Node, executes the parse operation for Stamp objects. The parse operation creates or updates the broken-down representation from the string representation. For Stamp objects, the parse operation parses the string representation to extract the from, by, via, with, id, for, and date attributes. This member function also calls the parse() member function of its contained DateTime object. You should call this member function after you set or modify the string representation, and before you access any of the attributes of this object. This function clears the is-modified flag. Reimplemented from FieldBody. |
|
|
Sets the receiving host.
|
|
|
Sets the date and time that the message was received.
|
|
|
Sets the original addressee.
|
|
|
Sets the sending host.
|
|
|
Sets the internal message identifier.
|
|
|
Sets the physical mechanism.
|
|
|
Sets the protocol.
|
|
|
Gets the physical mechanism. In the "Received" header field, the physical mechanism follows the "via" keyword. If the physical mechanism is not present, this function returns an empty string.
|
|
|
Gets the protocol that was used to send this message (that is, the protocol by which the receiving host received it). In the "Received" header field, the protocol follows the "with" keyword. Usually, the protocol is SMTP or ESMTP. If the protocol is not present, this function returns an empty string.
|
|
|
If sNewStamp is not NULL, it must point to a user-supplied function that returns a new instance of a subclass of Stamp.
|
Copyright © 2001-2007 Hunny Software, Inc. All rights reserved.