แฟล็ก IMAP ใดที่ได้รับการสนับสนุนอย่างน่าเชื่อถือในเซิร์ฟเวอร์อีเมลส่วนใหญ่


21

ฉันกำลังเขียนแอปพลิเคชันซึ่งตอบสนองต่ออีเมลที่ส่งไปยังกล่องจดหมาย มันดึงอีเมลผ่าน IMAP มันจะถูกปรับใช้กับระบบจำนวนมากที่ฉันไม่ได้ควบคุมการกำหนดค่าเซิร์ฟเวอร์อีเมล

ฉันต้องการใช้การตั้งค่าสถานะ IMAP เพื่อระบุว่ามีการจัดการข้อความใด ระบบแฟล็กสนับสนุนอย่างกว้างขวางเพียงพอที่ฉันสามารถพึ่งพาได้ในแอปพลิเคชันของฉันหรือไม่? ธงที่ผู้ใช้กำหนดเองได้รับการสนับสนุนอย่างกว้างขวางเพียงพอหรือไม่

(ถ้าคำตอบคือ "ฮ่าฮ่าไม่ใช่โอกาส" ฉันจะใช้โฟลเดอร์แทน)

ขอบคุณ

-Ben

คำตอบ:


20

ดูตัวอย่างเซสชันเซิร์ฟเวอร์ IMAPนี้ เป็นหลักเมื่อใดก็ตามที่คุณเห็นPERMANENTFLAGSมี\*เซิร์ฟเวอร์จะสนับสนุนการตั้งค่าสถานะที่ผู้ใช้กำหนด

หากต้องการเพิ่มในรายการนี่คือข้อความที่ตัดตอนมาจากเซสชัน Gimap (Google Mail IMAP):

* OK Gimap ready for requests from 192.0.2.1 5if380490pzk.17
a login username password
* CAPABILITY IMAP4rev1 UNSELECT LITERAL+ IDLE NAMESPACE QUOTA ID XLIST CHILDREN X-GM-EXT-1 UIDPLUS COMPRESS=DEFLATE
a OK username@gmail.com authenticated (Success)
b select inbox
* FLAGS (\Answered \Flagged \Draft \Deleted \Seen)
* OK [PERMANENTFLAGS (\Answered \Flagged \Draft \Deleted \Seen \*)]
* OK [UIDVALIDITY 2]
* 1089 EXISTS
* 0 RECENT
* OK [UIDNEXT 2371]
b OK [READ-WRITE] inbox selected. (Success)
c logout
* BYE LOGOUT Requested
c OK 73 good day (Success)

และในทำนองเดียวกันเซสชันจาก Exchange 2007:

* OK Microsoft Exchange Server 2007 IMAP4 service ready
00000000 CAPABILITY
* CAPABILITY IMAP4 IMAP4rev1 AUTH=NTLM AUTH=GSSAPI IDLE NAMESPACE LITERAL+
00000000 OK CAPABILITY completed.
   [...]
00000003 SELECT INBOX
* 1 EXISTS
* 0 RECENT
* FLAGS (\Seen \Answered \Flagged \Deleted \Draft $MDNSent)
* OK [PERMANENTFLAGS (\Seen \Answered \Flagged \Deleted \Draft $MDNSent)] Permanent flags
* OK [UIDVALIDITY 472] UIDVALIDITY value
* OK [UIDNEXT 7] The next unique identifier value
00000003 OK [READ-WRITE] SELECT completed.

ฉันไม่พบเซสชันจาก Exchange 2010

ดังนั้นมันจึงไม่เป็นสากล - โดยการแลกเปลี่ยนเป็นผู้ที่มีชื่อเสียง แต่มันก็เป็นเรื่องธรรมดามากกว่านั้น


6

เอกสารโปรโตคอล IMAP หลักคือ RFC3501 ส่วน 2.3.2 อธิบายการตั้งค่าสถานะมาตรฐานทุกการใช้งาน IMAP ต้องทำงานด้วย

ระบบแฟล็กสนับสนุนอย่างกว้างขวางเพียงพอที่ฉันสามารถพึ่งพาได้ในแอปพลิเคชันของฉันหรือไม่?

อันที่จริง RFC3501 อธิบายการตั้งค่าสถานะระบบสากล

ธงที่ผู้ใช้กำหนดเองได้รับการสนับสนุนอย่างกว้างขวางเพียงพอหรือไม่

ที่มีอยู่ไม่ RFC ใด ๆ เกี่ยวกับเรื่องของธงที่ผู้ใช้กำหนดเพียงข้อเสนอ

RFC 3501                         IMAPv4                       March 2003

2.3.2.  Flags Message Attribute

   A list of zero or more named tokens associated with the message.  A
   flag is set by its addition to this list, and is cleared by its
   removal.  There are two types of flags in IMAP4rev1.  A flag of
   either type can be permanent or session-only.

   A system flag is a flag name that is pre-defined in this
   specification.  All system flags begin with "\".  Certain system
   flags (\Deleted and \Seen) have special semantics described
   elsewhere.  The currently-defined system flags are:

        \Seen
           Message has been read

        \Answered
           Message has been answered

        \Flagged
           Message is "flagged" for urgent/special attention

        \Deleted
           Message is "deleted" for removal by later EXPUNGE

        \Draft
           Message has not completed composition (marked as a draft).

        \Recent
           Message is "recently" arrived in this mailbox.  This session
           is the first session to have been notified about this
           message; if the session is read-write, subsequent sessions
           will not see \Recent set for this message.  This flag can not
           be altered by the client.

           If it is not possible to determine whether or not this
           session is the first session to be notified about a message,
           then that message SHOULD be considered recent.

           If multiple connections have the same mailbox selected
           simultaneously, it is undefined which of these connections
           will see newly-arrived messages with \Recent set and which
           will see it without \Recent set.

   A keyword is defined by the server implementation.  Keywords do not
   begin with "\".  Servers MAY permit the client to define new keywords
   in the mailbox (see the description of the PERMANENTFLAGS response
   code for more information).

   A flag can be permanent or session-only on a per-flag basis.
   Permanent flags are those which the client can add or remove from the
   message flags permanently; that is, concurrent and subsequent
   sessions will see any change in permanent flags.  Changes to session
   flags are valid only in that session.

    Note: The \Recent system flag is a special case of a
    session flag.  \Recent can not be used as an argument in a
    STORE or APPEND command, and thus can not be changed at
    all.

4

Exchange 2010 มี PERMANENTFLAGS ชุดเดียวกัน

* OK [PERMANENTFLAGS (\Seen \Answered \Flagged \Deleted \Draft $MDNSent)] Perman
ent flags

1
เหมือนกันสำหรับ Office 365* OK [PERMANENTFLAGS (\Seen \Answered \Flagged \Deleted \Draft $MDNSent)] Permanent flags
Nisd
โดยการใช้ไซต์ของเรา หมายความว่าคุณได้อ่านและทำความเข้าใจนโยบายคุกกี้และนโยบายความเป็นส่วนตัวของเราแล้ว
Licensed under cc by-sa 3.0 with attribution required.