On Fri, Feb 20, 2009 at 1:15 AM, Reza Muhammad <[email protected]>wrote:
> > Hello All, > > I'm trying to play around with a send_mail/mail_admins function but > couldn't get it to work properly. I hope someone can help me out :) > > > I'm trying to create a "send feedback" feature in my application which > will basically retrieve user's inputted data through form, and then > send e-mail to the admins, or any specified users. > > The problem I'm facing is when I try to connect to a Qmail mail > server. I noticed this kind of thing in my mail server log: > > Feb 19 02:39:47 mail vpopmail[1941]: vchkpw-smtp: password fail (pass: > 'adf1dbac6d55b9972704870a4f6f7ff0') firstname.lastn...@domain:ip_address > > Whereas if I connect to the mail server from a regular mail client, I > will see something like this: > Feb 19 02:38:20 mail vpopmail[1891]: vchkpw-smtp: (PLAIN) login > success firstname.lastn...@domain:ip_address > > These are the settings I have on settings.py: > > EMAIL_HOST = 'Qmai's smtp server addresss' > EMAIL_HOST_USER = 'firstname.lastn...@domainname' # I presume this is > how virtual email address is handled on Qmail > EMAIL_HOST_PASSWORD = 'my password' > DEFAULT_FROM_EMAIL = 'firstname.lastn...@domainname' > EMAIL_SUBJECT_PREFIX = '[Feedback]' > SERVER_EMAIL = 'firstname.lastn...@domainname' > > Now, my concern is that, since from the mail server log says that my > password fail with a *jibberish* password, does that mean django hash > the EMAIL_HOST_PASSWORD value before connecting to the mail server? > Django doesn't, no. Here's the Django code that creates the SMTP connection and logs in, if user and password values have been specified: http://code.djangoproject.com/browser/django/trunk/django/core/mail.py#L104 As you can see, if use_tls has been specified, then TLS will be activated before login and the entire connection will be encrypted, but Django doesn't do anything specifically with the password. > Or does it fail not because of the password? because I can connect to > the mail server from my regular email client with pretty much the same > setting. > Pretty much the same? What's different? Do you specify anything about secure sockets or STARTTLS with the client? If you do, you probably need to turn on EMAIL_USE_TLS in the Django config. Other than that I'm not sure where to look for what's going wrong. Karen --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---

