Skip to content

Commit

Permalink
Fatturazione elettronica gestione mail di avviso
Browse files Browse the repository at this point in the history
  • Loading branch information
mspasiano committed Mar 30, 2015
1 parent 8902314 commit 7955e54
Showing 1 changed file with 5 additions and 3 deletions.
Expand Up @@ -21,6 +21,7 @@
import java.util.Properties;

import javax.activation.DataHandler;
import javax.mail.AuthenticationFailedException;
import javax.mail.BodyPart;
import javax.mail.Folder;
import javax.mail.Message;
Expand Down Expand Up @@ -142,8 +143,7 @@ public void pecScanForRiceviFatture(String userName, String password) throws Com
terms.add(new FromStringTerm(pecSDIFromStringTerm));
terms.add(new SubjectTerm(pecSDISubjectRiceviFattureTerm));
Message messages[] = inbox.search(new AndTerm(terms.toArray(new SearchTerm[terms.size()])));
if (logger.isDebugEnabled())
logger.debug("Recuperati " + messages.length +" messaggi dalla casella PEC:" + userName);
logger.info("Recuperati " + messages.length +" messaggi dalla casella PEC:" + userName);
for (int i = 0; i < messages.length; i++) {
try {
Message message = messages[i];
Expand Down Expand Up @@ -187,6 +187,8 @@ public void pecScanForRiceviFatture(String userName, String password) throws Com
}
inbox.close(true);
store.close();
} catch (AuthenticationFailedException e) {
logger.error("Error while scan PEC email:" +userName + " - password:"+password);
} catch (NoSuchProviderException e) {
logger.error("Error while scan PEC email:" +userName, e);
} catch (MessagingException e) {
Expand Down Expand Up @@ -254,4 +256,4 @@ public void afterPropertiesSet() throws Exception {
new Integer(java.util.Calendar.getInstance().get(java.util.Calendar.YEAR)),
null,null,null);
}
}
}

0 comments on commit 7955e54

Please sign in to comment.