亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來(lái)到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? email.java

?? 基于UDP的可靠郵件系統(tǒng)
?? JAVA
?? 第 1 頁(yè) / 共 2 頁(yè)
字號(hào):
/***********************************************************************
 * Copyright (c) 2000-2004 The Apache Software Foundation.             *
 * All rights reserved.                                                *
 * ------------------------------------------------------------------- *
 * Licensed under the Apache License, Version 2.0 (the "License"); you *
 * may not use this file except in compliance with the License. You    *
 * may obtain a copy of the License at:                                *
 *                                                                     *
 *     http://www.apache.org/licenses/LICENSE-2.0                      *
 *                                                                     *
 * Unless required by applicable law or agreed to in writing, software *
 * distributed under the License is distributed on an "AS IS" BASIS,   *
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or     *
 * implied.  See the License for the specific language governing       *
 * permissions and limitations under the License.                      *
 ***********************************************************************/

package org.hwmhere.email.impl;

// import org.apache.avalon.framework.activity.Disposable;
import org.hwmhere.email.impl.util.RFC2822Headers;
import org.hwmhere.email.mailet.MailAddress;

import java.io.*;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Date;
import java.util.Enumeration;
import java.util.HashSet;
import java.util.Iterator;
import java.util.HashMap;

/**
 * <P>
 * Wraps a MimeMessage adding routing information (from SMTP) and some simple
 * API enhancements.
 * </P>
 * <P>
 * From James version > 2.2.0a8 "mail attributes" have been added. Backward and
 * forward compatibility is supported: messages stored in file repositories
 * <I>without</I> attributes by James version <= 2.2.0a8 will be processed by
 * later versions as having an empty attributes hashmap; messages stored in file
 * repositories <I>with</I> attributes by James version > 2.2.0a8 will be
 * processed by previous versions, ignoring the attributes.
 * </P>
 * 
 * @version CVS $Revision: 1.17.4.6 $ $Date: 2004/03/15 03:54:15 $
 */
public class Email implements Serializable, Cloneable {// /Disposable, Mail {
	/**
	 * We hardcode the serialVersionUID so that from James 1.2 on, Email will be
	 * deserializable (so your mail doesn't get lost)
	 */
	public static final long serialVersionUID = -4289663364703986260L;

	/**
	 * The error message, if any, associated with this mail.
	 */
	private String errorMessage;

	/**
	 * The state of this mail, which determines how it is processed.
	 */
	private String state;

	/**
	 * The MimeMessage that holds the mail data.
	 */
	private byte[] message;

	/**
	 * The sender of this mail.
	 */
	private MailAddress sender;

	/**
	 * The collection of recipients to whom this mail was sent.
	 */
	private Collection recipients;

	/**
	 * The identifier for this mail message
	 */
	private String name;

	/**
	 * The remote host from which this mail was sent.
	 */
	private String remoteHost = "localhost";

	/**
	 * The remote address from which this mail was sent.
	 */
	private String remoteAddr = "127.0.0.1";

	/**
	 * The last time this message was updated.
	 */
	private Date lastUpdated = new Date();

	/**
	 * Attributes added to this Email instance
	 */
	private HashMap attributes;

	/**
	 * A constructor that creates a new, uninitialized Email
	 */
	public Email() {
//		setState(Mail.DEFAULT);
		attributes = new HashMap();
	}

	/**
	 * A constructor that creates a Email with the specified name, sender, and
	 * recipients.
	 * 
	 * @param name
	 *            the name of the Email
	 * @param sender
	 *            the sender for this Email
	 * @param recipients
	 *            the collection of recipients of this Email
	 */
	public Email(String name, MailAddress sender, Collection recipients) {
		this();
		this.name = name;
		this.sender = sender;
		this.recipients = null;

		// Copy the recipient list
		if (recipients != null) {
			Iterator theIterator = recipients.iterator();
			this.recipients = new ArrayList();
			while (theIterator.hasNext()) {
				this.recipients.add(theIterator.next());
			}
		}
	}

	/**
	 * A constructor that creates a Email with the specified name, sender,
	 * recipients, and MimeMessage.
	 * 
	 * @param name
	 *            the name of the Email
	 * @param sender
	 *            the sender for this Email
	 * @param recipients
	 *            the collection of recipients of this Email
	 * @param message
	 *            the MimeMessage associated with this Email
	 */
	public Email(String name, MailAddress sender, Collection recipients,
			byte[] message) {
		this(name, sender, recipients);
		this.setMessage(message);
	}

	/**
	 * A constructor which will attempt to obtain sender and recipients from the
	 * headers of the byte[] supplied.
	 * 
	 * @param message -
	 *            a byte[] from which to construct a Mail
	 */
//	public Email(byte[] message) throws MessagingException {
//        this();
//        MailAddress sender = getReturnPath(message);
//        Collection recipients = null;
//        Address[] addresses = message.getRecipients(byte[].RecipientType.TO);
//        if (addresses != null) {
//            recipients = new ArrayList();
//            for (int i = 0; i < addresses.length; i++) {
//                try {
//                    recipients.add(new MailAddress(new InternetAddress(addresses[i].toString(), false)));
//                } catch (ParseException pe) {
//                    // RFC 2822 section 3.4 allows To: fields without <>
//                    // Let's give this one more try with <>.
//                    try {
//                        recipients.add(new MailAddress("<" + new InternetAddress(addresses[i].toString()).toString() + ">"));
//                    } catch (ParseException _) {
//                        throw new MessagingException("Could not parse address: " + addresses[i].toString() + " from " + message.getHeader(RFC2822Headers.TO, ", "), pe);
//                    }
//                }
//            }
//        }
//        this.name = message.toString();
//        this.sender = sender;
//        this.recipients = recipients;
//        this.setMessage(message);
//    }

	/**
	 * Gets the MailAddress corresponding to the existing "Return-Path" of
	 * <I>message</I>. If missing or empty returns <CODE>null</CODE>,
	 */
//	private MailAddress getReturnPath(byte[] message) throws MessagingException {
//		MailAddress mailAddress = null;
//		String[] returnPathHeaders = message
//				.getHeader(RFC2822Headers.RETURN_PATH);
//		String returnPathHeader = null;
//		if (returnPathHeaders != null) {
//			returnPathHeader = returnPathHeaders[0];
//			if (returnPathHeader != null) {
//				returnPathHeader = returnPathHeader.trim();
//				if (!returnPathHeader.equals("<>")) {
//					try {
//						mailAddress = new MailAddress(new InternetAddress(
//								returnPathHeader, false));
//					} catch (ParseException pe) {
//						throw new MessagingException(
//								"Could not parse address: "
//										+ returnPathHeader
//										+ " from "
//										+ message.getHeader(
//												RFC2822Headers.RETURN_PATH,
//												", "), pe);
//					}
//				}
//			}
//		}
//		return mailAddress;
//	}

	/**
	 * Duplicate the Email.
	 * 
	 * @return a Email that is a duplicate of this one
	 */
	public Email duplicate() {
		return duplicate(name);
	}

	/**
	 * Duplicate the Email, replacing the mail name with the one passed in as an
	 * argument.
	 * 
	 * @param newName
	 *            the name for the duplicated mail
	 * 
	 * @return a Email that is a duplicate of this one with a different name
	 */
	public Email duplicate(String newName) {
		try {
			Email newMail = new Email(newName, sender, recipients, getMessage());
			newMail.setRemoteHost(remoteHost);
			newMail.setRemoteAddr(remoteAddr);
			newMail.setLastUpdated(lastUpdated);
			newMail.setAttributesRaw((HashMap) attributes.clone());
			return newMail;
		} catch (Exception me) {
			// Ignored. Return null in the case of an error.
		}
		return null;
	}

	/**
	 * Get the error message associated with this Email.
	 * 
	 * @return the error message associated with this Email
	 */
	public String getErrorMessage() {
		return errorMessage;
	}

	/**
	 * Get the byte[] associated with this Email.
	 * 
	 * @return the byte[] associated with this Email
	 */
	public byte[] getMessage(){
		return message;
	}

	/**
	 * Set the name of this Email.
	 * 
	 * @param name
	 *            the name of this Email
	 */
	public void setName(String name) {
		this.name = name;
	}

	/**
	 * Get the name of this Email.
	 * 
	 * @return the name of this Email
	 */
	public String getName() {
		return name;
	}

	/**
	 * Get the recipients of this Email.
	 * 
	 * @return the recipients of this Email
	 */
	public Collection getRecipients() {
		return recipients;
	}

	/**
	 * Get the sender of this Email.
	 * 
	 * @return the sender of this Email
	 */
	public MailAddress getSender() {
		return sender;
	}

	/**
	 * Get the state of this Email.
	 * 
	 * @return the state of this Email
	 */
	public String getState() {
		return state;
	}

	/**
	 * Get the remote host associated with this Email.
	 * 
	 * @return the remote host associated with this Email
	 */
	public String getRemoteHost() {
		return remoteHost;
	}

	/**
	 * Get the remote address associated with this Email.
	 * 
	 * @return the remote address associated with this Email
	 */
	public String getRemoteAddr() {
		return remoteAddr;
	}

	/**
	 * Get the last updated time for this Email.
	 * 
	 * @return the last updated time for this Email
	 */
	public Date getLastUpdated() {
		return lastUpdated;
	}

	/**
	 * <p>
	 * Return the size of the message including its headers. byte[].getSize()
	 * method only returns the size of the message body.
	 * </p>
	 * 
	 * <p>
	 * Note: this size is not guaranteed to be accurate - see Sun's
	 * documentation of byte[].getSize().
	 * </p>

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
成人黄色小视频| 欧美日韩成人高清| 首页国产欧美久久| 国产精品久久久久久久久免费丝袜 | 亚洲欧美综合在线精品| 欧美一级欧美三级在线观看 | 国产成人精品三级| 天堂影院一区二区| 亚洲美女免费在线| 国产欧美精品一区| 日韩免费一区二区| 欧美影院一区二区三区| 成人午夜在线视频| 另类小说视频一区二区| 性做久久久久久免费观看| 自拍av一区二区三区| 国产亚洲人成网站| 日韩三级免费观看| 欧美老人xxxx18| 色综合视频一区二区三区高清| 久久99精品一区二区三区| 亚洲一二三四区| √…a在线天堂一区| 久久精品夜色噜噜亚洲aⅴ| 在线播放91灌醉迷j高跟美女 | 欧美日韩一区不卡| 色综合久久中文综合久久牛| 国产不卡在线播放| 国产麻豆精品视频| 国产美女视频91| 国内精品国产成人国产三级粉色 | 国产三级欧美三级日产三级99| 在线综合视频播放| 欧美精品777| 欧美性xxxxx极品少妇| 在线观看亚洲一区| 在线观看日韩一区| 欧美日韩精品综合在线| 欧美性受xxxx| 欧美日韩成人在线一区| 911精品产国品一二三产区| 欧美视频一区二区三区四区| 欧美日韩一区精品| 7777精品伊人久久久大香线蕉超级流畅 | 欧美绝品在线观看成人午夜影视| 精品1区2区3区| 欧美一区二区视频在线观看2022| 欧美一级久久久| 26uuu久久综合| 国产香蕉久久精品综合网| 国产精品青草久久| 中文字幕一区二区日韩精品绯色| 亚洲欧美国产三级| 午夜精品久久久久影视| 琪琪一区二区三区| 国产一区二区91| 99riav久久精品riav| 日本大香伊一区二区三区| 欧美男同性恋视频网站| 欧美一区二区三区四区五区 | 日韩精品乱码av一区二区| 日本91福利区| 国产成人精品亚洲777人妖| 99久久综合狠狠综合久久| 欧美日韩一区久久| 26uuu国产在线精品一区二区| 国产午夜精品一区二区三区视频| 中文字幕日本乱码精品影院| 亚洲综合精品久久| 久久精品99国产精品日本| 成人午夜视频网站| 在线观看不卡视频| 26uuu国产日韩综合| 亚洲欧美日韩一区| 蜜桃久久久久久久| 99久久精品99国产精品| 3751色影院一区二区三区| 久久精品欧美一区二区三区麻豆| 亚洲麻豆国产自偷在线| 蜜臀av性久久久久蜜臀aⅴ流畅| 国产精品白丝jk白祙喷水网站| 91免费在线播放| 日韩亚洲欧美在线观看| 中文字幕一区二区不卡 | 精品一区二区三区久久久| 99re这里只有精品6| 日韩欧美亚洲国产精品字幕久久久| 欧美极品xxx| 蜜臀久久99精品久久久画质超高清 | 色综合久久久久综合体| 精品久久久久一区二区国产| 亚洲日本在线a| 国产揄拍国内精品对白| 精品视频一区三区九区| 亚洲国产高清在线观看视频| 视频一区欧美精品| 97se亚洲国产综合自在线不卡| 91精品国产美女浴室洗澡无遮挡| 亚洲天天做日日做天天谢日日欢 | 国产成人免费9x9x人网站视频| 欧美色综合久久| 中文字幕亚洲不卡| 狠狠色狠狠色综合日日91app| 欧美在线色视频| 国产精品三级av| 国产精品影视在线| 日韩女优视频免费观看| 亚洲第一久久影院| 日本高清不卡一区| 自拍av一区二区三区| 国产精品一级片| 日韩一本二本av| 日韩av不卡一区二区| 欧美在线视频全部完| 亚洲视频综合在线| www.综合网.com| 国产偷v国产偷v亚洲高清| 精品一区二区三区香蕉蜜桃| 欧美色图激情小说| 亚洲国产精品久久久久婷婷884| 99re这里都是精品| 成人免费在线视频观看| 国产精品 欧美精品| 久久久久久久免费视频了| 久久99精品国产麻豆婷婷| 日韩一区二区在线观看视频| 婷婷六月综合网| 欧美日韩一区不卡| 天堂成人国产精品一区| 7777精品伊人久久久大香线蕉| 亚洲国产精品综合小说图片区| 色综合久久天天| 一区二区在线观看视频| 色先锋aa成人| 夜夜操天天操亚洲| 欧美亚洲免费在线一区| 亚洲一区二区三区四区在线观看| 欧亚一区二区三区| 香蕉乱码成人久久天堂爱免费| 欧美日韩一区二区三区在线看| 亚洲h精品动漫在线观看| 欧美日韩国产另类不卡| 三级一区在线视频先锋| 这里只有精品电影| 秋霞影院一区二区| 久久一区二区视频| 成人伦理片在线| 亚洲精品国久久99热| 欧美少妇性性性| 捆绑调教一区二区三区| 久久免费电影网| 9l国产精品久久久久麻豆| 一区二区三区四区亚洲| 777色狠狠一区二区三区| 美女在线一区二区| 欧美激情中文不卡| 色拍拍在线精品视频8848| 亚洲第一精品在线| 日韩视频国产视频| 成人高清伦理免费影院在线观看| 综合欧美亚洲日本| 91精品国产综合久久精品图片| 精品一区二区影视| 中文字幕佐山爱一区二区免费| 欧美在线|欧美| 狠狠色狠狠色综合日日91app| 国产精品高潮久久久久无| 欧美天堂一区二区三区| 狠狠v欧美v日韩v亚洲ⅴ| 中文字幕中文乱码欧美一区二区 | 欧美一级一级性生活免费录像| 狠狠色丁香婷婷综合久久片| 亚洲视频一区二区在线| 欧美一级专区免费大片| av激情综合网| 同产精品九九九| 国产精品久久久久久久久免费相片| 欧洲精品一区二区| 国模无码大尺度一区二区三区| 亚洲日本在线观看| 精品久久久久香蕉网| 91福利精品第一导航| 国产精品自拍av| 亚洲第一在线综合网站| 中文字幕不卡在线| 91麻豆精品91久久久久同性| 成人h精品动漫一区二区三区| 日韩激情一二三区| ...中文天堂在线一区| 欧美tk—视频vk| 欧日韩精品视频| 成人丝袜18视频在线观看| 日韩中文字幕av电影| 亚洲欧洲日产国码二区| 精品av综合导航| 91精品国产全国免费观看| 色综合视频在线观看| 成人综合在线观看| 黄色精品一二区| 日韩av一区二|