GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
Qpsmtpd::Address(3) User Contributed Perl Documentation Qpsmtpd::Address(3)

Qpsmtpd::Address - Lightweight E-Mail address objects

Based originally on cut and paste from Mail::Address and including every jot and tittle from RFC-2821/2822 on what is a legal e-mail address for use during the SMTP transaction.

  my $rcpt = Qpsmtpd::Address->new('<email.address@example.com>');

The objects created can be used as is, since they automatically stringify to a standard form, and they have an overloaded comparison for easy testing of values.

Can be called two ways:
  • Qpsmtpd::Address->new('<full_address@example.com>')

    The normal mode of operation is to pass the entire contents of the RCPT TO: command from the SMTP transaction. The value will be fully parsed via the canonify method, using the full RFC 2821 rules.

  • Qpsmtpd::Address->new("user", "host")

    If the caller has already split the address from the domain/host, this mode will not canonify the input values. This is not recommended in cases of user-generated input for that reason. This can be used to generate Qpsmtpd::Address objects for accounts like "<postmaster>" or indeed for the bounce address "<>".

The resulting objects can be stored in arrays or used in plugins to test for equality (like in badmailfrom).

Primarily an internal method, it is used only on the path portion of an e-mail message, as defined in RFC-2821 (this is the part inside the angle brackets and does not include the "human readable" portion of an address). It returns a list of (local-part, domain).

Retained as a compatibility method, it is completely equivalent to new() called with a single parameter.

Can be used to reset the value of an existing Q::A object, in which case it takes a parameter with or without the angle brackets.

Returns the stringified representation of the address. NOTE: does not escape any of the characters that need escaping, nor does it include the surrounding angle brackets. For that purpose, see format.

Returns the canonical stringified representation of the address. It does escape any characters requiring it (per RFC-2821/2822) and it does include the surrounding angle brackets. It is also the default stringification operator, so the following are equivalent:

  print $rcpt->format();
  print $rcpt;

Returns the "localpart" of the address, per RFC-2821, or the portion before the '@' sign.

If called with one parameter, the localpart is set and the new value is returned.

Returns the "domain" part of the address, per RFC-2821, or the portion after the '@' sign.

If called with one parameter, the domain is set and the new value is returned.

Get or set a note on the address. This is a piece of data that you wish to attach to the address and read somewhere else. For example you can use this to pass data between plugins.

Copyright 2004-2005 Peter J. Holzer. See the LICENSE file for more information.
2013-12-17 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.