|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.jalios.jcms.mail.MailManager
public class MailManager
Provides convenient methods to manage DBMailMessage stored in DataBase and on HardDrive
Field Summary | |
---|---|
static String |
REVISION
|
Method Summary | |
---|---|
static String |
addAuthKeyToImagesSrc(String content,
Member mbr)
When the site is private, add an authentication key to all src='...' URL in order for the mailer to access them without any authentication. |
static String |
buildContentFromJsp(String jspPath,
Member loggedMember,
String language,
HashMap<Object,Object> requestAttributeMap,
HashMap<Object,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(String msgid)
Returns the DBMailMessage for the given Message Id |
int |
getDBMailMessageCount()
Returns the count of DBMailMessage |
int |
getDBMailMessageCount(String account)
Returns the count of DBMailMessage for given account |
Collection<? extends MailMessage> |
getDBMailMessageReplies(String msgid)
Returns the DBMailMessage for the given Message Id |
Set<Object> |
getDBMailMessageSet(String[] ids)
Returns a Collection of MailMessage or Message-ID (if not found) |
Collection<? extends MailMessage> |
getDBMailMessageThread(String thread)
|
static Set<javax.mail.internet.InternetAddress> |
getIAFromMemberSet(Set<Member> mbrSet)
Returns a Set of InternetAddress build from a Set of Members |
static String |
getIncomingAddress(String localpart,
Member mbr,
String label)
Returns JCMS incoming email for the given Member |
static MailManager |
getInstance()
|
static TreeSet<String> |
getInvalidEmailSet(Set<String> mailSet,
Set<Member> mbrSet)
Retrieve all INVALID email from the specified mail and member Set. |
static String |
getLocalPartSuffixAuthKey(Member mbr)
Returns a localpart sufix authkey for given members |
MailFetcher |
getMailFetcher()
Returns the MailFetcher |
String |
getMessageIdQuietly(javax.mail.Message msg)
Convenient method that delegate to MailFetcher method |
void |
init()
|
static String |
replaceRelativeUrlsWithAbsoluteUrls(String contentHtml)
Convert all relative URLs inside the specified HTML content into absolute URL. |
void |
saveDBMailMessage(MailMessage mail,
Map<String,Object> context)
Build a DBMessage from a Message and save in into the DB |
File |
writeEml(javax.mail.Message msg)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String REVISION
Method Detail |
---|
public static MailManager getInstance()
public void init()
public static String addAuthKeyToImagesSrc(String content, Member mbr)
content
- html content to updatembr
- the recipient member
public static String replaceRelativeUrlsWithAbsoluteUrls(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 Set<Object> getDBMailMessageSet(String[] ids)
ids
- a list of Message-ID
public int getDBMailMessageCount()
public int getDBMailMessageCount(String account)
account
- the account name
public MailMessage getDBMailMessage(javax.mail.Message msg)
msg
- a javax.mail.Message
public MailMessage getDBMailMessage(String msgid)
msgid
- the message id
public Collection<? extends MailMessage> getDBMailMessageReplies(String msgid)
msgid
- the message id
public Collection<? extends MailMessage> getDBMailMessageThread(String thread)
public MailMessage createDBMailMessage(javax.mail.Message msg, MailAccount account)
msg
- a javax.mail.Messageaccount
- the mailAccount
public void saveDBMailMessage(MailMessage mail, Map<String,Object> context)
mail
- the MailMessagecontext
- the contextual mappublic File writeEml(javax.mail.Message msg)
public MailFetcher getMailFetcher()
public String getMessageIdQuietly(javax.mail.Message msg)
msg
- the javax.mail.Message
MailFetcher.getMessageIdQuietly(Message)
public static String getIncomingAddress(String localpart, Member mbr, String label)
localpart
- the mail prefixmbr
- Member author of the maillabel
- the email label
public static String getLocalPartSuffixAuthKey(Member mbr)
mbr
- the member
public static Set<javax.mail.internet.InternetAddress> getIAFromMemberSet(Set<Member> mbrSet) throws javax.mail.MessagingException
mbrSet
- a Set of Members
javax.mail.MessagingException
public static TreeSet<String> getInvalidEmailSet(Set<String> mailSet, Set<Member> mbrSet)
mailSet
- a set of email addressesmbrSet
- a set of Member
public static String buildContentFromJsp(String jspPath, Member loggedMember, String language, HashMap<Object,Object> requestAttributeMap, HashMap<Object,Object> sessionAttributeMap)
jspPath
- the jsp to processloggedMember
- the loggedMemberlanguage
- the user languagerequestAttributeMap
- Map of request attributessessionAttributeMap
- Map of session attributes
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |