NAME

  RT::Interface::CLI - helper functions for creating a commandline RT interface

SYNOPSIS

DESCRIPTION

METHODS

new

ParseMIMEEntityFromScalar $message

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.

ParseMIMEEntityFromFilehandle *FH

Parses a mime entity from a filehandle passed in as an argument

ParseMIMEEntityFromFile

Parses a mime entity from a filename passed in as an argument

_DoParse PARSEMETHOD CONTENT

A helper for the various parsers to turn around and do the dispatch to the actual parser

_PostProcessNewEntity

cleans up and postprocesses a newly parsed MIME Entity

MailError { }

# TODO this doesn't belong here. # TODO doc this

ParseCcAddressesFromHead HASHREF

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.

ParseSenderAddressFromHead

Takes a MIME::Header object. Returns a tuple: (user@host, friendly name) of the From (evaluated in order of Reply-To:, From:, Sender)

ParseErrorsToAddressFromHead

Takes a MIME::Header object. Return a single value : user@host of the From (evaluated in order of Errors-To:,Reply-To:, From:, Sender)

ParseAddressFromHeader ADDRESS

Takes an address from $self->Head->get('Line') and returns a tuple: user@host, friendly name

IsRTaddress ADDRESS

Takes a single parameter, an email address. Returns true if that address matches the $RTAddressRegexp. Returns false, otherwise.

CullRTAddresses ARRAY

Takes a single argument, an array of email addresses. Returns the same array with any IsRTAddress()es weeded out.

LookupExternalUserInfo
 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

Head

Return the parsed head from this message

Entity

Return the parsed Entity from this message

_SetupMIMEParser $parser

A private instance method which sets up a mime parser to do its job