Giter Club home page Giter Club logo

Comments (4)

rcarmo avatar rcarmo commented on September 4, 2024

Hi there! Thanks for reporting this. I added a -toption to set the global socket timeout that may fix this, try it out and re-open the issue if it doesn't (although I'm afraid that if your server is resetting the connection, the mailbox may indeed be too large, and you're probably best off splitting it into multiple smaller folders).

Re-connection is trickier, because if you're using the script as part of something bigger you may well want to handle re-connection yourself. Regardless, I hope this fixes it for you -- Happy New Year!

from imapbackup.

C-Duv avatar C-Duv commented on September 4, 2024

Hello, I fail to run script using the new -t option: The moment I add the -t option I get the Usage: erroneous message:

All the following commands prints the Usage: message:

python imapbackup.py --server=imap.example.com:993 [email protected] -t 180
python imapbackup.py --server=imap.example.com:993 [email protected] --timeout=180
python imapbackup.py -t 180 --server=imap.example.com:993 [email protected]
python imapbackup.py --timeout=180 --server=imap.example.com:993 [email protected]
python imapbackup.py -t 180 --server=imap.example.com:993 [email protected]
python imapbackup.py ---timeout=180 --server=imap.example.com:993 [email protected]

Here is the Usage: message I get:

Usage: imapbackup [OPTIONS] -s HOST -u USERNAME [-p PASSWORD]
 -a --append-to-mboxes     Append new messages to mbox files. (default)
 -y --yes-overwrite-mboxes Overwite existing mbox files instead of appending.
 -n --compress=none        Use one plain mbox file for each folder. (default)
 -z --compress=gzip        Use mbox.gz files.  Appending may be very slow.
 -b --compress=bzip2       Use mbox.bz2 files. Appending not supported: use -y.
 -f --=folder              Specifify which folders use.  Comma separated list.
 -e --ssl                  Use SSL.  Port defaults to 993.
 -k KEY --key=KEY          PEM private key file for SSL.  Specify cert, too.
 -c CERT --cert=CERT       PEM certificate chain for SSL.  Specify key, too.
                           Python's SSL module doesn't check the cert chain.
 -s HOST --server=HOST     Address of server, port optional, eg. mail.com:143
 -u USER --user=USER       Username to log into server
 -p PASS --pass=PASS       Prompts for password if not specified.
 -t SECS --timeout=SECS    Sets socket timeout to SECS seconds.
 --thunderbird             Create Mozilla Thunderbird compatible mailbox
 --nospinner               Disable spinner (makes output log-friendly)

NOTE: mbox files are created in the current working directory.

If I remove the -t/--timeout= part the commands starts just fine.
I might get something wrong...

Version: Python v2.7.12

(Edit: simplified the command examples to remove optional options that does not change the results)

from imapbackup.

rcarmo avatar rcarmo commented on September 4, 2024

from imapbackup.

C-Duv avatar C-Duv commented on September 4, 2024

Yep: works now.

But I noticed the -t seems to be mandatory (even before e1ad2d3), running the command without it returns (after the password prompt):

Traceback (most recent call last):
  File "imapbackup.py", line 713, in <module>
    main()
  File "imapbackup.py", line 600, in main
    server = connect_and_login(config)
  File "imapbackup.py", line 547, in connect_and_login
    if config['timeout']:
KeyError: 'timeout

I guess it is missing from the part that fills config variable with default values, see PR #4

from imapbackup.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.