<div dir="ltr">I'm running imap in a docker container (maxkratz/onlineimap), after trying repeatedly to run it in bare debian.  I'm backing up from Gmail.  In the container, offlineimap -V shows: <br><br><div>offlineimap v8.0.0, imaplib2 v3.05, Python v3.10.6, OpenSSL 3.0.2 15 Mar 2022<div><br></div><div>The docker container gets me further, but in both cases, offlineimap eventually errors and closes after hitting 5-10 encoding errors, such as: <div><pre class="gmail-log_viewer gmail-wrap_lines" style="box-sizing:border-box;margin-top:0px;margin-bottom:10px;padding:9.5px;overflow:auto scroll;border-radius:8px;line-height:1.42857;word-break:break-all;height:481.125px"><div class="gmail-line gmail-ng-scope" style="font-family:Menlo,Monaco,Consolas,"Courier New",monospace;box-sizing:border-box;margin:0px;padding:0px"><p class="gmail-inner_line" style="box-sizing:border-box;margin:0px;padding:0px 15px"><span class="gmail-ng-binding gmail-ng-scope" style="box-sizing:border-box;margin:0px;padding:0px"><font size="1">ERROR: UID 140848 (<<a href="mailto:ZF3lf1bGTw-Ct-Y9A5ZZl3Q6MXODdPHg-212.129.51.36@ismtpd0003p1iad1.sendgrid.net">ZF3lf1bGTw-Ct-Y9A5ZZl3Q6MXODdPHg-212.129.51.36@ismtpd0003p1iad1.sendgrid.net</a>>) has defects preventing it from being processed!</font></span></p></div><div class="gmail-line gmail-ng-scope" style="box-sizing:border-box;margin:0px;padding:0px"><p class="gmail-inner_line gmail-line_selected" style="font-family:Menlo,Monaco,Consolas,"Courier New",monospace;box-sizing:border-box;margin:0px;padding:0px 15px"><span class="gmail-ng-binding gmail-ng-scope" style="box-sizing:border-box;margin:0px;padding:0px"><font size="1">  UnicodeEncodeError: 'ascii' codec can't encode characters in position 434-435: ordinal not in range(128)</font></span></p><pre class="gmail-log_viewer gmail-wrap_lines" style="box-sizing:border-box;margin-top:0px;margin-bottom:10px;padding:9.5px;overflow:auto scroll;border-radius:8px;line-height:1.42857;word-break:break-all;height:481.125px"><div class="gmail-line gmail-ng-scope" style="font-family:Menlo,Monaco,Consolas,"Courier New",monospace;box-sizing:border-box;margin:0px;padding:0px"><p class="gmail-inner_line" style="box-sizing:border-box;margin:0px;padding:0px 15px"><span class="gmail-ng-binding gmail-ng-scope" style="box-sizing:border-box;margin:0px;padding:0px"><font size="1">Traceback:</font></span></p></div><div class="gmail-line gmail-ng-scope" style="font-family:Menlo,Monaco,Consolas,"Courier New",monospace;box-sizing:border-box;margin:0px;padding:0px"><p class="gmail-inner_line" style="box-sizing:border-box;margin:0px;padding:0px 15px"><span class="gmail-ng-binding gmail-ng-scope" style="box-sizing:border-box;margin:0px;padding:0px"><font size="1">  File "/usr/share/offlineimap3/offlineimap/folder/Base.py", line 810, in copymessageto</font></span></p></div><div class="gmail-line gmail-ng-scope" style="font-family:Menlo,Monaco,Consolas,"Courier New",monospace;box-sizing:border-box;margin:0px;padding:0px"><p class="gmail-inner_line" style="box-sizing:border-box;margin:0px;padding:0px 15px"><span class="gmail-ng-binding gmail-ng-scope" style="box-sizing:border-box;margin:0px;padding:0px"><font size="1">    message = self.getmessage(uid)</font></span></p></div><div class="gmail-line gmail-ng-scope" style="font-family:Menlo,Monaco,Consolas,"Courier New",monospace;box-sizing:border-box;margin:0px;padding:0px"><p class="gmail-inner_line" style="box-sizing:border-box;margin:0px;padding:0px 15px"><span class="gmail-ng-binding gmail-ng-scope" style="box-sizing:border-box;margin:0px;padding:0px"><font size="1">  File "/usr/share/offlineimap3/offlineimap/folder/Gmail.py", line 69, in getmessage</font></span></p></div><div class="gmail-line gmail-ng-scope" style="font-family:Menlo,Monaco,Consolas,"Courier New",monospace;box-sizing:border-box;margin:0px;padding:0px"><p class="gmail-inner_line" style="box-sizing:border-box;margin:0px;padding:0px 15px"><span class="gmail-ng-binding gmail-ng-scope" style="box-sizing:border-box;margin:0px;padding:0px"><font size="1">    data = self._fetch_from_imap(str(uid), self.retrycount)</font></span></p></div><div class="gmail-line gmail-ng-scope" style="font-family:Menlo,Monaco,Consolas,"Courier New",monospace;box-sizing:border-box;margin:0px;padding:0px"><p class="gmail-inner_line" style="box-sizing:border-box;margin:0px;padding:0px 15px"><span class="gmail-ng-binding gmail-ng-scope" style="box-sizing:border-box;margin:0px;padding:0px"><font size="1">  File "/usr/share/offlineimap3/offlineimap/folder/IMAP.py", line 930, in _fetch_from_imap</font></span></p></div><div class="gmail-line gmail-ng-scope" style="box-sizing:border-box;margin:0px;padding:0px"><p class="gmail-inner_line" style="font-family:Menlo,Monaco,Consolas,"Courier New",monospace;box-sizing:border-box;margin:0px;padding:0px 15px"><span class="gmail-ng-binding gmail-ng-scope" style="box-sizing:border-box;margin:0px;padding:0px"><font size="1">    raise OfflineImapError(</font></span></p><p class="gmail-inner_line" style="font-family:Menlo,Monaco,Consolas,"Courier New",monospace;box-sizing:border-box;margin:0px;padding:0px 15px"><br></p><p class="gmail-inner_line" style="font-family:Menlo,Monaco,Consolas,"Courier New",monospace;box-sizing:border-box;margin:0px;padding:0px 15px"><br></p><p class="gmail-inner_line" style="box-sizing:border-box;margin:0px;padding:0px 15px"><font face="arial, sans-serif">This seems to be related to UTF-8 encoding somehow. My next step would be to look at these message (or figure out a fix). But how do I determine which message is causing the failure?  UID 140848 doesn't appear in my maildir yet, and Gmail does not see the sendgrid address when I search.  </font></p></div></pre></div></pre></div></div></div></div>