SMTP Server Login Error An error occurred : character mapping must return integer, None or unicode

Bug #581854 reported by Leovega on 2010-05-17
16
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Power Email
Fix Committed
Undecided
Unassigned

Bug Description

I am using Power Email 5.0.0.7 RC with python2.6 in openERP Sever 5.0.10
When I try to check outgoing Connection, this error is showed:
"SMTP Server Login Error An error occurred : character mapping must return integer, None or unicode "

stack trace :

[2010-05-18 09:31:16,240] DEBUG:Connection:create cursor to "laboratoriosPruebas"
[2010-05-18 09:31:16,240] DEBUG:ConnectionPool:ConnectionPool(used=0/count=1/max=64) Borrow connection to user=leo dbname=laboratoriosPruebas
[2010-05-18 09:31:16,240] DEBUG:ConnectionPool:ConnectionPool(used=1/count=1/max=64) Existing connection found at index 0
[2010-05-18 09:31:16,427] DEBUG:ConnectionPool:ConnectionPool(used=1/count=1/max=64) Give back connection to user=leo dbname=laboratoriosPruebas
[2010-05-18 09:31:16,428] DEBUG:ConnectionPool:ConnectionPool(used=0/count=1/max=64) Put connection to user=leo dbname=laboratoriosPruebas in pool
/usr/lib/python2.5/site-packages/openerp-server/tools/misc.py:750: DeprecationWarning: BaseException.message has been deprecated as of Python 2.6
  if hasattr(e, 'message'):
/usr/lib/python2.5/site-packages/openerp-server/tools/misc.py:751: DeprecationWarning: BaseException.message has been deprecated as of Python 2.6
  return ustr(e.message)
[2010-05-18 09:31:16,429] DEBUG_RPC:exception:u'warning -- SMTP Server Login Error\n\nAn error occurred : character mapping must return integer, None or unicode '
[2010-05-18 09:31:16,738] DEBUG_RPC:service:'object'
[2010-05-18 09:31:16,738] DEBUG_RPC:method:'execute'
[2010-05-18 09:31:16,740] DEBUG_RPC:params:[01]: ('laboratoriosPruebas',
[2010-05-18 09:31:16,740] DEBUG_RPC:params:[02]: 1,
[2010-05-18 09:31:16,740] DEBUG_RPC:params:[04]: 'ir.attachment',
[2010-05-18 09:31:16,740] DEBUG_RPC:params:[05]: 'search_count',
[2010-05-18 09:31:16,741] DEBUG_RPC:params:[06]: [('res_model', '=', u'poweremail.core_accounts'), ('res_id', '=', 1)])
[2010-05-18 09:31:16,741] DEBUG:Connection:create cursor to "laboratoriosPruebas"

Not always, I tried with two email accounts with one work and the other is not

It's a problem with python2.6.

I fixed writing in poweremail_core.py :

def out_connection(self, cr, uid, ids, context={}):
...........
                try:
                    if serv.has_extn('AUTH') or rec.smtpuname or rec.smtppass:
                        serv.login(rec.smtpuname.encode('utf-8'), rec.smtppass.encode('utf-8'))
..............

Thank you for reporting this error.

Could you please report the stack trace so that we could triage this issue?

Leovega (leooviedo) on 2010-05-18
description: updated
Leovega (leooviedo) on 2010-05-19
description: updated

Hi:

Just confirm that it happens also to us.

Thank you:

Ana

Kamik (kamik-sl) wrote :

confirm

Davide Corio (enlightx) wrote :

The attached patch seems to solve this issue.

Can you confirm?

For me not work. The message changed to error 535. But If you do the same for incoming, the test is success.

Hi,

I have made the changes on the refactoring branch.

Unicode issues have been the most difficult for me to test, because i dont use anything other than english for everyday use.

Would be great if you could test.

I have put in a combined path of enlightx(Davide corio) and Alberto Garcia(agarcia-tic) in the commit http://bazaar.launchpad.net/~openlabs/poweremail/refactoring/revision/214

BTW: Badly need help in testing the refactoring branch.

Thanks

Omar (Pexego) (omar7r) wrote :

Hi Sharoon,

Yes, it works. With this line: "serv.login(this_object.smtpuname.encode('UTF-8'), this_object.smtppass.encode('UTF-8'))" , it works.

Thanks you.

Changed in poweremail:
status: New → Fix Committed

The username and password must be in UTF-8

this patch solve this bug.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers