Package i2p.susi.webmail
Class Mail
- java.lang.Object
-
- i2p.susi.webmail.Mail
-
-
Field Summary
Fields Modifier and Type Field Description (package private) String[]
cc
May be null.String
contentType
Date
date
String
dateString
String
error
String
formattedDate
(package private) static byte[]
HEADER_MATCH
Also used by MailPart See MailPart for why we don't do \r\n\r\nString
localFormattedDate
boolean
markForDeletion
String
messageID
String
quotedDate
String
reply
String
sender
String
shortSender
String
shortSubject
String
subject
(package private) String[]
to
May be null.String
uidl
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static 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 <>Buffer
getBody()
This contains the header also.Buffer
getHeader()
This may or may not contain the body also.MailPart
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
hasAttachment()
boolean
hasBody()
boolean
hasHeader()
boolean
hasPart()
boolean
isNew()
boolean
isSpam()
void
setBody(Buffer rb)
void
setHeader(Buffer rb)
void
setNew(boolean isNew)
void
setSize(long size)
static boolean
validateAddress(String address)
-
-
-
Field Detail
-
HEADER_MATCH
static final byte[] HEADER_MATCH
Also used by MailPart See MailPart for why we don't do \r\n\r\n
-
sender
public String sender
-
reply
public String reply
-
subject
public String subject
-
dateString
public String dateString
-
formattedDate
public String formattedDate
-
localFormattedDate
public String localFormattedDate
-
shortSender
public String shortSender
-
shortSubject
public String shortSubject
-
quotedDate
public String quotedDate
-
uidl
public final String uidl
-
date
public Date date
-
to
String[] to
May be null. Non-empty if non-null. Not HTML escaped.
-
cc
String[] cc
May be null. Non-empty if non-null. Not HTML escaped.
-
contentType
public String contentType
-
messageID
public String messageID
-
error
public String error
-
markForDeletion
public boolean markForDeletion
-
-
Constructor Detail
-
Mail
public Mail(String uidl)
-
-
Method Detail
-
getHeader
public Buffer getHeader()
This may or may not contain the body also.- Returns:
- if null, nothing has been loaded yet for this UIDL
-
setHeader
public void setHeader(Buffer rb)
-
hasHeader
public boolean hasHeader()
- Returns:
- if false, nothing has been loaded yet for this UIDL
-
getBody
public Buffer getBody()
This contains the header also.- Returns:
- may be null
-
setBody
public void setBody(Buffer rb)
-
hasBody
public boolean hasBody()
-
getPart
public MailPart 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
public static boolean validateAddress(String address)
- Parameters:
address
- E-mail address to be validated- Returns:
- Is the e-mail address valid?
-
getAddress
public static String getAddress(String address)
Returns the first email address portion, enclosed by <>- Parameters:
address
-
-
getRecipientsFromList
public static boolean getRecipientsFromList(ArrayList<String> recipients, String text, boolean ok)
A little misnamed. Adds all addresses from the comma-separated line in text to the recipients list.- Parameters:
text
- comma-separatedrecipients
- out paramok
- will be returned- Returns:
- true if ALL e-mail addresses are valid AND the in parameter was true
-
getRecipientsFromList
public static boolean getRecipientsFromList(ArrayList<String> recipients, String[] ccs, boolean ok)
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
public static void appendRecipients(StringBuilder buf, ArrayList<String> recipients, String prefix)
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
public static 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.- Parameters:
prefix
- prepended to the addresses, includes trailing ": "- Since:
- 0.9.35
-
-