protobjs = rcfile_y.o rcfile_l.o socket.o getpass.o pop2.o pop3.o imap.o \
etrn.o fetchmail.o env.o options.o daemon.o driver.o rfc822.o smtp.o \
xmalloc.o uid.o mxget.o md5c.o md5ify.o rpa.o interface.o netrc.o \
- base64.o error.o unmime.o conf.o
+ base64.o error.o unmime.o conf.o is_ip_alias.o
objs = $(protobjs) $(extras) $(EXTRAOBJ)
$(srcdir)/xmalloc.c $(srcdir)/uid.c $(srcdir)/mxget.c \
$(srcdir)/md5c.c $(srcdir)/md5ify.c $(srcdir)/rpa.c \
$(srcdir)/interface.c $(srcdir)/netrc.c $(srcdir)/base64.c \
- $(srcdir)/error.c $(srcdir)/unmime.c $(srcdir)/conf.c
+ $(srcdir)/error.c $(srcdir)/unmime.c $(srcdir)/conf.c \
+ $(srcdir)/is_ip_alias.c
.SUFFIXES:
.SUFFIXES: .o .c .h .y .l .ps .dvi .info .texi
Release Notes:
------------------------------------------------------------------------------
+fetchmail-4.5.1 ():
+* Checkalias option from Enrico Musio <enrico.musio@spaziozerouno.it>.
+
fetchmail-4.5.0bis (Sat Jun 20 10:55:52 EDT 1998):
One-line fix for an embarrassing bug in the `gold' version; command-line
#define MX_RETRIES 3
+extern int is_ip_alias();
+
static int is_host_alias(const char *name, struct query *ctl)
/* determine whether name is a DNS alias of the hostname */
{
- struct hostent *he;
+ struct hostent *he,*he_st;
struct mxentry *mxp, *mxrecords;
struct hostdata *lead_server =
{
if (strcasecmp(ctl->server.truename, he->h_name) == 0)
goto match;
+ else if (((he_st = gethostbyname(ctl->server.truename)) != (struct hostent *)NULL) && ctl->server.checkalias)
+ {
+ if (outlevel == O_VERBOSE)
+ error(0, 0, "Checking if %s is really the same node as %s",ctl->server.truename,name);
+ if (is_ip_alias(ctl->server.truename,name) == TRUE)
+ {
+ if (outlevel == O_VERBOSE)
+ error(0, 0, "Yes, their IP addresses match");
+ goto match;
+ }
+ if (outlevel == O_VERBOSE)
+ error(0, 0, "No, their IP addresses don't match");
+ }
else
return(FALSE);
}
FLAG_MERGE(server.qvirtual);
FLAG_MERGE(server.skip);
FLAG_MERGE(server.dns);
+ FLAG_MERGE(server.checkalias);
FLAG_MERGE(server.uidl);
#ifdef linux
DEFAULT(ctl->mimedecode, FALSE);
DEFAULT(ctl->server.dns, TRUE);
DEFAULT(ctl->server.uidl, FALSE);
+ DEFAULT(ctl->server.checkalias, FALSE);
#undef DEFAULT
#if !defined(HAVE_GETHOSTBYNAME) || !defined(HAVE_RES_SEARCH)
{
printf(" DNS lookup for multidrop addresses is %sabled.\n",
ctl->server.dns ? "en" : "dis");
-
+ if (ctl->server.dns)
+ {
+ printf(" Server aliases will be compared with multidrop addresses by ");
+ if (ctl->server.checkalias)
+ printf("IP address.");
+ else
+ printf("name.");
+ }
if (ctl->server.envelope == STRING_DISABLED)
printf(" Envelope-address routing is disabled\n");
else
flag skip; /* suppress poll in implicit mode? */
flag dns; /* do DNS lookup on multidrop? */
flag uidl; /* use RFC1725 UIDLs? */
+ flag checkalias; /* try to resolve aliases by comparing IPs ?*/
+
#ifdef linux
char *interface;
no dns \& T{
Disable DNS lookup for multidrop
T}
+checkalias \& T{
+Do comparison by IP address for multidrop
+T}
+no checkalias \& T{
+Do comparison by name for multidrop (default)
+T}
uidl -U T{
Force POP3 to use client-side UIDLs
T}
.PP
All options correspond to the obvious command-line arguments, except
the following: `via', `interval', `aka', `is', `to', `dns'/`no dns',
+`checkalias'/`no checkalias',
\&`password', \&`preconnect', \&`postconnect', `localdomains',
\&`stripcr'/`no stripcr', \&`forcecr'/`no forcecr', `pass8bits'/`no
pass8bits' `dropstatus/no dropstatus', `mimedecode/no mimedecode',
addresses with hostname parts that match your poll name or your `via',
`aka' or `localdomains' options, and usually also for hostname parts
which DNS tells it are aliases of the mailserver. See the discussion
-of `dns', `localdomains', and `aka' for details on how matching
+of `dns', `checkalias', `localdomains', and `aka' for details on how matching
addresses are handled. If \fIfetchmail\fR cannot match any mailserver
usernames or localdomain addresses, the default recipient is the
calling user (as set by the USER or LOGNAME variable in the
attached to a matching hostname part, its local mapping is added to
the list of local recipients.
.PP
+The `checkalias' option (normally off) extends the lookups performed
+by the `dns' keyword in multidrop mode, providing a way to cope with
+remote MTAs that identify themselves using their canonical name, while
+they're polled using an alias.
+When such a server is polled, checks to extract the envelope address
+fail, and
+.IR fetchmail
+reverts to delivery using the To/Cc/Bcc headers (See below
+`Header vs. Envelope addresses').
+Specifying this option instructs
+.IR fetchmail
+to retrieve all the IP addresses associated with both the poll name
+and the name used by the remote MTA and to do a comparison of the IP
+addresses. This comes in handy in situations where the remote server
+undergoes frequent canonical name changes, that would otherwise
+require modifications to the rcfile. `checkalias' has no effect if
+`no dns' is specified in the rcfile.
+.PP
The `aka' option is for use with multidrop mailboxes. It allows you
to pre-declare a list of DNS aliases for a server. This is an
optimization hack that allows you to trade space for speed. When
= { return MAP; }
"*" { return WILDCARD; }
-no/[kfrsdu \t].* { return NO;}
+no/[kfrsduc \t].* { return NO;}
keep { return KEEP; }
flush { return FLUSH; }
mimedec(ode)? { return MIMEDECODE; }
dns { return DNS; }
uidl { return UIDL; }
+checkalias { return CHECKALIAS; }
limit { return LIMIT; }
%token <sval> STRING
%token <number> NUMBER
%token NO KEEP FLUSH FETCHALL REWRITE FORCECR STRIPCR PASS8BITS DROPSTATUS
-%token DNS SERVICE PORT UIDL INTERVAL MIMEDECODE
+%token DNS SERVICE PORT UIDL INTERVAL MIMEDECODE CHECKALIAS
%%
}
| UIDL {current.server.uidl = FLAG_TRUE;}
| NO UIDL {current.server.uidl = FLAG_FALSE;}
+ | CHECKALIAS {current.server.checkalias = FLAG_TRUE;}
+ | NO CHECKALIAS {current.server.checkalias = FLAG_FALSE;}
| SERVICE STRING {
#if INET6
current.server.service = $2;