See METHODS in Mail::Reporter
Represent this imap4 connection as URL.
Create the IMAP connection to the server. IMAP servers can handle multiple folders for a single user, which means that connections may get shared. This is sharing is hidden for the user.
When an imap_client
is specified, then the options hostname
,
port
, username
, and password
are extracted from it.
Option | Defined in | Default |
---|---|---|
authenticate |
| |
domain | <server_name> | |
executable | Mail::Transport |
|
hostname | Mail::Transport |
|
imap_client | ||
interval | Mail::Transport |
|
log | Mail::Reporter |
|
password | Mail::Transport | undef |
port | Mail::Transport | 143 |
proxy | Mail::Transport | undef |
retry | Mail::Transport | <false> |
starttls |
| |
timeout | Mail::Transport |
|
trace | Mail::Reporter |
|
username | Mail::Transport | undef |
via | Mail::Transport |
|
Returned is a list of pairs (ref arrays) each describing one possible
way to contact the server. Each pair contains a mechanism name and
a challenge callback (which may be undef
).
The settings are used by login() to get server access. The initial value origins from new(authenticate), but may be changed later.
Available basic TYPES are CRAM-MD5
, NTLM
, and PLAIN
. With
AUTO
, all available types will be tried. When the Authen::NTLM
is not installed, the NTLM
option will silently be skipped. Be warned
that, because of PLAIN
, erroneous username/password combinations will
be passed readible as last attempt!
The NTLM
authentication requires Authen::NTLM to be installed. Other
methods may be added later. Besides, you may also specify a CODE
reference which implements some authentication.
An ARRAY as TYPE can be used to specify both mechanism as callback. When
no array is used, callback of the pair is set to undef
. See
manual Mail::IMAPClient entry authenticate for the gory details.
$transporter->authentication('CRAM-MD5', [MY_AUTH => \&c], 'PLAIN'); foreach my $pair ($transporter->authentication) { my ($mechanism, $challange) = @$pair; ... }
Used in NTLM authentication to define the Windows domain which is accessed. Initially set by new(domain) and defaults to the server's name.
The follow methods handle protocol internals, and should not be used by a normal user of this class.
Write the message to the server. The optional DATA can be a RFC-822 date or a timestamp.
Add a folder.
Create an object of CLASS, which extends manual Mail::IMAPClient.
All OPTIONS will be passed to the constructor (new) of CLASS.
Be sure that the specific FOLDER is the current one selected. If the folder is already selected, no IMAP traffic will be produced.
The boolean return value indicates whether the folder is selectable. It will return undef if it does not exist.
Remove one folder.
Command the server to delete for real all messages which are flagged to be deleted.
Get some INFO about the MESSAGES from the server. The specified messages
shall extend Mail::Box::Net::Message, Returned is a list
of hashes, each info about one result. The contents of the hash
differs per INFO, but at least a message
field will be present, to
relate to the message in question.
The right folder should be selected before this method is called. When
the connection was lost, undef
is returned. Without any
messages, and empty array is returned. The retrieval is done by
Mail::IMAPClient method fetch()
, which is then
parsed.
In SCALAR context, a hash with labels is returned. In LIST context, pairs are returned.
The WHAT parameter can be 'SET'
, 'CLEAR'
, or 'REPLACE'
. With the
latter, all standard imap flags do not appear in the list will be ignored:
their value may either by set or cleared. See getFlags()
Unknown flags in LIST are stripped from their backslash and lower-cased. For instance, '\SomeWeirdFlag' will become `someweirdflag => 1'.
my @flags = ('\Seen', '\Flagged'); my $labels = Mail::Transport::IMAP4->flags2labels(SET => @flags);
Returns a list of folder names which are sub-folders of the specified FOLDERNAME. Without FOLDERNAME, the top-level foldernames are returned.
Get the records with the specified NAMES from the header. The header
fields are returned as list of Mail::Message::Field::Fast objects.
When the name is ALL
, the whole header is returned.
Returns the values of all flags which are related to the message with the specified ID. These flags are translated into the names which are standard for the MailBox suite.
A HASH is returned. Names which do not appear will also provide a value in the returned: the negative for the value is it was present.
Returns the whole text of the specified message: the head and the body.
Returns a list of UIDs which are defined by the IMAP server.
Returns the object which implements the IMAP4 protocol, an instance of a Mail::IMAPClient, which is logged-in and ready to use.
If the contact to the server was still present or could be established,
an Mail::IMAPClient object is returned. Else, undef
is returned and
no further actions should be tried on the object.
Convert MailBox labels into IMAP flags. Returned is a string. Unsupported labels are ignored.
Returns all predefined flags as list.
Establish a new connection to the IMAP4 server, using username and password.
Change the flags on the message which are represented by the label. The value which can be related to the label will be lost, because IMAP only defines a boolean value, where MailBox labels can contain strings.
Returned is a list of LABEL=>VALUE pairs which could not be send to the IMAP server. These values may be cached in a different way.
The connection is cleanly terminated when the program is terminated.