From: markus schnalke Date: Wed, 21 Mar 2012 15:54:24 +0000 (+0100) Subject: Removed support for UUCP bang path addresses. X-Git-Tag: mmh-thesis-end~271 X-Git-Url: http://git.marmaro.de/?a=commitdiff_plain;h=83e04675b53374a1436029a367283d6d4ee05a07;p=mmh Removed support for UUCP bang path addresses. If you still rely on UUCP, use nmh, not mmh. --- diff --git a/h/addrsbr.h b/h/addrsbr.h index 5e19b78..a86a90d 100644 --- a/h/addrsbr.h +++ b/h/addrsbr.h @@ -6,7 +6,6 @@ #define AD_NHST 0 /* getm(): do not lookup official name */ #define AD_NAME AD_NHST /* AD_HOST is TOO slow */ -#define UUCPHOST (-1) #define LOCALHOST 0 #define NETHOST 1 #define BADHOST 2 diff --git a/h/prototypes.h b/h/prototypes.h index 4a74bec..a078dc5 100644 --- a/h/prototypes.h +++ b/h/prototypes.h @@ -146,6 +146,5 @@ int what_now(char *, int, int, char *, char *, int, struct msgs *, ** from the former mts.h */ char *LocalName(void); /* hostname */ -char *SystemName(void); char *getusername(void); char *getfullname(void); diff --git a/man/slocal.man1 b/man/slocal.man1 index aea64e4..f8952bc 100644 --- a/man/slocal.man1 +++ b/man/slocal.man1 @@ -56,8 +56,8 @@ The message delivery address and message sender are determined from the Message Transfer Agent envelope information, if possible. Under .BR sendmail , -the sender will obtained from the UUCP -\*(lqFrom:\*(rq line, if present. The user may override these +the sender will obtained from the mbox +\*(lqFrom \*(rq line, if present. The user may override these values with command line arguments, or arguments to the .B \-addr and diff --git a/man/whom.man b/man/whom.man index 27aa597..d01533a 100644 --- a/man/whom.man +++ b/man/whom.man @@ -96,6 +96,4 @@ being listed as ok means that at the time that was run the address was thought to be deliverable by the transport service. For local addresses, this is absolute; for network addresses, it means -that the host is known; for uucp addresses, it (often) means that the -.B UUCP -network is available for use. +that the host is known. diff --git a/sbr/addrsbr.c b/sbr/addrsbr.c index a829c1d..2327e47 100644 --- a/sbr/addrsbr.c +++ b/sbr/addrsbr.c @@ -24,7 +24,7 @@ ** to their "official" represenations. ** ** To summarize, when we're all done, here's what MH knows about the address: -** type: local, uucp, or network +** type: local or network ** host: not locally defaulted, not explicitly expanded ** everything else */ @@ -73,7 +73,6 @@ getname(char *addrs) struct mailname * getm(char *str, char *dfhost, int dftype, int wanthost, char *eresult) { - char *pp; struct mailname *mp; if (err[0]) { @@ -134,21 +133,14 @@ getm(char *str, char *dfhost, int dftype, int wanthost, char *eresult) mp->m_mbox = getcpy(mbox); mp->m_host = getcpy(host); } else { - if ((pp = strchr(mbox, '!'))) { - *pp++ = '\0'; - mp->m_mbox = getcpy(pp); - mp->m_host = getcpy(mbox); - mp->m_type = UUCPHOST; + mp->m_nohost = 1; + mp->m_mbox = getcpy(mbox); + if (route == NULL && dftype == LOCALHOST) { + mp->m_host = NULL; + mp->m_type = dftype; } else { - mp->m_nohost = 1; - mp->m_mbox = getcpy(mbox); - if (route == NULL && dftype == LOCALHOST) { - mp->m_host = NULL; - mp->m_type = dftype; - } else { - mp->m_host = route ? NULL : getcpy(dfhost); - mp->m_type = route ? NETHOST : dftype; - } + mp->m_host = route ? NULL : getcpy(dfhost); + mp->m_type = route ? NETHOST : dftype; } goto got_host; } @@ -207,11 +199,9 @@ adrformat(struct mailname *mp) if (mp->m_nohost) strncpy(addr, mp->m_mbox ? mp->m_mbox : "", sizeof(addr)); - else if (mp->m_type != UUCPHOST) + else snprintf(addr, sizeof(addr), mp->m_host ? "%s%s@%s" : "%s%s", empty(mp->m_path), empty(mp->m_mbox), mp->m_host); - else - snprintf(addr, sizeof(addr), "%s!%s", mp->m_host, mp->m_mbox); if (mp->m_pers || mp->m_path) { if (mp->m_note) @@ -315,9 +305,6 @@ ismymbox(struct mailname *np) break; goto local_test; - case UUCPHOST: - if (mh_strcasecmp(np->m_host, SystemName())) - break; /* fall */ case LOCALHOST: local_test: ; if (!mh_strcasecmp(np->m_mbox, mq.m_mbox)) diff --git a/sbr/fmt_scan.c b/sbr/fmt_scan.c index 4a8da14..f26b02b 100644 --- a/sbr/fmt_scan.c +++ b/sbr/fmt_scan.c @@ -678,15 +678,9 @@ fmt_scan(struct format *format, char *scanl, int width, int *dat) case LOCALHOST: str = mn->m_mbox; break; - case UUCPHOST: - snprintf(buffer, sizeof(buffer), "%s!%s", - mn->m_host, mn->m_mbox); - str = buffer; - break; default: if (mn->m_mbox) { - snprintf(buffer, sizeof(buffer), "%s@%s", - mn->m_mbox, mn->m_host); + snprintf(buffer, sizeof(buffer), "%s@%s", mn->m_mbox, mn->m_host); str= buffer; } else str = mn->m_text; diff --git a/sbr/m_getfld.c b/sbr/m_getfld.c index 534f896..47c7e7d 100644 --- a/sbr/m_getfld.c +++ b/sbr/m_getfld.c @@ -720,45 +720,20 @@ m_Eom(int c, FILE *iob) ** Return the Return-Path and Delivery-Date ** header information. ** -** Currently, I'm assuming that the "From " line -** takes one of the following forms. -** -** From sender date remote from host (for UUCP delivery) -** From sender@host date (for sendmail delivery) +** Currently, I'm assuming that the "From " line takes the following form: +** "From" sender@host date (sendmail delivery) */ - int get_returnpath(char *rp, int rplen, char *dd, int ddlen) { - char *ap, *bp, *cp, *dp; + char *ap, *bp; ap = unixbuf; - if (!(bp = cp = strchr(ap, ' '))) + if (!(bp = strchr(ap, ' '))) return 0; - /* - ** Check for "remote from" in envelope to see - ** if this message uses UUCP style addressing - */ - while ((cp = strchr(++cp, 'r'))) { - if (strncmp(cp, "remote from", 11) == 0) { - cp = strrchr(cp, ' '); - break; - } - } - - /* - ** Get the Return-Path information from - ** the "From " envelope. - */ - if (cp) { - /* return path for UUCP style addressing */ - dp = strchr(++cp, '\n'); - snprintf(rp, rplen, "%.*s!%.*s\n", (int)(dp - cp), cp, (int)(bp - ap), ap); - } else { - /* return path for standard domain addressing */ - snprintf(rp, rplen, "%.*s\n", (int)(bp - ap), ap); - } + /* Get the Return-Path information from the "From " envelope. */ + snprintf(rp, rplen, "%.*s\n", (int)(bp - ap), ap); /* ** advance over the spaces to get to @@ -770,7 +745,7 @@ get_returnpath(char *rp, int rplen, char *dd, int ddlen) /* Now get delivery date from envelope */ snprintf(dd, ddlen, "%.*s\n", 24, bp); - unixbuf[0] = 0; + *unixbuf = '\0'; return 1; } diff --git a/sbr/mts.c b/sbr/mts.c index dd193bc..a464493 100644 --- a/sbr/mts.c +++ b/sbr/mts.c @@ -71,34 +71,6 @@ LocalName(void) /* -** This is only for UUCP mail. It gets the hostname -** as part of the UUCP "domain". -*/ -char * -SystemName(void) -{ - static char buffer[BUFSIZ] = ""; - -#ifdef HAVE_UNAME - struct utsname name; -#endif - - /* check if we have cached the system name */ - if (buffer[0]) - return buffer; - -#ifdef HAVE_UNAME - uname(&name); - strncpy(buffer, name.nodename, sizeof(buffer)); -#else - gethostname(buffer, sizeof(buffer)); -#endif - - return buffer; -} - - -/* ** Get the username of current user */ char * diff --git a/uip/aliasbr.c b/uip/aliasbr.c index 073b1b2..7b7bcef 100644 --- a/uip/aliasbr.c +++ b/uip/aliasbr.c @@ -444,7 +444,7 @@ add_aka(struct aka *ak, char *pp) ad = (struct adr *) mh_xmalloc(sizeof(*ad)); ad->ad_text = getcpy(pp); - ad->ad_local = strchr(pp, '@') == NULL && strchr(pp, '!') == NULL; + ad->ad_local = strchr(pp, '@') == NULL; ad->ad_next = NULL; if (ak->ak_addr) ld->ad_next = ad; diff --git a/uip/slocal.c b/uip/slocal.c index 3713954..d97af90 100644 --- a/uip/slocal.c +++ b/uip/slocal.c @@ -1318,7 +1318,7 @@ you_lose: if (first) { first = 0; if (strncmp(buffer, "From ", i)==0) { - char *fp, *cp, *hp, *ep; + char *fp, *cp; /* ** get copy of envelope information ** ("From " line) @@ -1329,27 +1329,10 @@ you_lose: ** Now create a "Return-Path:" line ** from the "From " line. */ - hp = cp = strchr(fp = envelope + i, ' '); - while ((hp = strchr(++hp, 'r'))) { - if (uprf(hp, "remote from")) { - hp = strrchr(hp, ' '); - break; - } - } - if (hp) { - /* - ** return path for UUCP style - ** addressing - */ - ep = strchr(++hp, '\n'); - snprintf(buffer, sizeof(buffer), "Return-Path: %.*s!%.*s\n", (int)(ep - hp), hp, (int)(cp - fp), fp); - } else { - /* - ** return path for standard domain - ** addressing - */ - snprintf(buffer, sizeof(buffer), "Return-Path: %.*s\n", (int)(cp - fp), fp); - } + cp = strchr(fp = envelope + i, ' '); + snprintf(buffer, sizeof(buffer), + "Return-Path: %.*s\n", + (int)(cp - fp), fp); /* Add Return-Path header to message */ fputs(buffer, ffp);