Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 98c1b560

Von Tamino Steinert vor mehr als 1 Jahr hinzugefügt

  • ID 98c1b56003d58d720c689575ccb38d2b59baa8bf
  • Vorgänger e90d8470
  • Nachfolger 166f3c75

IMAPClient: nutze Mandantenkonfiguration

Unterschiede anzeigen:

SL/IMAPClient.pm
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>
config/kivitendo.conf.default
162 162
login =
163 163
password =
164 164

  
165
[imap_client]
166
enabled = 0
167
hostname = local
168
username =
169
password =
170
# Port only needs to be changed if it is not the default port.
171
# port = 993
172
base_folder = INBOX
173
# If SSL is to be used, then set port to 993 or leave empty
174
ssl = 1
175

  
176 165
[sent_emails_in_imap]
177 166
enabled = 0
178 167
hostname = localhost

Auch abrufbar als: Unified diff