PostMaster#

NAME#

Kernel::System::PostMaster - postmaster lib

DESCRIPTION#

All postmaster functions. E. g. to process emails.

PUBLIC INTERFACE#

new()#

Don’t use the constructor directly, use the ObjectManager instead:

my $PostMasterObject = $Kernel::OM->Create(
    'Kernel::System::PostMaster',
    ObjectParams => {
        Email   => \@ArrayOfEmailContent,
        Trusted => 1,                       # 1|0 ignore X-OTRS header if false
    },
);

Run()#

to execute the run process

$PostMasterObject->Run(
    Queue   => 'Junk',  # optional, specify target queue for new tickets
    QueueID => 1,       # optional, specify target queue for new tickets
);

return params

0 = error (also false)
1 = new ticket created
2 = follow up / open/reopen
3 = follow up / close -> new ticket
4 = follow up / close -> reject
5 = ignored (because of X-OTRS-Ignore header)

CheckFollowUp()#

to detect the ticket number in processing email

my ($TicketNumber, $TicketID) = $PostMasterObject->CheckFollowUp(
    Subject => 'Re: [Ticket:#123456] Some Subject',
);

GetEmailParams()#

to get all configured PostmasterX-Header email headers

my %Header = $PostMasterObject->GetEmailParams();