otrs -> rel-6_0 API documentation

NAME

Kernel::System::MailAccount - to manage mail accounts

DESCRIPTION

All functions to manage the mail accounts.

PUBLIC INTERFACE

new()

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

my $MailAccountObject = $Kernel::OM->Get('Kernel::System::MailAccount');

MailAccountAdd()

adds a new mail account

$MailAccount->MailAccountAdd(
    Login         => 'mail',
    Password      => 'SomePassword',
    Host          => 'pop3.example.com',
    Type          => 'POP3',
    IMAPFolder    => 'Some Folder', # optional, only valid for IMAP-type accounts
    ValidID       => 1,
    Trusted       => 0,
    DispatchingBy => 'Queue', # Queue|From
    QueueID       => 12,
    UserID        => 123,
);

MailAccountGetAll()

returns an array of all mail account data

my @MailAccounts = $MailAccount->MailAccountGetAll();

(returns list of the fields for each account: ID, Login, Password, Host, Type, QueueID, Trusted, IMAPFolder, Comment, DispatchingBy, ValidID)

MailAccountGet()

returns a hash of mail account data

my %MailAccount = $MailAccount->MailAccountGet(
    ID => 123,
);

(returns: ID, Login, Password, Host, Type, QueueID, Trusted, IMAPFolder, Comment, DispatchingBy, ValidID)

MailAccountUpdate()

update a new mail account

$MailAccount->MailAccountUpdate(
    ID            => 1,
    Login         => 'mail',
    Password      => 'SomePassword',
    Host          => 'pop3.example.com',
    Type          => 'POP3',
    IMAPFolder    => 'Some Folder', # optional, only valid for IMAP-type accounts
    ValidID       => 1,
    Trusted       => 0,
    DispatchingBy => 'Queue', # Queue|From
    QueueID       => 12,
    UserID        => 123,
);

MailAccountDelete()

deletes a mail account

$MailAccount->MailAccountDelete(
    ID => 123,
);

MailAccountList()

returns a list (Key, Name) of all mail accounts

my %List = $MailAccount->MailAccountList(
    Valid => 0, # just valid/all accounts
);

MailAccountBackendList()

returns a list of usable backends

my %List = $MailAccount->MailAccountBackendList();

MailAccountFetch()

fetch emails by using backend

my $Ok = $MailAccount->MailAccountFetch(
    Login         => 'mail',
    Password      => 'SomePassword',
    Host          => 'pop3.example.com',
    Type          => 'POP3', # POP3,POP3s,IMAP,IMAPS
    Trusted       => 0,
    DispatchingBy => 'Queue', # Queue|From
    QueueID       => 12,
    UserID        => 123,
);

MailAccountCheck()

Check inbound mail configuration

my %Check = $MailAccount->MailAccountCheck(
    Login         => 'mail',
    Password      => 'SomePassword',
    Host          => 'pop3.example.com',
    Type          => 'POP3', # POP3|POP3S|IMAP|IMAPS
    Timeout       => '60',
    Debug         => '0',
);

TERMS AND CONDITIONS

This software is part of the OTRS project (https://otrs.org/).

This software comes with ABSOLUTELY NO WARRANTY. For details, see the enclosed file COPYING for license information (GPL). If you did not receive this file, see https://www.gnu.org/licenses/gpl-3.0.txt.