RT::Interface::Email(3)

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

SYNOPSIS
  use lib "!!RT_LIB_PATH!!";
  use lib "!!RT_ETC_PATH!!";

  use RT::Interface::Email  qw(CleanEnv LoadConfig DBConnect
                              );

  #Clean out all the nasties from the environment
  CleanEnv();

  #Load etc/config.pm and drop privs
  LoadConfig();

  #Connect to the database and get RT::SystemUser and RT::Nobody loaded
  DBConnect();

  #Get the current user all loaded
  my $CurrentUser = GetCurrentUser();

DESCRIPTION

METHODS

  CleanEnv
Removes some of the nastiest nasties from the user\'s environment.

  LoadConfig
Loads RT's config file and then drops setgid privileges.

  DBConnect
  Calls RT::Init, which creates a database connection and then creates $RT::Nobody
  and $RT::SystemUser

  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 configuration sub RT::IsRTAddress 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 $head->get('Line') and returns a tuple: user@host, friendly name