The slice of created mailboxes does not include the RemoteName when it
hits the remote.ApplyDiff function. Set the remote name, replacing the
path delimiters, if necessary, before attempting to create it.
Signed-off-by: Tim Culverhouse <tim@timculverhouse.com>
---
imap/update.go | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/imap/update.go b/imap/update.go
index 8da0fef18513..57f68edb8d0e 100644
--- a/imap/update.go+++ b/imap/update.go
@@ -2,6 +2,7 @@ package imap
import (
"fmt"
+ "strings" "time"
"git.sr.ht/~rockorager/offmap"
@@ -17,6 +18,10 @@ func (s *Store) ApplyDiff(state *offmap.State, c *offmap.Diff) error {
for _, mbox := range c.Mailboxes.Created {
conn := s.getConn()
defer conn.done()
+ mbox.RemoteName = mbox.LocalName+ if s.Delimiter() != "/" {+ mbox.RemoteName = strings.ReplaceAll(mbox.RemoteName, "/", s.Delimiter())+ } err := conn.Create(mbox.RemoteName)
if err != nil {
// TODO how to handle this error?
--
2.38.1