Authentication-Results: mail-b.sr.ht; dkim=pass header.d=timculverhouse.com header.i=@timculverhouse.com; dkim=pass header.d=messagingengine.com header.i=@messagingengine.com Received: from wout3-smtp.messagingengine.com (wout3-smtp.messagingengine.com [64.147.123.19]) by mail-b.sr.ht (Postfix) with ESMTPS id C942C11EFC6 for <~rockorager/offmap@lists.sr.ht>; Mon, 28 Nov 2022 21:28:29 +0000 (UTC) Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.west.internal (Postfix) with ESMTP id B35B2320097E; Mon, 28 Nov 2022 16:28:28 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Mon, 28 Nov 2022 16:28:28 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= timculverhouse.com; h=cc:cc:content-transfer-encoding:date:date :from:from:in-reply-to:message-id:mime-version:reply-to:sender :subject:subject:to:to; s=fm1; t=1669670908; x=1669757308; bh=+C 3VwuFokI/OgK1uO1RDdwK6dK7plS+vR/bXwblbspk=; b=TnIROqq0Crb1Vygpcf hWVqnVo+JRhfysGLxxqIlqlMGi0b3Geu92abNeyUZhrez1Z+FSGvOYBm1j9RWh+h jKeeF8eLJlMi/y1wLR9IaIZFo0EZ5XOI3ESHlvTfLnr5vRiRlfVJgboGR8LGYf3S VngwtFC0/fk0BpkA+DPVf/yzFtQtRzTqlsqPHhkUpNA399+QR9KzNEySvtLi+1X+ g9P2p0hrZ0Evj1HgP1rFwc31DRFhgbfNoIqVGiTyvdYpMhC0kSNk+PCLwEQm965L Qh9SHj/iMdH6F5NXWqvLiVrvttsUwm3d7i6dVxoDeDhBqQYS661XJrRz8v0Zvxou WO+g== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding:date:date :feedback-id:feedback-id:from:from:in-reply-to:message-id :mime-version:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t= 1669670908; x=1669757308; bh=+C3VwuFokI/OgK1uO1RDdwK6dK7plS+vR/b Xwblbspk=; b=NOZYQKi/DslEF7ST1V9zxbcGnQ8brf+jez3+W5SrIjt15QLqUR1 5lSCht4nLLe9FQ8A9q9mPaIr/68t2DXJYP8z/FjkwFfuLzsCGIdpbqIesmDOpbXe 1hN9S1YOLMXrfWvJIu1gps64pv9m8BC/zvDUPkpuWo/goNaHcYfW696R7HSobiB+ 1G176F7v8pW3fTbqjGcORiBnzrJtWQTlykHRhCFqU8UTBDfCpE9SfRyOGcLdrEm+ ySkPzMFIfh902ffvziDShyDNALtNPktwGTOd0oFNY0CoWJo1By7dsG//MZtv3eZu affZQlSfFFdLV0TeOY8N6uUMpX4ze7jAq6w== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvgedrjedvgdduhedvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvfevufffkffoggfgsedtkeertd ertddtnecuhfhrohhmpefvihhmucevuhhlvhgvrhhhohhushgvuceothhimhesthhimhgt uhhlvhgvrhhhohhushgvrdgtohhmqeenucggtffrrghtthgvrhhnpeeijeejteefgeevtd dvteevffejhedthfehkefgkeekhefhudffudeiuddttddvveenucffohhmrghinhepshhr rdhhthenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpe htihhmsehtihhmtghulhhvvghrhhhouhhsvgdrtghomh X-ME-Proxy: Feedback-ID: i3ad947a1:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 28 Nov 2022 16:28:27 -0500 (EST) From: Tim Culverhouse To: ~rockorager/offmap@lists.sr.ht Cc: Tim Culverhouse Subject: [PATCH offmap] imap: set RemoteName before attempting mailbox create Date: Mon, 28 Nov 2022 15:28:15 -0600 Message-Id: <20221128212815.4920-1-tim@timculverhouse.com> X-Mailer: git-send-email 2.38.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 --- 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