Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision c4baf68a

Von Tamino Steinert vor etwa 1 Jahr hinzugefügt

  • ID c4baf68a61b8af66f23678cc84b0931e926757f4
  • Vorgänger 868b7113
  • Nachfolger 9b06ba98

IMAPClient direkt erstellen (ohne separaten Socket)

Unterschiede anzeigen:

SL/Mailer.pm
337 337
  my $config = $::lx_office_conf{sent_emails_in_imap} || {};
338 338
  return unless ($config->{enabled} && $config->{hostname});
339 339

  
340
  my $socket;
341
  if ($config->{ssl}) {
342
    $socket = IO::Socket::SSL->new(
343
      Proto    => 'tcp',
344
      PeerAddr => $config->{hostname},
345
      PeerPort => $config->{port} || 993,
346
    );
347
  } else {
348
    $socket = IO::Socket::INET->new(
349
      Proto    => 'tcp',
350
      PeerAddr => $config->{hostname},
351
      PeerPort => $config->{port} || 143,
352
    );
353
  }
354
  if (!$socket) {
355
    die "Failed to create socket for IMAP client: $@\n";
356
  }
357

  
358
  # TODO: get email and password for each user
359 340
  my $imap = Mail::IMAPClient->new(
360
    Socket   => $socket,
341
    Server   => $config->{hostname},
361 342
    User     => $config->{username},
362 343
    Password => $config->{password},
344
    Port     => $config->{port},
345
    Ssl      => $config->{ssl},
363 346
  ) or do {
364 347
    die "Failed to create IMAP Client: $@\n"
365 348
  };

Auch abrufbar als: Unified diff