Removed support for UUCP bang path addresses.
authormarkus schnalke <meillo@marmaro.de>
Wed, 21 Mar 2012 15:54:24 +0000 (16:54 +0100)
committermarkus schnalke <meillo@marmaro.de>
Wed, 21 Mar 2012 15:54:24 +0000 (16:54 +0100)
If you still rely on UUCP, use nmh, not mmh.

h/addrsbr.h
h/prototypes.h
man/slocal.man1
man/whom.man
sbr/addrsbr.c
sbr/fmt_scan.c
sbr/m_getfld.c
sbr/mts.c
uip/aliasbr.c
uip/slocal.c

index 5e19b78..a86a90d 100644 (file)
@@ -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
index 4a74bec..a078dc5 100644 (file)
@@ -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);
index aea64e4..f8952bc 100644 (file)
@@ -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
index 27aa597..d01533a 100644 (file)
@@ -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.
index a829c1d..2327e47 100644 (file)
@@ -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))
index 4a8da14..f26b02b 100644 (file)
@@ -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;
index 534f896..47c7e7d 100644 (file)
@@ -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;
 }
 
index dd193bc..a464493 100644 (file)
--- 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 *
index 073b1b2..7b7bcef 100644 (file)
@@ -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;
index 3713954..d97af90 100644 (file)
@@ -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);