]> Pileus Git - ~andy/fetchmail/commitdiff
Freeze bug fixes befoire adding more features.
authorEric S. Raymond <esr@thyrsus.com>
Fri, 19 Jul 1996 14:51:00 +0000 (14:51 -0000)
committerEric S. Raymond <esr@thyrsus.com>
Fri, 19 Jul 1996 14:51:00 +0000 (14:51 -0000)
svn path=/trunk/; revision=38

NEWS
README
fetchmail.c
fetchmail.h
fetchmail.man
options.c
pop3.c
rcfile_l.l
rcfile_y.y

diff --git a/NEWS b/NEWS
index b130a699333c39caeae4e9ca8f853691c37c5f6d..82904985d938d6a19b54bffe607f5064f3a16610 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,10 +1,32 @@
                                NEWS
 
+To-do list:
+
+I want a --logfile option that redirects the daemon-mode output to a
+given file, but the code (in daemon.c near 200) unaccountably doesn't
+work (so I haven't documented it yet).
+
+Option to enable EMACS-like user folder versioning on each run.
+
+-p option to come back?
+
+S/key for secure challenge-response.
+
+Implement IMAP support.
+
+3.02:
+
+* Correct buggy processing of nokeep/noflush/fetchall.
+
+* Fix buggy -mda option processing.
+
+* Added -N/--norewrite option.
+
 3.01:
 
 * Fixed a lexical analyzer bug in quoted-string processing.
 
-* Fixed a bug in dump_options that cauded username to be displayed incorrectly.
+* Fixed a bug in dump_options that caused username to be displayed incorrectly.
 
 * The lock assertion code was in the wrong place relative to the daemonize()
   call.  
@@ -100,11 +122,6 @@ MISCELLANEOUS BUG FIXES
 * I've fixed the flaky parser error messages. They turned out to be due 
   to a misdeclaration of yytext.
 
-There's only one feature I haven't been able to add successfully.  I
-want a --logfile option that redirects the daemon-mode output to a
-given file, but the code (in daemon.c near 200) unaccountably doesn't
-work (so I haven't documented it yet).
-
 These are Carl Harris's change notes from prevuious releases:
 
 3.0b5
diff --git a/README b/README
index 3197bdef2f7c13258dde97084312937a1184f43d..f60fb7a0f7a2a660679a78ec831cf409b847113c 100644 (file)
--- a/README
+++ b/README
@@ -14,14 +14,14 @@ Features of POP include:
 
        * Easy configuration via command line or free-format .poprc file.
 
-       * Daemon mode --  popmail can be run in background to poll
+       * Daemon mode -- popmail can be run in background to poll
          one or more hosts at a specified interval.
 
        * Delivery via either file-append with mandatory locking or an
          MDA you specify.
 
        * From:, To:, Cc:, and Reply-To: headers are rewritten so that 
-         usernames relative to the popclient host become fiully-qualified
+         usernames relative to the popclient host become fully-qualified
          Internet addresses.  This enables replies to work correctly.
 
 There is a man page at popclient.man.  A sample rc file is at sample.poprc.
index 68b6600a0b63acbd0fe87ece248fcf4f082bb2fc..e8aae828e340e7ed8a48836c00952b4dfd305389 100644 (file)
@@ -404,7 +404,7 @@ struct hostrec *queryctl;
       exit(1);
     }
 
-    execv(queryctl->mda,mda_argv);
+    execv(queryctl->mda, mda_argv+1);
 
     /* if we got here, an error occurred */
     perror("popclient: openmailpipe: exec");
index b9b1cdcf3f8d725400ce75ee1e829ed70c4b03f0..3eaa1df9217d38c1529e2e831ec4675565cb0cc4 100644 (file)
@@ -21,7 +21,7 @@
 #define                PASSWORDLEN     MAX_PASSWORD_LENGTH
 #define                FOLDERLEN       256     /* max folder name length */
 #define                DIGESTLEN       33      /* length of MD5 digest */
-#define                MDALEN          33      /* length of delivery agent command */
+#define                MDALEN          256     /* length of delivery agent command */
 
 /* exit code values */
 #define                PS_SUCCESS      0       /* successful receipt of messages */
@@ -57,6 +57,7 @@ struct hostrec {
   int protocol;
   int fetchall;
   int flush;
+  int rewrite;
 
   /* dependent on the above members */
   int output;
index cdcb2246e12d572e2d950e4a00a5c5dae29c26b8..35fc9e365cffa8b01bd569a259f6fa8f7672bca0 100644 (file)
@@ -168,6 +168,16 @@ and the mailserver are echoed to stderr.  Specifying
 causes normal progress/status messages which would be redundant or meaningless
 to be modified or omitted.
 .TP
+.B \-N, --norewrite
+Normally,
+.I popclient
+edits RFC-822 address headers (To, From, Cc, Bcc, and Reply-To) in
+fetched mail so that any mail IDs local to the host are expanded to
+full addresses (@ and the POP host name are appended).  This enables 
+replies on the client to get addressed correctly (otherwise your
+mailer might think they should be addressed to local users on the
+client machine).  This option disables the rewrite.
+.TP
 .B \-V, --version
 Displays the version information for your copy of 
 .I popclient.
@@ -369,9 +379,11 @@ Legal keywords are:
     keep
     flush
     fetchall
+    rewrite
     nokeep
     noflush
     nofetchall
+    norewrite
 .PP
 Legal protocol identifiers are
 
index 3d4efe1d04557054b9b225aa3a4b917aad94fdf0..fbf50b54915468ffdbe6d22b1047323cc7357b2c 100644 (file)
--- a/options.c
+++ b/options.c
 #define LA_MDA         16
 #define LA_LOGFILE     17
 #define LA_QUIT                18
-#define LA_YYDEBUG     19
+#define LA_NOREWRITE   19
+#define LA_YYDEBUG     20
  
-static char *shortoptions = "23VaKkvscl:Fd:f:u:r:o:m:";
+static char *shortoptions = "23VaKkvscl:Fd:f:u:r:o:m:L:qN";
 static struct option longoptions[] = {
   {"version",   no_argument,       (int *) 0, LA_VERSION    },
   {"all",      no_argument,       (int *) 0, LA_ALL        },
@@ -63,6 +64,7 @@ static struct option longoptions[] = {
   {"mda",      required_argument, (int *) 0, LA_MDA        },
   {"logfile",  required_argument, (int *) 0, LA_LOGFILE    },
   {"quit",     no_argument,       (int *) 0, LA_QUIT       },
+  {"norewrite",        no_argument,       (int *) 0, LA_NOREWRITE  },
   {"yydebug",  no_argument,       (int *) 0, LA_YYDEBUG    },
   {(char *) 0,  no_argument,       (int *) 0, 0             }
 };
@@ -218,6 +220,10 @@ struct hostrec *queryctl;
       case LA_QUIT:
         quitmode = 1;
         break;
+      case 'N':
+      case LA_NOREWRITE:
+       queryctl->rewrite = 0;
+       break;
       case LA_YYDEBUG:
        yydebug = 1;
         break;
@@ -297,6 +303,7 @@ struct hostrec *queryctl;
 #else
   queryctl->keep = 0;
 #endif
+  queryctl->rewrite = 1;
 
   strcpy(queryctl->localname,pw->pw_name);
   strcpy(queryctl->remotename,pw->pw_name);
diff --git a/pop3.c b/pop3.c
index fab11a2b5260805a0698d46cae2f15d9554347f1..0be6b2111e448896290eaec6cf65e5a95bf516f9 100644 (file)
--- a/pop3.c
+++ b/pop3.c
@@ -40,7 +40,7 @@ int POP3_sendSTAT (int *msgcount, int socket);
 int POP3_sendRETR (int msgnum, int socket);
 int POP3_sendDELE (int msgnum, int socket);
 int POP3_sendLAST (int *last, int socket);
-int POP3_readmsg (int socket, int mboxfd, char *host, int topipe);
+int POP3_readmsg (int socket, int mboxfd, char *host, int topipe, int rewrite);
 int POP3_BuildDigest (char *buf, struct hostrec *options);
 #endif
 
@@ -165,7 +165,10 @@ struct hostrec *queryctl;
         goto cleanUp;
       
       if (number >= first || queryctl->fetchall)
-        ok = POP3_readmsg(socket,mboxfd,queryctl->servername,queryctl->output == TO_MDA);
+        ok = POP3_readmsg(socket,mboxfd,
+                         queryctl->servername,
+                         queryctl->output == TO_MDA, 
+                         queryctl->rewrite);
       else
         ok = 0;
       if (ok != 0)
@@ -537,11 +540,12 @@ int socket;
   globals:       reads outlevel. 
  *********************************************************************/
 
-int POP3_readmsg (socket,mboxfd,pophost,topipe)
+int POP3_readmsg (socket,mboxfd,pophost,topipe,rewrite)
 int socket;
 int mboxfd;
 char *pophost;
 int topipe;
+int rewrite;
 { 
   char buf [MSGBUFSIZE]; 
   char *bufp;
@@ -610,7 +614,7 @@ int topipe;
     /*
      * Edit some headers so that replies will work properly.
      */
-    if (inheaders)
+    if (inheaders && rewrite)
       reply_hack(bufp, pophost);
 
     /* write this line to the file */
index f5281f78cae8fd5ad25de57963f1ea5714c9d4fc..d6c0d9ffaa6e7c7b58792b935858f038e2d62261 100644 (file)
@@ -32,12 +32,14 @@ pass(word)? { return KW_PASSWORD; }
 remote(folder)? { return KW_REMOTEFOLDER; }
 local(folder)? { return KW_LOCALFOLDER; }
 mda            { return KW_MDA; }
-keep           { yylval.flag = 1; return KW_KEEP; }
-flush          { yylval.flag = 1; return KW_FLUSH; }
-fetchall       { yylval.flag = 1; return KW_FETCHALL; }
-nokeep         { yylval.flag = -1; return KW_KEEP; }
-noflush                { yylval.flag = -1; return KW_FLUSH; }
-nofetchall     { yylval.flag = -1; return KW_FETCHALL; }
+keep           { yylval.flag = TRUE; return KW_KEEP; }
+flush          { yylval.flag = TRUE; return KW_FLUSH; }
+fetchall       { yylval.flag = TRUE; return KW_FETCHALL; }
+rewrite                { yylval.flag = TRUE; return KW_REWRITE; }
+nokeep         { yylval.flag = FALSE; return KW_KEEP; }
+noflush                { yylval.flag = FALSE; return KW_FLUSH; }
+nofetchall     { yylval.flag = FALSE; return KW_FETCHALL; }
+norewrite      { yylval.flag = FALSE; return KW_REWRITE; }
 
 (pop2)|(POP2)  { yylval.proto = P_POP2;  return PROTO_POP2; }
 (pop3)|(POP3)  { yylval.proto = P_POP3;  return PROTO_POP3; }
index 8f93c3507cc876a1de8b41d3803495cd051c66c0..ec6a8b2467827acf3dba70e2ac3072c80b718e8b 100644 (file)
@@ -33,9 +33,13 @@ int yydebug; /* in case we didn't generate with -- debug */
 %token KW_REMOTEFOLDER KW_LOCALFOLDER KW_MDA KW_EOL KW_DEFAULTS
 %token <proto> PROTO_POP2 PROTO_POP3 PROTO_IMAP PROTO_APOP PROTO_RPOP
 %token <sval> PARAM_STRING
-%token <flag> KW_KEEP KW_FLUSH KW_FETCHALL
+%token <flag> KW_KEEP KW_FLUSH KW_FETCHALL KW_REWRITE
 %type <proto> proto;
 
+/* these are actually used by the lexer */
+%token TRUE    1
+%token FALSE   0
+
 %%
 
 rcfile:                rcline
@@ -68,6 +72,7 @@ serv_option_clause:
        |       KW_KEEP                         {prc_setkeep($1);}
        |       KW_FLUSH                        {prc_setflush($1);}
        |       KW_FETCHALL                     {prc_setfetchall($1);}
+       |       KW_REWRITE                      {prc_setrewrite($1);}
   ;
 
 proto:         PROTO_POP2