Closed francisLee777 closed 3 years ago
From RFC 3501 (IMAP4rev1):
greeting = "*" SP (resp-cond-auth / resp-cond-bye) CRLF
resp-cond-auth = ("OK" / "PREAUTH") SP resp-text
; Authentication condition
resp-text = ["[" resp-text-code "]" SP] text
text = 1*TEXT-CHAR
TEXT-CHAR = <any CHAR except CR and LF>
From RFC 5234 (ABNF):
CHAR = %x01-7F
; any 7-bit US-ASCII character,
; excluding NUL
FWIW Tencent Mail Server seems to be breaking RFCs by including non-ASCII characters where they are not alloweed.
From RFC 3501 (IMAP4rev1):
greeting = "*" SP (resp-cond-auth / resp-cond-bye) CRLF resp-cond-auth = ("OK" / "PREAUTH") SP resp-text ; Authentication condition resp-text = ["[" resp-text-code "]" SP] text text = 1*TEXT-CHAR TEXT-CHAR = <any CHAR except CR and LF>
From RFC 5234 (ABNF):
CHAR = %x01-7F ; any 7-bit US-ASCII character, ; excluding NUL
FWIW Tencent Mail Server seems to be breaking RFCs by including non-ASCII characters where they are not alloweed.
Yes I know,but this is not the reason that the library throws error. The '(' character which the greeting text contains leads to this error, but '(' is US-ASCII %x28, that is a correct character. Thanks for your reply 😀.
Oh, I am blind. Right, greeting parsing should allow more than what atom would.
Also, it seems like you trying to connect to the POP3 server instead of IMAP4 one.
I verified the go-imap code and it handles non-atom characters in info correctly.
so how can I parse the greeting message successfully? thanks a lot.
------------------ 原始邮件 ------------------ 发件人: "Max @.>; 发送时间: 2021年7月20日(星期二) 凌晨1:20 收件人: @.>; 抄送: @.>; @.>; 主题: Re: [emersion/go-imap] err : atom contains forbidden char ( (#435)
Oh, I am blind. Right, greeting parsing should allow more than what atom would.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.
Oh, I am blind. Right, greeting parsing should allow more than what atom would.
so how can I parse the greeting message successfully? thanks a lot.
when I connect to Tencent mail Server by
client.DialTLS("pop.qq.com:995", nil)
it return an error calledatom contains forbidden char :(
.In this function, client will greet to the server by
c.handleGreetAndStartReading()
.by debugging this function, I find the server successfully returns this message
+OK XMail POP3 Server v1.0 Service Ready(XMail v1.0)
in the response, butfunc (r *Reader) ReadAtom() (interface{}, error)
in read.go reads the " Ready(XMail v1.0)" in the message and return an error because the content contains '(' character.As a result, I can't connect to the Tencent mail Server successfully.