moinwiki / moin-1.9

MoinMoin Wiki (1.9, also: 1.5a ... 1.8), stable, for production wikis
https://moinmo.in/
Other
140 stars 51 forks source link

mailimport not working #53

Closed ThomasWaldmann closed 4 years ago

ThomasWaldmann commented 4 years ago
MoinMoin.xmlrpc.ProcessMail ERROR An error occurred while processing the message: ("No suitable user found for mail address u'Mustermann'",)
MoinMoin.wsgiapp ERROR An exception has occurred [https://info.*.*/?action=xmlrpc2].
Traceback (most recent call last):
File "/srv/moin-1.9/MoinMoin/wsgiapp.py", line 264, in __call__
     response = run(context)
File "/srv/moin-1.9/MoinMoin/wsgiapp.py", line 90, in run
     context.cfg.session_service.finalize(context, context.session)
File "/srv/moin-1.9/MoinMoin/web/session.py", line 179, in finalize
     if request.user.auth_method == 'setuid':
AttributeError: 'NoneType' object has no attribute 'auth_method'
ThomasWaldmann commented 4 years ago

Happens for the xmlrpc call made by wikimailimport.

ThomasWaldmann commented 4 years ago

No suitable user found for mail address u'Mustermann'

This is likely the main issue why the mail import does not work.

The AttributeError for auth_method is maybe only a secondary error.

ThomasWaldmann commented 4 years ago

From: =?utf-8?B?S29xxxxxxxxxxxx=?= xx@xxx.xxx

The email address looks like this.

ThomasWaldmann commented 4 years ago

So we have 2 issues here:

  1. issue due to utf-8 encoded name and our code not finding a wiki user for the mail address
  2. auth_method AttributeError as a secondary error
ThomasWaldmann commented 4 years ago

The problem is:

>>> getaddresses([u'From: Mustermann, Hans <hm@example.org>'])
[('', u'Mustermann'), (u'Hans', u'hm@example.org')]

>>> getaddresses([u'From: "Mustermann, Hans" <hm@example.org>'])
[(u'Mustermann, Hans', u'hm@example.org')]

getaddresses is from Python standard library, not moin code.