HTTP 500 error sending emails from within Booktype
  • I've installed Booktype on a Debian 6.0 server as described here  https://github.com/sourcefabric/Booktype/wiki/How-to-install-it-on-Debian except I'm using distributed python libs: python-django (squeeze
    backports), python-django-south, python-lxml, python-imaging (aka PIL); only unidecode installed via pip in virtualenv

    all seems to work fine after some testing (account creation, book creation, editing) except email sending: if I try to get a new password via /accounts/forgot_password/ I get no feedback (<h2>Check your email!</h2><p>Password reset instructions were sent to your email. as defined in Booktype/lib/booki/account/templates/account/forgot_password.html)

    I'm using nullmailer as local SMTP server: sending email via command line (mail me@myaddress.com) works well but looking at nullmailer logs after a forgot password request I see:

    Dec 14 18:03:21 node106 sm-mta[22757]: qBEE3LgO022757: SYSERR(root): collect: Cannot write ./dfqBEE3LgO022757 (bfcommit, uid=0, gid=104): No such file or directory
    Dec 14 18:03:21 node106 sm-mta[22757]: qBEE3LgO022757: from=<info@HIDDEN_ADDRESS>, size=362, class=0, nrcpts=1, proto=ESMTP, daemon=MTA-v4, relay=localhost.localdomain [127.0.0.1]


    "no such file or directory" makes me suppose Booktype is not able to write the message to a temporary file but I cannot find where the file should be created

    when running Booktype internal server on port 8080 the only thing I can see is:

    [14/Dec/2012 15:03:21] "POST /accounts/forgot_password/ HTTP/1.1" 500 14061

    in  settings.py I've set djiango debug mode:

    # DJANGO DEBUG
    DEBUG = True
    TEMPLATE_DEBUG = DEBUG


    but I'm not able to find **any** debug info about the problem

    please have you any kind of advice about this problem?

    Ciao
    Giovanni
  • 1 Comment sorted by
  • Hi Giovanni,

    there are couple of bugs which are fixed in devel branch (or Booktype 1.5.4) connected with this issue. One is that Booktype would break if it was not able to send email locally (that is why you get response code 500 for [14/Dec/2012 15:03:21] "POST /accounts/forgot_password/ HTTP/1.1" 500 14061). The other one is it would break if you had more then one user with the same e-mail address. It has all been fixed in devel branch. Looking at the log you send I would say you have 1st problem here (it tries to send email but does nothing when it fails).

    Looking at the log file I would say it is nullmailer and not Booktype who can not create this temporary file. Maybe something with missing directories or wrong file permissions. 

    Your can check settings.py file in your Booktype project which was created but looking at the log it is vissible that Booktype does connect to your mail server - 
    EMAIL_HOST = 'localhost'
    EMAIL_PORT = 25
    EMAIL_USE_TLS = True