Some improvements

---------

From: W. Tasin (tasin@fhm.edu)
Date: Wed Feb 14 2001 - 07:39:29 CST


Hi hypermail-developers,

thx for the great tool, I setted up some mailing lists with it.

I developed my own webmailer
(http://ftp.ee.fhm.edu/pub/unix/wxwmail-0.3beta1.tar.gz), because
I wanted to have a more flexible webmailer.
I think it is a good enhancement for hypermail usage.

If you like it, feel free to name it on your site ;-)

For me there were also some problems with hypermail,
which are now handled by the attached patch (can also be obtained at:
ftp://ftp.ee.fhm.edu/pub/unix/patches-hypermail-2b30.diff).

Please have a look at them, maybe they are of interest for your new
release:

=================
==Here a description of what I made:
=================

--- hypermail-2b30/src/lang.h Sun May 28 18:43:28 2000
+++ hypermail-2b30/src/lang.h Tue Jan 30 16:44:59 2001
@@ -159,10 +159,10 @@
    "Über diese Liste", /* About this list -HTML*/
    "Ende der Nachricht", /* End of Messages -HTML*/
    "Anfang der Nachricht", /* Start of Messages -HTML*/
- "Datums-Sicht", /* Date view -HTML*/
- "Thread-Sicht", /* Thread view -HTML*/
- "Subject-Sicht", /* Subject view -HTML*/
- "Autor-Sicht", /* Author view -HTML*/
+ "Datumsansicht", /* Date view -HTML*/
+ "Baumansicht", /* Thread view -HTML*/
+ "Betreffansicht", /* Subject view -HTML*/
+ "Autorenansicht", /* Author view -HTML*/
    "Weitere Gruppen", /* Other groups -HTML*/
......
=================
==some changements in the german translation
==(this is of course optional, because some like it in the first way...
==but I guess it would be a better translation ;-))
=================

--- hypermail-2b30/src/parse.c Thu Jun 8 00:10:44 2000
+++ hypermail-2b30/src/parse.c Sun Jan 28 16:05:56 2001
@@ -998,6 +998,7 @@
                char *dir, int inlinehtml, /* if HTML should be inlined */
                int startnum)
  {
+
      FILE *fp;
      char *date = NULL;
      char *subject = NULL;
@@ -1307,7 +1308,14 @@
           
            file_created = MAKE_FILE; /* please make one */
           
        }
                      }
+
            else if (!strncasecmp(head->line, "Content-Base:", 13)) {
+
                char *ptr = head->line + 13;
+ content=CONTENT_IGNORE;
+
                /* we must make sure this is not parsed more times
+
                   than this */
+
                head->parsedheader = TRUE;

+ }
                      else if (!strncasecmp(head->line, "Content-Type:", 13)) {
           
        char *ptr = head->line + 13;
  #define DISP_HREF 1
=================
==if a Content-Base is found so ignore the stuff because it is on another
==server and it would never be parsed well inside the mail...
==(this is more a workaround than a good patch... a better way would be to
==include this to every link inside the content... to show up also this
==external site... but I think it is an easy way to handle this problem)
=================
@@ -1994,7 +2002,7 @@
           
                else
           
                    fname = FILE_SUFFIXER;

-
                        binname = maprintf("%s%c%.2d-%s",
+
                        binname = maprintf("%s%c%05d-%s",
           
                                   att_dir, PATH_SEPARATOR,
           
                                   att_counter, fname);
           
                /* @@ move this one up */
=================
==expanding the att counter to 5 digits, not very important, but I think
=="02" instead of ".2" for the format specifier is more ANSI conforming. =
=================
           
                
--- hypermail-2b30/src/print.c Thu Jun 8 00:11:32 2000
+++ hypermail-2b30/src/print.c Sat Feb 3 23:14:09 2001
@@ -75,8 +75,9 @@

      if (set_mailcommand) {
          if (set_hmail) {
-
     ptr = makemailcommand("mailto:$TO", set_hmail, "", "");
-
     fprintf(fp, "<th><a href=\"%s\">%s</a></th>\n",
+
     ptr = makemailcommand(set_mailcommand, set_hmail, "", "");
+ if (strcmp(ptr, "NONE")!=0)
+
      fprintf(fp, "<th><a href=\"%s\">%s</a></th>\n",
                      ptr ? ptr : "", lang[MSG_NEW_MESSAGE]);
              if (ptr)
                  free(ptr);
=================
==adding NONE as value for hm_mailcommand, so "New Message" will not be
shown
=================
@@ -86,7 +87,8 @@

                  ptr = makemailcommand(set_mailcommand, set_hmail,
           
                      currentid, cursub);
-
        fprintf(fp, "<th><a href=\"%s\">%s</a></th>\n",
+
        if (strcmp(ptr, "NONE")!=0)
+
          fprintf(fp, "<th><a href=\"%s\">%s</a></th>\n",
           
        ptr ? ptr : "", lang[MSG_REPLY]);
                  if (ptr)
                      free(ptr);
=================
==adding NONE as value for hm_mailcommand, so "New Message" will not be
shown
=================
@@ -498,6 +500,7 @@
          }
          else {
              if (inheader) {
+ insig=0;
                  if (set_showhtml) {
                    if (pre) {
           
        fprintf(fp, "</pre>\n");

=================
==that's the most important bugfix:
==after a signature a normal textfile could follow as an inline
==attachment.
==W/o this the attached textfile wouldn't be formatted well, so if a
==header follows the insig-flag would be resetted.
=================
@@ -756,7 +759,7 @@
  #endif
          if (!strcmp(email->name, email->emailaddr)) {
              if (use_mailcommand) {
-
        ptr = makemailcommand(set_mailcommand,
+
        ptr = makemailcommand(set_bodymailcommand,
           
                      email->emailaddr,
           
                      email->msgid, email->subject);
                  fprintf(fp, "<strong>From:</strong> <a href=\"%s\">", ptr ? ptr : "");
@@ -768,8 +771,8 @@
                  fprintf(fp, "<em>%s</em><br>\n", email->name);
          }
          else {
-
     if (use_mailcommand) {
-
        ptr = makemailcommand(set_mailcommand,
+
     if (use_mailcommand && strcmp(email->emailaddr,"(no email)")!=0) {
+
        ptr = makemailcommand(set_bodymailcommand,
           
                      email->emailaddr,
           
                      email->msgid, email->subject);
                  fprintf(fp, "<strong>From:</strong> %s (<a href=\"%s\">",
@@ -779,9 +782,12 @@
                  fprintf(fp, "<em>%s</em></a>)<br>\n", email->emailaddr);
              }
              else
+
     {
                  fprintf(fp,
           
        "<strong>From:</strong> %s (<em>%s</em>)<br>\n",
-
                email->name, email->emailaddr);
+
                email->name,
+
                (strcmp(email->emailaddr,"(no email)")!=0) ? email->emailaddr : "no email");
+
     }
          }
          fprintf(fp, "<strong>Date:</strong> %s\n<p>\n",
                  getdatestr(email->date));
=================
==if "(no email)" was passed, so don't make this entry clickable!
=================
--- hypermail-2b30/src/setup.c Thu Jun 8 00:14:25 2000
+++ hypermail-2b30/src/setup.c Sun Jan 28 16:05:56 2001
@@ -47,6 +47,7 @@
  int set_locktime;

  char *set_mailcommand;
+char *set_bodymailcommand;
  char *set_mailto;
  char *set_hmail;
  char *set_domainaddr;
@@ -219,6 +220,13 @@
       "# This is an octal number representing the file permissions\n"
       "# that new files are set to when they are created.\n"},

+ {"bodymailcommand", &set_bodymailcommand, MAILCOMMAND, CFG_STRING,
+ "# This specifies the mail command to use when converting\n"
+ "# email addresses to links. The variables $TO, $SUBJECT,\n"
+ "# and $ID can be used in constructing the command string.\n"
+ "# This command is used inside the mail bodies and in the\n"
+ "# From: line.\n"},
+
      {"mailcommand", &set_mailcommand, MAILCOMMAND, CFG_STRING,
       "# This specifies the mail command to use when converting\n"
       "# email addresses to links. The variables $TO, $SUBJECT,\n"
@@ -622,6 +630,7 @@
      printf("set_dateformat = %s\n",set_dateformat ? set_dateformat :
"Not set");
      printf("set_stripsubject = %s\n",set_stripsubject ?
set_stripsubject : "Not set");
      printf("set_mailcommand = %s\n",set_mailcommand ? set_mailcommand
: "Not set");
+ printf("set_bodymailcommand = %s\n",set_bodymailcommand ?
set_bodymailcommand : "Not set");
      printf("set_mailto = %s\n",set_mailto ? set_mailto : "Not set");
      printf("set_hmail = %s\n",set_hmail ? set_hmail : "Not set");
      printf("set_domainaddr = %s\n",set_domainaddr ? set_domainaddr :
"Not set");
--- hypermail-2b30/src/setup.h Thu Jun 8 00:14:25 2000
+++ hypermail-2b30/src/setup.h Sun Jan 28 16:05:56 2001
@@ -73,6 +73,7 @@
  extern char *set_label;

  extern char *set_mailcommand;
+extern char *set_bodymailcommand;
  extern char *set_mailto;
  extern char *set_hmail;
  extern char *set_domainaddr;

=================
==another enhancement! [;-)]
==I had the problem. My Webmail Form is fixed in the destination email
==address (only for posting into the mailinglist). For security
==consideration I don't want to allow the user to specify the destination,
==but clicking on a email address inside the mail content would start the
==webform. With this extension two different email commands could be
==specified.
==(e.g.
==hm_mailcommand="/cgi-bin/foren/wxwmail?replyof=$ID&subject=$SUBJECT&label=test"
==hm_bodymailcommand=mailto:$TO?subject=$SUBJECT)
=================
--- hypermail-2b30/src/string.c Thu Jun 8 00:15:34 2000
+++ hypermail-2b30/src/string.c Sun Jan 28 16:05:56 2001
@@ -568,7 +568,7 @@
      char *newcmd = NULL;
      char *newcmd2;

- if (isre(subject, NULL))
+ if (subject && isre(subject, NULL))
          hasre = 1;
      else
          hasre = 0;
@@ -576,9 +576,9 @@
      convsubj = convchars(subject);

      /* remade to deal with any-length strings */
- tmpsubject = maprintf("%s%s", (hasre) ? "" : "Re: ", convsubj);
+ /* tmpsubject = maprintf("%s%s", (hasre) ? "" : "Re: ", (convsubj)
? convsubj : ""); */
+ tmpsubject = maprintf("%s%s", (convsubj && !hasre) ? "Re: " : "",
(convsubj) ? convsubj : "");

- if (tmpsubject) {

          if ((cp = strrchr(email, ' ')) != NULL)
              *cp = '\0';
@@ -587,7 +587,7 @@
          newcmd2 = replace(newcmd, "$ID", id);
          free(newcmd);

-
newcmd = replace(newcmd2, "$SUBJECT", tmpsubject);
+
newcmd = replace(newcmd2, "$SUBJECT", (tmpsubject) ? tmpsubject : "");
          free(newcmd2);

          newcmd2 = replacechar(newcmd, '%', "%25");
@@ -602,7 +602,7 @@
          newcmd = newcmd2; /* this is the new string */

          free(tmpsubject);
- }
+
      free(convsubj);
      return newcmd;
  }
=================
==getting rid of (nil) inside the predefined fields of the web form...
=================
@@ -678,7 +678,7 @@
                              ptr-email, email, at, mailbuff);

                      if (valid_root_domain(mailaddr)) {
-
                char *mailcmd = makemailcommand(set_mailcommand,
+
                char *mailcmd = makemailcommand(set_bodymailcommand,
           
                                        mailaddr, mid,
           
                                        msubject);
           
        msnprintf(tempbuff, sizeof(tempbuff),

=================
That's all!
           
        
Ciao

Walter

-- 
-- 
oohhh sveglia.... il mondo e' ammalato, ma x colpa di chi.........
(Zucchero)
:-------W. Tasin, FB 04,
FHM-------------------PGP-KeyID:0x7961A645----------:
<Key-Fingerprint: 1610 835F 0080 32F4 6140  6CF7 A7D0 44CD 7961A645>
<http://wwwkeys.pgp.net:11371/pks/lookup?op=index&search=0x7961A645&fingerprint=on=3



---------

This archive was generated by hypermail 2.1.5.