Documentation
¶
Overview ¶
Package IMAP implements IMAP4rev2.
IMAP4rev2 is defined in RFC 9051.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cap ¶
type Cap string
Cap represents an IMAP capability.
const ( CapIMAP4rev1 Cap = "IMAP4rev1" // RFC 3501 CapIMAP4rev2 Cap = "IMAP4rev2" // RFC 9051 CapAuthPlain Cap = "AUTH=PLAIN" CapStartTLS Cap = "STARTTLS" CapLoginDisabled Cap = "LOGINDISABLED" // Folded in IMAP4rev2 CapNamespace Cap = "NAMESPACE" // RFC 2342 CapUnselect Cap = "UNSELECT" // RFC 3691 CapUIDPlus Cap = "UIDPLUS" // RFC 4315 CapESearch Cap = "ESEARCH" // RFC 4731 CapSearchRes Cap = "SEARCHRES" // RFC 5182 CapEnable Cap = "ENABLE" // RFC 5161 CapIdle Cap = "IDLE" // RFC 2177 CapSASLIR Cap = "SASL-IR" // RFC 4959 CapListExtended Cap = "LIST-EXTENDED" // RFC 5258 CapListStatus Cap = "LIST-STATUS" // RFC 5819 CapMove Cap = "MOVE" // RFC 6851 CapLiteralMinus Cap = "LITERAL-" // RFC 7888 CapStatusSize Cap = "STATUS=SIZE" // RFC 8438 CapACL Cap = "ACL" // RFC 4314 CapAppendLimit Cap = "APPENDLIMIT" // RFC 7889 CapBinary Cap = "BINARY" // RFC 3516 CapCatenate Cap = "CATENATE" // RFC 4469 CapChildren Cap = "CHILDREN" // RFC 3348 CapCondStore Cap = "CONDSTORE" // RFC 7162 CapConvert Cap = "CONVERT" // RFC 5259 CapCreateSpecialUse Cap = "CREATE-SPECIAL-USE" // RFC 6154 CapESort Cap = "ESORT" // RFC 5267 CapFilters Cap = "FILTERS" // RFC 5466 CapID Cap = "ID" // RFC 2971 CapLanguage Cap = "LANGUAGE" // RFC 5255 CapListMyRights Cap = "LIST-MYRIGHTS" // RFC 8440 CapLiteralPlus Cap = "LITERAL+" // RFC 7888 CapLoginReferrals Cap = "LOGIN-REFERRALS" // RFC 2221 CapMailboxReferrals Cap = "MAILBOX-REFERRALS" // RFC 2193 CapMetadata Cap = "METADATA" // RFC 5464 CapMetadataServer Cap = "METADATA-SERVER" // RFC 5464 CapMultiAppend Cap = "MULTIAPPEND" // RFC 3502 CapMultiSearch Cap = "MULTISEARCH" // RFC 7377 CapNotify Cap = "NOTIFY" // RFC 5465 CapObjectID Cap = "OBJECTID" // RFC 8474 CapPreview Cap = "PREVIEW" // RFC 8970 CapQResync Cap = "QRESYNC" // RFC 7162 CapQuota Cap = "QUOTA" // RFC 9208 CapQuotaSet Cap = "QUOTASET" // RFC 9208 CapReplace Cap = "REPLACE" // RFC 8508 CapSaveDate Cap = "SAVEDATE" // RFC 8514 CapSearchFuzzy Cap = "SEARCH=FUZZY" // RFC 6203 CapSort Cap = "SORT" // RFC 5256 CapSortDisplay Cap = "SORT=DISPLAY" // RFC 5957 CapSpecialUse Cap = "SPECIAL-USE" // RFC 6154 CapThread Cap = "THREAD" // RFC 5256 CapUnauthenticate Cap = "UNAUTHENTICATE" // RFC 8437 CapURLPartial Cap = "URL-PARTIAL" // RFC 5550 CapURLAuth Cap = "URLAUTH" // RFC 4467 CapWithin Cap = "WITHIN" // RFC 5032 )
Registered capabilities.
type CapSet ¶
type CapSet map[Cap]struct{}
CapSet is a set of capabilities.
func (CapSet) AppendLimit ¶
AppendLimit checks the APPENDLIMIT capability.
If the server supports APPENDLIMIT, ok is true. If the server doesn't have the same upload limit for all mailboxes, limit is nil and per-mailbox limits must be queried via STATUS.
type Flag ¶
type Flag string
Flag is a message flag.
Message flags are defined in RFC 9051 section 2.3.2.
const ( // System flags FlagSeen Flag = "\\Seen" FlagAnswered Flag = "\\Answered" FlagFlagged Flag = "\\Flagged" FlagDeleted Flag = "\\Deleted" FlagDraft Flag = "\\Draft" // Widely used flags FlagForwarded Flag = "$Forwarded" FlagMDNSent Flag = "$MDNSent" // Message Disposition Notification sent FlagJunk Flag = "$Junk" FlagNotJunk Flag = "$NotJunk" FlagPhishing Flag = "$Phishing" FlagImportant Flag = "$Important" // RFC 8457 // Permanent flags FlagWildcard Flag = "\\*" )
type MailboxAttr ¶
type MailboxAttr string
MailboxAttr is a mailbox attribute.
Mailbox attributes are defined in RFC 9051 section 7.3.1.
const ( // Base attributes MailboxAttrNonExistent MailboxAttr = "\\NonExistent" MailboxAttrNoInferiors MailboxAttr = "\\Noinferiors" MailboxAttrNoSelect MailboxAttr = "\\Noselect" MailboxAttrHasChildren MailboxAttr = "\\HasChildren" MailboxAttrHasNoChildren MailboxAttr = "\\HasNoChildren" MailboxAttrMarked MailboxAttr = "\\Marked" MailboxAttrUnmarked MailboxAttr = "\\Unmarked" MailboxAttrSubscribed MailboxAttr = "\\Subscribed" MailboxAttrRemote MailboxAttr = "\\Remote" // Role (aka. "special-use") attributes MailboxAttrAll MailboxAttr = "\\All" MailboxAttrArchive MailboxAttr = "\\Archive" MailboxAttrDrafts MailboxAttr = "\\Drafts" MailboxAttrFlagged MailboxAttr = "\\Flagged" MailboxAttrJunk MailboxAttr = "\\Junk" MailboxAttrSent MailboxAttr = "\\Sent" MailboxAttrTrash MailboxAttr = "\\Trash" )
type ResponseCode ¶
type ResponseCode string
ResponseCode is a response code.
const ( ResponseCodeAlert ResponseCode = "ALERT" ResponseCodeAlreadyExists ResponseCode = "ALREADYEXISTS" ResponseCodeAuthenticationFailed ResponseCode = "AUTHENTICATIONFAILED" ResponseCodeAuthorizationFailed ResponseCode = "AUTHORIZATIONFAILED" ResponseCodeBadCharset ResponseCode = "BADCHARSET" ResponseCodeCannot ResponseCode = "CANNOT" ResponseCodeClientBug ResponseCode = "CLIENTBUG" ResponseCodeContactAdmin ResponseCode = "CONTACTADMIN" ResponseCodeCorruption ResponseCode = "CORRUPTION" ResponseCodeExpired ResponseCode = "EXPIRED" ResponseCodeHasChildren ResponseCode = "HASCHILDREN" ResponseCodeInUse ResponseCode = "INUSE" ResponseCodeLimit ResponseCode = "LIMIT" ResponseCodeNonExistent ResponseCode = "NONEXISTENT" ResponseCodeNoPerm ResponseCode = "NOPERM" ResponseCodeOverQuota ResponseCode = "OVERQUOTA" ResponseCodeParse ResponseCode = "PARSE" ResponseCodePrivacyRequired ResponseCode = "PRIVACYREQUIRED" ResponseCodeServerBug ResponseCode = "SERVERBUG" ResponseCodeTryCreate ResponseCode = "TRYCREATE" ResponseCodeUnknownCTE ResponseCode = "UNKNOWN-CTE" // METADATA ResponseCodeTooMany ResponseCode = "TOOMANY" ResponseCodeNoPrivate ResponseCode = "NOPRIVATE" )
type Seq ¶
type Seq struct {
Start, Stop uint32
}
Seq represents a single seq-number or seq-range value (RFC 3501 ABNF). Values may be static (e.g. "1", "2:4") or dynamic (e.g. "*", "1:*"). A seq-number is represented by setting Start = Stop. Zero is used to represent "*", which is safe because seq-number uses nz-number rule. The order of values is always Start <= Stop, except when representing "n:*", where Start = n and Stop = 0.
func (Seq) Contains ¶
Contains returns true if the seq-number q is contained in sequence value s. The dynamic value "*" contains only other "*" values, the dynamic range "n:*" contains "*" and all numbers >= n.
type SeqSet ¶
type SeqSet []Seq
SeqSet is used to represent a set of message sequence numbers or UIDs (see sequence-set ABNF rule). The zero value is an empty set.
func ParseSeqSet ¶
ParseSeqSet returns a new SeqSet after parsing the set string.
func SeqSetRange ¶
SeqSetRange returns a new SeqSet containing the sequence range.
func (*SeqSet) AddNum ¶
AddNum inserts new sequence numbers into the set. The value 0 represents "*".
func (SeqSet) Contains ¶
Contains returns true if the non-zero sequence number or UID q is contained in the set. The dynamic range "n:*" contains all q >= n. It is the caller's responsibility to handle the special case where q is the maximum UID in the mailbox and q < n (i.e. the set cannot match UIDs against "*:n" or "*" since it doesn't know what the maximum value is).
type StatusResponse ¶
type StatusResponse struct { Type StatusResponseType Code ResponseCode Text string }
StatusResponse is a generic status response.
See RFC 9051 section 7.1.
type StatusResponseType ¶
type StatusResponseType string
StatusResponseType is a generic status response type.
const ( StatusResponseTypeOK StatusResponseType = "OK" StatusResponseTypeNo StatusResponseType = "NO" StatusResponseTypeBad StatusResponseType = "BAD" StatusResponseTypePreAuth StatusResponseType = "PREAUTH" StatusResponseTypeBye StatusResponseType = "BYE" )
Directories
¶
Path | Synopsis |
---|---|
internal
|
|
imapwire
Package imapwire implements the IMAP wire protocol.
|
Package imapwire implements the IMAP wire protocol. |
utf7
Package utf7 implements modified UTF-7 encoding defined in RFC 3501 section 5.1.3
|
Package utf7 implements modified UTF-7 encoding defined in RFC 3501 section 5.1.3 |