diff options
author | Runxi Yu <me@runxiyu.org> | 2025-01-16 16:31:47 +0800 |
---|---|---|
committer | Runxi Yu <me@runxiyu.org> | 2025-01-16 16:33:22 +0800 |
commit | c63ff23771a50b160ca119372f1f9accf89c5942 (patch) | |
tree | bb12a015e01fc5cc56877de8cb60e4205a9b1a1d /common_imap.go | |
parent | IMAP: Re-add server protocol state (diff) | |
download | maild-c63ff23771a50b160ca119372f1f9accf89c5942.tar.gz maild-c63ff23771a50b160ca119372f1f9accf89c5942.tar.zst maild-c63ff23771a50b160ca119372f1f9accf89c5942.zip |
Remove IMAP again for now
Diffstat (limited to 'common_imap.go')
-rw-r--r-- | common_imap.go | 31 |
1 files changed, 0 insertions, 31 deletions
diff --git a/common_imap.go b/common_imap.go deleted file mode 100644 index 3d79124..0000000 --- a/common_imap.go +++ /dev/null @@ -1,31 +0,0 @@ -package main - -import ( - "errors" - "strings" -) - -var err_imap_generic = errors.New("Error in IMAP command received by server.") - -func parse_imap_line(line string) (tag, cmd, param string, err error) { - line = strings.TrimSuffix(line, "\n") - line = strings.TrimSuffix(line, "\r") - tag_end := strings.IndexByte(line, ' ') - if tag_end == -1 { - err = err_imap_generic - return - } - tag = line[:tag_end] - rest := line[tag_end+1:] - cmd_end := strings.IndexByte(rest, ' ') - var param_start int - if cmd_end == -1 { - cmd_end = len(rest) - param_start = len(rest) - } else { - param_start = cmd_end + 1 - } - cmd = strings.ToUpper(rest[:cmd_end]) - param = rest[param_start:] - return -} |