Kernel::System::MailAccount - to manage mail accounts
All functions to manage the mail accounts.
Don't use the constructor directly, use the ObjectManager instead:
my $MailAccountObject = $Kernel::OM->Get('Kernel::System::MailAccount');
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,
);
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)
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)
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,
);
deletes a mail account
$MailAccount->MailAccountDelete(
ID => 123,
);
returns a list (Key, Name) of all mail accounts
my %List = $MailAccount->MailAccountList(
Valid => 0, # just valid/all accounts
);
returns a list of usable backends
my %List = $MailAccount->MailAccountBackendList();
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,
);
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',
);
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.