Inherits Garbage
The Address class represents one e-mail address.
All aspects of e-mail addresses are emulated, mostly except address groups.
Address groups can exist, but only as empty groups ("internet-drafts:;"). (An empty address group is an address with a name() but without a localpart() or a domain().)
The un-address <> can be parsed and represented; both its name(), localpart() and domain() are empty. Local-only addresses (e.g. "root") are accepted, because so much legacy software generated it, and some even generates it still.
Domains are kept as naked strings, and there is as yet no attempt to make this fit nicely in the database.
Constructs a copy of other.
Constructs an address whose display-name is n (which must be in ASCII), whose localpart is l and whose domain is o.
Constructs an address whose display-name is n, whose localpart is l and whose domain is o.
Constructs an empty invalid Address.
Reimplements Garbage::Garbage().
Returns the domain stored in this Address. In case of a memberless group, domain() returns an empty string.
Returns whatever setError() set, or an empty string.
Returns the numeric ID of this address object in the database, or 0 if it is not known.
This private function contains the shared part of the constructors, initialising the object with the display-name n, localpart l, and domain o and an appropriate type().
Returns the localpart stored in this Address. In case of a memberless group, localpart() returns an empty string.
Returns true if this is a sensible-looking localpart, and false if it needs quoting. We should never permit one of our users to need quoting, but we must permit foreign addresses that do.
Returns the localpart and domain as a String. Returns toString() if the type() isn't Normal or Local.
Returns the name stored in this Address. The name is the RFC 2822 display-part, or in case of memberless groups, the display-name of the group.
A memberless group is stored as an Address whose localpart() and domain() are both empty.
Records message as an error message relating to the parsing of this Address. The initial value is empty.
Sets the numeric ID of this address object to id. This is only meant to be used by the AddressQuery class when it retrieves the ID from the database.
Sets this Address to have name n, overwriting whatever was there before.
Returns an RFC 2822 representation of this address.
Returns the type of Address, which is inferred at construction time.
If type() is Normal, name(), localpart() and domain() are valid. If type() is EmptyGroup, name() alone is. If type() is Bounce or Invalid, none of the three are.
Returns the canonical name belonging to this address.
Removes any addresses from l that exist twice in the list.
Returns true if this Address is a meaningful object, or false if its content is meaningless.
Destroys the object and frees any allocated resources.
This web page based on source code belonging to Oryx Mail Systems GmbH. All rights reserved.