RT::Interface::CLI - helper functions for creating a commandline RT interface
Takes either a scalar or a reference to a scalr which contains a stringified MIME message. Parses it.
Returns true if it wins. Returns false if it loses.
Parses a mime entity from a filehandle passed in as an argument
Parses a mime entity from a filename passed in as an argument
A helper for the various parsers to turn around and do the dispatch to the actual parser
cleans up and postprocesses a newly parsed MIME Entity
# TODO this doesn't belong here. # TODO doc this
Takes a hashref object containing QueueObj, Head and CurrentUser objects. Returns a list of all email addresses in the To and Cc headers b<except> the current Queue\'s email addresses, the CurrentUser\'s email address and anything that the $RTAddressRegexp matches.
Takes a MIME::Header object. Returns a tuple: (user@host, friendly name) of the From (evaluated in order of Reply-To:, From:, Sender)
Takes a MIME::Header object. Return a single value : user@host of the From (evaluated in order of Errors-To:,Reply-To:, From:, Sender)
Takes an address from $self->Head->get('Line') and returns a tuple: user@host, friendly name
Takes a single parameter, an email address. Returns true if that address matches the $RTAddressRegexp. Returns false, otherwise.
Takes a single argument, an array of email addresses. Returns the same array with any IsRTAddress()es weeded out.
LookupExternalUserInfo is a site-definable method for synchronizing incoming users with an external data source.
This routine takes a tuple of EmailAddress and FriendlyName EmailAddress is the user's email address, ususally taken from an email message's From: header. FriendlyName is a freeform string, ususally taken from the "comment" portion of an email message's From: header.
It returns (FoundInExternalDatabase, ParamHash);
FoundInExternalDatabase must be set to 1 before return if the user was found in the external database.
ParamHash is a Perl parameter hash which can contain at least the following fields. These fields are used to populate RT's users database when the user is created
EmailAddress is the email address that RT should use for this user. Name is the 'Name' attribute RT should use for this user. 'Name' is used for things like access control and user lookups. RealName is what RT should display as the user's name when displaying 'friendly' names
Return the parsed head from this message
Return the parsed Entity from this message
A private instance method which sets up a mime parser to do its job