rgrove / larch

:skull: Larch copies messages from one IMAP server to another. No longer maintained.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

larch does not copy folders with only one message

donapieppo opened this issue · comments

when scanning folders with only one message in imap/mailbox.rb
variable full_range is 1...2

Since

full_range.max - full_range.min 

is zero

need_full_scan = full_range && full_range.max && full_range.min && full_range.max - full_range.min > 0

is false and nothing is done on the folder.

I suggest to change the definition of need_full_scan as

need_full_scan = full_range && full_range.max && full_range.min && full_range.max - full_range.min >= 0

Hi, I confirm this issue and that the solution works well :)
I also put >= in te line before for need_flag_scan

I just installed the pre-release version of larch (hoping most issues would be resolved)...but I just experienced this one while trying to migrate a test account with only one email in it. So this is still an issue.

Sorry for the long delay on this one, guys. When this issue first cropped up, I was in the midst of a huge Larch rewrite and figured I'd just fix it there, but I never got around to finishing it, and in the time since I've been way off in JavaScript land and haven't had time for Larch.

Should be fixed now, and I've pushed a new 1.1.2 gem. Thanks for being patient!