jarus/imap_copy — pull request #3 by gsbabil (2014-01-16 07:22:39+00:00)
Title: Added 'skip' and 'limit' options (useful for copying messages to Gmail or over unreliable network connection)

Since Gmail terribly throttles uploading and downloading mails over IMAP (randomly disconnects - happened to me at least twice last night), you may find the 'skip' and 'limit' options handy. If Gmail disconnected you after copying 123 emails out of your total 1000 emails in the example shown above, you may use the following command to resume copying skipping the first 123 messages.

```
python imapcopy.py "imap.otherserver.com.au:993" "username:password" \
"imap.googlemail.com:993" "username@gmail.com:password" \
"INBOX" "OTHER-SERVER/Inbox" --skip 123
```
Similarly 'limit' allows to copy only a total of N number of messages. For example, the following command will copy
message no. 124 to 223 into Gmail.

```
python imapcopy.py "imap.otherserver.com.au:993" "username:password" \
"imap.googlemail.com:993" "username@gmail.com:password" \
"INBOX" "OTHER-SERVER/Inbox" --skip 123 --limit 100
```