Revision b5966ff7
Von Tamino Steinert vor mehr als 1 Jahr hinzugefügt
SL/Mailer.pm | ||
---|---|---|
287 | 287 |
); |
288 | 288 |
$self->{mail_attachments} = []; |
289 | 289 |
|
290 |
my $email_as_string; |
|
290 | 291 |
my $error; |
291 | 292 |
my $ok = eval { |
292 | 293 |
# Clean up To/Cc/Bcc address fields |
... | ... | |
301 | 302 |
$self->{driver}->print($email->as_string); |
302 | 303 |
$self->{driver}->send; |
303 | 304 |
|
305 |
$email_as_string = $email->as_string; |
|
304 | 306 |
1; |
305 | 307 |
}; |
306 | 308 |
|
307 | 309 |
$error = $@ if !$ok; |
308 | 310 |
|
309 |
$self->_store_in_imap_sent_folder() or do { |
|
311 |
$self->_store_in_imap_sent_folder($email_as_string) or do {
|
|
310 | 312 |
$ok = 0; |
311 | 313 |
push @$error, $@; |
312 | 314 |
}; |
... | ... | |
333 | 335 |
} |
334 | 336 |
|
335 | 337 |
sub _store_in_imap_sent_folder { |
336 |
my ($self) = @_; |
|
338 |
my ($self, $email_as_string) = @_;
|
|
337 | 339 |
my $config = $::lx_office_conf{sent_emails_in_imap} || {}; |
338 | 340 |
return unless ($config->{enabled} && $config->{hostname}); |
339 | 341 |
|
... | ... | |
355 | 357 |
my $folder = $config->{folder} || 'INBOX/Sent'; |
356 | 358 |
$folder =~ s|/|${separator}|g; |
357 | 359 |
|
358 |
my $header_string = $self->_get_header_string; |
|
359 |
my $email_string = $header_string. "\n" . $self->{message}; |
|
360 |
|
|
361 |
# TODO: doesn't stop with non ASCII-Chars |
|
362 |
# In test file it works like a charm !? |
|
363 |
$imap->append_string($folder, $email_string) or do { |
|
360 |
$imap->append_string($folder, $email_as_string) or do { |
|
364 | 361 |
my $last_error = $imap->LastError(); |
365 | 362 |
$imap->logout(); |
366 | 363 |
die "IMAP Client append failed: $last_error\n"; |
Auch abrufbar als: Unified diff
Mailer: IMAP: Nutze String von gesendeter Email