imap continuations must have a space after the "+"

prevented at least the gmail/mail (?) android app from appending a sent message
to the sent mailbox.
This commit is contained in:
Mechiel Lukkien 2023-07-24 19:54:55 +02:00
parent bc62aae0e6
commit cc4ecf2927
No known key found for this signature in database
4 changed files with 5 additions and 5 deletions

View file

@ -54,7 +54,7 @@ func TestAuthenticatePlain(t *testing.T) {
tc.readstatus("bad")
tc.cmdf("", "authenticate plain")
tc.readprefixline("+")
tc.readprefixline("+ ")
tc.writelinef("%s", base64.StdEncoding.EncodeToString([]byte("\u0000mjl@mox.example\u0000testtest")))
tc.readstatus("ok")
}

View file

@ -23,7 +23,7 @@ func TestIdle(t *testing.T) {
// todo: test with delivery through smtp
tc2.cmdf("", "idle")
tc2.readprefixline("+")
tc2.readprefixline("+ ")
done := make(chan error)
go func() {
defer func() {

View file

@ -566,7 +566,7 @@ func (c *conn) readCommand(tag *string) (cmd string, p *parser) {
func (c *conn) xreadliteral(size int64, sync bool) string {
if sync {
c.writelinef("+")
c.writelinef("+ ")
}
buf := make([]byte, size)
if size > 0 {
@ -2541,7 +2541,7 @@ func (c *conn) cmdAppend(tag, cmd string, p *parser) {
c.xmailbox(tx, name, "TRYCREATE")
})
if sync {
c.writelinef("+")
c.writelinef("+ ")
}
// Read the message into a temporary file.

View file

@ -512,7 +512,7 @@ func TestScenario(t *testing.T) {
tc.transactf("ok", "append inbox (\\seen) {%d+}\r\n%s", len(exampleMsg), exampleMsg)
tc.transactf("no", "append bogus () {%d}", len(exampleMsg))
tc.cmdf("", "append inbox () {%d}", len(exampleMsg))
tc.readprefixline("+")
tc.readprefixline("+ ")
_, err := tc.conn.Write([]byte(exampleMsg + "\r\n"))
tc.check(err, "write message")
tc.response("ok")