Revision 6ae6a365
Von Tamino Steinert vor mehr als 1 Jahr hinzugefügt
SL/Mailer.pm | ||
---|---|---|
343 | 343 |
my $config = $::lx_office_conf{sent_emails_in_imap} || {}; |
344 | 344 |
return unless ($config->{enabled} && $config->{hostname}); |
345 | 345 |
|
346 |
my $socket; |
|
347 |
if ($config->{ssl}) { |
|
348 |
$socket = IO::Socket::SSL->new( |
|
349 |
Proto => 'tcp', |
|
350 |
PeerAddr => $config->{hostname}, |
|
351 |
PeerPort => $config->{port} || 993, |
|
352 |
); |
|
353 |
} else { |
|
354 |
$socket = IO::Socket::INET->new( |
|
355 |
Proto => 'tcp', |
|
356 |
PeerAddr => $config->{hostname}, |
|
357 |
PeerPort => $config->{port} || 143, |
|
358 |
); |
|
359 |
} |
|
360 |
if (!$socket) { |
|
361 |
die "Failed to create socket for IMAP client: $@\n"; |
|
362 |
} |
|
363 |
|
|
364 |
# TODO: get email and password for each user |
|
346 | 365 |
my $imap = Mail::IMAPClient->new( |
347 |
Server => $config->{hostname},
|
|
366 |
Socket => $socket,
|
|
348 | 367 |
User => $config->{username}, |
349 | 368 |
Password => $config->{password}, |
350 |
Port => $config->{port}, |
|
351 |
Ssl => $config->{ssl}, |
|
352 | 369 |
) or do { |
353 | 370 |
die "Failed to create IMAP Client: $@\n" |
354 | 371 |
}; |
Auch abrufbar als: Unified diff
Revert "IMAPClient direkt erstellen (ohne separaten Socket)"
This reverts commit 3bf2f348a50f4f9a49ad6f5ed1fa439440f15d60.