[hypermail] Some improvements

From: W. Tasin <tasin_at_fhm.edu_at_hypermail-project.org>
Date: Wed, 14 Feb 2001 14:39:29 +0100
Message-ID: <3A8A8A91.8010008_at_fhm.edu>


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:

            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)


_at_@ -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);            

                /* _at_@ 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. =

                            
      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

_at_@ -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

_at_@ -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.


_at_@ -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 : "");
_at_@ -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\">",
_at_@ -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!

  char *set_mailcommand;
+char *set_bodymailcommand;

  char *set_mailto;
  char *set_hmail;
  char *set_domainaddr;
_at_@ -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"
_at_@ -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
_at_@ -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)

      /* 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 ((cp = strrchr(email, ' ')) != NULL)
  	    *cp = '\0';
_at_@ -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"); _at_@ -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...


_at_@ -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>



Received on Wed 14 Feb 2001 06:06:30 PM GMT

This archive was generated by hypermail 2.3.0 : Sat 13 Mar 2010 03:46:12 AM GMT GMT