[SRU] getmail_fetch crash, bugfix available upstream

Bug #2008594 reported by Borim
12
This bug affects 1 person
Affects Status Importance Assigned to Milestone
getmail6 (Ubuntu)
Fix Released
Undecided
Unassigned
Jammy
Fix Released
Undecided
Unassigned

Bug Description

[ Impact ]

getmail_fetch crashes when executed.

[ Test Plan ]

Execute `getmail_fetch` with the arguments as given in the original bug description.

But for more clarity, these are the commands that needs to be run.

mkdir -p ~/testmaildir/{cur,tmp,new}
getmail_fetch -s dummy.example.com testacc testpw ~/testmaildir/

If we run the above commands on jammy, we can see the error.

With the fixed package the error will not be seen and `getmail_fetch` will now try to connect to dummy.example.com.

[ Where problems could occur ]

The fix is adding a try-except block in the code and the error handling is done in the except part. Since the error is generated because of Python3, upstream has added the Python3 version of the `types.MethodType` in the except block. So, it should not change the behaviour and has little chance of regressing the user behaviour.

[ Other Info ]

 The problem exists in v6.8.4 and has been fixed by upstream on v6.8.5. It has been updated on Ubuntu Lunar, Mantic and Noble. But Jammy still has the problem and can be reproduced very easily.

Original Bug Description:

When I execute getmail_fetch with plausible arguments it crash, e.g
getmail_fetch -s dummy.example.com testacc testpw ./testmaildir/

exception: please read docs/BUGS and include the following information in any bug report:

  getmail_fetch version 6.18.4
  Python version 3.10.6 (main, Nov 14 2022, 16:10:14) [GCC 11.3.0]

Unhandled exception follows:
    File "/usr/bin/getmail_fetch", line 138, in main
    options.get = types.MethodType(get, options, options.__class__)
  TypeError: method expected 2 arguments, got 3

The result is the same when used with real login data.

I have tested with the latest version on github https://github.com/getmail6/getmail6 and with it no error occurs. The reported version from github is
getmail_fetch 6.18.12

Regards Matthias

ProblemType: Bug
DistroRelease: Ubuntu 22.04
Package: getmail6 6.18.4-2
ProcVersionSignature: Ubuntu 5.15.0-60.66-generic 5.15.78
Uname: Linux 5.15.0-60-generic x86_64
NonfreeKernelModules: wl
ApportVersion: 2.20.11-0ubuntu82.3
Architecture: amd64
CasperMD5CheckResult: unknown
CurrentDesktop: ubuntu:GNOME
Date: Sat Feb 25 22:29:02 2023
Dependencies:

InstallationDate: Installed on 2016-07-24 (2407 days ago)
InstallationMedia: Ubuntu 16.04.1 LTS "Xenial Xerus" - Release amd64 (20160719)
PackageArchitecture: all
ProcEnviron:
 TERM=xterm-256color
 PATH=(custom, no user)
 XDG_RUNTIME_DIR=<set>
 LANG=de_DE.UTF-8
 SHELL=/bin/bash
SourcePackage: getmail6
UpgradeStatus: Upgraded to jammy on 2023-02-25 (0 days ago)

Revision history for this message
Borim (borim) wrote :
Borim (borim)
summary: - getmail_fetch crash, bugfix available
+ getmail_fetch crash, bugfix available upstream
Revision history for this message
Borim (borim) wrote :

Workaround until ubuntu ship working package:

- Get source from upstream: https://github.com/getmail6/getmail6
- Install tools for deb package creation: sudo apt install python3-setuptools python3-stdeb fakeroot
- Build deb package with:
python3 setup.py sdist
python3 setup.py --command-packages=stdeb.command bdist_deb

- install deb package which is located under deb_dist folder

Changed in getmail6 (Ubuntu):
assignee: nobody → Sudip Mukherjee (sudipmuk)
status: New → In Progress
summary: - getmail_fetch crash, bugfix available upstream
+ [SRUgetmail_fetch crash, bugfix available upstream
summary: - [SRUgetmail_fetch crash, bugfix available upstream
+ [SRU] getmail_fetch crash, bugfix available upstream
description: updated
Revision history for this message
Sudip Mukherjee (sudipmuk) wrote :

debdiff attached.

description: updated
Changed in getmail6 (Ubuntu):
status: In Progress → New
assignee: Sudip Mukherjee (sudipmuk) → nobody
Revision history for this message
Sergio Durigan Junior (sergiodj) wrote :

Hi Sudip,

Thank you for your contribution.

Aside from a small nit on the backported patch (it should use a proper DEP3 header, like "Origin"), everything else looks good. I went ahead and fixed the nit locally, so there's no need to reupload the debdiff.

I have verified that the bug is indeed reproducible, and that the patch fixes it.

Uploaded to jammy-proposed.

Thanks.

Changed in getmail6 (Ubuntu Jammy):
status: New → In Progress
Changed in getmail6 (Ubuntu):
status: New → Fix Released
Revision history for this message
Timo Aaltonen (tjaalton) wrote : Please test proposed package

Hello Borim, or anyone else affected,

Accepted getmail6 into jammy-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/getmail6/6.18.4-2ubuntu1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, what testing has been performed on the package and change the tag from verification-needed-jammy to verification-done-jammy. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-jammy. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in getmail6 (Ubuntu Jammy):
status: In Progress → Fix Committed
tags: added: verification-needed verification-needed-jammy
Revision history for this message
Sudip Mukherjee (sudipmuk) wrote :

I can confirm that the getmail6 package in jammy-proposed has fixed the bug for me.

Test done:
1. Install getmail6 on a jammy installation.
2. mkdir -p ~/testmaildir/{cur,tmp,new}
3. getmail_fetch -s dummy.example.com testacc testpw ~/testmaildir/
   - command fails with the error:

# getmail_fetch -s dummy.example.com testacc testpw ~/testmaildir/

Exception: please read docs/BUGS and include the following information in any bug report:

  getmail_fetch version 6.18.4
  Python version 3.10.12 (main, Nov 20 2023, 15:14:05) [GCC 11.4.0]

Unhandled exception follows:
    File "/usr/bin/getmail_fetch", line 138, in main
    options.get = types.MethodType(get, options, options.__class__)
  TypeError: method expected 2 arguments, got 3

4. Add jammy-proposed to apt sources
5. Update getmail6 from jammy-proposed.
6. execute getmail_fetch again.

# getmail_fetch -s dummy.example.com testacc testpw ~/testmaildir/
getmail version 6.18.4
Copyright (C) 1998-2021 Charles Cazabon and others. Licensed under GNU GPL version 2.
BrokenUIDLPOP3SSLRetriever:<email address hidden>:995:
Operational error: error resolving name dummy.example.com during connect ([Errno -2] Name or service not known)

Test result: the exception with getmail_fetch has been fixed and it can be executed again

Package tested:

# dpkg -l | grep getmail
ii getmail6 6.18.4-2ubuntu1 all mail retriever with support for POP3, IMAP4 and SDPS

tags: added: verification-done-jammy
removed: verification-needed-jammy
tags: added: verification-done
removed: verification-needed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package getmail6 - 6.18.4-2ubuntu1

---------------
getmail6 (6.18.4-2ubuntu1) jammy; urgency=medium

  * Backport upstream patch to fix getmail_fetch crash. (LP: #2008594)

 -- Sudip Mukherjee <email address hidden> Sun, 05 Nov 2023 12:46:07 +0000

Changed in getmail6 (Ubuntu Jammy):
status: Fix Committed → Fix Released
Revision history for this message
Brian Murray (brian-murray) wrote : Update Released

The verification of the Stable Release Update for getmail6 has completed successfully and the package is now being released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.