RT 4.4.5 Documentation

RT::Interface::Email::Role

Go to latest version →

NAME

RT::Interface::Email::Role - Role for mail plugins

SYNOPSIS

    package RT::Interface::Email::Action::Something;

    use Role::Basic 'with';
    with 'RT::Interface::Email::Role';

    sub CheckACL { ... }
    sub HandleSomething { ... }

DESCRIPTION

Provides a means to affect the handling of RT's mail gateway. Mail plugins (which appear in "@MailPlugins" in RT_Config should implement this role.

See docs/extending/mail_plugins.pod for a list of hook points which plugins can implement.

METHODS

TMPFAIL

This should be called for configuration errors. It results in a temporary failure code to the MTA, ensuring that the message is not lost, and will be retried later.

This function should be passed the warning message to log with the temporary failure. Does not return.

FAILURE

This should be used upon rejection of a message. It will not be retried by the MTA; as such, it should be used sparingly, and in conjunction with "MailError" such that the sender is aware of the failure.

The function should be passed a message to return to the mailgate. Does not return.

SUCCESS

The message was successfully parsed. The function takes an optional RT::Ticket object to return to the mailgate. Does not return.

MailError

Sends an error concerning the email, or the processing thereof. Takes the following arguments:

To

Only necessary in "BeforeDecode" and BeforeDecrypt hooks, where it defaults to "OwnerEmail" in RT_Config; otherwise, defaults to the originator of the message.

Subject

Subject of the email

Explanation

The body of the email

FAILURE

If passed a true value, will call "FAILURE" after sending the message.

← Back to index