Skip to content

Commit

Permalink
🔀 Merge pull request #354 from ruby/fix-README-example
Browse files Browse the repository at this point in the history
Fix README example
  • Loading branch information
nevans authored Nov 12, 2024
2 parents 3e7ed21 + 8916a49 commit 3094fcc
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,16 @@ end

```ruby
imap.select('Mail/sent-mail')
if not imap.list('Mail/', 'sent-apr03')
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 3094fcc

Please sign in to comment.