* Minor portation fixes for early AIX version and NextSTEP.
* Fixed a bad interaction between --limit and the repoll feature.
* = is now optional in global options.
+* Added --invisible option.
There are 276 people on fetchmail-friends and 20 on fetchmail-announce.
{
/*
* RFC 1123 requires that the domain name in HELO address is a
- * "valid principal domain name" for the client host. We
- * violate this with malice aforethought in order to make the
- * Received headers and logging look right.
+ * "valid principal domain name" for the client host. If we're
+ * running in invisible mode, violate this with malice
+ * aforethought in order to make the Received headers and
+ * logging look right.
*
* In fact this code relies on the RFC1123 requirement that the
* SMTP listener must accept messages even if verification of the
* What it will affect is the listener's logging.
*/
struct idlist *idp;
+ char *id_me = use_invisible ? ctl->server.truename : fetchmailhost;
errno = 0;
continue;
if (SMTP_ok(ctl->smtp_socket) == SM_OK &&
- SMTP_ehlo(ctl->smtp_socket,
- ctl->server.truename,
+ SMTP_ehlo(ctl->smtp_socket, id_me,
&ctl->server.esmtp_options) == SM_OK)
break; /* success */
continue;
if (SMTP_ok(ctl->smtp_socket) == SM_OK &&
- SMTP_helo(ctl->smtp_socket, ctl->server.truename) == SM_OK)
+ SMTP_helo(ctl->smtp_socket, id_me) == SM_OK)
break; /* success */
close(ctl->smtp_socket);
n = stuffline(ctl, headers);
*rcv = 'R';
}
- if (n != -1)
+ if (!use_invisible && n != -1)
{
/* utter any per-message Received information we need here */
sprintf(buf, "Received: from %s\n", ctl->server.truename);
time(&now);
strcat(buf, ctime(&now));
n = stuffline(ctl, buf);
- if (n != -1)
- n = stuffline(ctl, rcv); /* ship out rest of headers */
}
}
}
+ if (n != -1)
+ n = stuffline(ctl, rcv); /* ship out rest of headers */
+
if (n == -1)
{
error(0, errno, "writing RFC822 headers");
if (use_syslog)
printf("Progress messages will be logged via syslog\n");
#endif
+ if (use_invisible)
+ printf("Fetchmail will masquerade and will not generate Received\n");
for (ctl = querylist; ctl; ctl = ctl->next) {
if (ctl->active && !(implicitmode && ctl->server.skip))
dump_params(ctl);
extern int poll_interval; /* poll interval in seconds */
extern flag nodetach; /* if TRUE, don't detach daemon process */
extern char *logfile; /* log file for daemon mode */
-extern flag use_syslog; /* if --syslog was set */
+extern flag use_syslog; /* if syslog was set */
+extern flag use_invisible; /* if invisible was set */
extern flag quitmode; /* if --quit was set */
extern flag check_only; /* if --check was set */
extern char *cmd_logfile; /* if --logfile was set */
option was used.
.PP
The
+.B --invisible
+option tries to make fetchmail invisible. Normally, fetchmail behaves
+like any other MTA would -- it generates a Received header into each
+message describing its place in the chain of transmission, and tells
+the MTA it forwards to that the mail came from the machine fetchmail
+itself is running on. If the invisible option is on, the Received
+header is suppressed and fetchmail tries to spoof the MTA it forwards
+to into thinking it came directly from the mailserver host.
+.PP
+The
.B \-N
or --nodetach option suppresses backgrounding and detachment of the
daemon process from its control terminal. This is primarily useful
#define LA_NODETACH 7
#define LA_QUIT 8
#define LA_LOGFILE 9
-#define LA_SYSLOG 10
-#define LA_RCFILE 11
-#define LA_IDFILE 12
-#define LA_PROTOCOL 13
-#define LA_UIDL 14
-#define LA_PORT 15
-#define LA_AUTHENTICATE 16
-#define LA_TIMEOUT 17
-#define LA_ENVELOPE 18
-#define LA_USERNAME 19
-#define LA_ALL 20
-#define LA_NOKEEP 21
-#define LA_KEEP 22
-#define LA_FLUSH 23
-#define LA_NOREWRITE 24
-#define LA_LIMIT 25
-#define LA_FOLDER 26
-#define LA_SMTPHOST 27
-#define LA_BATCHLIMIT 28
-#define LA_FETCHLIMIT 29
-#define LA_EXPUNGE 30
-#define LA_MDA 31
-#define LA_INTERFACE 32
-#define LA_MONITOR 33
-#define LA_YYDEBUG 34
-#define LA_QVIRTUAL 35
+#define LA_INVISIBLE 10
+#define LA_SYSLOG 11
+#define LA_RCFILE 12
+#define LA_IDFILE 13
+#define LA_PROTOCOL 14
+#define LA_UIDL 15
+#define LA_PORT 16
+#define LA_AUTHENTICATE 17
+#define LA_TIMEOUT 18
+#define LA_ENVELOPE 19
+#define LA_USERNAME 20
+#define LA_ALL 21
+#define LA_NOKEEP 22
+#define LA_KEEP 23
+#define LA_FLUSH 24
+#define LA_NOREWRITE 25
+#define LA_LIMIT 26
+#define LA_FOLDER 27
+#define LA_SMTPHOST 28
+#define LA_BATCHLIMIT 29
+#define LA_FETCHLIMIT 30
+#define LA_EXPUNGE 31
+#define LA_MDA 32
+#define LA_INTERFACE 33
+#define LA_MONITOR 34
+#define LA_YYDEBUG 35
+#define LA_QVIRTUAL 36
/* options still left: CDgGhHjJoORTUwWxXYzZ */
static const char *shortoptions =
{"nodetach", no_argument, (int *) 0, LA_NODETACH },
{"quit", no_argument, (int *) 0, LA_QUIT },
{"logfile", required_argument, (int *) 0, LA_LOGFILE },
+ {"invisible", no_argument, (int *) 0, LA_INVISIBLE },
{"syslog", no_argument, (int *) 0, LA_SYSLOG },
{"fetchmailrc",required_argument,(int *) 0, LA_RCFILE },
{"idfile", required_argument, (int *) 0, LA_IDFILE },
case LA_LOGFILE:
cmd_logfile = optarg;
break;
+ case LA_INVISIBLE:
+ use_invisible = TRUE;
+ break;
case 'f':
case LA_RCFILE:
rcfile = (char *) xmalloc(strlen(optarg)+1);
fputs(" -q, --quit kill daemon process\n", stderr);
fputs(" -L, --logfile specify logfile name\n", stderr);
fputs(" --syslog use syslog(3) for most messages when running as a daemon\n", stderr);
+ fputs(" --invisible suppress Received line & enable host spoofing\n", stderr);
fputs(" -f, --fetchmailrc specify alternate run control file\n", stderr);
fputs(" -i, --idfile specify alternate UIDs file\n", stderr);
#ifdef linux
logfile { return LOGFILE; }
daemon { return DAEMON; }
syslog { return SYSLOG; }
+invisible { return INVISIBLE; }
defaults { return DEFAULTS; }
server { return POLL; }
int poll_interval; /* poll interval in seconds */
char *logfile; /* log file for daemon mode */
flag use_syslog; /* if syslog was set */
+flag use_invisible; /* if invisible was set */
struct query *querylist; /* head of server list (globally visible) */
int yydebug; /* in case we didn't generate with -- debug */
%token PRECONNECT POSTCONNECT LIMIT
%token IS HERE THERE TO MAP WILDCARD
%token BATCHLIMIT FETCHLIMIT EXPUNGE
-%token SET LOGFILE DAEMON SYSLOG INTERFACE MONITOR
+%token SET LOGFILE DAEMON SYSLOG INVISIBLE INTERFACE MONITOR
%token <proto> PROTO
%token <sval> STRING
%token <number> NUMBER
statement : SET LOGFILE optmap STRING {logfile = xstrdup($4);}
| SET DAEMON optmap NUMBER {poll_interval = $4;}
| SET SYSLOG {use_syslog = TRUE;}
+ | SET INVISIBLE {use_invisible = TRUE;}
/*
* The way the next two productions are written depends on the fact that
# set logfile = -- must be followed by a string
# set daemon -- must be followed by a number
# set syslog
+# set invisible
#
# The noise keywords `and', `with', `has', `wants', and `options' are ignored
# anywhere in an entry; they can be used to make it resemble English. The