I'm trying to setup OSQA to send emails @ WebFaction.

I can't seem to authenticate to my mail server, I think the password is not being rendered to String.

I put some logging.error() in there to show what the app was seeing.

###########################################################
if not settings: logging.error("forum/settings not in scope")  
logging.error('Email settings: %s' % settings.EMAIL_HOST_USER)  
logging.error("DEFAULT_FROM_EMAIL: %s" %  settings.DEFAULT_FROM_EMAIL)  
logging.error('SERVER_MAIL: %s' % settings.SERVER_EMAIL)  
if not str(settings.EMAIL_HOST_PASSWORD): logging.error('settings.EMAIL_HOST_PASSWORD NULL***')  
logging.error('EMAIL_HOST_PASSWORD: %s' % str(settings.EMAIL_HOST_PASSWORD)  
if not settings.EMAIL_HOST_USER: logging.error('settings.EMAIL_HOST_USER VOID**')
###########################################################

/home/spirituality/webapps/paleo/paleo_app/forum/utils/mail.py TIME: 2011-10-11 14:16:22,174 MSG: mail.py:create_connection:42 Email settings: admin
/home/spirituality/webapps/paleo/paleo_app/forum/utils/mail.py TIME: 2011-10-11 14:16:22,174 MSG: mail.py:create_connection:43 DEFAULT_FROM_EMAIL: site.com
/home/spirituality/webapps/paleo/paleo_app/forum/utils/mail.py TIME: 2011-10-11 14:16:22,174 MSG: mail.py:create_connection:44 SERVER_MAIL: myname@gmail.com
/home/spirituality/webapps/paleo/paleo_app/forum/utils/mail.py TIME: 2011-10-11 14:16:22,174 MSG: mail.py:create_connection:46 EMAIL_HOST_PASSWORD:
/home/spirituality/webapps/paleo/paleo_app/forum/utils/mail.py TIME: 2011-10-11 14:16:22,205 MSG: mail.py:create_and_send_mail_messages:99 Email address not accepted. Exception: {u'myname@gmail.com': (554, '5.7.1 <web104.webfaction.com[174.120.139.136]>: Client host rejected: Access denied')}
username@web104 Tue Oct 11 13:16:42 ~/webapps/paleo/paleo_app

I then tried to use the shell to confirm this. You can see that the settings.EMAIL_HOST_PASSWORD default is set to 'password' for some reason it's not rendering to a a string.

$ python2.7 manage.py shell

In [1]: from forum import settings

In [2]: settings.EMAIL_HOST_USER
Out[2]: <forum.settings.base.strsetting at="" 0xa3a828c="">

In [3]: settings.EMAIL_HOST_USER.dict
Out[3]:
{'_temp': None,
'default': 'admin',
'field_context': {'help_text': <django.utils.functional.__proxy__ at="" 0xa3a824c="">,
'label': <django.utils.functional.__proxy__ at="" 0xa3a820c="">,
'required': False},
'name': 'EMAIL_HOST_USER',
'set': [<forum.settings.base.strsetting at="" 0xa3a3aac="">,
<forum.settings.base.strsetting at="" 0xa3a3b4c="">,
<forum.settings.base.intsetting at="" 0xa3a3c2c="">,
<forum.settings.base.strsetting at="" 0xa3a828c="">,
<forum.settings.base.strsetting at="" 0xa3a832c="">,
<forum.settings.base.boolsetting at="" 0xa3a83cc="">,
<forum.settings.base.strsetting at="" 0xa3a846c="">,
<forum.settings.base.strsetting at="" 0xa3a850c="">,
<forum.settings.base.strsetting at="" 0xa3a85ac="">,
<forum.settings.base.strsetting at="" 0xa3a864c="">,
<forum.settings.base.strsetting at="" 0xa3a86ec="">,
<forum.settings.base.strsetting at="" 0xa3a878c="">,
<forum.settings.base.boolsetting at="" 0xa3a882c="">,
<forum.settings.base.boolsetting at="" 0xa3a88cc="">]}

In [4]: settings.EMAIL_HOST_PASSWORD.dict
Out[4]:
{'_temp': None,
'default': 'password',
'field_context': {'help_text': <django.utils.functional.__proxy__ at="" 0xa3a82ec="">,
'label': <django.utils.functional.__proxy__ at="" 0xa3a82ac="">,
'required': False,
'widget': django.forms.widgets.PasswordInput},
'name': 'EMAIL_HOST_PASSWORD',
'set': [<forum.settings.base.strsetting at="" 0xa3a3aac="">,
<forum.settings.base.strsetting at="" 0xa3a3b4c="">,
<forum.settings.base.intsetting at="" 0xa3a3c2c="">,
<forum.settings.base.strsetting at="" 0xa3a828c="">,
<forum.settings.base.strsetting at="" 0xa3a832c="">,
<forum.settings.base.boolsetting at="" 0xa3a83cc="">,
<forum.settings.base.strsetting at="" 0xa3a846c="">,
<forum.settings.base.strsetting at="" 0xa3a850c="">,
<forum.settings.base.strsetting at="" 0xa3a85ac="">,
<forum.settings.base.strsetting at="" 0xa3a864c="">,
<forum.settings.base.strsetting at="" 0xa3a86ec="">,
<forum.settings.base.strsetting at="" 0xa3a878c="">,
<forum.settings.base.boolsetting at="" 0xa3a882c="">,
<forum.settings.base.boolsetting at="" 0xa3a88cc="">]}

In [5]: str(settings.EMAIL_HOST_PASSWORD)
Out[5]: ''

asked 11 Oct '11, 14:44

mrB's gravatar image

mrB
56349
accept rate: 0%

edited 12 Oct '11, 15:57


Use the value attribute:

str(settings.EMAIL_HOST_PASSWORD.value)

However I doubt that this issue can be connected with another one filed by you: http://meta.osqa.net/questions/10535/how-do-i-setup-email-webfaction

link

answered 14 Oct '11, 09:11

Jordan's gravatar image

Jordan ♦♦
3.1k618
accept rate: 39%

Your answer
toggle preview

Follow this question

By Email:

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

By RSS:

Answers

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

Tags:

×101
×49
×10

Asked: 11 Oct '11, 14:44

Seen: 291 times

Last updated: 14 Oct '11, 09:11

powered by OSQA