Hello community, here is the log from the commit of package getmail for openSUSE:Factory checked in at 2017-07-21 22:49:20 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/getmail (Old) and /work/SRC/openSUSE:Factory/.getmail.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "getmail" Fri Jul 21 22:49:20 2017 rev:22 rq:511408 version:5.1 Changes: -------- --- /work/SRC/openSUSE:Factory/getmail/getmail.changes 2017-06-08 15:03:22.315900366 +0200 +++ /work/SRC/openSUSE:Factory/.getmail.new/getmail.changes 2017-07-21 22:49:22.856883216 +0200 @@ -1,0 +2,23 @@ +Tue Jul 18 17:00:00 UTC 2017 - [email protected] + +- Version bump to 5.1 + * bugfix: if password_command parameter was used with a non-existent + program, getmail would error out during the handling of that + condition and not report the problem correctly. + +- Changes from 5.0 + * new release numbering scheme; previous version numbers were just + getting too high. + * catch and ignore/exit cleanly after reset connection in IMAP IDLE + mode. Thanks: Stephan Schulz. + * allow specifying an expected SSL certificate hostname, for when + the server's certificate does not match the domain name used to + connect to it. Thanks: "Andre". + * fix error message not actually giving the header field name + incorrectly specified as containing the envelope recipient address. + Thanks: Hardy Braunsdorf. + * add new password_command configuration parameter for retrievers, + allowing getmail to retrieve the account password from any + arbitrary external command. Suggestion: "ng0". + +------------------------------------------------------------------- Old: ---- getmail-4.54.0.tar.gz New: ---- getmail-5.1.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ getmail.spec ++++++ --- /var/tmp/diff_new_pack.9w2CZ7/_old 2017-07-21 22:49:23.436801411 +0200 +++ /var/tmp/diff_new_pack.9w2CZ7/_new 2017-07-21 22:49:23.436801411 +0200 @@ -17,7 +17,7 @@ Name: getmail -Version: 4.54.0 +Version: 5.1 Release: 0 BuildRoot: %{_tmppath}/%{name}-%{version}-build Url: http://pyropus.ca/software/getmail/ ++++++ _service ++++++ --- /var/tmp/diff_new_pack.9w2CZ7/_old 2017-07-21 22:49:23.472796334 +0200 +++ /var/tmp/diff_new_pack.9w2CZ7/_new 2017-07-21 22:49:23.472796334 +0200 @@ -1,7 +1,7 @@ <services> <service name="verify_file" mode="localonly"> <param name="verifier">sha256</param> - <param name="checksum">d45657945353c68785b106dd9c5fae6bc2cec8f99fbb202d9dddd4967f483a65</param> - <param name="file">getmail-4.54.0.tar.gz</param> + <param name="checksum">3d6e20e5ea41c1ffb284a46de3d2a474bf2ebd9215441c4c379183d03710027e</param> + <param name="file">getmail-5.1.tar.gz</param> </service> </services> ++++++ getmail-4.54.0.tar.gz -> getmail-5.1.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/getmail-4.54.0/PKG-INFO new/getmail-5.1/PKG-INFO --- old/getmail-4.54.0/PKG-INFO 2017-02-19 19:08:50.000000000 +0100 +++ new/getmail-5.1/PKG-INFO 2017-07-16 05:26:27.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: getmail -Version: 4.54.0 +Version: 5.1 Summary: a mail retrieval, sorting, and delivering system Home-page: http://pyropus.ca/software/getmail/ Author: Charles Cazabon diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/getmail-4.54.0/docs/CHANGELOG new/getmail-5.1/docs/CHANGELOG --- old/getmail-4.54.0/docs/CHANGELOG 2017-02-19 19:08:34.000000000 +0100 +++ new/getmail-5.1/docs/CHANGELOG 2017-07-16 05:26:01.000000000 +0200 @@ -1,6 +1,29 @@ +Version 5.1 +15 July 2017 + -bugfix: if password_command parameter was used with a non-existent program, + getmail would error out during the handling of that condition and not report + the problem correctly. + +Version 5.0 +15 July 2017 + -new release numbering scheme; previous version numbers were just getting + too high. + -catch and ignore/exit cleanly after reset connection in IMAP IDLE mode. + Thanks: Stephan Schulz. + -allow specifying an expected SSL certificate hostname, for when the + server's certificate does not match the domain name used to connect to + it. Thanks: "Andre". + -fix error message not actually giving the header field name incorrectly + specified as containing the envelope recipient address. Thanks: Hardy + Braunsdorf. + -add new password_command configuration parameter for retrievers, allowing + getmail to retrieve the account password from any arbitrary external + command. Suggestion: "ng0". + Version 4.54.0 19 February 2017 - -fix error running getmail_fetch introduced in 4.53.0. Thanks: "fsckd". + -fix error running getmail_fetch introduced in 4.53.0. Thanks: "fsckd" + of Arch Linux. Version 4.53.0 15 January 2017 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/getmail-4.54.0/docs/configuration.html new/getmail-5.1/docs/configuration.html --- old/getmail-4.54.0/docs/configuration.html 2017-02-19 19:08:45.000000000 +0100 +++ new/getmail-5.1/docs/configuration.html 2017-07-16 05:26:23.000000000 +0200 @@ -3,10 +3,10 @@ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> <head> <meta http-equiv="content-type" content="application/xhtml+xml;charset=iso-8859-1" /> - <title>getmail configuration (version 4)</title> + <title>getmail configuration (version 5)</title> <meta name="author" content="Charles Cazabon" /> - <meta name="description" content="Configuration instructions for getmail version 4" /> - <meta name="keywords" content="getmail configuration, getmail 4 configuration, POP3, IMAP, SSL, domain mailbox, multidrop, fetchmail replacement, message filtering, maildir, mboxrd, MDA" /> + <meta name="description" content="Configuration instructions for getmail version 5" /> + <meta name="keywords" content="getmail configuration, getmail 5 configuration, getmail 4 configuration, POP3, IMAP, SSL, domain mailbox, multidrop, fetchmail replacement, message filtering, maildir, mboxrd, MDA" /> <link rel="Contents Up Index" title="Charles Cazabon's Software" href="../" /> <style type="text/css" media="all">@import "getmaildocs.css";</style> <style type="text/css" media="all">@import "/style/styles.css";</style> @@ -16,7 +16,7 @@ <!----><h1 id="title">getmail documentation</h1> <p class="introduction"> - This is the documentation for getmail version 4. Version 4 includes + This is the documentation for getmail version 5. Version 5 includes numerous changes from version 3.x; if you are using getmail version 3, please refer to the documentation included with that version of the software. @@ -33,7 +33,7 @@ <h1 id="toc">Table of Contents</h1> <ul> - <li><a href="documentation.html">getmail documentation</a></li> + <li><a href="documentation.html">getmail documentation (version 5)</a></li> <li> <ul> <li><a href="documentation.html#title">getmail documentation</a></li> @@ -49,7 +49,7 @@ </li> </ul> </li> - <li><a href="configuration.html">getmail configuration</a></li> + <li><a href="configuration.html">getmail configuration (version 5)</a></li> <li> <ul> <li><a href="configuration.html#configuring">Configuring getmail</a></li> @@ -148,7 +148,7 @@ </li> </ul> </li> - <li><a href="troubleshooting.html">getmail troubleshooting</a></li> + <li><a href="troubleshooting.html">getmail troubleshooting (version 5)</a></li> <li> <ul> <li><a href="troubleshooting.html#troubleshooting">Troubleshooting problems</a></li> @@ -161,7 +161,7 @@ </li> </ul> </li> - <li><a href="faq.html">getmail frequently-asked questions (FAQs)</a></li> + <li><a href="faq.html">getmail frequently-asked questions (FAQs) (version 5)</a></li> <li> <ul> <li><a href="faq.html#faq">Frequently-Asked Questions (FAQs)</a></li> @@ -552,6 +552,7 @@ credential for the POP/IMAP server in one of the following ways: <ol> <li>from the <span class="file">password</span> configuration item in the getmailrc file</li> + <li>by running an arbitrary command specified with the password_command parameter (see below)</li> <li>on Mac OS X only, from the OS X keychain</li> <li>on systems with Gnome keyring support, from the default Gnome keyring</li> <li>if not found via any of the above methods, getmail will prompt for the password when run</li> @@ -569,6 +570,19 @@ via the keychain. See <a href="http://article.gmane.org/gmane.mail.getmail.user/5120">this posting to the getmail users' mailing list by Alan Schmitt</a> for details. </li> + <li> + password_command + (<a href="#parameter-tuplestrings">tuple of quoted strings</a>) + — retrieve the account password by running an arbitrary external + program. The program must write the password and nothing else to stdout, + and must exit with a status of 0 on success. Note that the password parameter + (above) overrides this parameter; specify one or the other, not both. + This parameter is specified as the program to run as the first string in the + tuple, and all remaining strings are arguments passed to that program. + <pre class="example"> +password_command = ("/path/to/password-retriever", "-p", "[email protected]") + </pre> + </li> </ul> <p> All IMAP retriever types also take the following optional parameters: @@ -736,6 +750,15 @@ if you supply the <span class="file">--fingerprint</span> commandline option. <strong>Note: this option is only available with Python 2.6 or higher.</strong> </li> + <li> + ssl_cert_hostname + (<a href="#parameter-string">string</a>) + — advanced option to specify an alternate hostname which is expected + in the server's SSL certificate hostname field. Specify this if the name + used to connect to the server is known not to match the hostname in the + server's certificate; otherwise, getmail will error out with a hostname + mismatch. + </li> </ul> <h4 id="retriever-simplepop3">SimplePOP3Retriever</h4> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/getmail-4.54.0/docs/configuration.txt new/getmail-5.1/docs/configuration.txt --- old/getmail-4.54.0/docs/configuration.txt 2017-02-19 19:08:46.000000000 +0100 +++ new/getmail-5.1/docs/configuration.txt 2017-07-16 05:26:24.000000000 +0200 @@ -1,6 +1,6 @@ getmail documentation - This is the documentation for getmail version 4. Version 4 includes + This is the documentation for getmail version 5. Version 5 includes numerous changes from version 3.x; if you are using getmail version 3, please refer to the documentation included with that version of the software. @@ -13,7 +13,7 @@ Table of Contents - * getmail documentation + * getmail documentation (version 5) * + getmail documentation + @@ -23,7 +23,7 @@ o Obtaining getmail o Installing getmail o getmail mailing lists - * getmail configuration + * getmail configuration (version 5) * + Configuring getmail + @@ -88,14 +88,14 @@ # @ Example o Using getmail_fetch to retrieve mail from scripts - * getmail troubleshooting + * getmail troubleshooting (version 5) * + Troubleshooting problems + o Error messages o Warning messages o Unexpected Behaviour - * getmail frequently-asked questions (FAQs) + * getmail frequently-asked questions (FAQs) (version 5) * + Frequently-Asked Questions (FAQs) + @@ -341,10 +341,12 @@ getmail gets the password credential for the POP/IMAP server in one of the following ways: 1. from the password configuration item in the getmailrc file - 2. on Mac OS X only, from the OS X keychain - 3. on systems with Gnome keyring support, from the default Gnome + 2. by running an arbitrary command specified with the + password_command parameter (see below) + 3. on Mac OS X only, from the OS X keychain + 4. on systems with Gnome keyring support, from the default Gnome keyring - 4. if not found via any of the above methods, getmail will prompt + 5. if not found via any of the above methods, getmail will prompt for the password when run To store your POP/IMAP account password into the Gnome keyring, ensure the password is not provided in the getmailrc file, and run @@ -358,6 +360,16 @@ the password available to getmail via the keychain. See this posting to the getmail users' mailing list by Alan Schmitt for details. + * password_command (tuple of quoted strings) — retrieve the account + password by running an arbitrary external program. The program must + write the password and nothing else to stdout, and must exit with a + status of 0 on success. Note that the password parameter (above) + overrides this parameter; specify one or the other, not both. This + parameter is specified as the program to run as the first string in + the tuple, and all remaining strings are arguments passed to that + program. +password_command = ("/path/to/password-retriever", "-p", "[email protected]" +) All IMAP retriever types also take the following optional parameters: * mailboxes (tuple of quoted strings) — a list of mailbox paths to @@ -473,6 +485,12 @@ connection. Getmail will log the fingerprint of the server's certificate if you supply the --fingerprint commandline option. Note: this option is only available with Python 2.6 or higher. + * ssl_cert_hostname (string) — advanced option to specify an + alternate hostname which is expected in the server's SSL + certificate hostname field. Specify this if the name used to + connect to the server is known not to match the hostname in the + server's certificate; otherwise, getmail will error out with a + hostname mismatch. SimplePOP3Retriever diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/getmail-4.54.0/docs/documentation.html new/getmail-5.1/docs/documentation.html --- old/getmail-4.54.0/docs/documentation.html 2017-02-19 19:08:45.000000000 +0100 +++ new/getmail-5.1/docs/documentation.html 2017-07-16 05:26:23.000000000 +0200 @@ -3,10 +3,10 @@ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> <head> <meta http-equiv="content-type" content="application/xhtml+xml;charset=iso-8859-1" /> - <title>getmail documentation (version 4)</title> + <title>getmail documentation (version 5)</title> <meta name="author" content="Charles Cazabon" /> - <meta name="description" content="Official documentation for getmail version 4, an extensible mail-retrieval program with support for POP3, IMAP, SDPS, SSL, domain mailboxes, message filtering, and other features." /> - <meta name="keywords" content="getmail, getmail 4, POP3, IMAP, SSL, domain mailbox, multidrop, fetchmail replacement, message filtering, maildir, mboxrd, MDA" /> + <meta name="description" content="Official documentation for getmail version 5, an extensible mail-retrieval program with support for POP3, IMAP, SDPS, SSL, domain mailboxes, message filtering, and other features." /> + <meta name="keywords" content="getmail, getmail 5, getmail 4, POP3, IMAP, SSL, domain mailbox, multidrop, fetchmail replacement, message filtering, maildir, mboxrd, MDA" /> <link rel="Contents Up Index" title="Charles Cazabon's Software" href="../" /> <style type="text/css" media="all">@import "getmaildocs.css";</style> <style type="text/css" media="all">@import "/style/styles.css";</style> @@ -16,7 +16,7 @@ <h1 id="title">getmail documentation</h1> <p class="introduction"> - This is the documentation for getmail version 4. Version 4 includes + This is the documentation for getmail version 5. Version 5 includes numerous changes from version 3.x; if you are using getmail version 3, please refer to the documentation included with that version of the software. @@ -34,7 +34,7 @@ <h1 id="toc">Table of Contents</h1> <ul> - <li><a href="documentation.html">getmail documentation</a></li> + <li><a href="documentation.html">getmail documentation (version 5)</a></li> <li> <ul> <li><a href="documentation.html#title">getmail documentation</a></li> @@ -90,7 +90,7 @@ </li> </ul> </li> - <li><a href="configuration.html">getmail configuration</a></li> + <li><a href="configuration.html">getmail configuration (version 5)</a></li> <li> <ul> <li><a href="configuration.html#configuring">Configuring getmail</a></li> @@ -109,7 +109,7 @@ </li> </ul> </li> - <li><a href="troubleshooting.html">getmail troubleshooting</a></li> + <li><a href="troubleshooting.html">getmail troubleshooting (version 5)</a></li> <li> <ul> <li><a href="troubleshooting.html#troubleshooting">Troubleshooting problems</a></li> @@ -122,7 +122,7 @@ </li> </ul> </li> - <li><a href="faq.html">getmail frequently-asked questions (FAQs)</a></li> + <li><a href="faq.html">getmail frequently-asked questions (FAQs) (version 5)</a></li> <li> <ul> <li><a href="faq.html#faq">Frequently-Asked Questions (FAQs)</a></li> @@ -150,7 +150,7 @@ retrievers such as fetchmail. </p> <p> - getmail version 4 includes the following features: + getmail version 5 includes the following features: </p> <ul> <li> @@ -216,7 +216,7 @@ types can be easily added </li> <li> - cross-platform operation; getmail 4 should work on Unix/Linux, + cross-platform operation; getmail 5 should work on Unix/Linux, Macintosh, and other platforms. Windows support available under the free <a href="http://cygwin.com/">Cygwin</a> package. </li> @@ -232,7 +232,7 @@ <h2 id="v4differences">Differences from previous versions</h2> <p> - getmail version 4 has been completely rewritten. It is designed to closely + getmail version 4/5 has been completely rewritten. It is designed to closely mimic the interface and user experience of getmail version 3, but the new architecture necessitates some differences you will notice: </p> @@ -272,7 +272,7 @@ <h2 id="requirements">Requirements</h2> <p> - getmail version 4 requires + getmail version 5 requires <a href="http://www.python.org/">Python</a> version 2.3.3 or later. If you have only an earlier version of Python available, you can install the latest version without disturbing your @@ -293,17 +293,17 @@ make install </pre> <p> - Since the above was written, Python 2.4 has been released. getmail 4 + Since the above was written, Python 2.4 has been released. getmail 5 will work with that version of Python as well. </p> <p> - getmail 4 also requires that servers uniquely identify the messages + getmail 5 also requires that servers uniquely identify the messages they provide (via the <span class="file">UIDL</span> command) to getmail for full functionality. Certain very old or broken POP3 servers may not be capable of this (I have had only one report of such problems from among the tens of thousands of people who have downloaded - getmail 4 from my website and from other archives), or may not implement + getmail 5 from my website and from other archives), or may not implement the <span class="file">UIDL</span> command at all, and limited support is available for such servers via the @@ -317,7 +317,7 @@ <h2 id="obtaining">Obtaining getmail</h2> <p> - Download getmail 4 from the official website main page at + Download getmail 5 from the official website main page at <a href="http://pyropus.ca/software/getmail/#download">http://pyropus.ca/software/getmail/</a> . </p> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/getmail-4.54.0/docs/documentation.txt new/getmail-5.1/docs/documentation.txt --- old/getmail-4.54.0/docs/documentation.txt 2017-02-19 19:08:46.000000000 +0100 +++ new/getmail-5.1/docs/documentation.txt 2017-07-16 05:26:24.000000000 +0200 @@ -1,6 +1,6 @@ getmail documentation - This is the documentation for getmail version 4. Version 4 includes + This is the documentation for getmail version 5. Version 5 includes numerous changes from version 3.x; if you are using getmail version 3, please refer to the documentation included with that version of the software. @@ -14,7 +14,7 @@ Table of Contents - * getmail documentation + * getmail documentation (version 5) * + getmail documentation + @@ -52,7 +52,7 @@ @ How to post @ Archives of the getmail announcements mailing list - * getmail configuration + * getmail configuration (version 5) * + Configuring getmail + @@ -62,14 +62,14 @@ o Commandline options o Using getmail as an MDA o Using getmail_fetch to retrieve mail from scripts - * getmail troubleshooting + * getmail troubleshooting (version 5) * + Troubleshooting problems + o Error messages o Warning messages o Unexpected Behaviour - * getmail frequently-asked questions (FAQs) + * getmail frequently-asked questions (FAQs) (version 5) * + Frequently-Asked Questions (FAQs) + @@ -87,7 +87,7 @@ flexible, reliable, and easy-to-use. getmail is designed to replace other mail retrievers such as fetchmail. - getmail version 4 includes the following features: + getmail version 5 includes the following features: * simple to install, configure, and use * retrieve virtually any mail + support for accessing mailboxes with the following protocols: @@ -117,7 +117,7 @@ + a flexible, extensible architecture so that support for new mail access protocols, message filtering operations, or destination types can be easily added - + cross-platform operation; getmail 4 should work on Unix/Linux, + + cross-platform operation; getmail 5 should work on Unix/Linux, Macintosh, and other platforms. Windows support available under the free Cygwin package. * winner of various software awards, including DaveCentral's "Best of @@ -125,7 +125,7 @@ Differences from previous versions - getmail version 4 has been completely rewritten. It is designed to + getmail version 4/5 has been completely rewritten. It is designed to closely mimic the interface and user experience of getmail version 3, but the new architecture necessitates some differences you will notice: * the getmail rc file (configuration file) format has changed. If you @@ -151,7 +151,7 @@ Requirements - getmail version 4 requires Python version 2.3.3 or later. If you have + getmail version 5 requires Python version 2.3.3 or later. If you have only an earlier version of Python available, you can install the latest version without disturbing your current version, or use getmail version 3, which requires only Python version 1.5.2 or later. @@ -166,14 +166,14 @@ make make install - Since the above was written, Python 2.4 has been released. getmail 4 + Since the above was written, Python 2.4 has been released. getmail 5 will work with that version of Python as well. - getmail 4 also requires that servers uniquely identify the messages + getmail 5 also requires that servers uniquely identify the messages they provide (via the UIDL command) to getmail for full functionality. Certain very old or broken POP3 servers may not be capable of this (I have had only one report of such problems from among the tens of - thousands of people who have downloaded getmail 4 from my website and + thousands of people who have downloaded getmail 5 from my website and from other archives), or may not implement the UIDL command at all, and limited support is available for such servers via the BrokenUIDLPOP3Retriever and BrokenUIDLPOP3SSLRetriever retriever @@ -181,7 +181,7 @@ Obtaining getmail - Download getmail 4 from the official website main page at + Download getmail 5 from the official website main page at http://pyropus.ca/software/getmail/ . Installing getmail diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/getmail-4.54.0/docs/faq.html new/getmail-5.1/docs/faq.html --- old/getmail-4.54.0/docs/faq.html 2017-02-19 19:08:45.000000000 +0100 +++ new/getmail-5.1/docs/faq.html 2017-07-16 05:26:23.000000000 +0200 @@ -3,10 +3,10 @@ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> <head> <meta http-equiv="content-type" content="application/xhtml+xml;charset=iso-8859-1" /> - <title>getmail frequently-asked questions (FAQs) (version 4)</title> + <title>getmail frequently-asked questions (FAQs) (version 5)</title> <meta name="author" content="Charles Cazabon" /> - <meta name="description" content="Frequently-asked questions about getmail version 4" /> - <meta name="keywords" content="getmail FAQ, getmail 4 FAQ, POP3, IMAP, SSL, domain mailbox, multidrop, fetchmail replacement, message filtering, maildir, mboxrd, MDA" /> + <meta name="description" content="Frequently-asked questions about getmail version 5" /> + <meta name="keywords" content="getmail FAQ, getmail 5 FAQ, getmail 4 FAQ, POP3, IMAP, SSL, domain mailbox, multidrop, fetchmail replacement, message filtering, maildir, mboxrd, MDA" /> <link rel="Contents Up Index" title="Charles Cazabon's Software" href="../" /> <style type="text/css" media="all">@import "getmaildocs.css";</style> <style type="text/css" media="all">@import "/style/styles.css";</style> @@ -16,7 +16,7 @@ <!----><h1 id="title">getmail documentation</h1> <p class="introduction"> - This is the documentation for getmail version 4. Version 4 includes + This is the documentation for getmail version 5. Version 5 includes numerous changes from version 3.x; if you are using getmail version 3, please refer to the documentation included with that version of the software. @@ -33,7 +33,7 @@ <h1 id="toc">Table of Contents</h1> <ul> - <li><a href="documentation.html">getmail documentation</a></li> + <li><a href="documentation.html">getmail documentation (version 5)</a></li> <li> <ul> <li><a href="documentation.html#title">getmail documentation</a></li> @@ -49,7 +49,7 @@ </li> </ul> </li> - <li><a href="configuration.html">getmail configuration</a></li> + <li><a href="configuration.html">getmail configuration (version 5)</a></li> <li> <ul> <li><a href="configuration.html#configuring">Configuring getmail</a></li> @@ -68,7 +68,7 @@ </li> </ul> </li> - <li><a href="troubleshooting.html">getmail troubleshooting</a></li> + <li><a href="troubleshooting.html">getmail troubleshooting (version 5)</a></li> <li> <ul> <li><a href="troubleshooting.html#troubleshooting">Troubleshooting problems</a></li> @@ -81,7 +81,7 @@ </li> </ul> </li> - <li><a href="faq.html">getmail frequently-asked questions (FAQs)</a></li> + <li><a href="faq.html">getmail frequently-asked questions (FAQs) (version 5)</a></li> <li> <ul> <li><a href="faq.html#faq">Frequently-Asked Questions (FAQs)</a></li> @@ -107,7 +107,7 @@ <li><a href="faq.html#faq-about-spam">Does getmail support spam filtering of retrieved messages?</a></li> <li><a href="faq.html#faq-about-ssl">Does getmail support SSL?</a></li> <li><a href="faq.html#faq-about-rewrite">Does getmail rewrite mail headers when it retrieves mail?</a></li> - <li><a href="faq.html#faq-about-upgrade">Can I upgrade from getmail 3 to getmail 4? What about my "oldmail" files?</a></li> + <li><a href="faq.html#faq-about-upgrade">Can I upgrade from getmail 3 to getmail 4/5? What about my "oldmail" files?</a></li> <li><a href="faq.html#faq-about-why">Why did you write getmail? Why not just use fetchmail?</a></li> </ul> </li> @@ -406,14 +406,14 @@ creation of these header fields. </p> -<h3 id="faq-about-upgrade">Can I upgrade from getmail 3 to getmail 4? What about my "oldmail" files?</h3> +<h3 id="faq-about-upgrade">Can I upgrade from getmail 3 to getmail 4/5? What about my "oldmail" files?</h3> <p> - Yes. getmail version 4 uses exactly the same + Yes. getmail version 4/5 uses exactly the same <span class="file">oldmail-<span class="meta">server</span>-<span class="meta">port</span>-<span class="meta">username</span></span> naming convention for its oldmail files. The only difference is that - version 4 escapes a couple of additional characters in this string so that + version 4/5 escapes a couple of additional characters in this string so that it is truly cross-platform compatible. If you upgrade from version 3 to - version 4, getmail will still remember which messages you've already + version 4/5, getmail will still remember which messages you've already retrieved. </p> <p> @@ -454,7 +454,7 @@ <li> If you were retrieving messages from multiple mail accounts in a single version 3 getmail rc file, split them up into one account per - version 4 rc file. + version 5 rc file. </li> </ol> <p> @@ -1116,21 +1116,35 @@ <h3 id="faq-how-daemon">How do I run getmail in "daemon" mode?</h3> <p> - Use your system's cron utility to run getmail periodically if you wish to - have mail retrieved automatically at intervals. This is precisely what cron - is designed to do; there's no need to add special code to getmail to do - this. + getmail does not have, and does not need, any special "daemon mode". + You just run getmail under whatever process-supervision or periodic-job + system you already have on your system. </p> <p> - With a reasonably standard system - <span class="file">cron</span> - utility, a - <span class="file">crontab(5)</span> - entry like the following will make getmail retrieve mail every hour: + For example, if you use daemontools/svscan/supervise, you can configure a getmail + "service" using a simple run script like: </p> <pre class="example"> -0 * * * * /usr/local/bin/getmail --quiet +#!/bin/sh + +/path/to/getmail [options] +sleep 1800 </pre> +<p> + That example would run getmail continuously, sleeping for 30 minutes between + runs. You can probably work out similar scripts for other process-supervision + systems. +</p> +<p> + If you don't have such a system, you can use your system's cron utility to run getmail + periodically, but you absolutely have to prevent multiple copies of getmail from being + run by cron simultaneously. Most versions of cron have no protection for this built-in, + so you have to use setlock or flock or a similar utility to prevent it. For more + details, see <a href="#faq-how-to-mutex">How do I stop multiple instances of getmail from running at the same time?</a> + below. <b>If you do not prevent multiple copies of getmail running against the same server + (and IMAP folder) simultaneously, you will get odd behaviour, including retrieving + the same messages multiple times.</b> +</p> <h3 id="faq-how-maxpersession">How do I make getmail stop after retrieving X messages so that the server actually flushes deleted messages?</h3> <p> @@ -1637,7 +1651,7 @@ <p> Various people have reported this "bug" in getmail — it's actually a bug in some versions of Python 2.3.X. It was fixed in Python - version 2.3.3. getmail 4 detects problematic versions of Python and refuses + version 2.3.3. getmail 5 detects problematic versions of Python and refuses to run, but you can still encounter this problem with getmail version 3 if you try to run it with a broken Python version. </p> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/getmail-4.54.0/docs/faq.txt new/getmail-5.1/docs/faq.txt --- old/getmail-4.54.0/docs/faq.txt 2017-02-19 19:08:46.000000000 +0100 +++ new/getmail-5.1/docs/faq.txt 2017-07-16 05:26:24.000000000 +0200 @@ -1,6 +1,6 @@ getmail documentation - This is the documentation for getmail version 4. Version 4 includes + This is the documentation for getmail version 5. Version 5 includes numerous changes from version 3.x; if you are using getmail version 3, please refer to the documentation included with that version of the software. @@ -13,7 +13,7 @@ Table of Contents - * getmail documentation + * getmail documentation (version 5) * + getmail documentation + @@ -23,7 +23,7 @@ o Obtaining getmail o Installing getmail o getmail mailing lists - * getmail configuration + * getmail configuration (version 5) * + Configuring getmail + @@ -33,14 +33,14 @@ o Commandline options o Using getmail as an MDA o Using getmail_fetch to retrieve mail from scripts - * getmail troubleshooting + * getmail troubleshooting (version 5) * + Troubleshooting problems + o Error messages o Warning messages o Unexpected Behaviour - * getmail frequently-asked questions (FAQs) + * getmail frequently-asked questions (FAQs) (version 5) * + Frequently-Asked Questions (FAQs) + @@ -64,7 +64,7 @@ # Does getmail support SSL? # Does getmail rewrite mail headers when it retrieves mail? - # Can I upgrade from getmail 3 to getmail 4? What + # Can I upgrade from getmail 3 to getmail 4/5? What about my "oldmail" files? # Why did you write getmail? Why not just use fetchmail? @@ -298,13 +298,13 @@ but does not rewrite existing headers. You can disable the creation of these header fields. -Can I upgrade from getmail 3 to getmail 4? What about my "oldmail" files? +Can I upgrade from getmail 3 to getmail 4/5? What about my "oldmail" files? - Yes. getmail version 4 uses exactly the same + Yes. getmail version 4/5 uses exactly the same oldmail-server-port-username naming convention for its oldmail files. - The only difference is that version 4 escapes a couple of additional + The only difference is that version 4/5 escapes a couple of additional characters in this string so that it is truly cross-platform - compatible. If you upgrade from version 3 to version 4, getmail will + compatible. If you upgrade from version 3 to version 4/5, getmail will still remember which messages you've already retrieved. To upgrade, do the following: @@ -320,7 +320,7 @@ MDA_external, or type = MultiSorter destination as appropriate. 5. If you were retrieving messages from multiple mail accounts in a single version 3 getmail rc file, split them up into one account - per version 4 rc file. + per version 5 rc file. That's it. @@ -766,14 +766,31 @@ How do I run getmail in "daemon" mode? - Use your system's cron utility to run getmail periodically if you wish - to have mail retrieved automatically at intervals. This is precisely - what cron is designed to do; there's no need to add special code to - getmail to do this. - - With a reasonably standard system cron utility, a crontab(5) entry like - the following will make getmail retrieve mail every hour: -0 * * * * /usr/local/bin/getmail --quiet + getmail does not have, and does not need, any special "daemon mode". + You just run getmail under whatever process-supervision or periodic-job + system you already have on your system. + + For example, if you use daemontools/svscan/supervise, you can configure + a getmail "service" using a simple run script like: +#!/bin/sh + +/path/to/getmail [options] +sleep 1800 + + That example would run getmail continuously, sleeping for 30 minutes + between runs. You can probably work out similar scripts for other + process-supervision systems. + + If you don't have such a system, you can use your system's cron utility + to run getmail periodically, but you absolutely have to prevent + multiple copies of getmail from being run by cron simultaneously. Most + versions of cron have no protection for this built-in, so you have to + use setlock or flock or a similar utility to prevent it. For more + details, see How do I stop multiple instances of getmail from running + at the same time? below. If you do not prevent multiple copies of + getmail running against the same server (and IMAP folder) + simultaneously, you will get odd behaviour, including retrieving the + same messages multiple times. How do I make getmail stop after retrieving X messages so that the server actually flushes deleted messages? @@ -1099,7 +1116,7 @@ Various people have reported this "bug" in getmail — it's actually a bug in some versions of Python 2.3.X. It was fixed in Python version - 2.3.3. getmail 4 detects problematic versions of Python and refuses to + 2.3.3. getmail 5 detects problematic versions of Python and refuses to run, but you can still encounter this problem with getmail version 3 if you try to run it with a broken Python version. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/getmail-4.54.0/docs/getmail.1 new/getmail-5.1/docs/getmail.1 --- old/getmail-4.54.0/docs/getmail.1 2013-08-26 05:00:20.000000000 +0200 +++ new/getmail-5.1/docs/getmail.1 2017-07-15 23:58:46.000000000 +0200 @@ -1,4 +1,4 @@ -.TH getmail "1" "August 2004" "getmail 4" "User Commands" +.TH getmail "1" "August 2004" "getmail 5" "User Commands" .SH NAME getmail \- retrieve messages from one or more POP3, IMAP4, or SDPS mailboxes and deliver to a maildir, mboxrd-format mbox file, or external MDA .SH SYNOPSIS diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/getmail-4.54.0/docs/getmail_fetch.1 new/getmail-5.1/docs/getmail_fetch.1 --- old/getmail-4.54.0/docs/getmail_fetch.1 2009-08-07 00:20:44.000000000 +0200 +++ new/getmail-5.1/docs/getmail_fetch.1 2017-07-15 23:58:46.000000000 +0200 @@ -1,4 +1,4 @@ -.TH getmail_fetch "1" "November 2005" "getmail 4" "User Commands" +.TH getmail_fetch "1" "November 2005" "getmail 5" "User Commands" .SH NAME getmail_fetch \- retrieve messages from one or more POP3 or POP3-over-SSL mailboxes and deliver to a maildir, mboxrd-format mbox file, or external MDA .SH SYNOPSIS diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/getmail-4.54.0/docs/getmail_maildir.1 new/getmail-5.1/docs/getmail_maildir.1 --- old/getmail-4.54.0/docs/getmail_maildir.1 2009-08-07 00:20:44.000000000 +0200 +++ new/getmail-5.1/docs/getmail_maildir.1 2017-07-15 23:58:46.000000000 +0200 @@ -1,4 +1,4 @@ -.TH getmail_maildir "1" "July 2004" "getmail 4" "User Commands" +.TH getmail_maildir "1" "July 2004" "getmail 5" "User Commands" .SH NAME getmail_maildir \- read a message from stdin and deliver to a named maildir .SH SYNOPSIS diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/getmail-4.54.0/docs/getmail_mbox.1 new/getmail-5.1/docs/getmail_mbox.1 --- old/getmail-4.54.0/docs/getmail_mbox.1 2009-08-07 00:20:44.000000000 +0200 +++ new/getmail-5.1/docs/getmail_mbox.1 2017-07-15 23:58:46.000000000 +0200 @@ -1,4 +1,4 @@ -.TH getmail_mbox "1" "July 2004" "getmail 4" "User Commands" +.TH getmail_mbox "1" "July 2004" "getmail 5" "User Commands" .SH NAME getmail_mbox \- read a message from stdin and deliver to a named mboxrd-format mbox file with fcntl-style locking. .SH SYNOPSIS diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/getmail-4.54.0/docs/troubleshooting.html new/getmail-5.1/docs/troubleshooting.html --- old/getmail-4.54.0/docs/troubleshooting.html 2017-02-19 19:08:45.000000000 +0100 +++ new/getmail-5.1/docs/troubleshooting.html 2017-07-16 05:26:23.000000000 +0200 @@ -3,10 +3,10 @@ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> <head> <meta http-equiv="content-type" content="application/xhtml+xml;charset=iso-8859-1" /> - <title>getmail troubleshooting (version 4)</title> + <title>getmail troubleshooting (version 5)</title> <meta name="author" content="Charles Cazabon" /> - <meta name="description" content="Troubleshooting instructions for getmail version 4" /> - <meta name="keywords" content="getmail troubleshooting, getmail 4 troubleshooting, POP3, IMAP, SSL, domain mailbox, multidrop, fetchmail replacement, message filtering, maildir, mboxrd, MDA" /> + <meta name="description" content="Troubleshooting instructions for getmail version 5" /> + <meta name="keywords" content="getmail troubleshooting, getmail 5 troubleshooting, getmail 4 troubleshooting, POP3, IMAP, SSL, domain mailbox, multidrop, fetchmail replacement, message filtering, maildir, mboxrd, MDA" /> <link rel="Contents Up Index" title="Charles Cazabon's Software" href="../" /> <style type="text/css" media="all">@import "getmaildocs.css";</style> <style type="text/css" media="all">@import "/style/styles.css";</style> @@ -16,7 +16,7 @@ <!----><h1 id="title">getmail documentation</h1> <p class="introduction"> - This is the documentation for getmail version 4. Version 4 includes + This is the documentation for getmail version 5. Version 5 includes numerous changes from version 3.x; if you are using getmail version 3, please refer to the documentation included with that version of the software. @@ -33,7 +33,7 @@ <h1 id="toc">Table of Contents</h1> <ul> - <li><a href="documentation.html">getmail documentation</a></li> + <li><a href="documentation.html">getmail documentation (version 5)</a></li> <li> <ul> <li><a href="documentation.html#title">getmail documentation</a></li> @@ -49,7 +49,7 @@ </li> </ul> </li> - <li><a href="configuration.html">getmail configuration</a></li> + <li><a href="configuration.html">getmail configuration (version 5)</a></li> <li> <ul> <li><a href="configuration.html#configuring">Configuring getmail</a></li> @@ -68,7 +68,7 @@ </li> </ul> </li> - <li><a href="troubleshooting.html">getmail troubleshooting</a></li> + <li><a href="troubleshooting.html">getmail troubleshooting (version 5)</a></li> <li> <ul> <li><a href="troubleshooting.html#troubleshooting">Troubleshooting problems</a></li> @@ -77,7 +77,7 @@ <li><a href="troubleshooting.html#error-messages">Error messages</a></li> <li> <ul> - <li><a href="troubleshooting.html#errmsg-pyversion">ImportError: getmail version 4 requires Python version 2.3.3 or later</a></li> + <li><a href="troubleshooting.html#errmsg-pyversion">ImportError: getmail version 5 requires Python version 2.3.3 or later</a></li> <li><a href="troubleshooting.html#errmsg-config">Configuration error: …</a></li> <li> <ul> @@ -144,7 +144,7 @@ </li> </ul> </li> - <li><a href="faq.html">getmail frequently-asked questions (FAQs)</a></li> + <li><a href="faq.html">getmail frequently-asked questions (FAQs) (version 5)</a></li> <li> <ul> <li><a href="faq.html#faq">Frequently-Asked Questions (FAQs)</a></li> @@ -163,9 +163,7 @@ <h1 id="troubleshooting">Troubleshooting problems</h1> <p> - This section of the documentation is to be added to as getmail version 4 - progresses through beta testing to release state. If you have - suggestions for additions or changes to this documentation, please + If you have suggestions for additions or changes to this documentation, please send them to the mailing list or me. </p> @@ -177,9 +175,9 @@ </p> <!-- ********************************************************************** --> -<h3 id="errmsg-pyversion" class="errmsg">ImportError: getmail version 4 requires Python version 2.3.3 or later</h3> +<h3 id="errmsg-pyversion" class="errmsg">ImportError: getmail version 5 requires Python version 2.3.3 or later</h3> <p> - You tried to run getmail 4 with a version of Python prior to Python 2.3.3. + You tried to run getmail 5 with a version of Python prior to Python 2.3.3. This is unsupported. If you cannot install a newer Python alongside your current version, please use getmail version 3, which supports Python 1.5.2 and later. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/getmail-4.54.0/docs/troubleshooting.txt new/getmail-5.1/docs/troubleshooting.txt --- old/getmail-4.54.0/docs/troubleshooting.txt 2017-02-19 19:08:45.000000000 +0100 +++ new/getmail-5.1/docs/troubleshooting.txt 2017-07-16 05:26:24.000000000 +0200 @@ -2,7 +2,7 @@ getmail documentation - This is the documentation for getmail version 4. Version 4 includes + This is the documentation for getmail version 5. Version 5 includes numerous changes from version 3.x; if you are using getmail version 3, please refer to the documentation included with that version of the software. @@ -15,19 +15,17 @@ Troubleshooting problems - This section of the documentation is to be added to as getmail version 4 - progresses through beta testing to release state. If you have suggestions - for additions or changes to this documentation, please send them to the - mailing list or me. + If you have suggestions for additions or changes to this documentation, + please send them to the mailing list or me. Error messages getmail may output various diagnostic error messages. The common ones and their meanings are given below. - ImportError: getmail version 4 requires Python version 2.3.3 or later + ImportError: getmail version 5 requires Python version 2.3.3 or later - You tried to run getmail 4 with a version of Python prior to Python 2.3.3. + You tried to run getmail 5 with a version of Python prior to Python 2.3.3. This is unsupported. If you cannot install a newer Python alongside your current version, please use getmail version 3, which supports Python 1.5.2 and later. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/getmail-4.54.0/getmail new/getmail-5.1/getmail --- old/getmail-4.54.0/getmail 2016-09-11 17:30:41.000000000 +0200 +++ new/getmail-5.1/getmail 2017-07-15 23:58:46.000000000 +0200 @@ -3,7 +3,7 @@ import sys if sys.hexversion < 0x2030300: - raise ImportError('getmail version 4 requires Python version 2.3.3 ' + raise ImportError('getmail version 5 requires Python version 2.3.3 ' 'or later') import os.path @@ -59,7 +59,7 @@ logging from getmailcore.exceptions import * from getmailcore.utilities import eval_bool, logfile, format_params, \ - address_no_brackets, expand_user_vars, get_password + address_no_brackets, expand_user_vars, get_password, run_command except ImportError, o: sys.stderr.write('ImportError: %s\n' % o) sys.exit(127) @@ -434,6 +434,12 @@ # The newline is to clear the ^C shown in terminal log.info('\n') pass + except socket.error, o: + if o.errno != errno.ECONNRESET: + # Something unexpected happened + raise + #pass + # Just exit after a reset connection. retriever.quit() except getmailOperationError, o: @@ -724,14 +730,31 @@ if gnomekeyring and options.store_gnome_keyring: # Need to get the password first, if the user hasn't put # it in the rc file. - if retriever.conf.get('password', None) is None: + if retriever.conf.get('password', None) is not None: + password = retriever.conf['password'] + elif retriever.conf.get('password_command', None): + # Retrieve from an arbitrary external command + command = retriever.conf['password_command'][0] + args = retriever.conf['password_command'][1:] + (rc, stdout, stderr) = run_command(command, args) + if stderr: + log.warn( + 'External password program "%s" wrote to stderr: %s', + command, stderr + ) + if rc: + # program exited nonzero + raise getmailOperationError( + 'External password program error (exited %d)' % rc + ) + else: + password = stdout + else: password = get_password( str(retriever), retriever.conf['username'], retriever.conf['server'], retriever.received_with, log ) - else: - password = retriever.conf['password'] gnomekeyring.set_network_password_sync( # keyring=None, user, domain=None, server, object=None, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/getmail-4.54.0/getmail.spec new/getmail-5.1/getmail.spec --- old/getmail-4.54.0/getmail.spec 2017-02-19 19:08:46.000000000 +0100 +++ new/getmail-5.1/getmail.spec 2017-07-16 05:26:24.000000000 +0200 @@ -2,7 +2,7 @@ Summary: POP3 mail retriever with reliable Maildir delivery Name: getmail -Version: 4.54.0 +Version: 5.1 Release: 1 License: GPL Group: Applications/Internet @@ -52,6 +52,15 @@ %{python_sitelib}/getmailcore/ %changelog +* Sat Jul 15 2017 Charles Cazabon <[email protected]> +-update to version 5.1 + +* Sat Jul 15 2017 Charles Cazabon <[email protected]> +-update to version 5.0 + +* Sat Jul 15 2017 Charles Cazabon <[email protected]> +-update to version 5.0 + * Sun Feb 19 2017 Charles Cazabon <[email protected]> -update to version 4.54.0 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/getmail-4.54.0/getmail_fetch new/getmail-5.1/getmail_fetch --- old/getmail-4.54.0/getmail_fetch 2017-02-19 19:08:34.000000000 +0100 +++ new/getmail-5.1/getmail_fetch 2017-07-15 23:58:46.000000000 +0200 @@ -3,7 +3,7 @@ import sys if sys.hexversion < 0x2030300: - raise ImportError('getmail version 4 requires Python version 2.3.3 ' + raise ImportError('getmail version 5 requires Python version 2.3.3 ' 'or later') import os diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/getmail-4.54.0/getmail_maildir new/getmail-5.1/getmail_maildir --- old/getmail-4.54.0/getmail_maildir 2012-06-20 05:44:15.000000000 +0200 +++ new/getmail-5.1/getmail_maildir 2017-07-15 23:58:46.000000000 +0200 @@ -21,7 +21,7 @@ import sys if sys.hexversion < 0x2030300: - raise ImportError('getmail version 4 requires Python version 2.3.3 ' + raise ImportError('getmail version 5 requires Python version 2.3.3 ' 'or later') import os diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/getmail-4.54.0/getmail_mbox new/getmail-5.1/getmail_mbox --- old/getmail-4.54.0/getmail_mbox 2012-06-20 05:44:15.000000000 +0200 +++ new/getmail-5.1/getmail_mbox 2017-07-15 23:58:46.000000000 +0200 @@ -21,7 +21,7 @@ import sys if sys.hexversion < 0x2030300: - raise ImportError('getmail version 4 requires Python version 2.3.3 ' + raise ImportError('getmail version 5 requires Python version 2.3.3 ' 'or later') import os diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/getmail-4.54.0/getmailcore/__init__.py new/getmail-5.1/getmailcore/__init__.py --- old/getmail-4.54.0/getmailcore/__init__.py 2017-02-19 19:08:34.000000000 +0100 +++ new/getmail-5.1/getmailcore/__init__.py 2017-07-16 05:26:01.000000000 +0200 @@ -16,7 +16,7 @@ raise ImportError('getmail version 4 requires Python version 2.3.3' ' or later') -__version__ = '4.54.0' +__version__ = '5.1' __all__ = [ 'baseclasses', diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/getmail-4.54.0/getmailcore/_retrieverbases.py new/getmail-5.1/getmailcore/_retrieverbases.py --- old/getmail-4.54.0/getmailcore/_retrieverbases.py 2017-02-19 19:08:34.000000000 +0100 +++ new/getmail-5.1/getmailcore/_retrieverbases.py 2017-07-15 23:37:25.000000000 +0200 @@ -399,8 +399,11 @@ # Ensure cert is for server we're connecting to if ssl and self.conf['ca_certs']: - ssl_match_hostname(self.conn.sslobj.getpeercert(), - self.conf['server']) + ssl_match_hostname( + self.conn.sslobj.getpeercert(), + self.conf.get('ssl_cert_hostname', None) + or self.conf['server'] + ) if ssl_fingerprints: if not actual_hash: @@ -634,8 +637,11 @@ # Ensure cert is for server we're connecting to if ssl and self.conf['ca_certs']: - ssl_match_hostname(self.conn.ssl().getpeercert(), - self.conf['server']) + ssl_match_hostname( + self.conn.ssl().getpeercert(), + self.conf.get('ssl_cert_hostname', None) + or self.conf['server'] + ) if ssl_fingerprints: if not actual_hash: @@ -1110,10 +1116,28 @@ self.mailboxes = (None, ) # Handle password if self.conf.get('password', None) is None: - self.conf['password'] = get_password( - self, self.conf['username'], self.conf['server'], - self.received_with, self.log - ) + if self.conf.get('password_command', None): + # Retrieve from an arbitrary external command + command = self.conf['password_command'][0] + args = self.conf['password_command'][1:] + (rc, stdout, stderr) = run_command(command, args) + if stderr: + self.log.warn( + 'External password program "%s" wrote to stderr: %s', + command, stderr + ) + if rc: + # program exited nonzero + raise getmailOperationError( + 'External password program error (exited %d)' % rc + ) + else: + self.conf['password'] = stdout + else: + self.conf['password'] = get_password( + self, self.conf['username'], self.conf['server'], + self.received_with, self.log + ) RetrieverSkeleton.initialize(self, options) try: self._connect() @@ -1183,7 +1207,8 @@ if self.envrecipname in NOT_ENVELOPE_RECIPIENT_HEADERS: raise getmailConfigurationError( 'the %s header field does not record the envelope ' - 'recipient address' + 'recipient address' + % self.envrecipname ) self.envrecipnum = 0 try: @@ -1588,7 +1613,7 @@ self.log.warning('Could not fetch google imap extensions: %s' % o) return {} - if not response: + if not response or not response[0]: return {} ext = re.search( @@ -1633,10 +1658,28 @@ # Handle password if (self.conf.get('password', None) is None and not (HAVE_KERBEROS_GSS and self.conf['use_kerberos'])): - self.conf['password'] = get_password( - self, self.conf['username'], self.conf['server'], - self.received_with, self.log - ) + if self.conf['password_command']: + # Retrieve from an arbitrary external command + command = self.conf['password_command'][0] + args = self.conf['password_command'][1:] + (rc, stdout, stderr) = run_command(command, args) + if stderr: + self.log.warn( + 'External password program "%s" wrote to stderr: %s', + command, stderr + ) + if rc: + # program exited nonzero + raise getmailOperationError( + 'External password program error (exited %d)' % rc + ) + else: + self.conf['password'] = stdout + else: + self.conf['password'] = get_password( + self, self.conf['username'], self.conf['server'], + self.received_with, self.log + ) RetrieverSkeleton.initialize(self, options) try: @@ -1814,7 +1857,8 @@ if self.envrecipname in NOT_ENVELOPE_RECIPIENT_HEADERS: raise getmailConfigurationError( 'the %s header field does not record the envelope recipient ' - 'address' + 'address' + % self.envrecipname ) self.envrecipnum = 0 try: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/getmail-4.54.0/getmailcore/retrievers.py new/getmail-5.1/getmailcore/retrievers.py --- old/getmail-4.54.0/getmailcore/retrievers.py 2016-10-22 18:46:10.000000000 +0200 +++ new/getmail-5.1/getmailcore/retrievers.py 2017-07-15 23:37:25.000000000 +0200 @@ -62,6 +62,7 @@ ConfInt(name='port', required=False, default=110), ConfString(name='username'), ConfPassword(name='password', required=False, default=None), + ConfTupleOfStrings(name='password_command', required=False, default=()), ConfBool(name='use_apop', required=False, default=False), ConfBool(name='delete_dup_msgids', required=False, default=False), ) @@ -95,6 +96,7 @@ ConfInt(name='port', required=False, default=POP3_ssl_port), ConfString(name='username'), ConfPassword(name='password', required=False, default=None), + ConfTupleOfStrings(name='password_command', required=False, default=()), ConfBool(name='use_apop', required=False, default=False), ConfBool(name='delete_dup_msgids', required=False, default=False), ConfFile(name='keyfile', required=False, default=None), @@ -103,6 +105,7 @@ ConfTupleOfStrings(name='ssl_fingerprints', required=False, default=()), ConfString(name='ssl_version', required=False, default=None), ConfString(name='ssl_ciphers', required=False, default=None), + ConfString(name='ssl_cert_hostname', required=False, default=None), ) received_from = None received_with = 'POP3-SSL' @@ -171,6 +174,7 @@ ConfInt(name='port', required=False, default=110), ConfString(name='username'), ConfPassword(name='password', required=False, default=None), + ConfTupleOfStrings(name='password_command', required=False, default=()), ConfBool(name='use_apop', required=False, default=False), ) received_with = 'POP3' @@ -201,6 +205,7 @@ ConfInt(name='port', required=False, default=POP3_ssl_port), ConfString(name='username'), ConfPassword(name='password', required=False, default=None), + ConfTupleOfStrings(name='password_command', required=False, default=()), ConfBool(name='use_apop', required=False, default=False), ConfFile(name='keyfile', required=False, default=None), ConfFile(name='certfile', required=False, default=None), @@ -208,6 +213,7 @@ ConfTupleOfStrings(name='ssl_fingerprints', required=False, default=()), ConfString(name='ssl_version', required=False, default=None), ConfString(name='ssl_ciphers', required=False, default=None), + ConfString(name='ssl_cert_hostname', required=False, default=None), ) received_with = 'POP3-SSL' @@ -237,6 +243,7 @@ ConfInt(name='port', required=False, default=110), ConfString(name='username'), ConfPassword(name='password', required=False, default=None), + ConfTupleOfStrings(name='password_command', required=False, default=()), ConfBool(name='use_apop', required=False, default=False), ConfString(name='envelope_recipient'), ) @@ -270,6 +277,7 @@ ConfInt(name='port', required=False, default=POP3_ssl_port), ConfString(name='username'), ConfPassword(name='password', required=False, default=None), + ConfTupleOfStrings(name='password_command', required=False, default=()), ConfBool(name='use_apop', required=False, default=False), ConfString(name='envelope_recipient'), ConfFile(name='keyfile', required=False, default=None), @@ -278,6 +286,7 @@ ConfTupleOfStrings(name='ssl_fingerprints', required=False, default=()), ConfString(name='ssl_version', required=False, default=None), ConfString(name='ssl_ciphers', required=False, default=None), + ConfString(name='ssl_cert_hostname', required=False, default=None), ) received_from = None received_with = 'POP3-SSL' @@ -316,6 +325,7 @@ ConfInt(name='port', required=False, default=110), ConfString(name='username'), ConfPassword(name='password', required=False, default=None), + ConfTupleOfStrings(name='password_command', required=False, default=()), # Demon apparently doesn't support APOP ConfBool(name='use_apop', required=False, default=False), ) @@ -368,6 +378,7 @@ ConfInt(name='port', required=False, default=imaplib.IMAP4_PORT), ConfString(name='username'), ConfPassword(name='password', required=False, default=None), + ConfTupleOfStrings(name='password_command', required=False, default=()), ConfTupleOfUnicode(name='mailboxes', required=False, default="('INBOX', )", allow_specials=('ALL',)), ConfBool(name='use_peek', required=False, default=True), @@ -409,6 +420,7 @@ ConfInt(name='port', required=False, default=imaplib.IMAP4_SSL_PORT), ConfString(name='username'), ConfPassword(name='password', required=False, default=None), + ConfTupleOfStrings(name='password_command', required=False, default=()), ConfTupleOfUnicode(name='mailboxes', required=False, default="('INBOX', )", allow_specials=('ALL',)), ConfBool(name='use_peek', required=False, default=True), @@ -423,6 +435,7 @@ # .authenticate(), so we can't do this yet (?). ConfBool(name='use_cram_md5', required=False, default=False), ConfBool(name='use_kerberos', required=False, default=False), + ConfString(name='ssl_cert_hostname', required=False, default=None), ) received_from = None received_with = 'IMAP4-SSL' @@ -454,6 +467,7 @@ ConfInt(name='port', required=False, default=imaplib.IMAP4_PORT), ConfString(name='username'), ConfPassword(name='password', required=False, default=None), + ConfTupleOfStrings(name='password_command', required=False, default=()), ConfTupleOfUnicode(name='mailboxes', required=False, default="('INBOX', )", allow_specials=('ALL',)), ConfBool(name='use_peek', required=False, default=True), @@ -496,6 +510,7 @@ ConfInt(name='port', required=False, default=imaplib.IMAP4_SSL_PORT), ConfString(name='username'), ConfPassword(name='password', required=False, default=None), + ConfTupleOfStrings(name='password_command', required=False, default=()), ConfTupleOfUnicode(name='mailboxes', required=False, default="('INBOX', )", allow_specials=('ALL',)), ConfBool(name='use_peek', required=False, default=True), @@ -511,6 +526,7 @@ ConfBool(name='use_cram_md5', required=False, default=False), ConfBool(name='use_kerberos', required=False, default=False), ConfString(name='envelope_recipient'), + ConfString(name='ssl_cert_hostname', required=False, default=None), ) received_from = None received_with = 'IMAP4-SSL' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/getmail-4.54.0/getmailcore/utilities.py new/getmail-5.1/getmailcore/utilities.py --- old/getmail-4.54.0/getmailcore/utilities.py 2016-09-11 17:30:41.000000000 +0200 +++ new/getmail-5.1/getmailcore/utilities.py 2017-07-16 05:26:01.000000000 +0200 @@ -27,6 +27,7 @@ 'uid_of_user', 'updatefile', 'get_password', + 'run_command', ] @@ -44,6 +45,12 @@ import getpass import commands import sys +import tempfile +import errno +try: + import subprocess +except ImportError, o: + subprocess = None # hashlib only present in python2.5, ssl in python2.6; used together # in SSL functionality below @@ -696,3 +703,42 @@ # no password found (or not on OSX), prompt in the usual way password = getpass.getpass('Enter password for %s: ' % label) return password + + +####################################### +def run_command(command, args): + # Simple subprocess wrapper for running a command and fetching its exit + # status and output/stderr. + if args is None: + args = [] + if type(args) == tuple: + args = list(args) + + # Programmer sanity checks + assert type(command) in (str, unicode), ( + 'command is %s (%s)' % (command, type(command)) + ) + assert type(args) == list, ( + 'args is %s (%s)' % (args, type(args)) + ) + for arg in args: + assert type(arg) in (str, unicode), 'arg is %s (%s)' % (arg, type(arg)) + + stdout = tempfile.TemporaryFile() + stderr = tempfile.TemporaryFile() + + cmd = [command] + args + + try: + p = subprocess.Popen(cmd, stdout=stdout, stderr=stderr) + except OSError, o: + if o.errno == errno.ENOENT: + # no such file, command not found + raise getmailConfigurationError('Program "%s" not found' % command) + #else: + raise + + rc = p.wait() + stdout.seek(0) + stderr.seek(0) + return (rc, stdout.read().strip(), stderr.read().strip())
