Rocco Rutte:
authorpdmef <pdmef@e385b8ad-14ed-0310-8656-cc95a2468c6d>
Wed, 14 Sep 2005 12:49:25 +0000 (12:49 +0000)
committerpdmef <pdmef@e385b8ad-14ed-0310-8656-cc95a2468c6d>
Wed, 14 Sep 2005 12:49:25 +0000 (12:49 +0000)
- merge in latest mutt changes

git-svn-id: svn://svn.berlios.de/mutt-ng/trunk@523 e385b8ad-14ed-0310-8656-cc95a2468c6d

ChangeLog.mutt
UPGRADING
VERSION.svn
curs_lib.c
globals.h
init.h
mutt_libesmtp.c
pop/pop.c
pop/pop.h
pop/pop_lib.c
sendlib.c

index c56e8b7..c548d37 100644 (file)
@@ -1,3 +1,22 @@
+2005-09-14 02:45:44  Brendan Cully  <brendan@kublai.com>  (brendan)
+
+       * globals.h, init.h, sendlib.c: Add new $envelope_from_address
+       variable for manually specifying the envelope sender. Rename (with
+       compatibility synonym) $envelope_from to $use_envelope_from. Make
+       $envelope_from subordinate to $use_e_f, as $from is to $use_from.
+
+2005-09-13 20:36:17  Brendan Cully  <brendan@kublai.com>  (brendan)
+
+       * doc/Makefile.in: Put chunked HTML manual in top doc directory
+       instead of HTML subdirectory.  Solves a weird $distdir
+       absolute/relative path nuisance.
+
+2005-09-12 06:22:21  Brendan Cully  <brendan@kublai.com>  (brendan)
+
+       * curs_lib.c, pop.c, pop.h, pop_lib.c: Teach pop driver about
+       mutt_progress_bar. Allow progress bar to omit total size if zero
+       (=unknown).
+
 2005-09-10 18:47:17  TAKAHASHI Tamotsu  <ttakah@lapis.plala.or.jp>  (brendan)
 
        * menu.c: Correct some inconsistencies introduced by
 2005-09-10 18:47:17  TAKAHASHI Tamotsu  <ttakah@lapis.plala.or.jp>  (brendan)
 
        * menu.c: Correct some inconsistencies introduced by
index 650a06d..81ebdde 100644 (file)
--- a/UPGRADING
+++ b/UPGRADING
@@ -10,6 +10,13 @@ This document is not the place for verbose documentation; it only offers
 the necessary keywords to look them up in the manual, ChangeLog or other
 sources of information.
 
 the necessary keywords to look them up in the manual, ChangeLog or other
 sources of information.
 
+2005-09-14:
+
+  The $smtp_envelope_from variable has been removed in favor of the
+  general $envelope_from_address.
+
+  The $envelope_from option has been renamed to $use_envelope_from.
+
 2005-09-07:
 
   SASL 1.x support has been removed.
 2005-09-07:
 
   SASL 1.x support has been removed.
index ec0e415..17c6383 100644 (file)
@@ -1 +1 @@
-522
+523
index 46f6d30..e73d4f5 100644 (file)
@@ -318,8 +318,9 @@ void mutt_progress_bar (progress_t* progress, long pos) {
     if (!NetInc)
       mutt_message (progress->msg);
     else {
     if (!NetInc)
       mutt_message (progress->msg);
     else {
-      mutt_pretty_size (progress->sizestr, sizeof (progress->sizestr),
-                        progress->size);
+      if (progress->size)
+        mutt_pretty_size (progress->sizestr, sizeof (progress->sizestr),
+                          progress->size);
       progress->pos = 0;
     }
   }
       progress->pos = 0;
     }
   }
@@ -331,7 +332,10 @@ void mutt_progress_bar (progress_t* progress, long pos) {
     progress->pos = pos;
     pos = pos / (NetInc << 10) * (NetInc << 10);
     mutt_pretty_size (posstr, sizeof (posstr), pos);
     progress->pos = pos;
     pos = pos / (NetInc << 10) * (NetInc << 10);
     mutt_pretty_size (posstr, sizeof (posstr), pos);
-    mutt_message ("%s %s/%s", progress->msg, posstr, progress->sizestr);
+    if (progress->size)
+      mutt_message ("%s %s/%s", progress->msg, posstr, progress->sizestr);
+    else
+      mutt_message ("%s %s", progress->msg, posstr);
   }
 }
 #endif
   }
 }
 #endif
index fa890ab..d918b03 100644 (file)
--- a/globals.h
+++ b/globals.h
@@ -29,6 +29,7 @@ WHERE char Quotebuf[SHORT_STRING];
 WHERE char *MuttDotlock;
 #endif
 
 WHERE char *MuttDotlock;
 #endif
 
+WHERE ADDRESS *EnvFrom;
 WHERE ADDRESS *From;
 
 WHERE char *AliasFile;
 WHERE ADDRESS *From;
 
 WHERE char *AliasFile;
@@ -147,7 +148,6 @@ WHERE char *SimpleSearch;
 #if defined(USE_LIBESMTP)
 WHERE char *SmtpAuthUser;
 WHERE char *SmtpAuthPass;
 #if defined(USE_LIBESMTP)
 WHERE char *SmtpAuthUser;
 WHERE char *SmtpAuthPass;
-WHERE char *SmtpEnvFrom;
 WHERE char *SmtpHost;
 WHERE unsigned short SmtpPort;
 WHERE char *SmtpUseTLS;
 WHERE char *SmtpHost;
 WHERE unsigned short SmtpPort;
 WHERE char *SmtpUseTLS;
diff --git a/init.h b/init.h
index f42922b..3afe5f1 100644 (file)
--- a/init.h
+++ b/init.h
@@ -676,16 +676,24 @@ struct option_t MuttVars[] = {
    ** you must take care of space-stuffing <tt/From / lines (with a trailing
    ** space) yourself.
    */
    ** you must take care of space-stuffing <tt/From / lines (with a trailing
    ** space) yourself.
    */
-  {"envelope_from", DT_BOOL, R_NONE, OPTENVFROM, "no" },
+  {"envelope_from", DT_SYN, R_NONE, UL "use_envelope_from", 0 },
+  {"use_envelope_from", DT_BOOL, R_NONE, OPTENVFROM, "no" },
   /*
    ** .pp
   /*
    ** .pp
-   ** When \fIset\fP, Mutt-ng will try to derive the message's \fIenvelope\fP
-   ** sender from the ``\fTFrom:\fP'' header field. Note that this information is passed 
-   ** to the sendmail command using the ``\fT-f\fP" command line switch, so don't set this
-   ** option if you are using that switch in $$sendmail yourself,
-   ** or if the sendmail on your machine doesn't support that command
-   ** line switch.
+   ** When \fIset\fP, mutt-ng will use ``$$envelope_from_address'' as the
+   ** \fIenvelope\fP sender if that is set, otherwise it will attempt to
+   ** derive it from the "From:" header.
+   **
+   ** .pp
+   ** \fBNote:\fP This information is passed
+   ** to sendmail command using the "-f" command line switch and
+   ** passed to the SMTP server for libESMTP (if support is compiled in).
    */
    */
+  {"envelope_from_address", DT_ADDR, R_NONE, UL &EnvFrom, "" },
+  /*
+  ** Manually sets the \fIenvelope\fP sender for outgoing messages.
+  ** This value is ignored if ``$$use_envelope_from'' is unset.
+  */
   {"escape", DT_STR, R_NONE, UL &EscChar, "~"},
   /*
    ** .pp
   {"escape", DT_STR, R_NONE, UL &EscChar, "~"},
   /*
    ** .pp
@@ -2529,20 +2537,8 @@ struct option_t MuttVars[] = {
    ** presents a security risk since the superuser of your machine may read it
    ** regardless of the file's permissions.  
    */
    ** presents a security risk since the superuser of your machine may read it
    ** regardless of the file's permissions.  
    */
-  {"smtp_envelope", DT_STR, R_NONE, UL &SmtpEnvFrom, "" },
-  /*
-   ** .pp
-   ** Availability: SMTP
-   **
-   ** .pp
-   ** If this variable is non-empty, it'll be used as the envelope sender. If it's empty
-   ** (the default), the value of the regular \fTFrom:\fP header will be used.
-   **
-   ** .pp
-   ** This may be necessary as some providers don't allow for arbitrary values
-   ** as the envelope sender but only a particular one which may not be the same as the
-   ** user's desired \fTFrom:\fP header.
-   */
+  {"smtp_envelope", DT_SYN, R_NONE, UL "envelope_from_address", 0 },
+
   {"smtp_host", DT_STR, R_NONE, UL &SmtpHost, "" },
   /*
    ** .pp
   {"smtp_host", DT_STR, R_NONE, UL &SmtpHost, "" },
   /*
    ** .pp
index 50a6f86..41da0e7 100644 (file)
@@ -358,8 +358,8 @@ int mutt_libesmtp_invoke (ADDRESS * from,       /* the sender */
     SMTPFAIL ("smtp_add_message");
 
   /*  Initialize envelope sender */
     SMTPFAIL ("smtp_add_message");
 
   /*  Initialize envelope sender */
-  if (SmtpEnvFrom && *SmtpEnvFrom)
-    envfrom = SmtpEnvFrom;
+  if (option (OPTENVFROM) && EnvFrom)
+    envfrom = EnvFrom->mailbox;
   if (!smtp_set_reverse_path (message, envfrom))
     SMTPFAIL ("smtp_set_reverse_path");
 
   if (!smtp_set_reverse_path (message, envfrom))
     SMTPFAIL ("smtp_set_reverse_path");
 
index f53f76a..804fec2 100644 (file)
--- a/pop/pop.c
+++ b/pop/pop.c
@@ -15,6 +15,7 @@
 #include "mx.h"
 #include "pop.h"
 #include "mutt_crypt.h"
 #include "mx.h"
 #include "pop.h"
 #include "mutt_crypt.h"
+#include "mutt_curses.h"
 
 #include "lib/mem.h"
 #include "lib/str.h"
 
 #include "lib/mem.h"
 #include "lib/str.h"
@@ -326,7 +327,7 @@ int pop_fetch_message (MESSAGE * msg, CONTEXT * ctx, int msgno)
   void *uidl;
   char buf[LONG_STRING];
   char path[_POSIX_PATH_MAX];
   void *uidl;
   char buf[LONG_STRING];
   char path[_POSIX_PATH_MAX];
-  char *m = _("Fetching message...");
+  progress_t bar;
   POP_DATA *pop_data = (POP_DATA *) ctx->data;
   POP_CACHE *cache;
   HEADER *h = ctx->hdrs[msgno];
   POP_DATA *pop_data = (POP_DATA *) ctx->data;
   POP_CACHE *cache;
   HEADER *h = ctx->hdrs[msgno];
@@ -364,7 +365,9 @@ int pop_fetch_message (MESSAGE * msg, CONTEXT * ctx, int msgno)
       return -1;
     }
 
       return -1;
     }
 
-    mutt_message (m);
+    bar.size = h->content->length + h->content->offset - 1;
+    bar.msg = _("Fetching message...");
+    mutt_progress_bar (&bar, 0);
 
     mutt_mktemp (path);
     msg->fp = safe_fopen (path, "w+");
 
     mutt_mktemp (path);
     msg->fp = safe_fopen (path, "w+");
@@ -376,7 +379,7 @@ int pop_fetch_message (MESSAGE * msg, CONTEXT * ctx, int msgno)
 
     snprintf (buf, sizeof (buf), "RETR %d\r\n", h->refno);
 
 
     snprintf (buf, sizeof (buf), "RETR %d\r\n", h->refno);
 
-    ret = pop_fetch_data (pop_data, buf, m, fetch_message, msg->fp);
+    ret = pop_fetch_data (pop_data, buf, &bar, fetch_message, msg->fp);
     if (ret == PQ_OK)
       break;
 
     if (ret == PQ_OK)
       break;
 
index 38205bb..bbafe1f 100644 (file)
--- a/pop/pop.h
+++ b/pop/pop.h
@@ -12,6 +12,7 @@
 
 #include "mx.h"
 #include "mutt_socket.h"
 
 #include "mx.h"
 #include "mutt_socket.h"
+#include "mutt_curses.h"
 
 #define POP_PORT 110
 #define POP_SSL_PORT 995
 
 #define POP_PORT 110
 #define POP_SSL_PORT 995
@@ -95,7 +96,7 @@ int pop_parse_path (const char *, ACCOUNT *);
 int pop_connect (POP_DATA *);
 pop_query_status pop_open_connection (POP_DATA *);
 pop_query_status pop_query_d (POP_DATA *, char *, size_t, char *);
 int pop_connect (POP_DATA *);
 pop_query_status pop_open_connection (POP_DATA *);
 pop_query_status pop_query_d (POP_DATA *, char *, size_t, char *);
-pop_query_status pop_fetch_data (POP_DATA *, char *, char *, int (*funct) (char *, void *),
+pop_query_status pop_fetch_data (POP_DATA *, char *, progress_t*, int (*funct) (char *, void *),
                     void *);
 pop_query_status pop_reconnect (CONTEXT *);
 void pop_logout (CONTEXT *);
                     void *);
 pop_query_status pop_reconnect (CONTEXT *);
 void pop_logout (CONTEXT *);
index 22b2eaa..fe30c11 100644 (file)
@@ -428,14 +428,15 @@ pop_query_status pop_query_d (POP_DATA * pop_data, char *buf, size_t buflen, cha
  * -2 - invalid command or execution error,
  * -3 - error in funct(*line, *data)
  */
  * -2 - invalid command or execution error,
  * -3 - error in funct(*line, *data)
  */
-pop_query_status pop_fetch_data (POP_DATA * pop_data, char *query, char *msg,
+pop_query_status pop_fetch_data (POP_DATA * pop_data, char *query, progress_t* bar,
                     int (*funct) (char *, void *), void *data)
 {
   char buf[LONG_STRING];
   char *inbuf;
   char *p;
   pop_query_status ret;
                     int (*funct) (char *, void *), void *data)
 {
   char buf[LONG_STRING];
   char *inbuf;
   char *p;
   pop_query_status ret;
-  int chunk, line = 0;
+  int chunk = 0;
+  long pos = 0;
   size_t lenbuf = 0;
 
   strfcpy (buf, query, sizeof (buf));
   size_t lenbuf = 0;
 
   strfcpy (buf, query, sizeof (buf));
@@ -463,14 +464,14 @@ pop_query_status pop_fetch_data (POP_DATA * pop_data, char *query, char *msg,
     }
 
     strfcpy (inbuf + lenbuf, p, sizeof (buf));
     }
 
     strfcpy (inbuf + lenbuf, p, sizeof (buf));
+    pos += chunk;
 
     if (chunk >= sizeof (buf)) {
       lenbuf += strlen (p);
     }
     else {
 
     if (chunk >= sizeof (buf)) {
       lenbuf += strlen (p);
     }
     else {
-      line++;
-      if (msg && ReadInc && (line % ReadInc == 0))
-        mutt_message ("%s %d", msg, line);
+      if (bar)
+        mutt_progress_bar (bar, pos);
       if (ret == 0 && funct (inbuf, data) < 0)
         ret = PFD_FUNCT_ERROR;
       lenbuf = 0;
       if (ret == 0 && funct (inbuf, data) < 0)
         ret = PFD_FUNCT_ERROR;
       lenbuf = 0;
@@ -506,6 +507,7 @@ pop_query_status pop_reconnect (CONTEXT * ctx)
 {
   pop_query_status ret;
   POP_DATA *pop_data = (POP_DATA *) ctx->data;
 {
   pop_query_status ret;
   POP_DATA *pop_data = (POP_DATA *) ctx->data;
+  progress_t bar;
 
   if (pop_data->status == POP_CONNECTED)
     return PQ_OK;
 
   if (pop_data->status == POP_CONNECTED)
     return PQ_OK;
@@ -517,15 +519,16 @@ pop_query_status pop_reconnect (CONTEXT * ctx)
 
     ret = pop_open_connection (pop_data);
     if (ret == PQ_OK) {
 
     ret = pop_open_connection (pop_data);
     if (ret == PQ_OK) {
-      char *msg = _("Verifying message indexes...");
       int i;
 
       int i;
 
+      bar.msg = _("Verifying message indexes...");
+      bar.size = 0;
+      mutt_progress_bar (&bar, 0);
+
       for (i = 0; i < ctx->msgcount; i++)
         ctx->hdrs[i]->refno = -1;
 
       for (i = 0; i < ctx->msgcount; i++)
         ctx->hdrs[i]->refno = -1;
 
-      mutt_message (msg);
-
-      ret = pop_fetch_data (pop_data, "UIDL\r\n", msg, check_uidl, ctx);
+      ret = pop_fetch_data (pop_data, "UIDL\r\n", &bar, check_uidl, ctx);
       if (ret == PQ_ERR) {
         mutt_error ("%s", pop_data->err_msg);
         mutt_sleep (2);
       if (ret == PQ_ERR) {
         mutt_error ("%s", pop_data->err_msg);
         mutt_sleep (2);
index 1e8ffe7..314c4a2 100644 (file)
--- a/sendlib.c
+++ b/sendlib.c
@@ -2025,9 +2025,16 @@ static int mutt_invoke_sendmail (ADDRESS * from,        /* the sender */
     if (eightbit && option (OPTUSE8BITMIME))
       args = add_option (args, &argslen, &argsmax, "-B8BITMIME");
 
     if (eightbit && option (OPTUSE8BITMIME))
       args = add_option (args, &argslen, &argsmax, "-B8BITMIME");
 
-    if (option (OPTENVFROM) && from && !from->next) {
-      args = add_option (args, &argslen, &argsmax, "-f");
-      args = add_args (args, &argslen, &argsmax, from);
+    if (option (OPTENVFROM)) {
+      ADDRESS *f = NULL;
+      if (EnvFrom)
+        f = EnvFrom;
+      else if (from && !from->next)
+        f = from;
+      if (f) {
+        args = add_option (args, &argslen, &argsmax, "-f");
+        args = add_args (args, &argslen, &argsmax, f);
+      }
     }
     if (DsnNotify) {
       args = add_option (args, &argslen, &argsmax, "-N");
     }
     if (DsnNotify) {
       args = add_option (args, &argslen, &argsmax, "-N");