NAME
Mail::Cclient - Mailbox access via the c-client library API
SYNOPSIS
use Mail::Cclient;
$c = Mail::Cclient->new(MAILBOX [, OPTION ...]);
($envelope, $body) = $c->fetchstructure(MSGNO [, FLAG ...] );
$hdr = $c->fetchheader(MSGNO [, FLAG ...]);
$text = $c->fetchtext(MSGNO [, FLAG ..i]);
$text = $c->fetchbody(MSGNO, SECTION, [, FLAG ...]);
$elt = $c->elt(MSGNO);
$c->create(MAILBOX);
$c->delete(MAILBOX);
$c->rename(OLDNAME, NEWNAME);
$c->open(MAILBOX);
$nmsgs = $c->nmsgs;
Mail::Cclient::set_callback KEY => CODE, ...
$c->list(REF, PAT); # uses "list" callback
$c->scan(REF, PAT, CONTENTS);
$c->lsub(REF, PAT);
$c->subscribe(MAILBOX);
$c->unsubscribe(MAILBOX);
$c->status(MAILBOX [, FLAG ...]); # uses "status" callback
$c->copy(SEQUENCE, MAILBOX [, FLAG ...]);
$c->move(SEQUENCE, MAILBOX [, FLAG ...]);
$c->append(MAILBOX, MESSAGE [, DATE [, FLAGS]);
$arrayref = $c->sort(
SORT => ["crit_1", rev_1, ..., "crit_n", rev_n], # (n <= 7)
CHARSET => "MIME character",
SEARCH => "string",
FLAG => [flag_1, ..., flag_n] / "flag" );
$c->search( # uses "search" callback
SEARCH => "string",
CHARSET => "MIME character",
FLAG => ["flag_1", ..., "flag_n"] / "flag");
$c->search_msg(MSGNO, CRITERIA [, CHARSET]);
$arrayref = $c->thread(
THREADING => "orderedsubject/references",
CHARSET => "MIME character",
SEARCH => "string",
FLAG => "flag");
$c->ping;
$c->check; # uses "log" callback
$c->expunge; # uses "expunge" callback
$uid = $c->uid(MSGNO);
$msgno = $c->msgno(uid);
$c->setflag(SEQUENCE, MAILFLAG [, FLAG ...]);
$c->clearflag(SEQUENCE, MAILFLAG [, FLAG ...]);
$c->fetchfast(SEQUENCE);
$c->fetchflags(SEQUENCE);
$c->gc( [FLAG, ...] );
$c->debug;
$c->nodebug;
$c->set_sequence(SEQUENCE);
$c->uid_set_sequence(SEQUENCE);
$result = $c->parameters(PARAM);
$c->parameters(PARAM1 => NEWVALUE1 [, PARAM2 => NEWVALUE2 ...]);
$text = Mail::Cclient::rfc822_base64(SOURCE);
$text = Mail::Cclient::rfc822_qprint(SOURCE);
$str = Mail::Cclient::rfc822_date;
$str = Mail::Cclient::rfc822_write_address(MAILBOX, HOST, PERSONAL);
$str = Mail::Cclient::rfc822_parse_adrlist(ADDRESSES, HOST);
$c->close;
DESCRIPTION
Mail::Cclient
gives access to mailboxes in many different formats (including remote IMAP folders) via the c-client API. The c-client library is the core library used by Pine and the University of Washington IMAP daemon (written by Mark Crispin).
The Perl API is mostly taken directly from the underlying c-client library with minor adjustments in places where Perl provides a more natural interface. The primary interface is an object oriented one via the Mail::Cclient
class but certain methods implicitly use callbacks set via the set_callback function.
The c-client library often provides a given piece of functionality by two different function names: one for simple usage under a name of the form mail_foo
and one with an additional flags arguments under a name of the form mail_foo_full
. The corresponding functionality is available from the Perl Mail::Cclient
class under the single name foo
.
Setting a flag bit such as FT_UID
in the c-client API is done in Perl by appending an extra argument "uid"
to the method call.
Arguments to c-client functions which are there only to pass or receive the length of a string argument or result are not present in the Perl API since Perl handles them automatically.
Some methods take arguments which refer to a message or messages in a mailbox. An argument denoted MSGNO is a number that refers to a single message. Message 1 refers to the first message in the mailbox, unless the "uid" option is passed as as additional argument in which case the number refers to the uid of the message. An argument denoted SEQUENCE refers to a list of messages and is a string such as '1,3,5-9,12'.
Creating a Mail::Cclient
object and associating a mailstream with it is done with the "new"
constructor method (whereas the underlying c-client library uses the mail_open
function).
- new(MAILBOX [, OPTION ...])
-
The MAILBOX argument can be anything accepted by the underlying c-client library. This includes the following forms
- the special string "INBOX"
-
This is the driver-dependent INBOX folder.
- an absolute filename
-
This specifies a mailbox in the default format (usually Berkeley format for most default library builds)
- a string of the form "{host}folder" or "{host/prot}folder"
-
These refer to an IMAP folder held on host. The "folder" part can be "INBOX" to reference the distinguished INBOX folder that the IMAP protocol defines. The username and password required for logging in to the IMAP server are obtained by using the "login" callback (q.v.).
- a string of the form "#driver.foo/bar/baz"
-
This refers to folder "/bar/baz" which is held in a non-default mailbox format handled by the c-client driver "foo" (e.g. "mbx").
The options which can be passed to the
new
are as follows (taken almost verbatim from the c-client Internal.doc file):- debug
-
Log IMAP protocol telemetry through "debug" callback (q.v.).
- readonly
-
Open mailbox read-only.
- anonymous
-
Don't use or update a .newsrc file for news.
- shortcache
-
Don't cache envelopes or body structures.
- prototype
-
Return the "prototype stream" for the driver associated with this mailbox instead of opening the stream.
- halfopen
-
For IMAP and NNTP names, open a connection to the server but don't open a mailbox.
- expunge
-
Silently expunge the oldstream before recycling.
You can use the method
to get the mailstream object to open a different mailbox. The cclient library will try to reuse the same IMAP connection where possible in the case of IMAP mailboxes but the host part of the mailbox spec must be given exactly as in the original connection for this to work.
Read-only access to the fields of the underlying mailstream of a
Mail::Cclient
object is supplied by the following methods:- nmsgs
-
Returns the number of messages in the mailbox.
- mailbox
-
Returns the mailbox name.
- rdonly
-
Stream is open read-only.
- anonymous
-
Stream is open with anonymous access.
- halfopen
-
Stream is half-open; it can be reopened or used for functions that don't need a open mailbox such as $c->create() but no message data can be fetched.
- perm_seen, perm_deleted, perm_flagged, perm_answered, perm_draft
-
The relevant flag can be set permanently.
- kwd_create
-
New user flags can be created by referencing them in setflag or clearflag method calls. This can change during a session (e.g. if there is a limit).
- perm_user_flags
-
Returns a list of the user flags which can be set permanently.
- recent
-
Number of recent messages in current mailbox.
- uid_validity
-
The UID validity value.
- uid_last
-
The highest currently assigned UID in the current mailbox.
The following methods are for creating/deleting/renaming folders.
The following methods provide access to messages themselves: their headers, structures and the text of their bodies (or parts thereof).
- fetchstructure(MSGNO [, FLAG ...] )
-
This returns the equivalent of what c-client calls an ENVELOPE structure for message MSGNO. If called in an array context then the equivalent of a BODY structure is passed as a second return value. The ENVELOPE structure is in the form of a Perl object of class
Mail::Cclient::Envelope
. The BODY structure is in the form of a Perl object of classMail::Cclient::Body
. See later on for the description of these objects. The FLAG "uid" can be passed which makes the MSGNO argument be interpreted as a message uid. - fetchheader(MSGNO [, LINES [, FLAG ...]])
-
This returns the header text (as a single string) of message MSGNO (which is interpreted as a message uid if the flag "uid" is included). With no LINES argument, all headers are put into the string. If an array ref argument is passed then it is taken to be a reference to a list of header names. Those headers are the ones that are included in the result, unless the flag "not" is passed in which case all headers are included except those in the list. The flag "internal" can be passed to avoid canonicalising the header texts. The flag "prefetchtext" can be passed to pre-fetch the RFC822.TEXT part of the message at the same time.
- fetchtext(MSGNO [, FLAG ...])
-
This returns the body of message MSGNO (a message uid if the flag "uid" is included). The whole body is returned as a single string with no MIME processing done. Line endings are canonicalised to CRLF unless the "internal" flag is included. If the "peek" flag is included then the \Seen flag is not actively set (though it may already have been set previously, of course).
- fetchbody(MSGNO, SECTION, [, FLAG ...])
-
This returns a single (MIME) section of message MSGNO (a message uid if the flag "uid" is included). The SECTION argument determines which section is returned and is a string in the form of a dot-separated list of numbers. See the IMAP specification for details. As an example, a multipart/mixed MIME message has sections "1", "2", "3" and so on. If section "3" is multipart/mixed itself, then it has subsections "3.1", "3.2" and so on. The "peek" and "internal" flags may also be passed and have the same effect as in
fetchtext
documented above. - elt(MSGNO)
-
This returns the MESSAGECACHE (commonly known as "elt") information associated with message MSGNO as an object in class Mail::Cclient::Elt. See below for what such an object contains. Important note: for this method to be valid, a previous
fetchstructure
orfetchflags
must have been called on this message. Otherwise, you are into the realms of undefined behaviour and at the mercy of the underlying c-client library.
A message may be copied or moved into another mailbox with the methods
copy
andmove
. These methods only allow the destination mailbox to be of the same type as (and on the same host as) the mailstream object on which the methods are called.- copy(MSGNO, MAILBOX [, FLAGS])
-
This copies message MSGNO (a message uid if the "uid" flag is included) to mailbox MAILBOX. If the "move" flag is included then the message is actually moved instead (for compatibility with the CP_MOVE flag of the underlying c-client
mail_copy_full
function). - move(MSGNO, MAILBOX [, FLAGS])
-
This moved message MSGNO (a message uid if the "uid" flag is included) to mailbox MAILBOX.
- append(MAILBOX, MESSAGE [, DATE [, FLAGS])
-
Append a raw message (MESSAGE is an ordinary string) to MAILBOX, giving it an optional date and FLAGS (again, simply strings).
- sort(KEY => VALUE [, KEY1 => VALUE1 ...])
-
Returns an array reference of message numbers sorted by the given pairs of parameters (KEY => VALUE). The SORT keyword value is a array reference, and the argument "crit_1", ..., "crit_n", is a string and can be one of the following: "date", "arrival", "from", "subject", "to", "cc", "size". The argument rev_1, ... rev_n is 0 or 1 if reverse sorting. The CHARSET keyword value is a MIME character set to use when sorting strings. The SEARCH keyword value is a string like, ALL, SEEN, UNSEEN, ANSWERED, UNANSWERED, FLAGGED, UNFLAGGED, SEARCHED or like SEARCH keyword in search method and return only messages that meet specified search criteria (See the searching criteria section for details). The FLAG keyword value can be a array reference or a string. Flags: "uid" return uid's instead of sequence numbers; "searchfree" return the search program to free storage after finishing (internal use only); "noprefetch" don't prefetch searched messages; "sortfree" return the sort program to free storage after finishing (internal use only). The SORT keyword/value is not optional. All others keywords are optional.
- search(KEY => VALUE [, KEY1 => VALUE1 ...])
-
Search for messages satisfying SEARCH keyword value. The "search" callback (q.v.) is called for each matching message. The SEARCH keyword value is a string containing a search specification as defined in item SEARCH Command (6.4.4.) of RFC2060 (imap2000/docs/rfc/rfc2060.txt). The SEARCH keyword value is like 'ANSWERED TO "malcolm"' or 'FLAGGED SINCE 1-Feb-1994 NOT FROM "Smith"' (See the searching criteria section for details). The CHARSET keyword value is a MIME character set to use when searching strings. The FLAG keyword value can be a array reference or a string. Flags: "uid" return a message uid's instead of sequence numbers; "searchfree" return the search program to free storage after finishing (internal use only); "noprefetch" don't prefetch searched messages. The SEARCH keyword/value is not optional. All others keywords are optional.
- search_msg(MSGNO, CRITERIA [, CHARSET])
-
It inspects the message MSGNO on that stream to see if it matches the CRITERIA or not. If it matches, 1 is returned, else 0.
- thread(KEY => VALUE [, KEY1 => VALUE1 ...])
-
This method returns a array reference of message sequence numbers and/or lists of lists of message numbers. The THREADING keyword value can take one of following strings values: "orderedsubject" or "references". The "orderedsubject" algorithm sorts by subject with a secondary sort of message date, and then for sets of messages with identical subjects. The "references" algorithm threads the searched messages by grouping them together in parent/child relationships based on which messages are replies to others. The CHARSET keyword value is a MIME character set to use when searching strings. The SEARCH keyword value accepts a string ala search() method. The FLAG keyword value is a string. Flags: "uid" return a message uid's instead of sequence numbers. All keywords are optional. If you don't use any keyword, in that case the default value is "orderedsubject".
Example:
ARRAYREF = [2, [3, 6, [4, 23], [44, 7, 96]]
The following methods provide access to information about mailboxes.
- status(MAILBOX [, FLAG ...])
-
This method provides status information about MAILBOX. The information calculated is limited to those mentioned in FLAG arguments and is returned via the "status" callback (q.v.). The FLAG arguments possible are precisely those mentioned in the documentation below for the "status" callback.
The following are miscellaneous methods.
ping
Checks where the mailstream is still alive: used as a keep-alive and to check for new mail.
check
Performs a (driver-dependent) checkpoint of the mailstream (not a check for new mail). Information about the checkpoint is passed to the "log" callback (q.v.).
expunge
Expunges all message marked as deleted in the mailbox. Calls the "expunged" callback (q.v.) on each such message and logging information is passed to the "log" callback. Decrementing message numbers happens after each and every message is expunged. As the example in the c-client documentation for mail_expunge says, if three consecutive messages starting at msgno 5 are expunged, the "expunged" callback will be called with a msgno of 5 three times.
uid(MSGNO)
Returns the uid associated with message MSGNO.
msgno(UID)
Returns the msgno associated with message UID.
setflag(SEQUENCE, MAILFLAG [, FLAG ...])
Sets flag MAILFLAG on each message in SEQUENCE (taken to be a sequence of message uids if the "uid" flag is passed). The "silent" flag causes the local cache not to be updated.
clearflag(SEQUENCE, MAILFLAG [, FLAG ...]);
Clears flag MAILFLAG from each message in SEQUENCE (taken to be a sequence of message uids if the "uid" flag is passed). The "silent" flag causes the local cache not to be updated.
gc( [FLAG, ...] )
Garbage collects the cache for the mailstream. The FLAG arguments, "elt", "env", "texts", determine what is garbage collected.
debug
Enables debugging for the mailstream, logged via the "dlog" callback (q.v.).
nodebug
Disables debugging for the mailstream.
set_sequence(SEQUENCE)
Sets the sequence bit for each message in SEQUENCE (and turns it off for all other messages). This has been renamed for Perl from the underlying c-client function
mail_sequence
to avoid clashing with the sequence field member of the mailstream object.uid_set_sequence(SEQUENCE)
Sets the sequence bit for each message referenced by uid in SEQUENCE (and turns it off for all other messages). This has been renamed for Perl from the underlying c-client function
mail_uid_sequence
for consistency withset_sequence
above.parameters(PARAM [, => NEWVALUE [, PARAM2 => NEWVALUE2 ...]])
With a single argument, gets the current value of parameter PARAM. With one or more pairs of PARAM => VALUE arguments, sets those PARAM values to the given new values. PARAM can be one of the following strings: USERNAME, HOMEDIR, LOCALHOST, SYSINBOX, OPENTIMEOUT, READTIMEOUT, WRITETIMEOUT, CLOSETIMEOUT, RSHTIMEOUT, MAXLOGINTRIALS, LOOKAHEAD, IMAPPORT, PREFETCH, CLOSEONERROR, POP3PORT, UIDLOOKAHEAD, MBXPROTECTION, DIRPROTECTION, LOCKPROTECTION, FROMWIDGET, NEWSACTIVE, NEWSSPOOL, NEWSRC, DISABLEFCNTLLOCK, LOCKEACCESERROR, LISTMAXLEVEL, ANONYMOUSHOME.
The following are utility functions (not methods).
- Mail::Cclient::rfc822_base64(SOURCE)
-
Returns the SOURCE text converted to base64 format.
- Mail::Cclient::rfc822_qprint(SOURCE)
-
Returns the SOURCE text converted to quoted printable format.
- Mail::Cclient::rfc822_date()
-
Returns the current date in RFC822 format.
- Mail::Cclient::rfc822_write_address(MAILBOX, HOST, PERSONAL)
-
This function return an RFC 822 format address string based on the information from MAILBOX, HOST and PERSONAL.
- Mail::Cclient::rfc822_parse_adrlist(ADDRESSES, HOST)
-
This function parses the string of ADDRESSES into an address list array ref. Any addresses missing a host name are have the host name defaulted from the HOST argument. Any parsing errors are noted via the log() callback.
CALLBACKS
Certain methods mentioned above use callbacks to pass or receive extra information. Each callback has a particular name (e.g. "log", "dlog", "list", "login") and can be associated with a particular piece of Perl code via the Mail::Cclient::set_callback
function (available for export by the Mail::Cclient
class). The set_callback
function takes pairs of arguments NAME, CODE for setting callback NAME to be the given CODE, a subroutine reference. The only callback which is required to be set and the only callback whose return value matters is the "login" callback (only used when the "new" method constructs an IMAP mailstream). Apart from that case, callbacks which have not been set are ignored. A callback set to undef is also ignored.
- searched(STREAM, MSGNO)
-
This callback is invoked for each message number satifying the CRITERIA of the "search" method, defined above.
- exists(STREAM, MSGNO)
- expunged(STREAM, MSGNO)
- flags(STREAM, MSGNO)
- notify(STREAM, STRING, ERRFLAG)
- list(STREAM, DELIMITER, MAILBOX [, ATTR ...])
- lsub(STREAM, DELIMITER, MAILBOX [, ATTR ...])
- status(STREAM, MAILBOX, [, ATTR, VALUE] ...)
-
Attribute values passed can be "messages", "recent", "unseen", "uidvalidity", "uidnext".
- log(STRING, ERRFLAG)
- dlog(STRING)
- fatal(STRING)
- login(NETMBXINFO, TRIAL)
-
The "login" callback is invoked when the c-client library is opening an IMAP mailstream and needs to find out the username and password required. This callback must return precisely two values in the form (USERNAME, PASSWORD). TRIAL is the number of the current login attempt (starting at 1). NETMBXINFO is a hash reference with the following keys:
- host
-
The hostname of the IMAP server.
- user
-
The username requested.
- mailbox
-
The mailbox name requested.
- service
- port
- anoflag
-
Set to 1 if anonymous access has been requested otherwise this key is not created at all.
- dbgflag
-
Set to 1 if debugging access has been requested otherwise this key is not created at all.
- critical(STREAM)
- nocritical(STREAM)
- diskerror(STREAM, ERRCODE, SERIOUS)
ENVELOPES, BODIES, ADDRESSES and ELTS
The results of the fetchstructure
and elt
methods involve objects in the classes Mail::Cclient::Envelope
, Mail::Cclient::Body
, Mail::Cclient::Address
and Mail::Cclient::Elt
. These will be referred to as Envelope, Body, Address and Elt objects respectively. These objects are all "read-only" and only have methods for picking out particular fields.
Address objects
An Address object represents a single email address and has the following fields, available as methods or, if Perl 5.005 or later is being used, as pseudo-hash keys.
- personal
-
The personal phrase of the address (i.e. the part contained in parentheses or outside the angle brackets).
- adl
-
The at-domain-list or source route (not usually used).
- mailbox
-
The mailbox name (i.e. the part before the @ which is usually a username or suchlike).
- host
-
The hostname (i.e. the part after the @).
- error
-
Only set if the address has delivery errors when
smtp_mail
is called. Since that function hasn't been implemented in the Perl module yet, this isn't any use.
Envelope objects
An Envelope object represents a structured form of the header of a message. It has the following fields, available as methods or, if Perl 5.005 or later is being used, as pseudo-hash keys.
- remail, date, subject, in_reply_to, message_id, newsgroups, followup_to, references,
-
These are all strings.
- return_path, from, sender, reply_to, to, cc, bcc
-
These are all references to lists which contain one or more Address objects.
Body objects
A Body object represents the structure of a message body (not its contents).It has the following fields, available as methods or, if Perl 5.005 or later is being used, as pseudo-hash keys.
- type
-
The MIME type (as a string) of the message (currently in uppercase as returned from the c-client library). For example, "TEXT" or "MULTIPART".
- encoding
-
The MIME encoding (as a string) of the message.
- subtype
-
The MIME subtype (as a string) of the message. For example, "PLAIN", "HTML" or "MIXED".
- parameter
-
A reference to a list of MIME parameter key/value pairs.
- id
-
The message ID.
- description
-
The MIME description of the body part.
- nested
-
If (and only if) the body is of MIME type multipart, then this field is a reference to a list of Body objects, each representing one of the sub parts of the message. If (and only if) the body is of MIME type message/rfc822, then this field is a reference to a list of the form (ENVELOPE, BODY) which are, respectively, the Body and Envelope objects referring to the encapsulated message. If the message is not of MIME type multipart or message/rfc822 then this field is undef.
- lines
-
The size in lines of the body.
- bytes
-
The size in bytes of the body.
- md5
-
The MD5 checksum of the body.
- disposition
-
The content disposition of the body: a reference to a list consisting of the disposition type followed by a (possibly empty) list of parameter key/value pairs.
Elt objects
These have fields containing flag information for a given message, along with internal date information and the RFC822 message size.
- msgno
-
The message number.
- date
-
This contains the internal date information (spread about a series of bitfields in the underlying c-client library C structure) in the form of a string:
yyyy-mm-dd hh:mm:ss [+-]hhmm
- flags
-
A reference to a list of flags associated with the message. The flags are in the forms of their RFC2060 names (e.g. \Deleted, \Seen) for official flags and the user-chosen name for user-defined flags.
- rfc822_size
-
The RFC822 size of the message.
SEARCHING CRITERIA
Searching criteria consist of one or more search keys. When multiple keys are specified, the result is the intersection (AND function) of all the messages that match those keys. A search key can also be a parenthesized list of one or more search keys. In all search keys that use strings, a message matches the key if the string is a substring of the field. The matching is case-insensitive.
The defined search keys are as follows.
- <message set>
-
Messages with message sequence numbers corresponding to the specified message sequence number set (not implemented yet).
- ALL
-
All messages in the mailbox; the default initial key for ANDing.
- ANSWERED
-
Messages with the \Answered flag set.
- BCC <string>
-
Messages that contain the specified string in the envelope structure's BCC field.
- BEFORE <date>
-
Messages whose internal date is earlier than the specified date.
- BODY <string>
-
Messages that contain the specified string in the body of the message.
- CC <string>
-
Messages that contain the specified string in the envelope structure's CC field.
- DELETED
-
Messages with the \Deleted flag set.
- DRAFT
-
Messages with the \Draft flag set.
- FLAGGED
-
Messages with the \Flagged flag set.
- FROM <string>
-
Messages that contain the specified string in the envelope structure's FROM field.
- HEADER <field-name> <string>
-
Messages that have a header with the specified field-name (as defined in [RFC-822]) and that contains the specified string in the [RFC-822] field-body (not implemented yet).
- KEYWORD <flag>
-
Messages with the specified keyword set.
- LARGER <n>
-
Messages with an [RFC-822] size larger than the specified number of octets.
- NEW
-
Messages that have the \Recent flag set but not the \Seen flag. This is functionally equivalent to "(RECENT UNSEEN)".
- NOT <search-key>
-
Messages that do not match the specified search key.
- OLD
-
Messages that do not have the \Recent flag set. This is functionally equivalent to "NOT RECENT" (as opposed to "NOT NEW").
- ON <date>
-
Messages whose internal date is within the specified date.
- OR <search-key1> <search-key2>
-
Messages that match either search key.
- RECENT
-
Messages that have the \Recent flag set.
- SEEN
-
Messages that have the \Seen flag set.
- SENTBEFORE <date>
-
Messages whose [RFC-822] Date: header is earlier than the specified date.
- SENTON <date>
-
Messages whose [RFC-822] Date: header is within the specified date.
- SENTSINCE <date>
-
Messages whose [RFC-822] Date: header is within or later than the specified date.
- SINCE <date>
-
Messages whose internal date is within or later than the specified date.
- SMALLER <n>
-
Messages with an [RFC-822] size smaller than the specified number of octets.
- SUBJECT <string>
-
Messages that contain the specified string in the envelope structure's SUBJECT field.
- TEXT <string>
-
Messages that contain the specified string in the header or body of the message.
- TO <string>
-
Messages that contain the specified string in the envelope structure's TO field.
- UID <message set>
-
Messages with unique identifiers corresponding to the specified unique identifier set (not implemented yet).
- UNANSWERED
-
Messages that do not have the \Answered flag set.
- UNDELETED
-
Messages that do not have the \Deleted flag set.
- UNDRAFT
-
Messages that do not have the \Draft flag set.
- UNFLAGGED
-
Messages that do not have the \Flagged flag set.
- UNKEYWORD <flag>
-
Messages that do not have the specified keyword set.
- UNSEEN
-
Messages that do not have the \Seen flag set.
CAVEATS
This CAVEATS section was contributed by Bruce Gingery <bgingery@gtcs.com>.
The Mail::Cclient::mailbox method returns the actual full path opened, which may not give an accurate string comparison with the mailbox that was requested to be opened. This is especially true with remote mailboxes.
The C-Client library is VERY intolerant of logic errors, and does not automatically garbage collect. Use the gc
method as it makes sense for your application.
Some POP3 servers delete and expunge WITHOUT instruction to do so. This is not a malfunction in either the C-Client code nor the Mail::Cclient modules.
The open
method can be used to extend a halfopen
connection (e.g. use the same c-client instance to read a mailbox that was previously halfopened for a list of mailboxes. This may or may not be a good idea, depending upon your needs. It does, however, eliminate the problem of opening multiple connections, such as has been noted in Netscape 4.x mail handling, and which plagues some servers badly. It may be better, however, to close
the connection used for list
, and re-instantiate to process the mailbox.
C-Client may not support headers you need for send. Note that other modules can be used in place of sending with the c-client. These include Net::SMTP, local invocation of piped sendmail (or other E-mail insertion software), or sendto: URLs under libwww POST.
Elt
information for remote mailboxes is server dependent, as well. You may or may not get rfc822_size in elt returns, for example.
Multiple c-client instances open simultaneously may not work as expected.
AUTHOR
Malcolm Beattie, mbeattie@sable.ox.ac.uk.
VERSION
version 1.3
SEE ALSO
perl(1) IMAP::Admin Mail::Send
15 POD Errors
The following errors were encountered while parsing the POD:
- Around line 459:
Expected '=item *'
- Around line 464:
Expected '=item *'
- Around line 470:
Expected '=item *'
- Around line 480:
Expected '=item *'
- Around line 484:
Expected '=item *'
- Around line 488:
Expected '=item *'
- Around line 494:
Expected '=item *'
- Around line 500:
Expected '=item *'
- Around line 505:
Expected '=item *'
- Around line 510:
Expected '=item *'
- Around line 514:
Expected '=item *'
- Around line 521:
Expected '=item *'
- Around line 528:
Expected '=item *'
- Around line 572:
You forgot a '=back' before '=head1'
- Around line 834:
'=item' outside of any '=over'