Impacted versions: 11.0

Steps to reproduce: fetchmal fails consistently while downloading messages

Current behavior: TypeError

Proposed patch for file addons/fetchmail/models/fetchmail.py:
```
--- fetchmail.py.orig	2017-10-30 20:53:32.590000000 +0000
+++ fetchmail.py	2017-10-30 20:53:53.890000000 +0000
@@ -204,7 +204,7 @@
                         pop_server.list()
                         for num in range(1, min(MAX_POP_MESSAGES, num_messages) + 1):
                             (header, messages, octets) = pop_server.retr(num)
-                            message = '\n'.join(messages)
+                            message = b'\n'.join(messages)
                             res_id = None
                             try:
                                 res_id = MailThread.with_context(**additionnal_context).message_process(server.object_id.model, message, save_original=server.original, strip_attachments=(not server.attach))
```



addons/fetchmail/models/fetchmail.py
failed += 1
                            if res_id and server.action_id:
                                server.action_id.with_context({
                                    'active_id': res_id,
                                    'active_ids': [res_id],
                                    'active_model': self.env.context.get("thread_model", server.object_id.model)
                                }).run()
                            self.env.cr.commit()
                        if num_messages < MAX_POP_MESSAGES:
                            break
                        pop_server.quit()
                        _logger.info("Fetched %d email(s) on %s server %s; %d succeeded, %d failed.", num_messages, server.type, server.name, (num_messages - failed), failed)
                except Exception:
                    _logger.info("General failure when trying to fetch mail from %s server %s.", server.type, server.name, exc_info=True)
                finally:
                    if pop_server:
                        pop_server.quit()
            server.write({'date': fields.Datetime.now()})
        return True
    @api.model
    def _update_cron(self):
        if self.env.context.get('fetchmail_cron_running'):
            return
        try:
            
            cron = self.env.ref('fetchmail.ir_cron_mail_gateway_action')
            cron.toggle(model=self._name, domain=[('state', '=', 'done'), ('type', 'in', ['pop', 'imap'])])
        except ValueError:
            pass