Mailfetch::Account - a (local or remote) mail account
use Mailfetch::Account::IMAP;
my @remote = (
Mailfetch::Account::APOP->new(
host => 'post.webmailer.de',
user => 'user',
password => 'secret' ),
Mailfetch::Account::APOP->new(
host => 'post.webmailer.de',
user => 'root',
password => 'supersecret' ),
Mailfetch::Account::POP3->new(
host => 'pop.cs.uni-frankfurt.de',
user => 'corion',
password => $ENV{USER_PASS} ),
);
my $local = Mailfetch::Account::Mbox->new( path => "./Mail/corion.net" );
The Mailfetch::Account is needed to describe where mail comes from and where it goes. There are subclasses for the specific types of accounts.
new ARGSCreates a new instance. Most of the stuff is lazy loaded; initial values may be passed via the ARGS hash.
hostAccessor to get/set the hostname. This value is ignored for local files.
userAccessor to get/set the username. This value is ignored for local files.
passwordAccessor to get/set the password. This value is ignored for local files.
pathAccessor to get/set the path. This value is ignored for POP3 servers.
urlCurrently not used
tlsUse TLS when authenticating
message_countNumber of messages in the current folder.
status MESSAGEOutputs a status message. Used for logging.
connectionReturns the connection to the account. Lazy loaded, so this may take some time on the first attempt.
connectInternal method to initialize the connection. Is called on the first call to connection.
disconnectInternal method to teardown the connection. Is called on object destruction.
delete_mail COOKIEDeletes the mail indicated by the cookie.
fetch COOKIEReturns the mail indicated by the cookie.
get_mail COOKIEReturns the mail indicated by the cookie as a scalar.
top_mail COOKIE LINESReturns the first LINES lines of the mail indicated by the cookie.
chdir PATHMethod to set a new path. In the default implementation disconnects and then reconnects with the new path.
deliver MAILDelivers the mail to the store.
nameReturns a string that can be presented to the user in logfiles or other progress indicators.
guessGuesses the correct subclass. Is not very smart.
path => path to mailbox / maildir / whatever