mirror of
https://github.com/mjl-/mox.git
synced 2025-07-12 22:14:40 +03:00
add rfc 4155 about mbox files, and cross-reference in the import/export code for mbox files
This commit is contained in:
@ -100,7 +100,7 @@ func (mr *MboxReader) Next() (*Message, *os.File, string, error) {
|
||||
}
|
||||
if len(line) > 0 {
|
||||
mr.line++
|
||||
// We store data with crlf, adjust any imported messages with bare newlines.
|
||||
// We store data with crlf, adjust any imported messages with bare newlines. ../rfc/4155:354
|
||||
if !bytes.HasSuffix(line, []byte("\r\n")) {
|
||||
line = append(line[:len(line)-1], "\r\n"...)
|
||||
}
|
||||
@ -156,12 +156,13 @@ func (mr *MboxReader) Next() (*Message, *os.File, string, error) {
|
||||
mr.header = false
|
||||
}
|
||||
|
||||
// Next mail message starts at bare From word.
|
||||
// Next mail message starts at bare From word. ../rfc/4155:71
|
||||
if mr.prevempty && bytes.HasPrefix(line, from) {
|
||||
mr.fromLine = strings.TrimSpace(string(line))
|
||||
mr.header = true
|
||||
break
|
||||
}
|
||||
// ../rfc/4155:119
|
||||
if bytes.HasPrefix(line, []byte(">")) && bytes.HasPrefix(bytes.TrimLeft(line, ">"), []byte("From ")) {
|
||||
line = line[1:]
|
||||
}
|
||||
|
Reference in New Issue
Block a user