21 |
21 |
|
22 |
22 |
sub new {
|
23 |
23 |
my ($class, %params) = @_;
|
24 |
|
my $config = $::lx_office_conf{imap_client} || {};
|
|
24 |
my %config = (
|
|
25 |
enabled => $::instance_conf->get_imap_client_enabled,
|
|
26 |
hostname => $::instance_conf->get_imap_client_hostname,
|
|
27 |
port => $::instance_conf->get_imap_client_port,
|
|
28 |
ssl => $::instance_conf->get_imap_client_ssl,
|
|
29 |
username => $::instance_conf->get_imap_client_username,
|
|
30 |
password => $::instance_conf->get_imap_client_password,
|
|
31 |
base_folder => $::instance_conf->get_imap_client_base_folder || 'INBOX',
|
|
32 |
);
|
25 |
33 |
my $self = bless {
|
26 |
|
enabled => $config->{enabled},
|
27 |
|
hostname => $config->{hostname},
|
28 |
|
port => $config->{port},
|
29 |
|
ssl => $config->{ssl},
|
30 |
|
username => $config->{username},
|
31 |
|
password => $config->{password},
|
32 |
|
base_folder => $config->{base_folder} || 'INBOX',
|
|
34 |
%config,
|
33 |
35 |
%params,
|
34 |
36 |
}, $class;
|
35 |
37 |
return unless $self->{enabled};
|
... | ... | |
188 |
190 |
|
189 |
191 |
use SL::IMAPClient;
|
190 |
192 |
|
191 |
|
# uses the config in config/kivitendo.conf
|
|
193 |
# uses the config form the client
|
192 |
194 |
my $imap_client = SL::IMAPClient->new();
|
193 |
195 |
|
194 |
|
# can also be used with a custom config, overriding the global config
|
|
196 |
# can also be used with a custom config, overriding the client config
|
195 |
197 |
my %config = (
|
196 |
198 |
enabled => 1,
|
197 |
199 |
hostname => 'imap.example.com',
|
... | ... | |
236 |
238 |
=item C<new>
|
237 |
239 |
|
238 |
240 |
Creates a new SL::IMAPClient object. If no config is passed, the config
|
239 |
|
from config/kivitendo.conf is used. If a config is passed, the global
|
|
241 |
from the current client is used. If a config is passed, the client
|
240 |
242 |
config is overridden.
|
241 |
243 |
|
242 |
244 |
=item C<DESTROY>
|
IMAPClient: nutze Mandantenkonfiguration