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 ARGS
Creates a new instance. Most of the stuff is lazy loaded; initial values may be passed via the ARGS
hash.
host
Accessor to get/set the hostname. This value is ignored for local files.
user
Accessor to get/set the username. This value is ignored for local files.
password
Accessor to get/set the password. This value is ignored for local files.
path
Accessor to get/set the path. This value is ignored for POP3 servers.
url
Currently not used
tls
Use TLS when authenticating
message_count
Number of messages in the current folder.
status MESSAGE
Outputs a status message. Used for logging.
connection
Returns the connection to the account. Lazy loaded, so this may take some time on the first attempt.
connect
Internal method to initialize the connection. Is called on the first call to connection
.
disconnect
Internal method to teardown the connection. Is called on object destruction.
delete_mail COOKIE
Deletes the mail indicated by the cookie.
fetch COOKIE
Returns the mail indicated by the cookie.
get_mail COOKIE
Returns the mail indicated by the cookie as a scalar.
top_mail COOKIE LINES
Returns the first LINES
lines of the mail indicated by the cookie.
chdir PATH
Method to set a new path. In the default implementation disconnects and then reconnects with the new path.
deliver MAIL
Delivers the mail to the store.
name
Returns a string that can be presented to the user in logfiles or other progress indicators.
guess
Guesses the correct subclass. Is not very smart.
path => path to mailbox / maildir / whatever