pikesaku’s blog

個人的な勉強メモです。記載内容について一切の責任は持ちません。

APPEND UTF8について

Courier-imapをVer5にすると、Outlookとかでメール移動時にappendコマンドが実行され、以下警告が出るようになる。

[ALERT] Your IMAP client does not appear to correctly implement Unicode messages, see https://tools.ietf.org/html/rfc6855.html

原因は、以下に説明あり。
Courier Mail Server / Re: [Courier-imap] Outlook 2016 with Courier-IMAP 5.0.8 append alert
RFC 6855 - IMAP Support for UTF-8
Issue 34138: imaplib RFC 6855 issue - Python tracker

RFC6855に準じたアクセスをすれば、Courier-IMAPが警告を出さないだろうと考え、思考錯誤アクセスしたが、失敗する。。。

通常

* OK [CAPABILITY IMAP4rev1 UIDPLUS CHILDREN NAMESPACE THREAD=ORDEREDSUBJECT THREAD=REFERENCES SORT QUOTA IDLE ACL ACL2=UNION STARTTLS ENABLE UTF8=ACCEPT] Courier-IMAP ready. Copyright 1998-2018 Double Precision, Inc.  See COPYING for distribution information.
a LOGIN "hoge" "hoge"
a OK LOGIN Ok.
a APPEND INBOX {33}
+ OK
From: "a" <a@hoge.go.jp>


a

a OK [APPENDUID 578246162 50] APPEND Ok.

失敗1

* OK [CAPABILITY IMAP4rev1 UIDPLUS CHILDREN NAMESPACE THREAD=ORDEREDSUBJECT THREAD=REFERENCES SORT QUOTA IDLE ACL ACL2=UNION STARTTLS ENABLE UTF8=ACCEPT] Courier-IMAP ready. Copyright 1998-2018 Double Precision, Inc.  See COPYING for distribution information.
a LOGIN "hoge" "hoge"
a OK LOGIN Ok.
a ENABLE UTF8=ACCEPT
* ENABLED UTF8=ACCEPT
a OK Options enabled
a APPEND INBOX UTF8 ~{36}
+ OK
From: "あ" <a@hoge.go.jp>

Test

a NO Error in IMAP command received by server.

失敗2

* OK [CAPABILITY IMAP4rev1 UIDPLUS CHILDREN NAMESPACE THREAD=ORDEREDSUBJECT THREAD=REFERENCES SORT QUOTA IDLE ACL ACL2=UNION STARTTLS ENABLE UTF8=ACCEPT] Courier-IMAP ready. Copyright 1998-2018 Double Precision, Inc.  See COPYING for distribution information.
a LOGIN "hoge" "hoge"
a OK LOGIN Ok.
a ENABLE UTF8=ACCEPT
* ENABLED UTF8=ACCEPT
a OK Options enabled
a APPEND INBOX UTF8 {36}
+ OK
From: "あ" <a@hoge.go.jp>

Test

* OK [ALERT] Your IMAP client does not appear to correctly implement Unicode messages, see https://tools.ietf.org/html/rfc6855.html
a OK [APPENDUID 578246162 52] APPEND Ok.

失敗3

* OK [CAPABILITY IMAP4rev1 UIDPLUS CHILDREN NAMESPACE THREAD=ORDEREDSUBJECT THREAD=REFERENCES SORT QUOTA IDLE ACL ACL2=UNION STARTTLS ENABLE UTF8=ACCEPT] Courier-IMAP ready. Copyright 1998-2018 Double Precision, Inc.  See COPYING for distribution information.
a LOGIN "hoge" "hoge"
a OK LOGIN Ok.
a ENABLE UTF8=ACCEPT
* ENABLED UTF8=ACCEPT
a OK Options enabled
a APPEND INBOX UTF8 (~{36}
From: "あ" <a@hoge.go.jp>

Test
)
a NO Error in IMAP command received by server.
From: NO Error in IMAP command received by server.
* NO Error in IMAP command received by server.
Test NO Error in IMAP command received by server.
* NO Error in IMAP command received by server.

失敗4

* OK [CAPABILITY IMAP4rev1 UIDPLUS CHILDREN NAMESPACE THREAD=ORDEREDSUBJECT THREAD=REFERENCES SORT QUOTA IDLE ACL ACL2=UNION STARTTLS ENABLE UTF8=ACCEPT] Courier-IMAP ready. Copyright 1998-2018 Double Precision, Inc.  See COPYING for distribution information.
a LOGIN "hoge" "hoge"
a OK LOGIN Ok.
a ENABLE UTF8=ACCEPT
* ENABLED UTF8=ACCEPT
a OK Options enabled
a APPEND INBOX UTF8 ~{36+}
a NO Error in IMAP command received by server.
From: "あ" <a@hoge.go.jp>

Test
From: NO Error in IMAP command received by server.

* NO Error in IMAP command received by server.
Test NO Error in IMAP command received by server.
* NO Error in IMAP command received by server.

失敗5

* OK [CAPABILITY IMAP4rev1 UIDPLUS CHILDREN NAMESPACE THREAD=ORDEREDSUBJECT THREAD=REFERENCES SORT QUOTA IDLE ACL ACL2=UNION STARTTLS ENABLE UTF8=ACCEPT] Courier-IMAP ready. Copyright 1998-2018 Double Precision, Inc.  See COPYING for distribution information.
a LOGIN "hoge" "hoge"
a OK LOGIN Ok.
a ENABLE UTF8=ACCEPT
* ENABLED UTF8=ACCEPT
a OK Options enabled
a APPEND INBOX UTF8 ~{36+}
a NO Error in IMAP command received by server.
From: "あ" <a@hoge.go.jp>

Test
From: NO Error in IMAP command received by server.

* NO Error in IMAP command received by server.
Test NO Error in IMAP command received by server.
* NO Error in IMAP command received by server.