public class MailManager
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
REVISION |
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
addAuthKeyToImagesSrc(java.lang.String content,
Member mbr)
When the site is private, add an authentication key to all
src='...'
|
static java.lang.String |
buildContentFromJsp(java.lang.String jspPath,
Member loggedMember,
java.lang.String language,
java.util.HashMap<java.lang.Object,java.lang.Object> requestAttributeMap,
java.util.HashMap<java.lang.Object,java.lang.Object> sessionAttributeMap)
Builds a mail content from a given jsp
|
MailMessage |
createDBMailMessage(javax.mail.Message msg,
MailAccount account)
Build a DBMessage from a Message and save in into the DB
|
MailMessage |
getDBMailMessage(javax.mail.Message msg)
Returns the DBMailMessage for the given Message
|
MailMessage |
getDBMailMessage(java.lang.String msgid)
Returns the DBMailMessage for the given Message Id
|
int |
getDBMailMessageCount()
Returns the count of DBMailMessage
|
int |
getDBMailMessageCount(java.lang.String account)
Returns the count of DBMailMessage for given account
|
java.util.Collection<? extends MailMessage> |
getDBMailMessageReplies(java.lang.String msgid)
Returns the DBMailMessage for the given Message Id
|
java.util.Set<java.lang.Object> |
getDBMailMessageSet(java.lang.String[] ids)
Returns a Collection of MailMessage or Message-ID (if not found)
|
java.util.Collection<? extends MailMessage> |
getDBMailMessageThread(java.lang.String thread) |
static java.util.Set<javax.mail.internet.InternetAddress> |
getIAFromMemberSet(java.util.Set<Member> mbrSet)
Returns a Set of InternetAddress build from a Set of Members
|
static java.lang.String |
getIncomingAddress(java.lang.String localpart,
Member mbr,
java.lang.String label)
Returns JCMS incoming email for the given Member
|
static MailManager |
getInstance() |
static java.util.TreeSet<java.lang.String> |
getInvalidEmailSet(java.util.Set<java.lang.String> mailSet,
java.util.Set<Member> mbrSet)
Retrieve all INVALID email from the specified mail and member Set.
|
static java.lang.String |
getLocalPartSuffixAuthKey(Member mbr)
Returns a localpart sufix authkey for given members
|
MailFetcher |
getMailFetcher()
Returns the MailFetcher
|
java.lang.String |
getMessageIdQuietly(javax.mail.Message msg)
Convenient method that delegate to MailFetcher method
|
void |
init() |
static java.lang.String |
replaceRelativeUrlsWithAbsoluteUrls(java.lang.String contentHtml)
Convert all relative URLs inside the specified HTML content into absolute URL.
|
void |
saveDBMailMessage(MailMessage mail,
java.util.Map<java.lang.String,java.lang.Object> context)
Build a DBMessage from a Message and save in into the DB
|
java.io.File |
writeEml(javax.mail.Message msg) |
public static final java.lang.String REVISION
public static MailManager getInstance()
public void init()
public static java.lang.String addAuthKeyToImagesSrc(java.lang.String content, Member mbr)
content
- html content to updatembr
- the recipient memberpublic static java.lang.String replaceRelativeUrlsWithAbsoluteUrls(java.lang.String contentHtml)
Uses the current channel URL as prefix of relative URL.
contentHtml
- the HTML content in which to look for relative URL (in src and href attributes)public java.util.Set<java.lang.Object> getDBMailMessageSet(java.lang.String[] ids)
ids
- a list of Message-IDpublic int getDBMailMessageCount()
public int getDBMailMessageCount(java.lang.String account)
account
- the account namepublic MailMessage getDBMailMessage(javax.mail.Message msg)
msg
- a javax.mail.Messagepublic MailMessage getDBMailMessage(java.lang.String msgid)
msgid
- the message idpublic java.util.Collection<? extends MailMessage> getDBMailMessageReplies(java.lang.String msgid)
msgid
- the message idpublic java.util.Collection<? extends MailMessage> getDBMailMessageThread(java.lang.String thread)
public MailMessage createDBMailMessage(javax.mail.Message msg, MailAccount account)
msg
- a javax.mail.Messageaccount
- the mailAccountpublic void saveDBMailMessage(MailMessage mail, java.util.Map<java.lang.String,java.lang.Object> context)
mail
- the MailMessagecontext
- the contextual mappublic java.io.File writeEml(javax.mail.Message msg)
public MailFetcher getMailFetcher()
public java.lang.String getMessageIdQuietly(javax.mail.Message msg)
msg
- the javax.mail.MessageMailFetcher.getMessageIdQuietly(Message)
public static java.lang.String getIncomingAddress(java.lang.String localpart, Member mbr, java.lang.String label)
localpart
- the mail prefixmbr
- Member author of the maillabel
- the email labelpublic static java.lang.String getLocalPartSuffixAuthKey(Member mbr)
mbr
- the memberpublic static java.util.Set<javax.mail.internet.InternetAddress> getIAFromMemberSet(java.util.Set<Member> mbrSet) throws javax.mail.MessagingException
mbrSet
- a Set of Membersjavax.mail.MessagingException
public static java.util.TreeSet<java.lang.String> getInvalidEmailSet(java.util.Set<java.lang.String> mailSet, java.util.Set<Member> mbrSet)
mailSet
- a set of email addressesmbrSet
- a set of Memberpublic static java.lang.String buildContentFromJsp(java.lang.String jspPath, Member loggedMember, java.lang.String language, java.util.HashMap<java.lang.Object,java.lang.Object> requestAttributeMap, java.util.HashMap<java.lang.Object,java.lang.Object> sessionAttributeMap)
jspPath
- the jsp to processloggedMember
- the loggedMemberlanguage
- the user languagerequestAttributeMap
- Map of request attributessessionAttributeMap
- Map of session attributesCopyright © 2001-2010 Jalios SA. All Rights Reserved.