jparyani / Mailpile

An experimental indexing and search engine for e-mail
Other
12 stars 2 forks source link

Failed to install mailpipe on sandstorm due to non-ascii name string #3

Closed franc0is closed 10 years ago

franc0is commented 10 years ago

Debug logs below. Mailpipe croaks when trying to install it on sandstorm, most likely because my account name countains non-ascii characters (Fran_ç_ois Baldassari). Looks like sandstorm is passing a utf-8 string to Mailpipe, whereas the python code probably expects UCS2. a .decode('utf-8') call would probably fix the issue.

Sandstorm Debug log: Untitled Mailpile Mailbox

...** SANDSTORM SUPERVISOR: Starting up grain.
+ export HOME=/var
+ export LANG=en_US.UTF-8
+ cd /var
+ test -e mail
+ mkdir -p mail/cur
+ mkdir -p mail/new
+ mkdir -p mail/tmp
+ chmod -R 770 mail
+ /usr/bin/python /mp --setup

Ignoring duplicate plugin: social-feed
Ignoring duplicate plugin: autoajax
Ignoring duplicate plugin: forcegrapher
Ignoring duplicate plugin: demos
Ignoring duplicate plugin: hacks
Ignoring duplicate plugin: maildeck
OK: Performed initial Mailpile setup
+ /usr/bin/python /mp --set sys.http_host=0.0.0.0

{
    "sys.http_host": "0.0.0.0"
}
+ /usr/bin/python /mp --add /var/mail/

{
    "added": {
        "1": "/var/mail/"
    }
}
+ /usr/bin/python /mp --set prefs.rescan_interval=5

{
    "prefs.rescan_interval": "5"
}
+ /usr/bin/python /mp --set prefs.empty_outbox_interval=5

{
    "prefs.empty_outbox_interval": "5"
}
+ /usr/bin/python /mp --rescan all

{
    "mailboxes": 0, 
    "messages": 0, 
    "vcards": 0
}
+ /usr/bin/python /mp --www
Traceback (most recent call last):
  File "/usr/lib/python2.7/SocketServer.py", line 595, in process_request_thread
    self.finish_request(request, client_address)
  File "/mailpile/httpd.py", line 375, in finish_request
    SimpleXMLRPCServer.finish_request(self, request, client_address)
  File "/usr/lib/python2.7/SocketServer.py", line 334, in finish_request
    self.RequestHandlerClass(request, client_address, self)
  File "/usr/lib/python2.7/SocketServer.py", line 651, in __init__
    self.handle()
  File "/usr/lib/python2.7/BaseHTTPServer.py", line 340, in handle
    self.handle_one_request()
  File "/usr/lib/python2.7/BaseHTTPServer.py", line 328, in handle_one_request
    method()
  File "/mailpile/httpd.py", line 265, in do_GET
    self.set_profile()
  File "/mailpile/httpd.py", line 220, in set_profile
    config.profiles = profiles
  File "/mailpile/config.py", line 570, in __setattr__
    self.__setitem__(attr, value)
  File "/mailpile/config.py", line 610, in __setitem__
    ) % (self._name, key, value))
ValueError: Invalid value for config/profiles: [{'name': 'Fran\xc3\xa7ois Baldassari', 'email': '0yh30f1pf2nupq3tfdjm@alpha.sandstorm.io'}, {}]
jparyani commented 10 years ago

Can you try and manually install https://docs.google.com/file/d/0BzLCOahiEfRWMVo5Z1BwczFKaWs/edit?

If it works for you, we'll push it to the app list.

franc0is commented 10 years ago

@jparyani looks like it does the trick. Happy logs below. Thanks! Out of curiosity, what's the patch?

...** SANDSTORM SUPERVISOR: Starting up grain.
+ export HOME=/var
+ export LANG=en_US.UTF-8
+ cd /var
+ test -e mail
+ mkdir -p mail/cur
+ mkdir -p mail/new
+ mkdir -p mail/tmp
+ chmod -R 770 mail
+ /usr/bin/python /mp --setup

Ignoring duplicate plugin: social-feed
Ignoring duplicate plugin: autoajax
Ignoring duplicate plugin: forcegrapher
Ignoring duplicate plugin: demos
Ignoring duplicate plugin: hacks
Ignoring duplicate plugin: maildeck
OK: Performed initial Mailpile setup
+ /usr/bin/python /mp --set sys.http_host=0.0.0.0

{
    "sys.http_host": "0.0.0.0"
}
+ /usr/bin/python /mp --add /var/mail/

{
    "added": {
        "1": "/var/mail/"
    }
}
+ /usr/bin/python /mp --set prefs.rescan_interval=5

{
    "prefs.rescan_interval": "5"
}
+ /usr/bin/python /mp --set prefs.empty_outbox_interval=5

{
    "prefs.empty_outbox_interval": "5"
}
+ /usr/bin/python /mp --rescan all

{
    "mailboxes": 0, 
    "messages": 0, 
    "vcards": 0
}
+ /usr/bin/python /mp --www
jparyani commented 10 years ago

It was exactly as simple as you said. I just added .decode('utf-8') to all the relevant strings. You can see it in 17f36994c9fd28dea97da8bdfd2198dde98c6885