Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

qpsmtpd::address(3pm) [debian man page]

Qpsmtpd::Address(3pm)					User Contributed Perl Documentation				     Qpsmtpd::Address(3pm)

NAME
Qpsmtpd::Address - Lightweight E-Mail address objects DESCRIPTION
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. USAGE
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. METHODS
new() Can be called two ways: o 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. o 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). canonify() 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). parse() Retained as a compatibility method, it is completely equivalent to new() called with a single parameter. address() 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. 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; user([$user]) 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. host([$host]) 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. notes($key[,$value]) 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
Copyright 2004-2005 Peter J. Holzer. See the LICENSE file for more information. perl v5.14.2 2009-04-02 Qpsmtpd::Address(3pm)

Check Out this Related Man Page

Address(3pm)						User Contributed Perl Documentation					      Address(3pm)

NAME
Mail::RFC822::Address - Perl extension for validating email addresses according to RFC822 SYNOPSIS
use Mail::RFC822::Address qw(valid validlist); if (valid("pdw@ex-parrot.com")) { print "That's a valid address "; } if (validlist("pdw@ex-parrot.com, other@elsewhere.com")) { print "That's a valid list of addresses "; } DESCRIPTION
Mail::RFC822::Address validates email addresses against the grammar described in RFC 822 using regular expressions. How to validate a user supplied email address is a FAQ (see perlfaq9): the only sure way to see if a supplied email address is genuine is to send an email to it and see if the user recieves it. The one useful check that can be performed on an address is to check that the email address is syntactically valid. That is what this module does. This module is functionally equivalent to RFC::RFC822::Address, but uses regular expressions rather than the Parse::RecDescent parser. This means that startup time is greatly reduced making it suitable for use in transient scripts such as CGI scripts. valid ( address ) Returns true or false to indicate if address is an RFC822 valid address. validlist ( addresslist ) In scalar context, returns true if the parameter is an RFC822 valid list of addresses. In list context, returns an empty list on failure (an invalid address was found); otherwise a list whose first element is the number of addresses found and whose remaining elements are the addresses. This is needed to disambiguate failure (invalid) from success with no addresses found, because an empty string is a valid list. AUTHOR
Paul Warren, pdw@ex-parrot.com CREDITS
Most of the test suite in test.pl is taken from RFC::RFC822::Address, written by Abigail, abigail@foad.org COPYRIGHT and LICENSE This program is copyright 2001-2002 by Paul Warren. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. SEE ALSO
RFC::RFC822::Address, Mail::Address perl v5.10.1 2002-04-13 Address(3pm)
Man Page