Revision 77cb45b9
SL/BackgroundJob/ImportRecordEmails.pm | ||
---|---|---|
34 | 34 |
record_type => $config->{record_type}, |
35 | 35 |
}, |
36 | 36 |
skip_broken_mime_mails => $config->{skip_broken_mime_mails}, |
37 |
not_imported_imap_flag => $config->{not_imported_imap_flag}, |
|
37 | 38 |
); |
38 | 39 |
return "No emails to import." unless $email_import; |
39 | 40 |
if ($config->{imported_imap_flag}) { |
... | ... | |
167 | 168 |
not_processed_imap_flag => { type => SCALAR, optional => 1, }, |
168 | 169 |
email_import_ids_to_delete => { type => ARRAYREF, optional => 1, }, |
169 | 170 |
imported_imap_flag => { type => SCALAR, optional => 1, }, |
171 |
not_imported_imap_flag => { type => SCALAR, optional => 1, }, |
|
170 | 172 |
skip_broken_mime_mails => { type => SCALAR, optional => 1, }, |
171 | 173 |
# email config |
172 | 174 |
hostname => { type => SCALAR, }, |
SL/IMAPClient.pm | ||
---|---|---|
129 | 129 |
type => SCALAR | UNDEF, |
130 | 130 |
optional => 1, |
131 | 131 |
}, |
132 |
not_imported_imap_flag => { |
|
133 |
type => SCALAR | UNDEF, |
|
134 |
optional => 1, |
|
135 |
}, |
|
132 | 136 |
}); |
133 | 137 |
my $folder_path = $params{folder} || $self->{base_folder}; |
134 | 138 |
|
... | ... | |
139 | 143 |
folder_strings => [$folder_string], |
140 | 144 |
email_journal_params => $params{email_journal_params}, |
141 | 145 |
skip_broken_mime_mails => $params{skip_broken_mime_mails}, |
146 |
not_imported_imap_flag => $params{not_imported_imap_flag}, |
|
142 | 147 |
); |
143 | 148 |
|
144 | 149 |
return $email_import; |
... | ... | |
191 | 196 |
type => SCALAR | UNDEF, |
192 | 197 |
optional => 1, |
193 | 198 |
}, |
199 |
not_imported_imap_flag => { |
|
200 |
type => SCALAR | UNDEF, |
|
201 |
optional => 1, |
|
202 |
}, |
|
203 |
|
|
194 | 204 |
}); |
195 | 205 |
my $dbh = SL::DB->client->dbh; |
196 | 206 |
|
... | ... | |
240 | 250 |
); |
241 | 251 |
$email_journal->save(); |
242 | 252 |
} catch { |
243 |
my ($headers, $body) = split /\n\n/, $new_email_string; |
|
244 |
my @subjects = grep {/^subject: +/i} (split /\n/, $headers); |
|
245 |
die t8("Error while attempting to parse email.\nUID: #1\n#2\nError reported: #3", $new_uid, @subjects[0], $_) |
|
246 |
unless $params{skip_broken_mime_mails}; |
|
253 |
|
|
254 |
$self->{imap_client}->set_flag($params{not_imported_imap_flag}, [$new_uid]) |
|
255 |
if $params{not_imported_imap_flag}; |
|
256 |
|
|
257 |
my ($headers, $body) = split /\n\n/, $new_email_string; |
|
258 |
my @subjects = grep {/^subject: +/i} (split /\n/, $headers); |
|
259 |
|
|
260 |
die t8("Error while attempting to parse email.\nUID: '#1'\n'#2'\nError reported: '#3'", $new_uid, @subjects[0], $_) |
|
261 |
unless $params{skip_broken_mime_mails}; |
|
247 | 262 |
} |
248 | 263 |
} |
249 | 264 |
} |
Auch abrufbar als: Unified diff
BJ IRE Neues Imap-Flag falls E-Mail nicht geparst werden kann