Beispiel #1
0
 @Override
 public Address[] getFrom() {
   if (mFrom == null) {
     String list = MimeUtility.unfold(getFirstHeader("From"));
     if (list == null || list.length() == 0) {
       list = MimeUtility.unfold(getFirstHeader("Sender"));
     }
     mFrom = Address.parse(list);
   }
   return mFrom;
 }
Beispiel #2
0
 @Override
 public Address[] getReplyTo() {
   if (mReplyTo == null) {
     mReplyTo = Address.parse(MimeUtility.unfold(getFirstHeader("Reply-to")));
   }
   return mReplyTo;
 }
Beispiel #3
0
 /**
  * Returns a list of the given recipient type from this message. If no addresses are found the
  * method returns an empty array.
  */
 @Override
 public Address[] getRecipients(RecipientType type) throws MessagingException {
   if (type == RecipientType.TO) {
     if (mTo == null) {
       mTo = Address.parse(MimeUtility.unfold(getFirstHeader("To")));
     }
     return mTo;
   } else if (type == RecipientType.CC) {
     if (mCc == null) {
       mCc = Address.parse(MimeUtility.unfold(getFirstHeader("CC")));
     }
     return mCc;
   } else if (type == RecipientType.BCC) {
     if (mBcc == null) {
       mBcc = Address.parse(MimeUtility.unfold(getFirstHeader("BCC")));
     }
     return mBcc;
   } else {
     throw new MessagingException("Unrecognized recipient type.");
   }
 }