From 2c3b7da72126a21f05130e9ed6bb70f43624ce25 Mon Sep 17 00:00:00 2001 From: markus schnalke Date: Wed, 25 Jan 2012 22:56:43 +0100 Subject: [PATCH] Removed the UCI code to read the signatur (= name) from ~/.signature. If we want to read something from ~/.signature, then those lines that form the footer of a mail message. What is called ``signature'' here is the name of the sender; the name that is put into the From: line. There are already several options to put it: - environment variable: SIGNATURE (to change temporary) - profile entry: Signature: (to set only for the mail system) - GECOS field in passwd (fallback and global) These should be enough. --- man/mh-profile.man5 | 7 ++----- uip/send.c | 17 +---------------- uip/whatnowsbr.c | 17 +---------------- 3 files changed, 4 insertions(+), 37 deletions(-) diff --git a/man/mh-profile.man5 b/man/mh-profile.man5 index 5ad243d..d94f301 100644 --- a/man/mh-profile.man5 +++ b/man/mh-profile.man5 @@ -345,11 +345,8 @@ environment variable If .B $SIGNATURE is not set and this profile entry is not present, the \*(lqgcos\*(rq field of -the \fI/etc/passwd\fP file will be used; otherwise, on hosts where -.B nmh -was configured with the UCI option, the file -.I $HOME/.signature -is consulted. Your signature will be added to the address +the \fI/etc/passwd\fP file will be used. +Your signature will be added to the address .B send puts in the \*(lqFrom:\*(rq header; do not include an address in the signature text. (profile, no default) diff --git a/uip/send.c b/uip/send.c index eb140c9..2092c37 100644 --- a/uip/send.c +++ b/uip/send.c @@ -105,9 +105,6 @@ main(int argc, char **argv) char *msgs[MAXARGS], *vec[MAXARGS]; struct msgs *mp; struct stat st; -#ifdef UCI - FILE *fp; -#endif /* UCI */ #ifdef LOCALE setlocale(LC_ALL, ""); @@ -263,21 +260,9 @@ main(int argc, char **argv) mp->msgflags |= SEQMOD; seq_save(mp); - if ((cp = getenv("SIGNATURE")) == NULL || *cp == 0) + if (!(cp = getenv("SIGNATURE")) || !*cp) if ((cp = context_find("signature")) && *cp) m_putenv("SIGNATURE", cp); -#ifdef UCI - else { - snprintf(buf, sizeof(buf), "%s/.signature", mypath); - if ((fp = fopen(buf, "r")) != NULL && - fgets(buf, sizeof buf, fp) != NULL) { - fclose(fp); - if (cp = strchr(buf, '\n')) - *cp = 0; - m_putenv("SIGNATURE", buf); - } - } -#endif /* UCI */ for (msgnum = 0; msgnum < msgp; msgnum++) if (stat(msgs[msgnum], &st) == NOTOK) diff --git a/uip/whatnowsbr.c b/uip/whatnowsbr.c index 4e93a1a..45f33c7 100644 --- a/uip/whatnowsbr.c +++ b/uip/whatnowsbr.c @@ -919,9 +919,6 @@ sendit(char *sp, char **arg, char *file, int pushed) #ifndef lint int distsw = 0; #endif -#ifdef UCI - FILE *fp; -#endif /* ** Make sure these are defined. In particular, we need @@ -1070,21 +1067,9 @@ sendit(char *sp, char **arg, char *file, int pushed) } } - if ((cp = getenv("SIGNATURE")) == NULL || *cp == 0) + if (!(cp = getenv("SIGNATURE")) || !*cp) if ((cp = context_find("signature")) && *cp) m_putenv("SIGNATURE", cp); -#ifdef UCI - else { - snprintf(buf, sizeof(buf), "%s/.signature", mypath); - if ((fp = fopen(buf, "r")) != NULL && - fgets(buf, sizeof(buf), fp) != NULL) { - fclose(fp); - if (cp = strchr(buf, '\n')) - *cp = 0; - m_putenv("SIGNATURE", buf); - } - } -#endif /* UCI */ if ((annotext = getenv("mhannotate")) == NULL || *annotext == 0) annotext = NULL; -- 1.7.10.4