POP3 メッセージストアへのアクセスを提供する JavaMail API の POP3 プロトコルプロバイダです。 詳細については、RFC 1939 を参照して下さい。

POP3 プロバイダは "INBOX" という単独の Folder を含む Store オブジェクトを提供します。 POP3 プロトコルの制限の為、イベント通知、フォルダ管理、フラグ管理等の様な JavaMail API の機能の多くが許可されていません。 対応するメソッドは MethodNotSupportedException 例外をスローします。 詳細に関して以下を参照して下さい。

JavaMail がメッセージをダウンロードし保存する事ができるローカルストアを含んでいない事に注意して下さい。 "mbox" と "MH" ローカルストアプロバイダの有用性に関しては。 Third Party Products のウェブページを参照して下さい。

POP3 プロバイダは、プロトコル名 "pop3" 又は、"pop3://user:password@host:port/INBOX" 形式の URL により、JavaMail API を通してアクセスされます。

POP3 は "INBOX" と言う単一のフォルダだけをサポートします。

POP3 はどの様な永久フラグもサポートしません。 ({@link javax.mail.Folder#getPermanentFlags Folder.getPermanentFlags()} を参照) 特に、Flags.Flag.RECENT フラグは POP3 メッセージには決して設定されません。 POP3 メールボックス中のどのメッセージが "新しいか" を決定するのはアプリケーションで行います。 アプリケーションと環境の必要性によって、これを達成する為に、いくつかの方法があります:

何れのアプローチもクライアントに関連しているので、いくらかの永久記録媒体を必要とします。

POP3 は、Folder.expunge() メソッドをサポートしません。 メッセージを削除して消去するには、メッセージに Flags.Flag.DELETED フラグを設定し、 Folder.close(true) メソッドを使用してフォルダを閉じて下さい。 フォルダを閉じずに消去する事はできません。

POP3 は "受信日時" を提供しないので、getReceivedDate メソッドは null を返します。 受信日時を見積もる為に他のメッセージヘッダ(例えば、"Received" ヘッダ)を調べるのが可能かもしれませんが、 これらのテクニックは誤り易い傾向があります。

POP3 プロバイダは、POP3 UIDL コマンドをサポートします。 {@link jp.sourceforge.livez.mail.pop3.POP3Folder#getUID POP3Folder.getUID()} を参照。 使用例

if (folder instanceof jp.sourceforge.livez.mail.pop3.POP3Folder) {
    jp.sourceforge.livez.mail.pop3.POP3Folder pf =
	(jp.sourceforge.livez.mail.pop3.POP3Folder) folder;
    String uid = pf.getUID(msg);
    if (uid != null)
	... // uid を使用するコード
}

又、以下の様に全てのメッセージの全ての UID をプリフェッチする事が可能です:

FetchProfile fp = new FetchProfile();
fp.add(UIDFolder.FetchProfileItem.UID);
folder.fetch(folder.getMessages(), fp);

各メッセージの UID を取得する方法は上記のテクニックを使用して下さい。 これは POP3 UID が IMAP UID の様な整数ではなく、文字列であるのに注意する事を除いて、 IMAP によってサポートされる UIDFolder インタフェースと共に使用されるテクニックと同様です。 詳細は POP3 仕様を参照して下さい。

POP3 プロトコルプロバイダは以下のプロパティをサポートします。 (プロパティは JavaMail Session オブジェクトに設定される場合があります) プロパティは常に文字列として設定します。型は文字列がどの様に解釈されるかを説明します。 使用例

	props.put("mail.pop3.port", "888");
mail.pop3.port のプロパティを設定します。(int 型のプロパティ)

名前 説明
mail.pop3.user String POP3 のデフォルトユーザ名です。
mail.pop3.host String 接続する POP3 サーバです。
mail.pop3.port int connect() メソッドで明示的に指定しない場合、接続する POP3 サーバポート、 デフォルトは 110 です。
mail.pop3.connectiontimeout int ソケット接続タイムアウト値です(ミリ秒)。 デフォルトは -1 (無限)です。
mail.pop3.timeout int ソケット I/O タイムアウト値です(ミリ秒)。 デフォルトは -1 (無限)です。
mail.pop3.rsetbeforequit boolean QUIT コマンド送信前のフォルダを閉じる時に、POP3 RSET コマンドを送信します。 Useful with POP3 servers that implicitly mark all messages that are read as "deleted"; this will prevent such messages from being deleted and expunged unless the client requests so. デフォルトは false です。
mail.pop3.message.class String jp.sourceforge.livez.mail.pop3.POP3Message のサブクラスのクラス名です。 (例えば)非標準の Content-Type ヘッダを扱う場合にサブクラスを使用することができます。 サブクラスは、MyPOP3Message(Folder f, int msgno) throws MessagingException 形式のパブリックなコンストラクタがなければなりません。
mail.pop3.localaddress String POP3 ソケット作成時にバインドするローカルアドレス(ホスト名)です。 Socket クラスで選択されるアドレスのデフォルト。 Should not normally need to be set, but useful with multi-homed hosts where it's important to pick a particular local address to bind to.
mail.pop3.localport int POP3 ソケット作成時にバインドするポート番号です。 Socket クラスで選択されるポート番号のデフォルト。
mail.pop3.apop.enable boolean true に設定した場合は、POP3 サーバが APOP をサポートする場合、 POP3 サーバへのログインに USER/PASS の代わりに APOP を使用します。 APOP はクリアテキストパスワードではなくダイジェストされたパスワードを送ります。 デフォルトは false です。
mail.pop3.socketFactory.class String 設定する場合、javax.net.SocketFactory インタフェースを実装するクラスの名前を指定します。 このクラスは、POP3 ソケットを作成する為に使用されます。
mail.pop3.socketFactory.fallback boolean If set to true, failure to create a socket using the specified socket factory class will cause the socket to be created using the java.net.Socket class. デフォルトは true です。
mail.pop3.socketFactory.port int 指定されたソケットファクトリを使用する場合に、接続するポートを指定します。 設定されない場合、デフォルトポートが使用されます。
mail.pop3.disabletop boolean If set to true, the POP3 TOP command will not be used to fetch message headers. This is ueful for POP3 servers that don't properly implement the TOP command, or that provide incorrect information in the TOP command results. Defaults to false.
mail.pop3.forgettopheaders boolean If set to true, the headers that might have been retrieved using the POP3 TOP command will be forgotten and replaced by headers retrieved as part ofthe POP3 RETR command. Some servers, such as some version of Microsft Exchange, will return slightly different headers each time the TOP or RETR command is used. To allow the POP3 provider to properly parse the message content returned from the RETR command, the headers also returned by the RETR command must be used. Setting this property to true will cause these headers to be used, even if they differ from the headers returned previously as a result of using the TOP command. Defaults to false.

一般的には、アプリケーションはこのパッケージ中のクラスを直接使用する必要はないはずです。 代わりに javax.mail パッケージ(とサブパッケージ)で定義された API を使用すべきです。 アプリケーションは POP3Store 又は POP3Folder のインスタンスを決して直接構成するべきではありません。 代わりに適切な Store オブジェクトを入手する SessiongetStore メソッドを使用すべきです。

警告: このパッケージのユニークな API は実験的であると考えるべきです。 将来、現在の API を使用するアプリケーションと両立しない方法でそれらを変えるかもしれません。