From 9fca5fd33b87291cdcb326c7aab6ab9574244289 Mon Sep 17 00:00:00 2001 From: markus schnalke Date: Wed, 27 Jun 2012 14:52:42 +0200 Subject: [PATCH] send,spost: No more use of -alias, spost reads Aliasfile from the profile. The profile entry Aliasfile was introduced in MH-6.7 to replace the -alias switches. Later, the profile entry was enhanced to support multiple files. Now that spost reads the profile itself, there is no more need to pass the file with switches. Operating with varying sets of alias files is now only possible with different profiles, but that should be a rare setup. --- man/mh-profile.man5 | 10 ++++------ man/send.man1 | 11 +---------- man/spost.man8 | 15 +++------------ uip/send.c | 34 ++++++---------------------------- uip/spost.c | 39 +++++++++++++++++++-------------------- 5 files changed, 33 insertions(+), 76 deletions(-) diff --git a/man/mh-profile.man5 b/man/mh-profile.man5 index 095a0f3..8d36895 100644 --- a/man/mh-profile.man5 +++ b/man/mh-profile.man5 @@ -297,13 +297,11 @@ aliases .I other-alias .RS 5 Indicates aliases files for -.BR ali -and +.BR ali , .BR send . -This may be used instead of the -.B \-alias -.I file -switch. (profile, no default) +and +.BR spost . +(profile, no default) .RE .PP .BR Draft\-Folder : diff --git a/man/send.man1 b/man/send.man1 index cbbf118..b2c2cf4 100644 --- a/man/send.man1 +++ b/man/send.man1 @@ -8,8 +8,6 @@ send \- send a message .HP 5 .na .B send -.RB [ \-alias -.IR aliasfile ] .RB [ \-verbose " | " \-noverbose ] .RB [ msg \&...] @@ -140,14 +138,7 @@ appear to any non\-Bcc receivers of the message. That is, it will have the appended fields and field reformatting. The `Fcc:' fields will be removed from all outgoing copies of the message. .PP -The files specified by the profile entry `Aliasfile:' and any -additional alias files given by the -.B \-alias -.I aliasfile -switch will be -read (more than one file, each preceded by -.BR \-alias , -can be named). +The files specified by the profile entry `Aliasfile:' will be read. See .BR mh\-alias (5) for more information. diff --git a/man/spost.man8 b/man/spost.man8 index fda53f4..98c08fa 100644 --- a/man/spost.man8 +++ b/man/spost.man8 @@ -9,9 +9,6 @@ spost \- feed a message to sendmail .na .HP 5 .B spost -.RB [ \-alias -.IR aliasfile -.RB " | " \-noalias ] .RB [ \-verbose " | " \-noverbose ] .I file .RB [ \-Version ] @@ -56,15 +53,9 @@ invokes .B send to send the Bcc message.) .PP -The -.B \-alias -.I aliasfile -switch can be used to specify a file that spost -should take aliases from. More than one file can be specified, each -being preceded with -.BR \-alias . -In any event, the alias file, set with the `Aliasfile' profile entry, is -read first. +The `Aliasfile' profile entry +can be used to specify one or more files that spost +should take aliases from. .PP The .B \-verbose diff --git a/uip/send.c b/uip/send.c index 245bf3c..5e1f0a1 100644 --- a/uip/send.c +++ b/uip/send.c @@ -52,17 +52,15 @@ static void make_mime_composition_file_entry(char *); static struct swit switches[] = { -#define ALIASW 0 - { "alias aliasfile", 0 }, -#define DEBUGSW 1 +#define DEBUGSW 0 { "debug", -5 }, -#define VERBSW 2 +#define VERBSW 1 { "verbose", 0 }, -#define NVERBSW 3 +#define NVERBSW 2 { "noverbose", 2 }, -#define VERSIONSW 4 +#define VERSIONSW 3 { "Version", 0 }, -#define HELPSW 5 +#define HELPSW 4 { "help", 0 }, { NULL, 0 } }; @@ -76,7 +74,7 @@ main(int argc, char **argv) int in, out; int n; char *cp, *maildir = NULL; - char buf[BUFSIZ], **ap, **argp, **arguments; + char buf[BUFSIZ], **argp, **arguments; char *msgs[MAXARGS], *vec[MAXARGS]; char *files[MAXARGS]; struct msgs *mp; @@ -118,16 +116,6 @@ main(int argc, char **argv) case NVERBSW: vec[vecp++] = --cp; continue; - - case ALIASW: - vec[vecp++] = --cp; - if (!(cp = *argp++) || *cp == '-') { - adios(NULL, "missing argument to %s", - argp[-2]); - } - vec[vecp++] = cp; - continue; - } } else { if (*cp == '/') { @@ -138,16 +126,6 @@ main(int argc, char **argv) } } - /* check for "Aliasfile:" profile entry */ - if ((cp = context_find("Aliasfile"))) { - char *dp = NULL; - - for (ap=brkstring(dp=getcpy(cp), " ", "\n"); ap && *ap; ap++) { - vec[vecp++] = "-alias"; - vec[vecp++] = getcpy(etcpath(*ap)); - } - } - if (!msgp && !nfiles) { msgs[msgp++] = seq_cur; } diff --git a/uip/spost.c b/uip/spost.c index fe2e34b..da02d27 100644 --- a/uip/spost.c +++ b/uip/spost.c @@ -24,17 +24,13 @@ static struct swit switches[] = { { "verbose", 0 }, #define NVERBSW 1 { "noverbose", 2 }, -#define ALIASW 2 - { "alias aliasfile", 0 }, -#define NALIASW 3 - { "noalias", 2 }, -#define VERSIONSW 4 +#define VERSIONSW 2 { "Version", 0 }, -#define HELPSW 5 +#define HELPSW 3 { "help", 0 }, -#define DEBUGSW 6 +#define DEBUGSW 4 { "debug", -5 }, -#define DISTSW 7 +#define DISTSW 5 { "dist", -4 }, /* interface from dist */ { NULL, 0 } }; @@ -181,18 +177,6 @@ main(int argc, char **argv) case NVERBSW: verbose = 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; } } if (msg) @@ -214,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;;) { -- 1.7.10.4