* Added preconnect option for initializing ssh connections.
+* Added local-domains feature as requested by Pablo Saratxaga.
+
* More FAQ material on how and when to use --interface.
bugs --
if ((atsign = strchr(cp, '@')))
{
+ struct idlist *idp;
+
+ /*
+ * Does a trailing segment of the hostname match something
+ * on the localdomains list? If so, save the whole name
+ * and keep going.
+ */
+ for (idp = ctl->localdomains; idp; idp = idp->next)
+ {
+ char *rhs;
+
+ rhs = atsign + 1 + (strlen(atsign) - strlen(idp->id));
+ if ((rhs[-1] == '.' || rhs[-1] == '@')
+ && strcmp(rhs, idp->id) == 0)
+ {
+ if (outlevel == O_VERBOSE)
+ error(0, 0, "passed through %s matching %s",
+ cp, idp->id);
+ save_str(xmit_names, -1, cp);
+ continue;
+ }
+ }
+
/*
- * Address has an @. Check to see if the right-hand part
- * is an alias or MX equivalent of the mailserver. If it's
- * not, skip this name. If it is, we'll keep going and try
- * to find a mapping to a client name.
+ * Check to see if the right-hand part is an alias
+ * or MX equivalent of the mailserver. If it's
+ * not, skip this name. If it is, we'll keep
+ * going and try to find a mapping to a client name.
*/
if (!is_host_alias(atsign+1, ctl))
continue;
printf(" (default).\n");
else
printf(".\n");
+ if (ctl->localdomains)
+ {
+ struct idlist *idp;
+
+ printf(" Local domains:");
+ for (idp = ctl->localdomains; idp; idp = idp->next)
+ printf(" %s", idp->id);
+ putchar('\n');
+ }
printf(" %s messages will be retrieved (--all %s).\n",
ctl->fetchall ? "All" : "Only new",
/* per-host data */
struct idlist *servernames; /* servername first, then akas */
struct idlist *localnames; /* including calling user's name */
+ struct idlist *localdomains; /* list of pass-through domains */
int wildcard; /* should unmatched names be passed through */
int protocol;
int port;
syslog
.PP
All options correspond to the obvious command-line arguments except
-the following: `aka', `is', `to', `password', and `preconnect'.
+the following: `aka', `is', `to', `password', `preconnect', and
+`localdomains'.
.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
attempting to set up secure POP connections with the aid of
.IR ssh (1).
.PP
+The `localdomains' option allows you to declare a list of domains
+which fetchmail should consider local. When fetchmail is parsing
+address lines in multidrop modes, and a trailing segment of a host
+name matches a declared local doman, that address is passed through
+to the listener or MDA unaltered.
+.PP
Legal protocol identifiers are
auto (or AUTO)
specifies that `golux' and `snark' have the same name on the
client as on the server, but mail for server user `hurkle' should be
delivered to client user `happy'.
+.PP
+Here's an example of another kind of multidrop connection:
+
+.nf
+ poll pop.provider.net localdomains loonytoons.org:
+ user maildrop with pass secret1 to esr * here
+.fi
+
+This also says that the mailbox of account `maildrop' on the server is
+a multi-drop box. It tells fetchmail that any address in the
+loonytoons.org domain (including subdomain addresses like
+`joe@daffy.loonytoons.org') should be passed through to the local SMTP
+listener without modification. Be careful of mail loops if you do this!
.SH THE USE AND ABUSE OF MULTIDROP MAILBOXES
Use the multiple-local-recipients feature with caution -- it can bite.
The fundamental problem is that by having your server toss several
poll { return POLL; }
skip { return SKIP; }
aka { return AKA; }
+local(domains) { return LOCALDOMAINS; }
proto(col)? { return PROTOCOL; }
port { return PORT; }
auth(enticate)? { return AUTHENTICATE; }
char *sval;
}
-%token DEFAULTS POLL SKIP AKA PROTOCOL AUTHENTICATE TIMEOUT KPOP KERBEROS
+%token DEFAULTS POLL SKIP AKA LOCALDOMAINS PROTOCOL
+%token AUTHENTICATE TIMEOUT KPOP KERBEROS
%token ENVELOPE USERNAME PASSWORD FOLDER SMTPHOST MDA PRECONNECT LIMIT
%token IS HERE THERE TO MAP WILDCARD
%token SET BATCHLIMIT FETCHLIMIT LOGFILE INTERFACE MONITOR
| serverspecs serv_option
;
-alias_list : STRING {save_str(¤t.servernames, -1, $1);}
- | alias_list STRING {save_str(¤t.servernames, -1, $2);}
+alias_list : STRING {save_str(¤t.servernames,-1,$1);}
+ | alias_list STRING {save_str(¤t.servernames,-1,$2);}
+ ;
+
+domain_list : STRING {save_str(¤t.localdomains,-1,$1);}
+ | domain_list STRING {save_str(¤t.localdomains,-1,$2);}
;
serv_option : AKA alias_list
+ | LOCALDOMAINS domain_list
| PROTOCOL PROTO {current.protocol = $2;}
| PROTOCOL KPOP {
current.protocol = P_POP3;
# timeout -- must be followed by a numeric timeout value
# envelope -- must be followed by an envelope header name
# aka -- must be followed by one or more server aliases
+# localdomains -- must be followed by one or more domain names
#
# username (or user) -- must be followed by a name
# is -- must be followed by one or more names