Package i2p.susi.webmail
Class Mail
java.lang.Object
i2p.susi.webmail.Mail
- Direct Known Subclasses:
Draft
data structure to hold a single message, mostly used with folder view and sorting
- Author:
- susi
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
appendRecipients
(PrintWriter out, String[] recipients, String prefix) Adds all items from the array to the builder, separated by commas This is for display of a forwarded email.static void
appendRecipients
(StringBuilder buf, ArrayList<String> recipients, String prefix) Adds all items from the list to the builder, separated by tabs.static String
getAddress
(String address) Returns the first email address portion, enclosed by <>getBody()
This contains the header also.This may or may not contain the body also.getPart()
static boolean
getRecipientsFromList
(ArrayList<String> recipients, String[] ccs, boolean ok) A little misnamed.static boolean
getRecipientsFromList
(ArrayList<String> recipients, String text, boolean ok) A little misnamed.long
getSize()
boolean
boolean
hasBody()
boolean
boolean
hasPart()
boolean
isNew()
boolean
isSpam()
void
void
void
setNew
(boolean isNew) void
setSize
(long size) static boolean
validateAddress
(String address)
-
Field Details
-
HEADER_MATCH
static final byte[] HEADER_MATCHAlso used by MailPart See MailPart for why we don't do \r\n\r\n -
sender
-
reply
-
subject
-
dateString
-
formattedDate
-
localFormattedDate
-
shortSender
-
shortSubject
-
quotedDate
-
uidl
-
date
-
to
String[] toMay be null. Non-empty if non-null. Not HTML escaped. -
cc
String[] ccMay be null. Non-empty if non-null. Not HTML escaped. -
contentType
-
messageID
-
error
-
markForDeletion
public boolean markForDeletion
-
-
Constructor Details
-
Mail
-
-
Method Details
-
getHeader
This may or may not contain the body also.- Returns:
- if null, nothing has been loaded yet for this UIDL
-
setHeader
-
hasHeader
public boolean hasHeader()- Returns:
- if false, nothing has been loaded yet for this UIDL
-
getBody
This contains the header also.- Returns:
- may be null
-
setBody
-
hasBody
public boolean hasBody() -
getPart
-
hasPart
public boolean hasPart() -
getSize
public long getSize()- Returns:
- 0 if unknown
-
setSize
public void setSize(long size) -
isSpam
public boolean isSpam() -
isNew
public boolean isNew() -
setNew
public void setNew(boolean isNew) -
hasAttachment
public boolean hasAttachment() -
validateAddress
- Parameters:
address
- E-mail address to be validated- Returns:
- Is the e-mail address valid?
-
getAddress
Returns the first email address portion, enclosed by <>- Parameters:
address
-
-
getRecipientsFromList
A little misnamed. Adds all addresses from the comma-separated line in text to the recipients list.- Parameters:
recipients
- out paramtext
- comma-separatedok
- will be returned- Returns:
- true if ALL e-mail addresses are valid AND the in parameter was true
-
getRecipientsFromList
A little misnamed. Adds all addresses from the elements in text to the recipients list.- Parameters:
recipients
- out paramok
- will be returned- Returns:
- true if ALL e-mail addresses are valid AND the in parameter was true
- Since:
- 0.9.35
-
appendRecipients
Adds all items from the list to the builder, separated by tabs. This is for SMTP/POP.- Parameters:
buf
- out paramprefix
- prepended to the addresses
-
appendRecipients
Adds all items from the array to the builder, separated by commas This is for display of a forwarded email.- Parameters:
prefix
- prepended to the addresses, includes trailing ": "- Since:
- 0.9.35
-