I had email working ok, but I wanted to change the format of the validate email link. I was changing this and the styles and it's stopped working. I've changed back to the original files, but it's still not working. My oops.

However how can I debug this?? I can see in the mail.log that it connects and send the EHLO to the smtp server and then the connection drops. However OSQA is giving me no output or logging as to what is going on. The error log, apache's logs etc. all remain with no information what so ever.

How can I start debugging the issue?

asked 07 Dec '10, 16:14

Musmuris's gravatar image

accept rate: 26%

To do this: Edit .../forum/utils

to the top add

 import logging

Then at the very end under where it has

 except Exception, e:

Change that to:

except Exception, e:
    logging.debug( 'Issue sending email' )
    logging.debug( str(e)  )

Now if you have logging set up then it should log the error which should help.

Now if only I could accept the answer to my own question!


answered 13 Jan '11, 12:16

Musmuris's gravatar image

accept rate: 26%


@Musmurls, I accepted it for you.

(13 Jan '11, 12:17) rickross ♦♦

Added to jira with patch file - http://jira.osqa.net/browse/OSQA-522

(13 Jan '11, 12:23) Musmuris

@rickross Thanks :)

(13 Jan '11, 13:46) Musmuris

@Musmuris : Thanks for the update, before trying that, I used gmail account and smtp and it is sending emails, seems to me that there may be a configuration issue with exim send only mail host or what not :-) I will still switch on logging as you have mentioned, do you mean to add the above lines to /osqa/forum/utils/mail.py ? - Also, after enabling the above, which LOG file shall I check? Thanks !

(14 Jan '11, 05:48) rihatum

@Musmuris, I added the lines you have mentioned above to mail.py, for once it broke osqa, I then browsed to /osqa/log/django.osqa.log it had some error saying "indentation or something" it has now disappeared as I replaced the mail.py I had backed up without the lines above.

(14 Jan '11, 07:26) rihatum

Are you using custom SMTP or just default sendmail? Is it postfix or exim? You can add some logging to your settings file and if there is logging for the mail function then it may show you something, if not you have to add the logging.debug() your self.

My guess would be a SMTP or mail transport error not a Django/OSQA one.



answered 07 Dec '10, 18:20

Justin%20Hamade's gravatar image

Justin Hamade
accept rate: 17%

I worked out that it was mail.py that needed some logging added to debug the issue.

To cut to the chase it was that somehow I'd entered an username and password for the email sending when I didn't need one (the smtp accepts from localhost only etc.) so it was throwing an exception.

The problem is that OSQA was just swallowing this exception and not reporting it to any log file! But that's for another question... ;)


answered 08 Dec '10, 06:03

Musmuris's gravatar image

accept rate: 26%

Hi Musmuris,

thanks for your input, I have OSQA running on a ubuntu 10.10 box at home, mapped a dyndns name to it, I setup exim send only smtp via http://library.linode.com/email/exim/send-only-mta-ubuntu-10.10-maverick all other PHP based apps are sending email, just not OSQA.

your help would be appreciated. I have tested exim sends email fine via the command line, not too familiar with django or python so your help would be appreciated.

Kind regards

(13 Jan '11, 10:11) rihatum

@rihatum, I moved your "answer" to a comment on Musmurls answer. Please be sure you choose to comment when replying to an answer. If you post an "answer", then it should answer the original question.

(13 Jan '11, 10:41) rickross ♦♦

@rihatum I can't recall which file I changed (something like mail.py) but I got it to log the exception it caused. I did asked a related question here: http://meta.osqa.net/questions/6054/osqa-can-swallow-exceptions but sadly I never put it in Jira. I should do that sometime

(13 Jan '11, 12:09) Musmuris
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "Title")
  • image?![alt text](/path/img.jpg "Title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported



Asked: 07 Dec '10, 16:14

Seen: 1,522 times

Last updated: 14 Jan '11, 07:26

powered by OSQA