Bug#986139: offlineimap3 crashes with encoding error

2021-04-17 Thread Sudip Mukherjee
Hi Santiago, Nehalenniæ,

On Thu, Apr 08, 2021 at 10:08:31AM +0100, Sudip Mukherjee wrote:
> Hi Santiago, Nehalenniæ,
> 
> On Fri, Apr 02, 2021 at 09:19:25PM +0100, Sudip Mukherjee wrote:
> > Control: forwarded -1 https://github.com/OfflineIMAP/offlineimap3/issues/62
> > --
> > 
> > On Fri, Apr 2, 2021 at 11:18 AM Nehalenniæ Oudin  
> > wrote:
> > >
> > > Hi,
> > >
> > > I have the same problem.
> > > If I have some time, I'll have a look at it.
> > 
> > Thanks. You might like to raise a PR in upstream repo also.
> 
> Can any of you help with a sample or sanitized email that causes the issue 
> please.

Will it be possible for you to test the PR at:
https://github.com/OfflineIMAP/offlineimap3/pull/63 and verify if that
fixes the encoding problem that you are seeing.

Thanks in advance.

--
Regards
Sudip



Bug#986139: offlineimap3 crashes with encoding error

2021-04-08 Thread Sudip Mukherjee
Hi Santiago, Nehalenniæ,

On Fri, Apr 02, 2021 at 09:19:25PM +0100, Sudip Mukherjee wrote:
> Control: forwarded -1 https://github.com/OfflineIMAP/offlineimap3/issues/62
> --
> 
> On Fri, Apr 2, 2021 at 11:18 AM Nehalenniæ Oudin  wrote:
> >
> > Hi,
> >
> > I have the same problem.
> > If I have some time, I'll have a look at it.
> 
> Thanks. You might like to raise a PR in upstream repo also.

Can any of you help with a sample or sanitized email that causes the issue 
please.

Ref: 
https://github.com/OfflineIMAP/offlineimap3/issues/62#issuecomment-814532373


--
Regards
Sudip



Bug#986139: offlineimap3 crashes with encoding error

2021-04-02 Thread Sudip Mukherjee
Control: forwarded -1 https://github.com/OfflineIMAP/offlineimap3/issues/62
--

On Fri, Apr 2, 2021 at 11:18 AM Nehalenniæ Oudin  wrote:
>
> Hi,
>
> I have the same problem.
> If I have some time, I'll have a look at it.

Thanks. You might like to raise a PR in upstream repo also.


-- 
Regards
Sudip



Bug#986139: offlineimap3 crashes with encoding error

2021-04-02 Thread Nehalenniæ Oudin
Hi,

I have the same problem.
If I have some time, I'll have a look at it.


-- 
Nehalenniæ


signature.asc
Description: PGP signature


Bug#986139: offlineimap3 crashes with encoding error

2021-03-30 Thread Santiago R.R.
Source: offlineimap3
Version: 0.0~git20210225.1e7ef9e+dfsg-3
Severity: important

Dear Sudip,

My offlineimap3 crashes when trying to retrieve some messages:

...
Last 11 debug messages logged for Copy message from 
Riseup-Remote:origin-mail-dir prior to exception:
thread: Register new thread 'Copy message from Riseup-Remote:origin-mail-dir' 
(account 'Riseup')
imap:   15:26.95 Copy message from Riseup-Remote:origin-mail-dir [async] UID 
('FETCH', '1981', '(BODY.PEEK[])')
imap:   15:26.95 Copy message from Riseup-Remote:origin-mail-dir 
state_change_pending.acquire
imap:   15:26.95 Copy message from Riseup-Remote:origin-mail-dir 
state_change_pending.release
imap:   15:26.95 Copy message from Riseup-Remote:origin-mail-dir 
_request_push(b'EPBL24', UID, {}) = b'EPBL24'
imap:   15:26.95 Copy message from Riseup-Remote:origin-mail-dir data=b'EPBL24 
UID FETCH 1981 (BODY.PEEK[])'
imap:   15:26.96 Copy message from Riseup-Remote:origin-mail-dir 
UID:b'EPBL24'.ready.wait
imap:   15:27.44 Copy message from Riseup-Remote:origin-mail-dir 
_get_untagged_response(FETCH) => [(b'184 (UID 1981 BODY[] {6664}', 
b'Return-Path:  [(b'184 (UID 1981 BODY[] {6664}', 
b'Return-Path: 
X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on towhee.riseup.net
X-Spam-Level: 
X... v2.0
*
'
maildir: Write mail 'origin-mail-dir:1981' with flags set()
2021-03-30 10:15:27 INFO: OfflineIMAP 7.3.0
  Licensed under the GNU GPL v2 or any later version (with an OpenSSL exception)
2021-03-30 10:15:27 WARNING: ERROR: Exceptions occurred during the run!
2021-03-30 10:15:27 WARNING: ERROR: Copying message 1981 [acc: Riseup]
  'ascii' codec can't encode characters in position 3523-3525: ordinal not in 
range(128)
2021-03-30 10:15:27 WARNING: 
Traceback:
  File "/usr/share/offlineimap3/offlineimap/folder/Base.py", line 807, in 
copymessageto
new_uid = dstfolder.savemessage(uid, message, flags, rtime)
  File "/usr/share/offlineimap3/offlineimap/folder/Maildir.py", line 380, in 
savemessage
tmpname = self.save_to_tmp_file(messagename, msg)
  File "/usr/share/offlineimap3/offlineimap/folder/Maildir.py", line 330, in 
save_to_tmp_file
fd.write(msg.as_bytes(policy=output_policy))
  File "/usr/lib/python3.9/email/message.py", line 178, in as_bytes
g.flatten(self, unixfrom=unixfrom)
  File "/usr/lib/python3.9/email/generator.py", line 116, in flatten
self._write(msg)
  File "/usr/lib/python3.9/email/generator.py", line 181, in _write
self._dispatch(msg)
  File "/usr/lib/python3.9/email/generator.py", line 218, in _dispatch
meth(msg)
  File "/usr/lib/python3.9/email/generator.py", line 268, in _handle_multipart
self.write(subparts)
  File "/usr/lib/python3.9/email/generator.py", line 410, in write
self._fp.write(s.encode('ascii', 'surrogateescape'))

Tell me if more debug information is needed.

Cheers,

 -- S


-- System Information:
Debian Release: bullseye/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'testing'), (500, 'stable'), (500, 
'oldstable'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 5.10.0-4-amd64 (SMP w/8 CPU threads)
Locale: LANG=es_CO.UTF-8, LC_CTYPE=es_CO.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

-- no debconf information


signature.asc
Description: PGP signature