Commit 2e881eb6 authored by Matthias Andree's avatar Matthias Andree

Align with legacy_6x branch.

parent 057b7188
......@@ -17,11 +17,6 @@ The bullet points below mention a few useful hints for package(r)s:
- Fetchmail requires a somewhat recent OpenSSL v1.0.2.
- The fetchmailconf script has been renamed to fetchmailconf.py, automake will
install it into Python's top-level site-packages directory and byte-compile
it (so you need to package or remove fetchmailconf.pyc and fetchmailconf.pyo
as well).
- If you want to defeat Python byte-code compilation and would rather like to
install fetchmailconf.py yourself, you can add
......
......@@ -25,7 +25,6 @@ can check their finger prints or certificates in arbitrary ways
- virtual domain DOCUMENTATION (rewriting @example.com to
@virtual.example.com possible? Joost Roeleveld, thread "Fetchmail with
Postfix virtual users" around 2009-09-23 on [email protected]).
+ mandate minimum supported OpenSSL version 1.0.1
soon - SHOULD:
- support NIL and strings where they are alternatives to literals
......
......@@ -16,9 +16,6 @@ AC_CONFIG_LIBOBJ_DIR([.])
AC_CANONICAL_HOST
dnl keep this before stuff that runs the compiler!
AC_USE_SYSTEM_EXTENSIONS
dnl automake options are in Makefile.am
AC_PREREQ([2.69])
dnl 2.60 required for AC_USE_SYSTEM_EXTENSIONS
......@@ -43,13 +40,10 @@ if test "$ac_cv_prog_cc_c99" = "no" ; then
fi
AM_PROG_CC_C_O
AC_PROG_INSTALL
AM_PROG_LEX
AC_PROG_MAKE_SET
AC_PROG_CPP dnl Later checks need this.
AC_PROG_CPP_WERROR
AM_PROG_AR
AC_PROG_RANLIB
AC_PROG_YACC
dnl check for b0rked Solaris (and other shells) and find one that works
AC_MSG_CHECKING(for a working shell...)
......@@ -265,8 +259,7 @@ AM_CONDITIONAL(NTLM_ENABLE, test "$with_NTLM" = yes)
### use option --enable-SDPS to compile in the SDPS support
AC_ARG_ENABLE(SDPS,
[AS_HELP_STRING([--enable-SDPS],[compile in SDPS protocol
support])],
[AS_HELP_STRING([--enable-SDPS],[compile in SDPS protocol support])],
[with_SDPS=$enableval],
[with_SDPS=no])
if test "$with_SDPS" = yes ; then
......
......@@ -5,6 +5,7 @@
*/
#include "config.h"
#include "fetchmail.h"
#include <stdio.h>
#include <errno.h>
......@@ -26,7 +27,6 @@
#define SIGCHLD SIGCLD
#endif
#include "fetchmail.h"
#include "tunable.h"
static void
......
......@@ -3562,7 +3562,7 @@ Using A4 format reaches far more people than (formerly known as DIN A4,
from DIN&nbsp;476) format. Besides that, A4 paper <em>is</em> available in North
America.
For further information on the Letter-vs-A4 story, see:</p>
<ul><li><a href="http://www.cl.cam.ac.uk/~mgk25/iso-paper.html">Markus
<ul><li><a href="https://www.cl.cam.ac.uk/~mgk25/iso-paper.html">Markus
Kuhn: "International standard paper sizes"</a></li>
<li><a
href="http://betweenborders.com/wordsmithing/a4-vs-us-letter/">Brian
......
......@@ -285,7 +285,7 @@ class User:
self.sslkey = None # SSL key filename
self.sslcert = None # SSL certificate filename
self.sslproto = None # Force SSL?
self.sslcertck = 0 # Enable strict SSL cert checking
self.sslcertck = 1 # Enable strict SSL cert checking
self.sslcertpath = None # Path to trusted certificates
self.sslcommonname = None # SSL CommonName to expect
self.sslfingerprint = None # SSL key fingerprint to check
......@@ -333,13 +333,13 @@ class User:
def __repr__(self):
res = " "
res = res + "user " + `self.remote` + " there ";
res = res + "user " + repr(self.remote) + " there ";
if self.password:
res = res + "with password " + `self.password` + " "
res = res + "with password " + repr(self.password) + " "
if self.localnames:
res = res + "is"
for x in self.localnames:
res = res + " " + `x`
res = res + " " + repr(x)
res = res + " here"
if (self.keep != UserDefaults.keep
or self.flush != UserDefaults.flush
......@@ -379,35 +379,35 @@ class User:
if self.idle != UserDefaults.idle:
res = res + flag2str(self.idle, 'idle')
if self.limit != UserDefaults.limit:
res = res + " limit " + `self.limit`
res = res + " limit " + repr(self.limit)
if self.warnings != UserDefaults.warnings:
res = res + " warnings " + `self.warnings`
res = res + " warnings " + repr(self.warnings)
if self.fetchlimit != UserDefaults.fetchlimit:
res = res + " fetchlimit " + `self.fetchlimit`
res = res + " fetchlimit " + repr(self.fetchlimit)
if self.fetchsizelimit != UserDefaults.fetchsizelimit:
res = res + " fetchsizelimit " + `self.fetchsizelimit`
res = res + " fetchsizelimit " + repr(self.fetchsizelimit)
if self.fastuidl != UserDefaults.fastuidl:
res = res + " fastuidl " + `self.fastuidl`
res = res + " fastuidl " + repr(self.fastuidl)
if self.batchlimit != UserDefaults.batchlimit:
res = res + " batchlimit " + `self.batchlimit`
res = res + " batchlimit " + repr(self.batchlimit)
if self.ssl and self.ssl != UserDefaults.ssl:
res = res + flag2str(self.ssl, 'ssl')
if self.sslkey and self.sslkey != UserDefaults.sslkey:
res = res + " sslkey " + `self.sslkey`
res = res + " sslkey " + repr(self.sslkey)
if self.sslcert and self.sslcert != UserDefaults.sslcert:
res = res + " sslcert " + `self.sslcert`
res = res + " sslcert " + repr(self.sslcert)
if self.sslproto and self.sslproto != UserDefaults.sslproto:
res = res + " sslproto " + `self.sslproto`
res = res + " sslproto " + repr(self.sslproto)
if self.sslcertck and self.sslcertck != UserDefaults.sslcertck:
res = res + flag2str(self.sslcertck, 'sslcertck')
if self.sslcertpath and self.sslcertpath != UserDefaults.sslcertpath:
res = res + " sslcertpath " + `self.sslcertpath`
res = res + " sslcertpath " + repr(self.sslcertpath)
if self.sslcommonname and self.sslcommonname != UserDefaults.sslcommonname:
res = res + " sslcommonname " + `self.sslcommonname`
res = res + " sslcommonname " + repr(self.sslcommonname)
if self.sslfingerprint and self.sslfingerprint != UserDefaults.sslfingerprint:
res = res + " sslfingerprint " + `self.sslfingerprint`
res = res + " sslfingerprint " + repr(self.sslfingerprint)
if self.expunge != UserDefaults.expunge:
res = res + " expunge " + `self.expunge`
res = res + " expunge " + repr(self.expunge)
res = res + "\n"
trimmed = self.smtphunt;
if trimmed != [] and trimmed[len(trimmed) - 1] == "localhost":
......@@ -605,7 +605,7 @@ class ListEdit(Frame):
self.listwidget.insert('end', item)
if self.list != None: self.list.append(item)
if self.editor:
apply(self.editor, (item,))
self.editor(*(item,))
self.newval.set('')
def editItem(self):
......@@ -613,24 +613,24 @@ class ListEdit(Frame):
if not select:
helpwin(listboxhelp)
else:
index = select[0]
if index and self.editor:
index = int(select[0])
if self.editor:
label = self.listwidget.get(index);
if self.editor:
apply(self.editor, (label,))
self.editor(*(label,))
def deleteItem(self):
select = self.listwidget.curselection()
if not select:
helpwin(listboxhelp)
else:
index = string.atoi(select[0])
index = int(select[0])
label = self.listwidget.get(index);
self.listwidget.delete(index)
if self.list != None:
del self.list[index]
if self.deletor != None:
apply(self.deletor, (label,))
self.deletor(*(label,))
def ConfirmQuit(frame, context):
ans = Dialog(frame,
......@@ -918,15 +918,15 @@ class ConfigurationEdit(Frame, MyWidget):
# Pre-1.5.2 compatibility...
except os.error:
pass
oldumask = os.umask(077)
oldumask = os.umask(0o77)
fm = open(self.outfile, 'w')
os.umask(oldumask)
if fm:
# be paranoid
if fm != sys.stdout:
os.chmod(self.outfile, 0600)
os.chmod(self.outfile, 0o600)
fm.write("# Configuration created %s by fetchmailconf %s\n" % (time.ctime(time.time()), version))
fm.write(`self.configuration`)
fm.write(repr(self.configuration))
if self.outfile:
fm.close()
self.destruct()
......@@ -1135,7 +1135,7 @@ class ServerEdit(Frame, MyWidget):
self.subwidgets[username] = UserEdit(username, self).edit(mode, Toplevel())
def user_delete(self, username):
if self.subwidgets.has_key(username):
if username in self.subwidgets:
self.subwidgets[username].destruct()
del self.server[username]
......@@ -1639,7 +1639,7 @@ class UserEdit(Frame, MyWidget):
def destruct(self):
# Yes, this test can fail -- if you delete the parent window.
if self.parent.subwidgets.has_key(self.user.remote):
if self.user.remote in self.parent.subwidgets:
del self.parent.subwidgets[self.user.remote]
self.master.destroy()
......@@ -2002,15 +2002,15 @@ def copy_instance(toclass, fromdict):
if 'typemap' in class_sig:
class_sig.remove('typemap')
if tuple(class_sig) != tuple(dict_keys):
print "Fields don't match what fetchmailconf expected:"
# print "Class signature: " + `class_sig`
# print "Dictionary keys: " + `dict_keys`
print("Fields don't match what fetchmailconf expected:")
# print("Class signature: " + repr(class_sig))
# print("Dictionary keys: " + repr(dict_keys))
diff = setdiff(class_sig, common)
if diff:
print "Not matched in class `" + toclass.__class__.__name__ + "' signature: " + `diff`
print("Not matched in class `" + toclass.__class__.__name__ + "' signature: " + repr(diff))
diff = setdiff(dict_keys, common)
if diff:
print "Not matched in dictionary keys: " + `diff`
print("Not matched in dictionary keys: " + repr(diff))
sys.exit(1)
else:
for x in fromdict.keys():
......@@ -2041,8 +2041,8 @@ def copy_instance(toclass, fromdict):
if __name__ == '__main__':
if not os.environ.has_key("DISPLAY"):
print "fetchmailconf must be run under X"
if "DISPLAY" not in os.environ:
print("fetchmailconf must be run under X")
sys.exit(1)
fetchmail_icon = """
......@@ -2082,7 +2082,7 @@ gUSiYASJpMEHhilJTEnhAlGoQqYAZQ1AiqEMZ0jDGtqQImhwwA13yMMevoQAGvGhEAWHGMOAAAA7
# The base64 data in the string above was generated by the following procedure:
#
# import base64
# print base64.encodestring(open("fetchmail.gif", "rb").read())
# print(base64.encodestring(open("fetchmail.gif", "rb").read()))
#
# Process options
......@@ -2095,22 +2095,22 @@ gUSiYASJpMEHhilJTEnhAlGoQqYAZQ1AiqEMZ0jDGtqQImhwwA13yMMevoQAGvGhEAWHGMOAAAA7
elif (switch == '-f'):
rcfile = val
elif (switch == '-h' or switch == '--help'):
print """
print("""
Usage: fetchmailconf {[-d] [-f fetchmailrc]|-h|--help|-V|--version}
-d - dump configuration (for debugging)
-f fmrc - read alternate fetchmailrc file
--help, -h - print this help text and quit
--version, -V - print fetchmailconf version and quit
"""
""")
sys.exit(0)
elif (switch == '-V' or switch == '--version'):
print "fetchmailconf %s" % version
print """
print("fetchmailconf %s" % version)
print("""
Copyright (C) 1997 - 2003 Eric S. Raymond
Copyright (C) 2005, 2006, 2008, 2009 Matthias Andree
fetchmailconf comes with ABSOLUTELY NO WARRANTY. This is free software, you are
welcome to redistribute it under certain conditions. Please see the file
COPYING in the source or documentation directory for details."""
COPYING in the source or documentation directory for details.""")
sys.exit(0)
# Get client host's FQDN
......@@ -2133,17 +2133,18 @@ COPYING in the source or documentation directory for details."""
try:
s = os.system(cmd)
if s != 0:
print "`" + cmd + "' run failure, status " + `s`
print("`" + cmd + "' run failure, status " + repr(s))
raise SystemExit
except:
print "Unknown error while running fetchmail --configdump"
print("Unknown error while running fetchmail --configdump")
os.remove(tmpfile)
sys.exit(1)
try:
execfile(tmpfile)
except:
print "Can't read configuration output of fetchmail --configdump."
except Exception as e:
print("Can't read configuration output of fetchmail --configdump.")
print(repr(e))
os.remove(tmpfile)
sys.exit(1)
......@@ -2170,7 +2171,7 @@ COPYING in the source or documentation directory for details."""
# We may want to display the configuration and quit
if dump:
print "This is a dump of the configuration we read:\n"+`Fetchmailrc`
print("This is a dump of the configuration we read:\n" + repr(Fetchmailrc))
# The theory here is that -f alone sets the rcfile location,
# but -d and -f together mean the new configuration should go to stdout.
......
......@@ -1246,12 +1246,10 @@ static int imap_fetch_body(int sock, struct query *ctl, int number, int *lenp)
* equivalent". However, we know of at least one server that
* treats them differently in the presence of MIME attachments;
* the latter form downloads the attachment, the former does not.
* The server is InterChange.
*
* When I tried working around this by disabling use of the 4rev1 form,
* I found that doing this breaks operation with M$ Exchange.
* Annoyingly enough, Exchange's refusal to cope is technically legal
* under RFC2062.
*/
switch (imap_version)
{
......
......@@ -32,16 +32,16 @@
#include <arpa/inet.h>
#include <net/if.h>
#if defined(__FreeBSD__)
#if defined __FreeBSD_USE_KVM
#include <net/if_var.h>
#include <kvm.h>
#include <nlist.h>
#include <sys/fcntl.h>
#else /* !defined __FreeBSD_USE_KVM */
#include <sys/sysctl.h>
#include <net/route.h>
#include <net/if_dl.h>
#endif /* defined __FreeBSD_USE_KVM */
# if defined __FreeBSD_USE_KVM
# include <net/if_var.h>
# include <kvm.h>
# include <nlist.h>
# include <sys/fcntl.h>
#else
# include <sys/sysctl.h>
# include <net/route.h>
# include <net/if_dl.h>
# endif /* defined __FreeBSD_USE_KVM */
#endif /* defined __FreeBSD__ */
#include "socket.h"
#include "i18n.h"
......
......@@ -10,8 +10,6 @@
(Makefile.am should have a rule so you can just type "make netrc")
*/
#define _XOPEN_SOURCE 600
#include "config.h"
#include "fetchmail.h"
......
......@@ -17,7 +17,6 @@
#include <limits.h>
#include "getopt.h"
#include "fetchmail.h"
#include "i18n.h"
enum {
......
......@@ -9,6 +9,7 @@
*
* For license terms, see the file COPYING in this directory.
*/
#include <string.h>
#include "fetchmail.h"
#include "xmalloc.h"
......
......@@ -431,8 +431,6 @@ void yyerror (const char *s)
/* report a syntax error */
{
yywarn(s);
report_at_line(stderr, 0, rcfile, prc_lineno, GT_("%s at %s"), s,
(yytext && yytext[0]) ? yytext : GT_("end of input"));
prc_errflag++;
}
......
......@@ -20,9 +20,6 @@ MIT license. Compile with -DMAIN to build the demonstrator.
******************************************************************************/
#define _XOPEN_SOURCE 600
#define __BSD_VISIBLE 1
#include "config.h"
#include "fetchmail.h"
......
......@@ -43,11 +43,11 @@ static int LenSkip(char** pptr, int rxlen);
static int DecBase64(char* bufp);
static void EncBase64(char* bufp, int len);
static void ToUnicode(char** pptr, char delim, unsigned char* buf, int* plen,
int conv);
int conv);
static int SetRealmService(char* bufp);
static void GenChallenge(unsigned char* buf, int len);
static int DigestPassphrase(char* passphrase,
unsigned char* rbuf, int unicodeit);
unsigned char* rbuf, int unicodeit);
static void CompUserResp(void);
static int CheckUserAuth(void);
static void md5(const void* in, int len, unsigned char* out);
......
......@@ -25,8 +25,8 @@
extern int DEBUGLEVEL;
#include <unistd.h>
#include <stdlib.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include "smbbyteorder.h"
......
......@@ -30,7 +30,6 @@
#include <time.h>
#include "socket.h"
#include "fetchmail.h"
#include "i18n.h"
#include "sdump.h"
#include "uid_db.h"
......
/** \file tls.c - collect common TLS functionality
/** \file starttls.c - collect common TLS functionality
* \author Matthias Andree
* \date 2006
*/
......@@ -6,6 +6,7 @@
#include "fetchmail.h"
#include <stdbool.h>
#include <string.h>
#include <strings.h>
#include "i18n.h"
......
......@@ -15,7 +15,7 @@ cat - <<'_EOF' | xmllint 2>/dev/null --nonet --postvalid --noout - || exit 77
<head><title /></head><body><p></p></body></html>
_EOF
for i in *.html ; do
for i in "${srcdir}"/*.html ; do
case "$i" in
*/Mailbox-Names-UTF7.html) ;;
*) continue ;;
......
......@@ -103,6 +103,7 @@ int dofastuidl = 0;
/** UIDs associated with un-queried hosts */
static struct idlist *scratchlist;
/** Read saved IDs from \a idfile and attach to each host in \a hostlist. */
static int dump_saved_uid(struct uid_db_record *rec, void *unused)
{
char *t;
......
......@@ -19,9 +19,10 @@
#include <string.h>
#include <strings.h> /* ffs() lives here - needs #define on Solaris. */
#include "xmalloc.h"
#include "uid_db.h"
#include "xmalloc.h"
/* constants */
enum {
MIN_RECORDS = 16 /* arbitrary */
......@@ -96,8 +97,8 @@ static struct pat_node *walk_down(struct uid_db *db, struct uid_db_record *rec,
*parentp =
(struct pat_node *)
((unsigned char *)edge - (v & bit_mask(bit_ndx) ?
offsetof(struct pat_node, ptrs_[2])
: offsetof(struct pat_node, ptrs_[0])));
offsetof(struct pat_node, ptrs_) + 2 * sizeof(struct pat_node *)
: offsetof(struct pat_node, ptrs_)));
*edgep = edge;
return cur;
}
......
......@@ -13,13 +13,13 @@
* For license terms, see the file COPYING in this directory.
*/
#include "fetchmail.h"
#include "config.h"
#include <string.h>
#include <strings.h>
#include <stdlib.h>
#include <stdio.h>
#include <ctype.h>
#include "fetchmail.h"
#include "i18n.h"
static unsigned char unhex(unsigned char c)
......
......@@ -14,7 +14,6 @@
#include <errno.h>
#include <string.h>
#include <stdlib.h>
#include "fetchmail.h"
#include "i18n.h"
void *xmalloc (size_t n)
......@@ -63,5 +62,4 @@ char *xstrndup(const char *s, size_t len)
return p;
}
/* xmalloc.c ends here */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment