Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 77cb45b9

Von Jan Büren vor 2 Tagen hinzugefügt

  • ID 77cb45b954b293647bfd5d0992a4b0059bb602de
  • Vorgänger 4d0056df
  • Nachfolger ac12428e

BJ IRE Neues Imap-Flag falls E-Mail nicht geparst werden kann

Unterschiede anzeigen:

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