aboutsummaryrefslogtreecommitdiff
path: root/worker/maildir/container.go
diff options
context:
space:
mode:
Diffstat (limited to 'worker/maildir/container.go')
-rw-r--r--worker/maildir/container.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/worker/maildir/container.go b/worker/maildir/container.go
index f9fb507b..946de74d 100644
--- a/worker/maildir/container.go
+++ b/worker/maildir/container.go
@@ -93,6 +93,15 @@ func (c *Container) Message(d maildir.Dir, uid uint32) (*Message, error) {
uid, d)
}
+func (c *Container) MessageFromKey(d maildir.Dir, key string) *Message {
+ uid := c.uids.GetOrInsert(key)
+ return &Message{
+ dir: d,
+ uid: uid,
+ key: key,
+ }
+}
+
// DeleteAll deletes a set of messages by UID and returns the subset of UIDs
// which were successfully deleted, stopping upon the first error.
func (c *Container) DeleteAll(d maildir.Dir, uids []uint32) ([]uint32, error) {