| Message(3pm) | User Contributed Perl Documentation | Message(3pm) |
Cyrus::Annotator::Message - representation of a message to annotate
use warnings;
use strict;
package MyAnnotatorDaemon;
use base Cyrus::Annotator::Daemon;
sub annotate_message
{
my ($message) = @_;
$message->set_flag('\Flagged');
$message->set_shared_annotation('/comment', 'Hello!!');
}
MyAnnotatorDaemon->run();
This module encapsulates a message which is being processed by the annotator daemon.
Cyrus::Annotator::Message has the following methods.
# required
* BODYSTRUCTURE => parsed bodystructure
# optional (but you need to provide SOMETHING if your code uses any
# of the accessors)
* GUID => 40 character sha1
* HEADER => Mail::Header object with headers pre-parsed
* FILENAME => path to rfc822 file
# totally optional (will be considered empty if not set)
* FLAGS => array of already set flags
* ANNOTATIONS => array of already set annotations
If no 'nbytes' is passed, read the entire part.
is a structure closely based on the IMAP BODYSTRUCTURE, decoded into a hash, including recursively all MIME sections. In general, the following items are defined for all body structures:
Body structures which have a MIME-Type of 'multipart' contain the following items:
For body structures except those that have a MIME-Type of 'multipart', the following are defined:
Note that changes are not immediate. They will be applied by the annotator at the end.
For example:
$message->set_flag("\\Flagged");
For example:
$message->set_shared_annotation('/comment', 'Hello World');
[["\\Flagged", 1]], [['/comment', 'value.shared', 'Hello World']]
RFC3501, RFC5257.
Greg Banks <gnb@fastmail.fm>. Bron Gondwana <brong@fastmail.fm>.
| 2024-03-16 | perl v5.38.2 |