Re: django doesn't send me error mails

181 views
Skip to first unread message

Chris Cogdon

unread,
Dec 16, 2012, 10:06:05 PM12/16/12
to django...@googlegroups.com
Oh... there's your problem... you've set the admin email to ****... i'm sure that doesn't exist! :)

Seriously, though... all that looks correct. Can you check your server's /var/log/maillog to see if the mail is being accepted?

On Sunday, December 16, 2012 1:33:01 PM UTC-8, Ali Vakilzade wrote:
I can send mails using send_mail or mail_admins methods

but django it self doesn't send me any mail on 404 error or 500 error.

I have even added  raise Exception('Test') to my view function
I see the 500 error for that but no mail was sent

This is my settings.py: http://dpaste.com/846959/

I use :
django from git master
python 3.2

Ali Vakilzade

unread,
Dec 16, 2012, 10:18:26 PM12/16/12
to django...@googlegroups.com
I don't have access to that file on server.
and log from uwsgi doesn't have any error massage about mail sending

can it be a python3 branch related bug?


در دوشنبه 17 دسامبر 2012، ساعت 1:36:05 (UTC+3:30)، Chris Cogdon نوشته:

Chris Cogdon

unread,
Dec 17, 2012, 3:37:18 AM12/17/12
to django...@googlegroups.com
My best guess is that the mail transport agent on the server is rejecting the mail because something is different from mail that is send through other places in your django code. Perhaps the mail "sender" is not correct, for example?

Unfortunately, looking at the mail log is the best way to see what's happening. If that's not available, you might want to see what is being sent.

Set this:

EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'

and then run your project with "runserver". The mail that it tries to send will be sent to the console instead. Check out the "from" headers and make sure they make sense. Compare that to the other kinds of email that are sent.

(Make sure you're still running with DEBUG=False)

Ali Vakilzade

unread,
Dec 17, 2012, 4:30:36 PM12/17/12
to django...@googlegroups.com
ok, after this answer a said I sghoulf test django internal server
I simply started server with runserver
(didn't change email backend)
and the mail sending worked!

so now I think It's a uwsgi related problem
but I couldn't fine anything about that

(there was a page on stackoverflow saying run uwsgi in threader mode but it didn't help)
http://stackoverflow.com/questions/8549371/mysterious-issue-with-django-uwsgi-send-email


در دوشنبه 17 دسامبر 2012، ساعت 7:07:18 (UTC+3:30)، Chris Cogdon نوشته:

Chris Cogdon

unread,
Dec 17, 2012, 9:10:48 PM12/17/12
to django...@googlegroups.com
I don't have any magic answers for you yet.

My only suggestion would be to find out what's different in the environment between running as uwsgi and running under runserver. Perhaps something in the environment, or perhaps the username under which django runs in either case.

/var/log/maillog is going to provide good information... see if you can get hold of it from your provider.
Reply all
Reply to author
Forward
0 new messages