As I think I said a couple of weeks back, I'd been working on a version of Hypermail before discovering this group.
I've now folded most of the changes I'd made into hypermail-20b3 with Andrew Tridgell's patch applied. For anyone interested, diffs follow.
Changes:
Added a file lock based on that from "movemail" for
incrementally updating big busy lists; I'd found that if sendmail
stalled for some reason (hich load, out of space etc.), then restarted,
several concurrent versions of hypermail would start and mess each other
up. With Andrew T's patch, it may be fast enough, but I put the lock stuff
back.
Added a stylesheet cookie and default value.
Added DC.Publisher META tag
Changed Author META tag to DC.Creator
DC is Dublin Core from http://purl.org/metadata/dublin_core_elements I'm considering adding more elements e.g. Date if it makes sense. (didn't make it to the workshop this year .. :-( )
(I suppose the stylesheet and Publisher could have just been done in the .hyp prototypes; didn't think of it at the time. Duh!)
Andrew Daviel
http://vancouver-webpages.com/andrew
Deniable unless digitally signed.
AC_ARG_ENABLE(defaultindex,[ --enable-defaultindex=type Use this type of index page for the default],"thread.html")
-for ac_hdr in unistd.h stdio.h sys/types.h sys/stat.h stdlib.h pwd.h arpa/inet.h netdb..h netinet/in.h string.h sys/socket.h
+for ac_hdr in unistd.h stdio.h sys/types.h sys/stat.h stdlib.h pwd.h arpa/inet.h netdb.h netinet/in.h string.h sys/socket.h sys/file.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
--- hypermail-20b3/src/hypermail.c Thu Aug 20 16:12:36 1998 +++ hypermail-20b3a/src/hypermail.c Mon Nov 2 01:48:57 1998
#include "hypermail.h" +#ifdef HAVE_SYS_FILE_H +#include <sys/file.h> +/* lockfile settings - sleep granularity and stale lock timeout +in seconds. Adjust so that concurrently spawned instances can +all complete for your size of archive */ +#define SLEEPTIME 5 +#define STALE 300
static char *savstrval(char *d, char *envvar)
{
_at_@ -117,6 +125,12 @@
int i, overwrite, use_stdin, use_mbox, increment, show_variables; char mbox[MAXLINE], label[MAXLINE], dir[MAXLINE]; char configfile[MAXLINE], defaultindex[MAXLINE]; +#ifdef HAVE_SYS_FILE_H + char tempname[MAXLINE], lockname[MAXLINE] ; + char *delete_lockname ; + int desc, tem, age ; + struct stat st ;
/* temporary cmdline option variables */ char *cmd_archives, *cmd_about, *cmd_dir;
_at_@ -251,7 +265,7 @@
*/ readconfigs(configfile, mbox, label, dir, archives, about, - &overwrite, &increment, defaultindex); + &overwrite, &increment, defaultindex, style, publish); /* ** Now override the configuration file variables with any explicitly
_at_@ -361,6 +375,8 @@
strcpy(subjname,(!strcmp(defaultindex, "subject")) ? INDEXNAME : SUBJNAME); strcpy(authname,(!strcmp(defaultindex, "author")) ? INDEXNAME : AUTHNAME);
+
+
/* ** A little performance speed up. The following was being done ** over and over in the write functions. This way it is done once.
if (show_variables) { dump_config(mbox, label, dir, archives, about, - overwrite, increment, defaultindex); + overwrite, increment, defaultindex, style, publish); printf("\nCommand and Control Variables:\n"); printf("use_stdin = %s\n", use_stdin ? "Yes" : "No");
_at_@ -409,6 +425,34 @@
if (use_mbox && use_stdin) progerr("Can't read from file and stdin at once."); +#ifdef HAVE_SYS_FILE_H + sprintf(lockname, "%s/Hypermail.lock" , dir) ; + sprintf(tempname, "%s/Hypermail.lck" , dir) ; + mktemp (tempname); + unlink (tempname); + delete_lockname = 0; + while (1) { + /* Create the lock file, but not under the lock file name. */ + /* Give up if cannot do that. */ + desc = open (tempname, O_WRONLY | O_CREAT | O_EXCL, 0666); + if (desc < 0) { + if (delete_lockname) unlink (delete_lockname); + exit(1) ; + } + close (desc); + tem = link (tempname, lockname); + unlink (tempname); + if (tem >= 0) break; + sleep (SLEEPTIME); + /* If lock file is too old, unlock it. */ + if (stat (lockname, &st) >= 0) { + age = time (0) - st.st_ctime ; + if ( age > STALE) unlink (lockname); + } + } + delete_lockname = lockname;
gettimezone(); getthisyear();-
_at_@ -454,7 +498,9 @@
if (ihtmlfooter) free(ihtmlfooter); if (mhtmlheader) free(mhtmlheader); if (mhtmlfooter) free(mhtmlfooter);
+#ifdef HAVE_SYS_FILE_H + unlink (lockname); +#endif return(0);
-void dump_config(char *mbox, char *label, char *dir, char *archives, - char *about, int overwrite, int increment, char *defaultindex)
+void dump_config(char *mbox, char *label, char *dir, char *archives, + char *about, int overwrite, int increment, char *defaultindex, + char *style, char *publish) { register char *cp;
_at_@ -220,6 +221,8 @@
printf("mbox = %s\n",*mbox ? mbox : "Not Used"); printf("label = %s\n",*label ? label : "Not set"); printf("archives = %s\n",*archives ? archives : "Not set"); + printf("style = %s\n",*style ? style : "Not set"); + printf("publish = %s\n",*publish ? publish : "Not set"); printf("about = %s\n",*about ? about : "Not set"); printf("dir = %s\n",*dir ? dir : "Not set"); printf("defaultindex = %s\n",*defaultindex ? defaultindex : "Not set");
void readconfigs(char *path, char *mbox, char *label, char *dir,
- char *archives, char *about, int *overwrite, - int *increment, char *defaultindex) + char *archives, char *about, int *overwrite, + int *increment, char *defaultindex, char *style, char *publish) { char *tmpfpath; char tmppath[MAXFILELEN], line[MAXLINE], value[MAXLINE];
_at_@ -326,6 +329,10 @@
strcpy(label, value); else if (getconfvalue(line, "hm_archives", value) != NULL) strcpy(archives, value); + else if (getconfvalue(line, "hm_style", value) != NULL) + strcpy(style, value); + else if (getconfvalue(line, "hm_publish", value) != NULL) + strcpy(publish, value); else if (getconfvalue(line, "hm_about", value) != NULL) strcpy(about, value); else if (getconfvalue(line, "hm_dir", value) != NULL) --- hypermail-20b3/src/printfile.c Thu Aug 20 16:12:36 1998 +++ hypermail-20b3a/src/printfile.c Mon Nov 2 01:04:18 1998
_at_@ -22,9 +22,11 @@
** %p - PROGNAME ** %s - Subject of message or Index Title ** %v - VERSION +** %y - Stylesheet TAG ** %u - Expanded version link (HMURL,PROGNAME,VERSION) ** %S - Subject META TAG - Not valid on index pages ** %A - Author META TAG - Not valid on index pages +** %P - Publisher TAG ** \n - newline character ** \t - tab character
continue; case 'A': /* %e - email address of message author */ if (email && name) { - fprintf(fp,"<META NAME=\"Author\" CONTENT=\"%s (%s)\">", + fprintf(fp,"<META NAME=\"DC.Creator\" CONTENT=\"%s (%s)\">", name, email); } continue;-
_at_@ -122,9 +124,12 @@
putc(*cp, fp); continue; case 'S': /* %s - Subject of message or Index Title */ - fprintf(fp,"<META NAME=\"Subject\" CONTENT=\"%s\">", + fprintf(fp,"<META NAME=\"DC.Subject\" CONTENT=\"%s\">", convchars(subject)); continue; + case 'y': /* %y - stylesheet */ + fprintf(fp,"<LINK REL=STYLESHEET HREF=\"%s\">",style) ; + continue; case 'v': /* %v - VERSION */ for (cp = VERSION; *cp; cp++) putc(*cp, fp);
_at_@ -133,6 +138,9 @@
fprintf(fp,"<A HREF=\"%s\">%s %s</A>", HMURL, PROGNAME, VERSION); continue; + case 'P': /* %P - Publisher */ + fprintf(fp,"<META NAME=\"DC.Publisher\" CONTENT=\"%s\">",publish) ; + continue; default: putc('%', fp); putc('?', fp);
_at_@ -179,10 +187,13 @@
*rp-- = '\0'; fprintf(fp,"<TITLE>%s</TITLE>\n", title);
+ fprintf(fp,"<LINK REL=STYLESHEET HREF=\"%s\">\n",style) ; if (name && email) - fprintf(fp,"<META NAME=\"Author\" CONTENT=\"%s (%s)\">\n",name,email); - fprintf(fp,"<META NAME=\"Subject\" CONTENT=\"%s\">\n", convchars(subject)); + fprintf(fp,"<META NAME=\"DC.Creator\" CONTENT=\"%s (%s)\">\n",name,email); + fprintf(fp,"<META NAME=\"DC.Subject\" CONTENT=\"%s\">\n", convchars(subject)); + if (*publish) + fprintf(fp,"<META NAME=\"DC.Publisher\" CONTENT=\"%s\">\n",publish) ; if (use_mailto) fprintf(fp,"<LINK REV=\"made\" HREF=\"mailto:%s\">\n",mailto); fprintf(fp,"</HEAD>\n"); --- hypermail-20b3/src/proto.h Thu Aug 20 16:12:36 1998 +++ hypermail-20b3a/src/proto.h Mon Nov 2 00:07:06 1998
void dump_config(char *mbox, char *label, char *dir,
char *archives, char *about, int overwrite, - int increment, char *defaultindex); + int increment, char *defaultindex, char *style, char *publish); void readconfigs(char *path, char *mbox, char *label, char *dir, char *archives, char *about, int *overwrite, - int *increment, char *defaultindex); + int *increment, char *defaultindex, char *style, char *publish);
/*
+/* Define if you have the <sys/file.h> header file. */ +#undef HAVE_SYS_FILE_H +
This archive was generated by hypermail 2.3.0 : Sat 13 Mar 2010 03:46:11 AM GMT GMT