X-Git-Url: http://git.marmaro.de/?a=blobdiff_plain;f=uip%2Fspost.c;h=da02d2798391206f2862149d84b9b1c14d775683;hb=9fca5fd33b87291cdcb326c7aab6ab9574244289;hp=30e283f44cf180cd4ec62720f76c4ab0b850d5e4;hpb=6e8e22e2ff93a8778f53b56246c42bf7f4dd8026;p=mmh diff --git a/uip/spost.c b/uip/spost.c index 30e283f..da02d27 100644 --- a/uip/spost.c +++ b/uip/spost.c @@ -24,24 +24,14 @@ static struct swit switches[] = { { "verbose", 0 }, #define NVERBSW 1 { "noverbose", 2 }, -#define WATCSW 2 - { "watch", 0 }, -#define NWATCSW 3 - { "nowatch", 2 }, -#define ALIASW 4 - { "alias aliasfile", 0 }, -#define NALIASW 5 - { "noalias", 2 }, -#define VERSIONSW 6 +#define VERSIONSW 2 { "Version", 0 }, -#define HELPSW 7 +#define HELPSW 3 { "help", 0 }, -#define DEBUGSW 8 +#define DEBUGSW 4 { "debug", -5 }, -#define DISTSW 9 +#define DISTSW 5 { "dist", -4 }, /* interface from dist */ -#define LIBSW 10 - { "library directory", -7 }, { NULL, 0 } }; @@ -105,10 +95,9 @@ static struct headers RHeaders[] = { }; -static int badmsg = 0; /* message has bad semantics */ -static int verbose = 0; /* spell it out */ -static int debug = 0; /* debugging post */ -static int watch = 0; /* watch the delivery process */ +static int badmsg = 0; +static int verbose = 0; +static int debug = 0; static int aliasflg = 0; /* if going to process aliases */ static unsigned msgflags = 0; /* what we've seen */ @@ -150,9 +139,7 @@ main(int argc, char **argv) setlocale(LC_ALL, ""); invo_name = mhbasename(argv[0]); - /* foil search of user profile/context */ - if (context_foil(NULL) == -1) - done(1); + context_read(); arguments = getarguments(invo_name, argc, argv, 0); argp = arguments; @@ -190,34 +177,6 @@ main(int argc, char **argv) case NVERBSW: verbose = 0; continue; - - case WATCSW: - watch++; - continue; - case NWATCSW: - watch = 0; - continue; - - case ALIASW: - if (!(cp = *argp++) || *cp == '-') - adios(NULL, "missing argument to %s", - argp[-2]); - aliasflg = 1; - if ((state = alias(cp)) != AK_OK) - adios(NULL, "aliasing error in file %s - %s", cp, akerror(state)); - continue; - case NALIASW: - aliasflg = 0; - continue; - - case LIBSW: - if (!(cp = *argp++) || *cp == '-') - adios(NULL, "missing argument to %s", - argp[-2]); - /* create a minimal context */ - if (context_foil(cp) == -1) - done(1); - continue; } } if (msg) @@ -239,6 +198,21 @@ main(int argc, char **argv) tmpfil = getcpy(m_mktemp2("/tmp/", invo_name, NULL, &out)); } + /* check for "Aliasfile:" profile entry */ + if ((cp = context_find("Aliasfile"))) { + char *dp, **ap; + + aliasflg = 1; + for (ap=brkstring(dp=getcpy(cp), " ", "\n"); ap && *ap; + ap++) { + if ((state = alias(etcpath(*ap))) != AK_OK) { + adios(NULL, "aliasing error in file %s: %s", + *ap, akerror(state)); + } + } + } + + hdrtab = (msgstate == normal) ? NHeaders : RHeaders; for (compnum = 1, state = FLD;;) { @@ -321,7 +295,7 @@ main(int argc, char **argv) *argp++ = "-m"; /* send to me too */ *argp++ = "-t"; /* read msg for recipients */ *argp++ = "-i"; /* don't stop on "." */ - if (watch || verbose) { + if (verbose) { *argp++ = "-v"; } *argp = NULL;