Skip to content

Commit

Permalink
📚 Update README example to use MOVE extension
Browse files Browse the repository at this point in the history
  • Loading branch information
nevans committed Nov 12, 2024
1 parent 669cabc commit 8916a49
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,12 @@ if imap.list('Mail/', 'sent-apr03').empty?
imap.create('Mail/sent-apr03')
end
imap.search(["BEFORE", "30-Apr-2003", "SINCE", "1-Apr-2003"]).each do |message_id|
imap.copy(message_id, "Mail/sent-apr03")
imap.store(message_id, "+FLAGS", [:Deleted])
if imap.capable?(:move) || imap.capable?(:IMAP4rev2)
imap.move(message_id, "Mail/sent-apr03")
else
imap.copy(message_id, "Mail/sent-apr03")
imap.store(message_id, "+FLAGS", [:Deleted])
end
end
imap.expunge
```
Expand Down

0 comments on commit 8916a49

Please sign in to comment.