- Author
- Lluis TurrĂ³ Cutiller lluis.nosp@m.@tur.nosp@m.ro.or.nosp@m.g
Definition at line 37 of file MailReader.java.
◆ MailReader()
org.turro.mail.reader.MailReader.MailReader |
( |
| ) |
|
◆ close()
void org.turro.mail.reader.MailReader.close |
( |
| ) |
|
Definition at line 74 of file MailReader.java.
76 if (emailFolder !=
null) {
77 emailFolder.close(
false);
82 }
catch (MessagingException ex) {
83 Logger.getLogger(
MailReader.class.getName()).log(Level.SEVERE, ElephantContext.logMsg(
null), ex);
◆ delete()
void org.turro.mail.reader.MailReader.delete |
( |
Message |
message | ) |
|
Definition at line 66 of file MailReader.java.
68 message.setFlag(Flags.Flag.DELETED,
true);
69 }
catch (MessagingException ex) {
70 Logger.getLogger(
MailReader.class.getName()).log(Level.SEVERE, ElephantContext.logMsg(
null), ex);
◆ getMessages()
Message [] org.turro.mail.reader.MailReader.getMessages |
( |
| ) |
|
Definition at line 87 of file MailReader.java.
90 Properties properties =
new Properties();
92 if(kvm.get(
"type").startsWith(
"pop3")) {
93 properties.put(
"mail.pop3.host", kvm.get(
"mailhost"));
94 properties.put(
"mail.pop3.port", kvm.get(
"port"));
95 properties.put(
"mail.pop3.starttls.enable", kvm.get(
"tls"));
96 properties.put(
"mail.pop3.ssl.enable", kvm.get(
"ssl"));
97 }
else if(kvm.get(
"type").startsWith(
"imap")) {
98 properties.put(
"mail.imap.host", kvm.get(
"mailhost"));
99 properties.put(
"mail.imap.port", kvm.get(
"port"));
100 properties.put(
"mail.imap.starttls.enable", kvm.get(
"tls"));
101 properties.put(
"mail.imap.ssl.enable", kvm.get(
"ssl"));
103 Session emailSession = Session.getDefaultInstance(properties);
105 store = emailSession.getStore(kvm.get(
"type"));
107 String password = kvm.get(
"password");
108 if (password ==
null) {
110 password = ElephantContext.decrypt(kvm.get(
"cryptpass"));
111 }
catch (Exception ex) {
112 Logger.getLogger(
MailReader.class.getName()).log(Level.SEVERE, ElephantContext.logMsg(
null), ex);
117 kvm.get(Integer.class,
"port"),
121 emailFolder = store.getFolder(kvm.get(String.class,
"folder",
"INBOX"));
122 emailFolder.open(Folder.READ_WRITE);
124 int count = kvm.get(Integer.class,
"count", 50) - 1;
126 int messageCount = emailFolder.getMessageCount();
128 return emailFolder.getMessages(messageCount - count, messageCount);
129 }
catch (MessagingException ex) {
130 Logger.getLogger(
MailReader.class.getName()).log(Level.SEVERE, ElephantContext.logMsg(
null), ex);
KeyValueMap getAttributes()
◆ isReadOnly()
boolean org.turro.mail.reader.MailReader.isReadOnly |
( |
| ) |
|
◆ isSeen()
boolean org.turro.mail.reader.MailReader.isSeen |
( |
Message |
message | ) |
|
Definition at line 49 of file MailReader.java.
51 return message.isSet(Flags.Flag.SEEN);
52 }
catch (MessagingException ex) {
53 Logger.getLogger(
MailReader.class.getName()).log(Level.SEVERE, ElephantContext.logMsg(
null), ex);
◆ seen()
void org.turro.mail.reader.MailReader.seen |
( |
Message |
message | ) |
|
Definition at line 58 of file MailReader.java.
60 message.setFlag(Flags.Flag.SEEN,
true);
61 }
catch (MessagingException ex) {
62 Logger.getLogger(
MailReader.class.getName()).log(Level.SEVERE, ElephantContext.logMsg(
null), ex);
The documentation for this class was generated from the following file: