uploaded to SRU queue now.

** Also affects: getmail6 (Ubuntu Oracular)
   Importance: Undecided
       Status: New

** Also affects: getmail6 (Ubuntu Noble)
   Importance: Undecided
       Status: New

** Changed in: getmail6 (Ubuntu Noble)
       Status: New => In Progress

** Changed in: getmail6 (Ubuntu)
     Assignee: Sudip Mukherjee (sudipmuk) => (unassigned)

** Changed in: getmail6 (Ubuntu)
       Status: New => Fix Released

** Changed in: getmail6 (Ubuntu Oracular)
       Status: New => Fix Released

** Summary changed:

- Incompatibility between Getmail 6.18.13 and Python 3.12.x
+ [SRU] Incompatibility between Getmail 6.18.13 and Python 3.12.x

** Description changed:

+ [ Impact ]
+ 
+ getmail6 crashes when the user tries to use a certificate and keyfile to
+ authenticate with the server.
+ 
+ The trace will be:
+ 
+ getmail version 6.18.13
+ Copyright (C) 1998-2023 Charles Cazabon and others. Licensed under GNU GPL 
version 2.
+ SimpleIMAPSSLRetriever:sudip@localhost:993: read_all and not delete -- all 
messages will be retrieved each time getmail is run
+ SimpleIMAPSSLRetriever:sudip@localhost:993:
+ 
+ Exception: please read docs/BUGS and include the following information
+ in any bug report:
+ 
+   getmail version 6.18.13
+   Python version 3.12.3 (main, Sep 11 2024, 14:17:37) [GCC 13.2.0]
+ 
+ Unhandled exception follows:
+     File "/usr/bin/getmail", line 1022, in main
+     success = go(configs, options.idle)
+               ^^^^^^^^^^^^^^^^^^^^^^^^^
+     File "/usr/bin/getmail", line 182, in go
+     retriever.initialize(options)
+     File "/usr/lib/python3/dist-packages/getmailcore/_retrieverbases.py", 
line 1758, in initialize
+     self._connect()
+     File "/usr/lib/python3/dist-packages/getmailcore/_retrieverbases.py", 
line 679, in _connect
+     self.conn = imaplib.IMAP4_SSL(
+                 ^^^^^^^^^^^^^^^^^^
+   TypeError: IMAP4_SSL.__init__() takes from 1 to 3 positional arguments but 
5 were given
+ 
+ Please also include configuration information from running getmail
+ with your normal options plus "--dump".
+ 
+ 
+ [ Test Plan ]
+ 
+ 1. install dovecot-imapd mailutils getmail6
+ 
+ 2. mkdir -p ~/mailbox/{cur,tmp,new}
+ 
+ 3. send a mail to the user, in this test, I am sending mail to my username:
+ echo "this is a test mail" | mail -s "getmail test" sudip   
+ 
+ 4. Use the same certificate and key that dovecot is using:
+ cp  /etc/ssl/certs/ssl-cert-snakeoil.pem certfile
+ sudo cp  /etc/ssl/private/ssl-cert-snakeoil.key keyfile
+ 
+ 5. change the owner of keyfile (in my test user is sudip)
+ sudo chown sudip:sudip keyfile
+ 
+ 6. create a file '~/getmailrc' and paste the below content in it: (replace 
username with your username and PASSWORD with your password)
+ [retriever]
+ type = SimpleIMAPSSLRetriever
+ server = localhost
+ username = sudip
+ password = PASSWORD
+ certfile = ~/certfile
+ keyfile = ~/keyfile
+ 
+ [destination]
+ type = Maildir
+ path = ~/mailbox/
+ 
+ [options]
+ verbose = 2
+ message_log = ~/getmaillog
+ delete = false
+ 
+ 7. use the getmail command to retrieve the mail:
+ getmail -r ~/getmailrc  -g ~/
+ 
+ If getmail is not fixed then it will crash. With the fixed getmail, it
+ will be able to retrieve the mail.
+ 
+ Test to check that there is no regression for users who are not using keyfile 
and certfile.
+ 
__________________________________________________________________________________________
+ 
+ 1. Follow the steps 1 - 5 from above.
+ 
+ 2. create a file '~/getmailrc' and paste the below content in it: (replace 
username with your username and PASSWORD with your password)
+ [retriever]
+ type = SimpleIMAPSSLRetriever
+ server = localhost
+ username = sudip
+ password = PASSWORD
+ 
+ [destination]
+ type = Maildir
+ path = ~/mailbox/
+ 
+ [options]
+ verbose = 2
+ message_log = ~/getmaillog
+ delete = false
+ 
+ 
+ Note: the only difference between the previous getmailrc and this new one is 
the keyfile/certfile are not mentioned here.
+ 
+ 3. use the getmail command to retrieve the mail:
+ getmail -r ~/getmailrc  -g ~/
+ 
+ 
+ This should work with the current package in Noble and also with the fixed 
package.
+ 
+ 
+ [ Where problems could occur ]
+ 
+ The upstream commits have changed the way imaplib.IMAP4_SSL is
+ initialized from 'IMAP4_SSL_EXTENDED'. IMAP4_SSL_EXTENDED is only used
+ when users are using keyfile/certfile or their own CA files, There is a
+ chance of regression due to this change but the affected users will be
+ same user group who are affected by this bug. And in a worst case
+ scenario of a regression they will not see any new failure, but they
+ will see that their keyfile/certfile or CA files are still not working
+ with getmail.
+ 
+ [ Other Info ]
+ 
+ * This is an upstream commit and has been verified by the user who reported 
this issue.
+ * It has been fixed in Debian from 6.19.02-1 and so Oracular and Plucky are 
not affected.
+ * I will be adding this test as an autopkgtest in Debian, so it will reach 
Plucky.
+ 
+ [ Original Bug Description ]
+ 
+ 
  Issue upstream : https://github.com/getmail6/getmail6/issues/199
  
  Error logs :
  Sep 12 21:38:58 drouard systemd[1]: [email protected]: 
Scheduled restart job, restart counter is at 2695.
  Sep 12 21:38:58 drouard systemd[1]: Started 
[email protected] - Getmail for ludovic - rc/free/mailpub.
  Sep 12 21:38:59 drouard getmail[3015356]: getmail version 6.18.13
  Sep 12 21:38:59 drouard getmail[3015356]: Copyright (C) 1998-2023 Charles 
Cazabon and others. Licensed under GNU GPL version 2.
  Sep 12 21:38:59 drouard getmail[3015356]: 
SimpleIMAPSSLRetriever:[email protected]:993:
  Sep 12 21:38:59 drouard getmail[3015356]: Exception: please read docs/BUGS 
and include the following information in any bug report:
  Sep 12 21:38:59 drouard getmail[3015356]:   getmail version 6.18.13
  Sep 12 21:38:59 drouard getmail[3015356]:   Python version 3.12.3 (main, Jul 
31 2024, 17:43:48) [GCC 13.2.0]
  Sep 12 21:38:59 drouard getmail[3015356]: Unhandled exception follows:
  Sep 12 21:38:59 drouard getmail[3015356]:     File "/usr/bin/getmail", line 
1022, in main
  Sep 12 21:38:59 drouard getmail[3015356]:     success = go(configs, 
options.idle)
  Sep 12 21:38:59 drouard getmail[3015356]:               
^^^^^^^^^^^^^^^^^^^^^^^^^
  Sep 12 21:38:59 drouard getmail[3015356]:     File "/usr/bin/getmail", line 
182, in go
  Sep 12 21:38:59 drouard getmail[3015356]:     retriever.initialize(options)
  Sep 12 21:38:59 drouard getmail[3015356]:     File 
"/usr/lib/python3/dist-packages/getmailcore/_retrieverbases.py", line 1758, in 
initialize
  Sep 12 21:38:59 drouard getmail[3015356]:     self._connect()
  Sep 12 21:38:59 drouard getmail[3015356]:     File 
"/usr/lib/python3/dist-packages/getmailcore/_retrieverbases.py", line 667, in 
_connect
  Sep 12 21:38:59 drouard getmail[3015356]:     self.conn = IMAP4_SSL_EXTENDED(
  Sep 12 21:38:59 drouard getmail[3015356]:                 ^^^^^^^^^^^^^^^^^^^
  Sep 12 21:38:59 drouard getmail[3015356]:     File 
"/usr/lib/python3/dist-packages/getmailcore/_retrieverbases.py", line 606, in 
__init__
  Sep 12 21:38:59 drouard getmail[3015356]:     
imaplib.IMAP4_SSL.__init__(self, host, port, keyfile, certfile)
  Sep 12 21:38:59 drouard getmail[3015356]:   TypeError: IMAP4_SSL.__init__() 
takes from 1 to 3 positional arguments but 5 were given
  Sep 12 21:38:59 drouard getmail[3015356]: Please also include configuration 
information from running getmail
  Sep 12 21:38:59 drouard getmail[3015356]: with your normal options plus 
"--dump".
  Sep 12 21:38:59 drouard systemd[1]: [email protected]: 
Main process exited, code=exited, status=4/NOPERMISSION
  Sep 12 21:38:59 drouard systemd[1]: [email protected]: 
Failed with result 'exit-code'.
  
- 
  Notes :
  It's seems fixed in getmail v6.18.14 then v6.19.03 => 
https://github.com/getmail6/getmail6/releases
  
  ProblemType: Bug
  DistroRelease: Ubuntu 24.04
  Package: getmail6 6.18.13-1
  ProcVersionSignature: Ubuntu 6.8.0-44.44-generic 6.8.12
  Uname: Linux 6.8.0-44-generic x86_64
  ApportVersion: 2.28.1-0ubuntu3.1
  Architecture: amd64
  CasperMD5CheckResult: pass
  CloudArchitecture: x86_64
  CloudID: none
  CloudName: none
  CloudPlatform: none
  CloudSubPlatform: config
  Date: Thu Sep 12 21:32:03 2024
  Dependencies:
-  
+ 
  InstallationDate: Installed on 2020-11-17 (1395 days ago)
  InstallationMedia: Ubuntu-Server 20.04.1 LTS "Focal Fossa" - Release amd64 
(20200731)
  PackageArchitecture: all
  ProcEnviron:
-  LANG=C.UTF-8
-  PATH=(custom, no user)
-  SHELL=/bin/bash
-  TERM=xterm-256color
+  LANG=C.UTF-8
+  PATH=(custom, no user)
+  SHELL=/bin/bash
+  TERM=xterm-256color
  SourcePackage: getmail6
  UpgradeStatus: Upgraded to noble on 2024-09-11 (1 days ago)
  mtime.conffile..etc.init.d.apport: 2024-07-22T16:59:07

** Changed in: getmail6 (Ubuntu Noble)
   Importance: Undecided => Medium

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2080570

Title:
  [SRU] Incompatibility between Getmail 6.18.13 and Python 3.12.x

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/getmail6/+bug/2080570/+subscriptions


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to