Mail-IMAPTalk
view release on metacpan or search on metacpan
- 'Literal'
The string/data in the value is sent as an IMAP literal
regardless of the actual data in the string/data.
- 'Quote'
The string/data in the value is sent as an IMAP quoted string
regardless of the actual data in the string/data.
Examples:
# Password is automatically quoted to "nasty%*\"passwd"
$IMAP->login("joe", 'nasty%*"passwd');
# Append $MsgTxt as string
$IMAP->append("inbox", { Literal => $MsgTxt })
# Append MSGFILE contents as new message
$IMAP->append("inbox", \*MSGFILE ])
# CONSTANTS
These constants relate to the standard 4 states that an IMAP connection can
be in. They are passed and returned from the `state()` method. See RFC 3501
for more details about IMAP connection states.
- _Unconnected_
Current not connected to any server.
- _Connected_
Connected to a server, but not logged in.
- _Authenticated_
Connected and logged into a server, but not current folder.
- _Selected_
Connected, logged in and have 'select'ed a current folder.
# CONSTRUCTOR
- _Mail::IMAPTalk->new(%Options)_
Creates new Mail::IMAPTalk object. The following options are supported.
- **Connection Options**
- **Server**
The hostname or IP address to connect to. This must be supplied unless
the **Socket** option is supplied.
- **Port**
The port number on the host to connect to. Defaults to 143 if not supplied
or 993 if not supplied and UseSSL is true.
- **UseSSL**
If true, use an IO::Socket::SSL connection. All other SSL\_\* arguments
are passed to the IO::Socket::SSL constructor.
- **Socket**
An existing socket to use as the connection to the IMAP server. If you
supply the **Socket** option, you should not supply a **Server** or **Port**
option.
This is useful if you want to create an SSL socket connection using
IO::Socket::SSL and then pass in the connected socket to the new() call.
It's also useful in conjunction with the `release_socket()` method
described below for reusing the same socket beyond the lifetime of the IMAPTalk
object. See a description in the section `release_socket()` method for
more information.
You must have write flushing enabled for any
socket you pass in here so that commands will actually be sent,
and responses received, rather than just waiting and eventually
timing out. you can do this using the Perl `select()` call and
$| ($AUTOFLUSH) variable as shown below.
my $ofh = select($Socket); $| = 1; select ($ofh);
- **UseBlocking**
For historical reasons, when reading from a socket, the module
sets the socket to non-blocking and does a select(). If you're
using an SSL socket that doesn't work, so you have to set
UseBlocking to true to use blocking reads instead.
- **State**
If you supply a `Socket` option, you can specify the IMAP state the
socket is currently in, namely one of 'Unconnected', 'Connected',
'Authenticated' or 'Selected'. This defaults to 'Connected' if not
supplied and the `Socket` option is supplied.
- **ExpectGreeting**
If supplied and true, and a socket is supplied via the `Socket`
option, checks that a greeting line is supplied by the server
and reads the greeting line.
- **PreserveINBOX**
For historical reasons, the special name "INBOX" is rewritten as
Inbox because it looks nicer on the way out, and back on the way
in. If you want to preserve the name INBOX on the outside, set
this flag to true.
- **UseCompress**
If you have the Compress::Zlib package installed, and the server
supports compress, then setting this flag to true will cause
compression to be enabled immediately after login.
- **Login Options**
- **Username**
The username to connect to the IMAP server as. If not supplied, no login
is attempted and the IMAP object is left in the **CONNECTED** state.
If supplied, you must also supply the **Password** option and a login
is attempted. If the login fails, the connection is closed and **undef**
is returned. If you want to do something with a connection even if the
login fails, don't pass a **Username** option, but instead use the **login**
method described below.
- **Password**
( run in 2.322 seconds using v1.01-cache-2.11-cpan-39bf76dae61 )