Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 578879
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T14:18:26+00:00 2026-05-13T14:18:26+00:00

I’m having a problem using imaplib on python 2.6 with the latest django svn.

  • 0

I’m having a problem using imaplib on python 2.6 with the latest django svn. I want to download imap emails in a queue (using celeryd). I’m able to connect/download emails from the command line, but when i offload the task through django to celeryd i get this error: “SSLError: [Errno 1] _ssl.c:1325: error:1408F10B:SSL routines:SSL3_GET_RECORD:wrong version number”.

Imaplib docs don’t mention how to specify a version of SSL. I’m trying to pull emails from gmail. I don’t understand why offloading the task to a queue using celeryd would cause the task to fail. Any help would be much appreciated.

Edit: here is a stack trace:

File “/usr/lib/python2.6/imaplib.py”, line 643, in select
typ, dat = self._simple_command(name, mailbox)

File “/usr/lib/python2.6/imaplib.py”, line 1059, in _simple_command
return self._command_complete(name, self._command(name, *args))

File “/usr/lib/python2.6/imaplib.py”, line 889, in _command_complete
typ, data = self._get_tagged_response(tag)

File “/usr/lib/python2.6/imaplib.py”, line 990, in _get_tagged_response
self._get_response()

File “/usr/lib/python2.6/imaplib.py”, line 907, in _get_response
resp = self._get_line()

File “/usr/lib/python2.6/imaplib.py”, line 1000, in _get_line
line = self.readline()

File “/usr/lib/python2.6/imaplib.py”, line 1170, in readline
char = self.sslobj.read(1)

File “/usr/lib/python2.6/ssl.py”, line 136, in read
return self._sslobj.read(len)

SSLError: [Errno 1] _ssl.c:1325: error:1408F10B:SSL routines:SSL3_GET_RECORD:wrong version number

Edit: Here is the task i’m trying to run, where imap_parser is a module that wraps imaplib and loads emails into my db.

class DumpIMAPData(Task):
    def run(self, user, username, password, imap_address, **kwargs):
        logger = self.get_logger(**kwargs)
        celery.log.redirect_stdouts_to_logger(logger, loglevel=None)
        #imap_address is e.g. 'imap.gmail.com'                                  
        parser = imap_parser.IMAPFetcher(imap_address, username, password, user\
)
        parser.load_all_emails()
    return True

I have noticed the task will actually run using celery UNLESS I daemonize the task using the –detach flag. I don’t know why the task would fail only when run as a daemon. I have tried setting the same userid and groupid with the -u and -g flags, the same umask, and ensuring the path and working directories are the same for both the daemon and the non-daemonized version, but the task still will not run in celery when celery is running as a daemon.

I”m using the latest version of celery (0.9.4).

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T14:18:26+00:00Added an answer on May 13, 2026 at 2:18 pm

    According to the creator of celeryd:

    Celery no longer does its own detaching as of 01a8a0e. There has been far too many problems with it, and since it works when detaching using start-stop-daemon, supervisord, launchd and so on, you are encouraged to use those tools instead.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 386k
  • Answers 386k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer $('#table tbody tr input[type=radio]').each(function(){ alert($(this).attr('checked')); }); HTH. May 14, 2026 at 11:52 pm
  • Editorial Team
    Editorial Team added an answer I'd suggest the biggest benefit of them being generated as… May 14, 2026 at 11:52 pm
  • Editorial Team
    Editorial Team added an answer Add android:layout_weight='1' to the WebView. May 14, 2026 at 11:52 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.