aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--internal/imap/connection.go14
1 files changed, 12 insertions, 2 deletions
diff --git a/internal/imap/connection.go b/internal/imap/connection.go
index 68b7e6b..431d1dc 100644
--- a/internal/imap/connection.go
+++ b/internal/imap/connection.go
@@ -130,10 +130,12 @@ func (conn *connection) ensureFolder(folder Folder) error {
func (conn *connection) delete(uids []uint32) error {
storeItem := imap.FormatFlagsOp(imap.AddFlags, true)
+ deleteFlag := []interface{}{imap.DeletedFlag}
+
seqSet := new(imap.SeqSet)
seqSet.AddNum(uids...)
- if err := conn.c.UidStore(seqSet, storeItem, imap.DeletedFlag, nil); err != nil {
+ if err := conn.c.UidStore(seqSet, storeItem, deleteFlag, nil); err != nil {
return fmt.Errorf("marking as deleted: %w", err)
}
@@ -189,11 +191,19 @@ func (conn *connection) replace(folder Folder, header, value, newContent string,
return err
}
+ // filter \Seen --> updating should be noted :)
+ filteredFlags := make([]string, 0, len(flags))
+ for _, f := range flags {
+ if f != imap.SeenFlag && f != imap.RecentFlag {
+ filteredFlags = append(filteredFlags, f)
+ }
+ }
+
if err = conn.delete(msgIds); err != nil {
return err
}
- if err = conn.append(folder, flags, newContent); err != nil {
+ if err = conn.append(folder, filteredFlags, newContent); err != nil {
return err
}
> 2012-09-07Bump debian to 1.1.3.Jason A. Donenfeld1-1/+1 2012-09-07Explicitly set permissions when running 'install'Christophe Fergeau1-3/+3 2012-09-07No need for a shebang in bash completion fileChristophe Fergeau1-1/+1 2012-09-06Update COPYING to reflect man page and project page.1.1.2Jason A. Donenfeld1-10/+11 2012-09-06Use BINDIR, MANDIR and SYSCONFDIR vars in MakefileChristophe Fergeau1-5/+8 2012-09-06Add dependencies to README.Jason A. Donenfeld1-0/+8 2012-09-06Change debian name.Jason A. Donenfeld5-5/+4 2012-09-06Use more normal sleep variant.1.1.1Jason A. Donenfeld1-1/+1 2012-09-06Use --noreport instead of head -n -2 for tree so that it works on mac.Jason A. Donenfeld1-1/+1 2012-09-05Be sure to explicitly state that install is a phony target.Jason A. Donenfeld1-0/+2 2012-09-05Bump debian version horribly.1.1Jason A. Donenfeld2-2/+2 2012-09-04No echo mode.Jason A. Donenfeld2-16/+42 2012-09-04Properly quote the path too.Jason A. Donenfeld1-1/+1 2012-09-04Allow passwords having spaces to go unbroken to the clipboard.Bernardo Freitas Paulo da Costa1-1/+1 2012-09-04Separate out the massive git example.Jason A. Donenfeld1-10/+14 2012-09-04Prepare for debianification.1.0Jason A. Donenfeld9-4/+60 2012-09-03Fix readme typo.Jason A. Donenfeld1-1/+1 2012-09-03Show program name properly in error message.Jason A. Donenfeld1-1/+1 2012-09-03Move examples into manpage.Jason A. Donenfeld4-93/+224 2012-09-03Make into a real project.Jason A. Donenfeld8-5/+173 2012-09-03Support pass gitJason A. Donenfeld2-1/+15 2012-08-31Add remove synonyms.Jason A. Donenfeld1-2/+2 2012-08-31Use basename in usage.Jason A. Donenfeld1-2/+1 2012-08-19now using gpg_id as a varMatthew Ramirez1-2/+2 2012-08-07Forty five seconds.Jason A. Donenfeld1-1/+1 2012-08-06Deal with klipper and new lines.Jason A. Donenfeld1-3/+19 2012-08-06Update examples.Jason A. Donenfeld1-7/+7 2012-08-06Update readme.Jason A. Donenfeld1-11/+13 2012-08-06Be slicker and more like git.Jason A. Donenfeld1-114/+173