From: markus schnalke Date: Sat, 4 Feb 2012 12:08:51 +0000 (+0100) Subject: Removed mts.conf; the maildelivery option went into slocal directly. X-Git-Tag: mmh-thesis-end~370 X-Git-Url: http://git.marmaro.de/?p=mmh;a=commitdiff_plain;h=d3540eaa4251b3a282115a72ed5d1bb39ce74b3f Removed mts.conf; the maildelivery option went into slocal directly. The MTS is a non-MUA part of MH, which is/gets removed in MMH. Now, you cannot change the global maildelivery file without changing the code. You stil can specify -maildelivery to slocal. I've also remove support for the env vars MHMTSCONF and MHMTSUSERCONF, which were added by Earl Hood in 2010. We might want to add support for them again. I need to think about the future of slocal anyway. --- diff --git a/INSTALL b/INSTALL index d4bd38f..89c9ac8 100644 --- a/INSTALL +++ b/INSTALL @@ -53,19 +53,7 @@ need an ANSI C compiler such as gcc. existing file. Watch for information messages while make is processing that directory to see if you need to merge changes. -5) Edit the file `mts.conf' (installed in the mmh `etc' directory) - and make any necessary changes for the mail transport interface - you are using. - - The default `mts.conf' file assumes you retrieve new mail from - a local (or NFS mounted) maildrop, and send outgoing mail by - injecting the message to a mail transfer agent (such as sendmail) - on the local machine. - - Check the `mts.conf(5)' man page for a list of all the available - options for this file. - -6) Edit the file `mhn.defaults' (installed in the mmh `etc' directory). +5) Edit the file `mhn.defaults' (installed in the mmh `etc' directory). This file contains the default profile entries for the mmh commands mhlist/mhstore/mhshow and is created by the script `mhn.defaults.sh'. This script will search a generic path (essentially your $PATH) for @@ -141,7 +129,7 @@ Options for configure mmh's support binaries (spost, slocal, mhl, ...) are installed here. --sysconfdir=DIR (DEFAULT is ${prefix}/etc) - mmh's config files (mts.conf, mhn.defaults, ...) are installed here. + mmh's config files (mhn.defaults, ...) are installed here. --mandir=DIR (DEFAULT is ${prefix}/man) mmh's man pages are installed here. diff --git a/docs/README.manpages b/docs/README.manpages index 90451b9..5e1004b 100644 --- a/docs/README.manpages +++ b/docs/README.manpages @@ -69,8 +69,8 @@ Source files .PP Of course, replace "components" with a unique identifier that - reflects the content being included, like "mts_conf" for - etc/mts.conf. Then, add two lines to the man.sed target in + reflects the content being included, like "mhl_reply" for + etc/mhl.reply. Then, add two lines to the man.sed target in Makefile.in like: echo '/%components%/r $(top_srcdir)/etc/components' >> $@ diff --git a/etc/Makefile.in b/etc/Makefile.in index 0c7736d..5de4e41 100644 --- a/etc/Makefile.in +++ b/etc/Makefile.in @@ -42,7 +42,7 @@ STATIC_FILES = components digestcomps distcomps forwcomps \ scan.timely scan.unseen # templates and scripts from which non-static files are generated -GENERATED_FILE_SRCS = mhn.defaults.sh mhn.find.sh mts.conf.in sendfiles.in +GENERATED_FILE_SRCS = mhn.defaults.sh mhn.find.sh sendfiles.in # scripts generated using above GENERATED_FILE_SRCs; don't add binaries # to this list, as they'll get installed with INSTALL_SCRIPT and won't @@ -50,7 +50,7 @@ GENERATED_FILE_SRCS = mhn.defaults.sh mhn.find.sh mts.conf.in sendfiles.in GENERATED_BIN_FILES = sendfiles # non-scripts generated using above GENERATED_FILE_SRCs -GENERATED_ETC_FILES = mhn.defaults mts.conf +GENERATED_ETC_FILES = mhn.defaults # auxiliary files (included in distribution but not installed) AUX = Makefile.in @@ -66,11 +66,6 @@ mhn.defaults: $(srcdir)/mhn.defaults.sh $(MHNSEARCHPROG) rm -f $@ $(srcdir)/mhn.defaults.sh $(MHNSEARCHPATH) $(MHNSEARCHPROG) > $@ -mts.conf: $(srcdir)/mts.conf.in Makefile - rm -f $@ - $(SED) -e 's,%mailspool%,$(mailspool),' \ - -e 's,%etcdir%,$(etcdir),' < $(srcdir)/mts.conf.in > $@ - sendfiles: $(srcdir)/sendfiles.in Makefile rm -f $@ $(SED) -e 's,%libdir%,$(libdir),' < $(srcdir)/sendfiles.in > $@ diff --git a/h/mts.h b/h/mts.h index a0f83dc..2155e05 100644 --- a/h/mts.h +++ b/h/mts.h @@ -8,17 +8,5 @@ char *LocalName(void); char *SystemName(void); - char *getusername(void); char *getfullname(void); - - -/* -** Read mts.conf file -*/ -void mts_init(char *); - -/* -** Global MailDelivery File -*/ -extern char *maildelivery; diff --git a/man/Makefile.in b/man/Makefile.in index de3c254..8998184 100644 --- a/man/Makefile.in +++ b/man/Makefile.in @@ -55,7 +55,7 @@ MAN1SRC = ali. anno. burst. comp. dist. flist. flists. folder. folders. \ rcvstore. rcvtty. refile. repl. rmf. rmm. scan. send. sendfiles. \ show. slocal. sortm. whatnow. -MAN5SRC = mh-alias. mh-format. mh-mail. mh-profile. mh-tailor. mts.conf. +MAN5SRC = mh-alias. mh-format. mh-mail. mh-profile. mh-tailor. MAN7SRC = mmh-intro. mh-draft. mh-sequence. diff --git a/man/ap.man8 b/man/ap.man8 index 0a5ac5a..af967df 100644 --- a/man/ap.man8 +++ b/man/ap.man8 @@ -83,7 +83,6 @@ the address. .nf .ta \w'%etcdir%/ExtraBigFileName 'u ^$HOME/.mmh/profile~^The user profile -^%etcdir%/mts.conf~^nmh mts configuration file .fi .SH "PROFILE COMPONENTS" diff --git a/man/conflict.man8 b/man/conflict.man8 index 4df7094..dc05548 100644 --- a/man/conflict.man8 +++ b/man/conflict.man8 @@ -62,7 +62,6 @@ or whenever system accounting takes place. .fc ^ ~ .nf .ta \w'%etcdir%/ExtraBigFileName 'u -^%etcdir%/mts.conf~^nmh mts configuration file ^/etc/passwd~^List of users ^/etc/group~^List of groups ^%bindir%/mhmail~^Program to send mail diff --git a/man/inc.man1 b/man/inc.man1 index 1dc9589..40a04c5 100644 --- a/man/inc.man1 +++ b/man/inc.man1 @@ -163,7 +163,6 @@ in the background and going on to other things. .nf .ta \w'%etcdir%/ExtraBigFileName 'u ^$HOME/.mmh/profile~^The user profile -^%etcdir%/mts.conf~^nmh mts configuration file ^%mailspool%/$USER~^Location of mail drop .fi diff --git a/man/mh-tailor.man5 b/man/mh-tailor.man5 index e3a949a..60545da 100644 --- a/man/mh-tailor.man5 +++ b/man/mh-tailor.man5 @@ -3,29 +3,13 @@ .\" .TH MH-TAILOR %manext5% "%nmhdate%" MH.6.8 [%nmhversion%] .SH NAME -mh-tailor, mts.conf \- mail transport customization for nmh message handler -.SH SYNOPSIS -.I %etcdir%/mts.conf +mh\-tailor \- obsolete man page .SH DESCRIPTION -The file -.I %etcdir%/mts.conf -defines run-time options for those -.B nmh -programs which interact (in some form) with the message transport system. -At present, these (user) programs are: -.BR ap , -.BR conflict , -.BR inc , -.BR msgchk , -.BR post , -.BR rcvdist , -and -.BR rcvpack . -.PP -Each option should be given on a single line. Blank lines and lines -which begin with `#' are ignored. The options available along with -default values and a description of their meanings are listed below: -.PP +.B "This man page is in transition state. +.B "It's original use is gone. +.B "Eventually it will be removed. +.B "Until then, it contains information that have no better place yet. +.SS "Spost's handling of From: headers .B spost will send messages by forking a local copy of @@ -37,16 +21,6 @@ uses it rather than constructing its own. However, to discourage email forgery, the SMTP envelope \*(lqFrom:\*(rq and a \*(lqSender:\*(rq header are set to the user's real address. .RE -.PP -.BR maildelivery : -%libdir%/maildelivery -.RS 5 -The name of the system-wide default -.I maildelivery -file. -See -.BR slocal (1) -for the details. .SS "File Locking" A few words on locking: .B nmh @@ -88,19 +62,3 @@ Prior to installing .BR nmh , you should see how locking is done at your site, and set the appropriate values. - -.SH FILES -.fc ^ ~ -.nf -.ta \w'%etcdir%/ExtraBigFileName 'u -^%etcdir%/mts.conf~^nmh mts configuration file -.fi - -.SH "PROFILE COMPONENTS" -None - -.SH "SEE ALSO" -mh\-mts(8), post(8) - -.SH DEFAULTS -As listed above diff --git a/man/mts.conf.man5 b/man/mts.conf.man5 deleted file mode 100644 index 9d534fd..0000000 --- a/man/mts.conf.man5 +++ /dev/null @@ -1 +0,0 @@ -.so man5/mh-tailor.5 diff --git a/man/rcvdist.man1 b/man/rcvdist.man1 index 3653f47..21bc1dc 100644 --- a/man/rcvdist.man1 +++ b/man/rcvdist.man1 @@ -70,7 +70,6 @@ profile component. .ta \w'%etcdir%/ExtraBigFileName 'u ^%etcdir%/rcvdistcomps~^Default message skeleton ^or $HOME/.mmh/rcvdistcomps~^Rather than standard message skeleton -^%etcdir%/mts.conf~^nmh mts configuration file ^$HOME/\&.maildelivery~^The file controlling local delivery ^%etcdir%/maildelivery~^Rather than the standard file .fi diff --git a/man/rcvpack.man1 b/man/rcvpack.man1 index 8c9da9e..55305f2 100644 --- a/man/rcvpack.man1 +++ b/man/rcvpack.man1 @@ -37,7 +37,6 @@ shell scripts. .fc ^ ~ .nf .ta \w'%etcdir%/ExtraBigFileName 'u -^%etcdir%/mts.conf~^nmh mts configuration file .fi .SH "SEE ALSO" diff --git a/man/rcvtty.man1 b/man/rcvtty.man1 index f098b21..3a141e3 100644 --- a/man/rcvtty.man1 +++ b/man/rcvtty.man1 @@ -103,7 +103,6 @@ instead. .fc ^ ~ .nf .ta \w'%etcdir%/ExtraBigFileName 'u -^%etcdir%/mts.conf~^nmh mts configuration file ^$HOME/\&.maildelivery~^The file controlling local delivery ^%etcdir%/maildelivery~^Rather than the standard file .fi diff --git a/man/slocal.man1 b/man/slocal.man1 index bf6c210..e2b6051 100644 --- a/man/slocal.man1 +++ b/man/slocal.man1 @@ -368,7 +368,6 @@ quicker delivery into your maildrop. .fc ^ ~ .nf .ta \w'%etcdir%/ExtraBigFileName 'u -^%etcdir%/mts.conf~^nmh mts configuration file ^$HOME/\&.maildelivery~^The file controlling local delivery ^%etcdir%/maildelivery~^Rather than the standard file ^%mailspool%/$USER~^The default maildrop diff --git a/sbr/Makefile.in b/sbr/Makefile.in index 95ff94c..d05672c 100644 --- a/sbr/Makefile.in +++ b/sbr/Makefile.in @@ -105,9 +105,6 @@ lint: sigmsg.h dtimep.c: dtimep.lex $(LEX) -n -t $(srcdir)/dtimep.lex > dtimep.c -mts.o: mts.c - $(COMPILE2) $(srcdir)/mts.c - pidstatus.o: sigmsg.h libmh.a: $(OBJS) diff --git a/sbr/m_getfld.c b/sbr/m_getfld.c index a2dba26..4dbd94f 100644 --- a/sbr/m_getfld.c +++ b/sbr/m_getfld.c @@ -30,9 +30,6 @@ ** the eom() macro returns FALSE saying we aren't at the end of the ** message. ** -** The next thing to do is to read the mts.conf file and initialize -** delimiter[] and delimlen accordingly... -** ** After mhl was made a built-in in msh, m_getfld() worked just fine ** (using m_unknown() at startup). Until one day: a message which was ** the result of a bursting was shown. Then, since the burst boundaries @@ -57,6 +54,9 @@ ** the code gets executed is when inc (or msh) calls it, and both of these ** have already called mts_init(). ** +** [ Note by meillo 2012-02: +** MMDF-style maildrops (4x ^A) and mts_init() were removed. ] +** ** ------------------------ ** (Written by Van Jacobson for the mh6 m_getfld, January, 1986): ** diff --git a/sbr/mts.c b/sbr/mts.c index 503ec3c..6b8b3a2 100644 --- a/sbr/mts.c +++ b/sbr/mts.c @@ -25,126 +25,16 @@ /* ** static prototypes */ -static char *tailor_value(unsigned char *); static void getuserinfo(void); -static const char *get_mtsconf_pathname(void); -static const char *get_mtsuserconf_pathname(void); -static void mts_read_conf_file(FILE *fp); - -/* -** nmh mail transport interface customization file -*/ -static char *mtsconf = NMHETCDIR"/mts.conf"; - /* Cache the username and fullname of the user */ static char username[BUFSIZ]; static char fullname[BUFSIZ]; -/* -** Global MailDelivery file -*/ -char *maildelivery = NMHETCDIR"/maildelivery"; - -/* -** Customize the MTS settings for nmh by adjusting -** the file mts.conf in the nmh etc directory. -*/ - -struct bind { - char *keyword; - char **value; -}; - -static struct bind binds[] = { - { "maildelivery", &maildelivery }, - { NULL, NULL } -}; - - -/* -** Read the configuration file for the nmh interface -** to the mail transport system (MTS). -*/ - -void -mts_init(char *name) -{ - const char *cp; - FILE *fp; - static int inited = 0; - - if (inited++ || (fp = fopen(get_mtsconf_pathname(), "r")) == NULL) - return; - mts_read_conf_file(fp); - fclose(fp); - - cp = get_mtsuserconf_pathname(); - if (cp != NULL && - ((fp = fopen(get_mtsuserconf_pathname(), "r")) != NULL)) { - mts_read_conf_file(fp); - fclose(fp); - } -} - - -#define QUOTE '\\' - -/* -** Convert escaped values, malloc some new space, -** and copy string to malloc'ed memory. -*/ - -static char * -tailor_value(unsigned char *s) -{ - int i, r; - char *bp; - char buffer[BUFSIZ]; - size_t len; - - for (bp = buffer; *s; bp++, s++) { - if (*s != QUOTE) { - *bp = *s; - } else { - switch (*++s) { - case 'b': *bp = '\b'; break; - case 'f': *bp = '\f'; break; - case 'n': *bp = '\n'; break; - case 't': *bp = '\t'; break; - - case 0: s--; - case QUOTE: - *bp = QUOTE; - break; - - default: - if (!isdigit(*s)) { - *bp++ = QUOTE; - *bp = *s; - } - r = *s != '0' ? 10 : 8; - for (i = 0; isdigit(*s); s++) - i = i * r + *s - '0'; - s--; - *bp = toascii(i); - break; - } - } - } - *bp = 0; - - len = strlen(buffer) + 1; - bp = mh_xmalloc(len); - memcpy(bp, buffer, len); - - return bp; -} /* ** Get the fully qualified name of the local host. */ - char * LocalName(void) { @@ -158,8 +48,6 @@ LocalName(void) if (buffer[0]) return buffer; - mts_init("mts"); - memset(buffer, 0, sizeof(buffer)); #ifdef HAVE_UNAME /* first get our local name */ @@ -187,7 +75,6 @@ LocalName(void) ** This is only for UUCP mail. It gets the hostname ** as part of the UUCP "domain". */ - char * SystemName(void) { @@ -201,8 +88,6 @@ SystemName(void) if (buffer[0]) return buffer; - mts_init("mts"); - #ifdef HAVE_UNAME uname(&name); strncpy(buffer, name.nodename, sizeof(buffer)); @@ -217,7 +102,6 @@ SystemName(void) /* ** Get the username of current user */ - char * getusername(void) { @@ -232,7 +116,6 @@ getusername(void) ** Get full name of current user (typically from GECOS ** field of password file). */ - char * getfullname(void) { @@ -314,50 +197,3 @@ getuserinfo(void) return; } - -static const char* -get_mtsconf_pathname(void) -{ - const char *cp = getenv( "MHMTSCONF "); - if (cp != NULL && *cp != '\0') { - return cp; - } - return mtsconf; -} - -static const char* -get_mtsuserconf_pathname(void) -{ - const char *cp = getenv( "MHMTSUSERCONF" ); - if (cp != NULL && *cp != '\0') { - return cp; - } - return NULL; -} - -static void -mts_read_conf_file(FILE *fp) -{ - unsigned char *bp; - char *cp, buffer[BUFSIZ]; - struct bind *b; - - while (fgets(buffer, sizeof(buffer), fp)) { - if (!(cp = strchr(buffer, '\n'))) - break; - *cp = 0; - if (*buffer == '#' || *buffer == '\0') - continue; - if (!(bp = strchr(buffer, ':'))) - break; - *bp++ = 0; - while (isspace(*bp)) - *bp++ = 0; - - for (b = binds; b->keyword; b++) - if (strcmp(buffer, b->keyword)==0) - break; - if (b->keyword && (cp = tailor_value(bp))) - *b->value = cp; - } -} diff --git a/uip/Makefile.in b/uip/Makefile.in index 58a82af..4a02564 100644 --- a/uip/Makefile.in +++ b/uip/Makefile.in @@ -17,14 +17,13 @@ etcdir = @sysconfdir@ CC = @CC@ CFLAGS = @CFLAGS@ DEFS = @DEFS@ +CONFIGDEFS = -DNMHETCDIR='"$(etcdir)"' INCLUDES = -I.. -I$(srcdir) -I$(top_srcdir) @CPPFLAGS@ LDFLAGS = @LDFLAGS@ LIBS = @LIBS@ -MTSLIB = -# ../mts/libmts.a NDBM_LIBS = @NDBM_LIBS@ -LOCALLIBS = ../config/version.o ../config/config.o $(MTSLIB) ../sbr/libmh.a +LOCALLIBS = ../config/version.o ../config/config.o ../sbr/libmh.a LINKLIBS = $(LOCALLIBS) $(LIBS) LINT = @LINT@ @@ -34,6 +33,7 @@ TERMLIB = @TERMLIB@ LEXLIB = @LEXLIB@ COMPILE = $(CC) -c $(DEFS) $(INCLUDES) $(CFLAGS) +COMPILE2 = $(CC) -c $(DEFS) $(CONFIGDEFS) $(INCLUDES) $(CFLAGS) LINK = $(CC) $(LDFLAGS) -o $@ LN = ln @@ -211,6 +211,9 @@ send: send.o sendsbr.o annosbr.o distsbr.o $(LOCALLIBS) show: show.o mhlsbr.o termsbr.o $(LOCALLIBS) $(LINK) show.o mhlsbr.o termsbr.o $(LINKLIBS) $(TERMLIB) +slocal.o: slocal.c + $(COMPILE2) $(srcdir)/slocal.c + slocal: slocal.o aliasbr.o dropsbr.o $(LOCALLIBS) $(LINK) slocal.o aliasbr.o dropsbr.o $(NDBM_LIBS) $(LINKLIBS) diff --git a/uip/ali.c b/uip/ali.c index 8907e69..f1d7416 100644 --- a/uip/ali.c +++ b/uip/ali.c @@ -69,7 +69,6 @@ main(int argc, char **argv) /* read user profile/context */ context_read(); - mts_init(invo_name); arguments = getarguments(invo_name, argc, argv, 1); argp = arguments; diff --git a/uip/ap.c b/uip/ap.c index ad3c998..4f7f760 100644 --- a/uip/ap.c +++ b/uip/ap.c @@ -68,7 +68,6 @@ main(int argc, char **argv) /* read user profile/context */ context_read(); - mts_init(invo_name); arguments = getarguments(invo_name, argc, argv, 1); argp = arguments; diff --git a/uip/conflict.c b/uip/conflict.c index 527dd11..03de873 100644 --- a/uip/conflict.c +++ b/uip/conflict.c @@ -74,7 +74,6 @@ main(int argc, char **argv) if (context_foil(NULL) == -1) done(1); - mts_init(invo_name); arguments = getarguments(invo_name, argc, argv, 0); argp = arguments; diff --git a/uip/inc.c b/uip/inc.c index f000d47..1f03e2b 100644 --- a/uip/inc.c +++ b/uip/inc.c @@ -166,7 +166,6 @@ main(int argc, char **argv) /* read user profile/context */ context_read(); - mts_init(invo_name); arguments = getarguments(invo_name, argc, argv, 1); argp = arguments; diff --git a/uip/msgchk.c b/uip/msgchk.c index 5b75814..5e10ad3 100644 --- a/uip/msgchk.c +++ b/uip/msgchk.c @@ -69,7 +69,6 @@ main(int argc, char **argv) /* read user profile/context */ context_read(); - mts_init(invo_name); user = getusername(); arguments = getarguments(invo_name, argc, argv, 1); diff --git a/uip/rcvdist.c b/uip/rcvdist.c index 898073f..cff337d 100644 --- a/uip/rcvdist.c +++ b/uip/rcvdist.c @@ -54,7 +54,6 @@ main(int argc, char **argv) /* read user profile/context */ context_read(); - mts_init(invo_name); arguments = getarguments(invo_name, argc, argv, 1); argp = arguments; diff --git a/uip/rcvpack.c b/uip/rcvpack.c index 85de619..f0f1bd1 100644 --- a/uip/rcvpack.c +++ b/uip/rcvpack.c @@ -36,7 +36,6 @@ main(int argc, char **argv) /* read user profile/context */ context_read(); - mts_init(invo_name); arguments = getarguments(invo_name, argc, argv, 1); argp = arguments; diff --git a/uip/rcvstore.c b/uip/rcvstore.c index ba3cfcc..ebf3e14 100644 --- a/uip/rcvstore.c +++ b/uip/rcvstore.c @@ -68,7 +68,6 @@ main(int argc, char **argv) /* read user profile/context */ context_read(); - mts_init(invo_name); arguments = getarguments(invo_name, argc, argv, 1); argp = arguments; diff --git a/uip/rcvtty.c b/uip/rcvtty.c index a62d091..1dc38c4 100644 --- a/uip/rcvtty.c +++ b/uip/rcvtty.c @@ -104,7 +104,6 @@ main(int argc, char **argv) /* read user profile/context */ context_read(); - mts_init(invo_name); arguments = getarguments(invo_name, argc, argv, 1); argp = arguments; diff --git a/uip/scan.c b/uip/scan.c index a11ca0d..18de4c4 100644 --- a/uip/scan.c +++ b/uip/scan.c @@ -63,7 +63,6 @@ main(int argc, char **argv) /* read user profile/context */ context_read(); - mts_init(invo_name); arguments = getarguments(invo_name, argc, argv, 1); argp = arguments; diff --git a/uip/slocal.c b/uip/slocal.c index 7546cdd..2573cbe 100644 --- a/uip/slocal.c +++ b/uip/slocal.c @@ -102,6 +102,11 @@ static struct swit switches[] = { { NULL, 0 } }; + +/* global maildelivery file */ +char *maildelivery = NMHETCDIR"/maildelivery"; + + static int globbed = 0; /* have we built "vars" table yet? */ static int parsed = 0; /* have we built header field table yet */ static int utmped = 0; /* have we scanned umtp(x) file yet */ @@ -220,7 +225,6 @@ main(int argc, char **argv) if (context_foil(NULL) == -1) done(1); - mts_init(invo_name); arguments = getarguments(invo_name, argc, argv, 0); argp = arguments; diff --git a/uip/spost.c b/uip/spost.c index e3cf211..5b51ad4 100644 --- a/uip/spost.c +++ b/uip/spost.c @@ -186,7 +186,6 @@ main(int argc, char **argv) if (context_foil(NULL) == -1) done(1); - mts_init(invo_name); arguments = getarguments(invo_name, argc, argv, 0); argp = arguments;