aboutsummaryrefslogtreecommitdiff
path: root/internal/imap
diff options
context:
space:
mode:
authorRené 'Necoro' Neumann <necoro@necoro.eu>2021-02-21 00:53:24 +0100
committerRené 'Necoro' Neumann <necoro@necoro.eu>2021-02-21 00:53:24 +0100
commit1cc4c12379e90abcb32397c15af729e3618c65e2 (patch)
tree02df3b6fb7346566d4952f557e1e2ee5229989e8 /internal/imap
parentf3b11edfb9d4f75ec10c04da4e52a1b29d929368 (diff)
downloadfeed2imap-go-1cc4c12379e90abcb32397c15af729e3618c65e2.tar.gz
feed2imap-go-1cc4c12379e90abcb32397c15af729e3618c65e2.tar.bz2
feed2imap-go-1cc4c12379e90abcb32397c15af729e3618c65e2.zip
#39 Ignore mails marked as deleted when looking for existing mails, as to not undelete them by accident.
Diffstat (limited to 'internal/imap')
-rw-r--r--internal/imap/connection.go1
1 files changed, 1 insertions, 0 deletions
diff --git a/internal/imap/connection.go b/internal/imap/connection.go
index e8d4da2..213171e 100644
--- a/internal/imap/connection.go
+++ b/internal/imap/connection.go
@@ -225,6 +225,7 @@ func (conn *connection) replace(folder Folder, header, value, newContent string,
func (conn *connection) searchHeader(header, value string) ([]uint32, error) {
criteria := imap.NewSearchCriteria()
criteria.Header.Set(header, value)
+ criteria.WithoutFlags = []string{imap.DeletedFlag}
ids, err := conn.search(criteria)
if err != nil {
return nil, fmt.Errorf("searching for header %q=%q: %w", header, value, err)