4.4BSD snapshot (revision 8.1); add 1993 to copyright
[unix-history] / usr / src / usr.sbin / sendmail / src / recipient.c
index 6a9995d..39f6938 100644 (file)
@@ -7,14 +7,11 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)recipient.c        6.8 (Berkeley) %G%";
+static char sccsid[] = "@(#)recipient.c        8.1 (Berkeley) %G%";
 #endif /* not lint */
 
 #endif /* not lint */
 
-# include <sys/types.h>
-# include <sys/stat.h>
-# include <fcntl.h>
-# include <pwd.h>
 # include "sendmail.h"
 # include "sendmail.h"
+# include <pwd.h>
 
 /*
 **  SENDTOLIST -- Designate a send list.
 
 /*
 **  SENDTOLIST -- Designate a send list.
@@ -36,6 +33,7 @@ static char sccsid[] = "@(#)recipient.c       6.8 (Berkeley) %G%";
 **                     expansion.
 **             sendq -- a pointer to the head of a queue to put
 **                     these people into.
 **                     expansion.
 **             sendq -- a pointer to the head of a queue to put
 **                     these people into.
+**             e -- the envelope in which to add these recipients.
 **             qflags -- special flags to set in the q_flags field.
 **
 **     Returns:
 **             qflags -- special flags to set in the q_flags field.
 **
 **     Returns:
@@ -58,8 +56,8 @@ sendto(list, copyf, ctladdr, qflags)
        register char *p;
        register ADDRESS *al;   /* list of addresses to send to */
        bool firstone;          /* set on first address sent */
        register char *p;
        register ADDRESS *al;   /* list of addresses to send to */
        bool firstone;          /* set on first address sent */
-       bool selfref;           /* set if this list includes ctladdr */
        char delimiter;         /* the address delimiter */
        char delimiter;         /* the address delimiter */
+       int naddrs;
        ADDRESS *sibl;          /* sibling pointer in tree */
        ADDRESS *prev;          /* previous sibling */
 
        ADDRESS *sibl;          /* sibling pointer in tree */
        ADDRESS *prev;          /* previous sibling */
 
@@ -79,19 +77,19 @@ sendto(list, copyf, ctladdr, qflags)
                delimiter = ',';
 
        firstone = TRUE;
                delimiter = ',';
 
        firstone = TRUE;
-       selfref = FALSE;
        al = NULL;
        al = NULL;
+       naddrs = 0;
 
        for (p = list; *p != '\0'; )
        {
 
        for (p = list; *p != '\0'; )
        {
+               auto char *delimptr;
                register ADDRESS *a;
                register ADDRESS *a;
-               extern char *DelimChar;         /* defined in prescan */
 
                /* parse the address */
 
                /* parse the address */
-               while (isspace(*p) || *p == ',')
+               while ((isascii(*p) && isspace(*p)) || *p == ',')
                        p++;
                        p++;
-               a = parseaddr(p, (ADDRESS *) NULL, 1, delimiter, e);
-               p = DelimChar;
+               a = parseaddr(p, (ADDRESS *) NULL, 1, delimiter, &delimptr, e);
+               p = delimptr;
                if (a == NULL)
                        continue;
                a->q_next = al;
                if (a == NULL)
                        continue;
                a->q_next = al;
@@ -106,22 +104,11 @@ sendto(list, copyf, ctladdr, qflags)
                        a->q_flags |= QPRIMARY;
 
                if (ctladdr != NULL && sameaddr(ctladdr, a))
                        a->q_flags |= QPRIMARY;
 
                if (ctladdr != NULL && sameaddr(ctladdr, a))
-                       selfref = TRUE;
+                       ctladdr->q_flags |= QSELFREF;
                al = a;
                firstone = FALSE;
        }
 
                al = a;
                firstone = FALSE;
        }
 
-       /* if this alias doesn't include itself, delete ctladdr */
-       if (!selfref && ctladdr != NULL)
-       {
-               if (tTd(25, 5))
-               {
-                       printf("sendtolist: QDONTSEND ");
-                       printaddr(ctladdr, FALSE);
-               }
-               ctladdr->q_flags |= QDONTSEND;
-       }
-
        /* arrange to send to everyone on the local send list */
        prev = sibl = NULL;
        if (ctladdr != NULL)
        /* arrange to send to everyone on the local send list */
        prev = sibl = NULL;
        if (ctladdr != NULL)
@@ -130,7 +117,6 @@ sendto(list, copyf, ctladdr, qflags)
        {
                register ADDRESS *a = al;
                extern ADDRESS *recipient();
        {
                register ADDRESS *a = al;
                extern ADDRESS *recipient();
-               extern ADDRESS *recipient();
 
                al = a->q_next;
                sibl = recipient(a);
 
                al = a->q_next;
                sibl = recipient(a);
@@ -152,6 +138,7 @@ sendto(list, copyf, ctladdr, qflags)
        }
 
        e->e_to = NULL;
        }
 
        e->e_to = NULL;
+       return (naddrs);
        if (ctladdr != NULL)
                ctladdr->q_child = prev;
        return (prev);
        if (ctladdr != NULL)
                ctladdr->q_child = prev;
        return (prev);
@@ -209,9 +196,6 @@ addrref(a, r)
 **             none.
 */
 
 **             none.
 */
 
-extern ADDRESS *getctladdr();
-extern char    *RcptLogFile;
-
 ADDRESS *
 ADDRESS *
 recipient(a, sendq, e)
 ADDRESS *
 ADDRESS *
 recipient(a, sendq, e)
@@ -226,7 +210,7 @@ recipient(a, sendq, e)
        bool quoted = FALSE;            /* set if the addr has a quote bit */
        int findusercount = 0;
        char buf[MAXNAME];              /* unquoted image of the user name */
        bool quoted = FALSE;            /* set if the addr has a quote bit */
        int findusercount = 0;
        char buf[MAXNAME];              /* unquoted image of the user name */
-       extern bool safefile();
+       extern int safefile();
 
        e->e_to = a->q_paddr;
        m = a->q_mailer;
 
        e->e_to = a->q_paddr;
        m = a->q_mailer;
@@ -240,7 +224,7 @@ recipient(a, sendq, e)
        /* break aliasing loops */
        if (AliasLevel > MAXRCRSN)
        {
        /* break aliasing loops */
        if (AliasLevel > MAXRCRSN)
        {
-               usrerr("aliasing/forwarding loop broken");
+               usrerr("554 aliasing/forwarding loop broken");
                return (NULL);
        }
 
                return (NULL);
        }
 
@@ -249,11 +233,7 @@ recipient(a, sendq, e)
        */
 
        /* set the queue timeout */
        */
 
        /* set the queue timeout */
-       a->q_timeout = TimeOut;
-
-       /* map user & host to lower case if requested on non-aliases */
-       if (a->q_alias == NULL)
-               loweraddr(a);
+       a->q_timeout = TimeOuts.to_q_return;
 
        /* get unquoted user for file, program or user.name check */
        (void) strcpy(buf, a->q_user);
 
        /* get unquoted user for file, program or user.name check */
        (void) strcpy(buf, a->q_user);
@@ -265,10 +245,11 @@ recipient(a, sendq, e)
        stripquotes(buf);
 
        /* check for direct mailing to restricted mailers */
        stripquotes(buf);
 
        /* check for direct mailing to restricted mailers */
-       if (a->q_alias == NULL && m == ProgMailer)
+       if (a->q_alias == NULL && m == ProgMailer &&
+           !bitset(EF_QUEUERUN, e->e_flags))
        {
        {
-               a->q_flags |= QDONTSEND|QBADADDR;
-               usrerr("Cannot mail directly to programs", m->m_name);
+               a->q_flags |= QBADADDR;
+               usrerr("550 Cannot mail directly to programs", m->m_name);
        }
 
        /*
        }
 
        /*
@@ -282,17 +263,23 @@ recipient(a, sendq, e)
 
        for (pq = sendq; (q = *pq) != NULL; pq = &q->q_next)
        {
 
        for (pq = sendq; (q = *pq) != NULL; pq = &q->q_next)
        {
-               if (!ForceMail && sameaddr(q, a))
+               if (sameaddr(q, a))
                {
                {
+                       /* if this is a reinsertion, just go ahead */
+                       if (bitset(QVERIFIED, q->q_flags))
+                               break;
+
                        if (tTd(26, 1))
                        {
                                printf("%s in sendq: ", a->q_paddr);
                                printaddr(q, FALSE);
                        }
                        if (tTd(26, 1))
                        {
                                printf("%s in sendq: ", a->q_paddr);
                                printaddr(q, FALSE);
                        }
-                       if (Verbose && !bitset(QDONTSEND|QPSEUDO, a->q_flags))
-                               message(Arpa_Info, "duplicate suppressed");
                        if (!bitset(QPRIMARY, q->q_flags))
                        if (!bitset(QPRIMARY, q->q_flags))
+                       {
+                               if (!bitset(QDONTSEND, a->q_flags))
+                                       message("duplicate suppressed");
                                q->q_flags |= a->q_flags;
                                q->q_flags |= a->q_flags;
+                       }
                        if (!bitset(QPSEUDO, a->q_flags))
                                q->q_flags &= ~QPSEUDO;
                        return (q);
                        if (!bitset(QPSEUDO, a->q_flags))
                                q->q_flags &= ~QPSEUDO;
                        return (q);
@@ -300,42 +287,14 @@ recipient(a, sendq, e)
        }
 
        /* add address on list */
        }
 
        /* add address on list */
-       *pq = a;
-       a->q_next = NULL;
-
-       if (a->q_alias == NULL && RcptLogFile != NULL &&
-           !bitset(QDONTSEND, a->q_flags))
+       if (*pq != a)
        {
        {
-               static int RcptLogFd = -1;
-
-               /*
-               **  Log the incoming recipient name before aliasing,
-               **  expanding, forwarding, rewriting, and all that jazz.
-               **  We'll use this to track down out-of-date aliases,
-               **  host names, and so forth.
-               */
-
-               if (RcptLogFd < 0)
-               {
-                       /* try to open the log file */
-                       RcptLogFd = open(RcptLogFile, O_WRONLY|O_APPEND|O_CREAT, 0666);
-                       if (RcptLogFd >= 0)
-                               (void) fcntl(RcptLogFd, F_SETFD, 1);
-               }
-               if (RcptLogFd >= 0)
-               {
-                       int l = strlen(a->q_paddr);
-
-                       a->q_paddr[l] = '\n';
-                       if (write(RcptLogFd, a->q_paddr, l + 1) < 0)
-                       {
-                               (void) close(RcptLogFd);
-                               RcptLogFd = -1;
-                       }
-                       a->q_paddr[l] = '\0';
-               }
+               *pq = a;
+               a->q_next = NULL;
        }
 
        }
 
+       a->q_flags &= ~QVERIFIED;
+
        /*
        **  Alias the name and handle special mailer types.
        */
        /*
        **  Alias the name and handle special mailer types.
        */
@@ -344,21 +303,40 @@ recipient(a, sendq, e)
        if (tTd(29, 7))
                printf("at trylocaluser %s\n", a->q_user);
 
        if (tTd(29, 7))
                printf("at trylocaluser %s\n", a->q_user);
 
-       if (bitset(QDONTSEND, a->q_flags))
+       if (bitset(QDONTSEND|QBADADDR|QVERIFIED, a->q_flags))
                return (a);
 
        if (m == InclMailer)
        {
                a->q_flags |= QDONTSEND;
                return (a);
 
        if (m == InclMailer)
        {
                a->q_flags |= QDONTSEND;
-               if (a->q_alias == NULL)
+               if (a->q_alias == NULL && !bitset(EF_QUEUERUN, e->e_flags))
                {
                        a->q_flags |= QBADADDR;
                {
                        a->q_flags |= QBADADDR;
-                       usrerr("Cannot mail directly to :include:s");
+                       usrerr("550 Cannot mail directly to :include:s");
                }
                else
                {
                }
                else
                {
-                       message(Arpa_Info, "including file %s", a->q_user);
-                       (void) include(a->q_user, FALSE, a, sendq, e);
+                       int ret;
+
+                       message("including file %s", a->q_user);
+                       ret = include(a->q_user, FALSE, a, sendq, e);
+                       if (transienterror(ret))
+                       {
+#ifdef LOG
+                               if (LogLevel > 2)
+                                       syslog(LOG_ERR, "%s: include %s: transient error: %e",
+                                               e->e_id, a->q_user, errstring(ret));
+#endif
+                               a->q_flags |= QQUEUEUP|QDONTSEND;
+                               usrerr("451 Cannot open %s: %s",
+                                       a->q_user, errstring(ret));
+                       }
+                       else if (ret != 0)
+                       {
+                               usrerr("550 Cannot open %s: %s",
+                                       a->q_user, errstring(ret));
+                               a->q_flags |= QBADADDR;
+                       }
                }
        }
        else if (m == FileMailer)
                }
        }
        else if (m == FileMailer)
@@ -368,16 +346,16 @@ recipient(a, sendq, e)
 
                p = strrchr(buf, '/');
                /* check if writable or creatable */
 
                p = strrchr(buf, '/');
                /* check if writable or creatable */
-               if (a->q_alias == NULL && !QueueRun)
+               if (a->q_alias == NULL && !bitset(EF_QUEUERUN, e->e_flags))
                {
                {
-                       a->q_flags |= QDONTSEND|QBADADDR;
-                       usrerr("Cannot mail directly to files");
+                       a->q_flags |= QBADADDR;
+                       usrerr("550 Cannot mail directly to files");
                }
                else if ((stat(buf, &stb) >= 0) ? (!writable(&stb)) :
                }
                else if ((stat(buf, &stb) >= 0) ? (!writable(&stb)) :
-                   (*p = '\0', !safefile(buf, getruid(), S_IWRITE|S_IEXEC)))
+                   (*p = '\0', safefile(buf, getruid(), S_IWRITE|S_IEXEC) != 0))
                {
                        a->q_flags |= QBADADDR;
                {
                        a->q_flags |= QBADADDR;
-                       giveresponse(EX_CANTCREAT, m, e);
+                       giveresponse(EX_CANTCREAT, m, NULL, e);
                }
        }
 
                }
        }
 
@@ -393,21 +371,23 @@ recipient(a, sendq, e)
 
 # ifdef USERDB
        /* if not aliased, look it up in the user database */
 
 # ifdef USERDB
        /* if not aliased, look it up in the user database */
-       if (!bitset(QDONTSEND|QNOTREMOTE, a->q_flags))
+       if (!bitset(QDONTSEND|QNOTREMOTE|QVERIFIED, a->q_flags))
        {
                extern int udbexpand();
        {
                extern int udbexpand();
+               extern int errno;
 
                if (udbexpand(a, sendq, e) == EX_TEMPFAIL)
                {
 
                if (udbexpand(a, sendq, e) == EX_TEMPFAIL)
                {
-                       a->q_flags |= QQUEUEUP;
+                       a->q_flags |= QQUEUEUP|QDONTSEND;
                        if (e->e_message == NULL)
                                e->e_message = newstr("Deferred: user database error");
 # ifdef LOG
                        if (e->e_message == NULL)
                                e->e_message = newstr("Deferred: user database error");
 # ifdef LOG
-                       if (LogLevel > 3)
-                               syslog(LOG_INFO, "%s: deferred: udbexpand",
-                                       e->e_id);
+                       if (LogLevel > 8)
+                               syslog(LOG_INFO, "%s: deferred: udbexpand: %s",
+                                       e->e_id, errstring(errno));
 # endif
 # endif
-                       message(Arpa_Info, "queued (user database error)");
+                       message("queued (user database error): %s",
+                               errstring(errno));
                        e->e_nrcpts++;
                        return (a);
                }
                        e->e_nrcpts++;
                        return (a);
                }
@@ -415,7 +395,7 @@ recipient(a, sendq, e)
 # endif
 
        /* if it was an alias or a UDB expansion, just return now */
 # endif
 
        /* if it was an alias or a UDB expansion, just return now */
-       if (bitset(QDONTSEND, a->q_flags))
+       if (bitset(QDONTSEND|QQUEUEUP|QVERIFIED, a->q_flags))
                return (a);
 
        /*
                return (a);
 
        /*
@@ -442,7 +422,7 @@ recipient(a, sendq, e)
        **  and deliver it.
        */
 
        **  and deliver it.
        */
 
-       if (!bitset(QDONTSEND, a->q_flags))
+       if (!bitset(QDONTSEND|QQUEUEUP, a->q_flags))
        {
                auto bool fuzzy;
                register struct passwd *pw;
        {
                auto bool fuzzy;
                register struct passwd *pw;
@@ -453,7 +433,7 @@ recipient(a, sendq, e)
                if (pw == NULL)
                {
                        a->q_flags |= QBADADDR;
                if (pw == NULL)
                {
                        a->q_flags |= QBADADDR;
-                       giveresponse(EX_NOUSER, m, e);
+                       giveresponse(EX_NOUSER, m, NULL, e);
                }
                else
                {
                }
                else
                {
@@ -465,7 +445,8 @@ recipient(a, sendq, e)
                                a->q_user = newstr(pw->pw_name);
                                if (findusercount++ > 3)
                                {
                                a->q_user = newstr(pw->pw_name);
                                if (findusercount++ > 3)
                                {
-                                       usrerr("aliasing/forwarding loop for %s broken",
+                                       a->q_flags |= QBADADDR;
+                                       usrerr("554 aliasing/forwarding loop for %s broken",
                                                pw->pw_name);
                                        return (a);
                                }
                                                pw->pw_name);
                                        return (a);
                                }
@@ -477,6 +458,7 @@ recipient(a, sendq, e)
                        a->q_home = newstr(pw->pw_dir);
                        a->q_uid = pw->pw_uid;
                        a->q_gid = pw->pw_gid;
                        a->q_home = newstr(pw->pw_dir);
                        a->q_uid = pw->pw_uid;
                        a->q_gid = pw->pw_gid;
+                       a->q_ruser = newstr(pw->pw_name);
                        a->q_flags |= QGOODUID;
                        buildfname(pw->pw_gecos, pw->pw_name, nbuf);
                        if (nbuf[0] != '\0')
                        a->q_flags |= QGOODUID;
                        buildfname(pw->pw_gecos, pw->pw_name, nbuf);
                        if (nbuf[0] != '\0')
@@ -527,12 +509,6 @@ finduser(name, fuzzyp)
        if (tTd(29, 4))
                printf("finduser(%s): ", name);
 
        if (tTd(29, 4))
                printf("finduser(%s): ", name);
 
-       /* map upper => lower case */
-       for (p = name; *p != '\0'; p++)
-       {
-               if (isascii(*p) && isupper(*p))
-                       *p = tolower(*p);
-       }
        *fuzzyp = FALSE;
 
        /* look up this login name using fast path */
        *fuzzyp = FALSE;
 
        /* look up this login name using fast path */
@@ -573,9 +549,12 @@ finduser(name, fuzzyp)
                        return (pw);
                }
        }
                        return (pw);
                }
        }
-#endif
        if (tTd(29, 4))
                printf("no fuzzy match found\n");
        if (tTd(29, 4))
                printf("no fuzzy match found\n");
+#else
+       if (tTd(29, 4))
+               printf("not found (fuzzy disabled)\n");
+#endif
        return (NULL);
 }
 \f/*
        return (NULL);
 }
 \f/*
@@ -667,6 +646,8 @@ include(fname, forwarding, ctladdr, sendq, e)
        char *oldfilename = FileName;
        int oldlinenumber = LineNumber;
        register EVENT *ev = NULL;
        char *oldfilename = FileName;
        int oldlinenumber = LineNumber;
        register EVENT *ev = NULL;
+       int nincludes;
+       int ret;
        char buf[MAXLINE];
        static int includetimeout();
 
        char buf[MAXLINE];
        static int includetimeout();
 
@@ -688,13 +669,14 @@ include(fname, forwarding, ctladdr, sendq, e)
        ev = setevent((time_t) 60, includetimeout, 0);
 
        /* if forwarding, the input file must be marked safe */
        ev = setevent((time_t) 60, includetimeout, 0);
 
        /* if forwarding, the input file must be marked safe */
-       if (forwarding && !safefile(fname, ctladdr->q_uid, S_IREAD))
+       if (forwarding && (ret = safefile(fname, ctladdr->q_uid, S_IREAD)) != 0)
        {
                /* don't use this .forward file */
                clrevent(ev);
                if (tTd(27, 4))
        {
                /* don't use this .forward file */
                clrevent(ev);
                if (tTd(27, 4))
-                       printf("include: not safe (uid=%d)\n", ctladdr->q_uid);
-               return EPERM;
+                       printf("include: not safe (uid=%d): %s\n",
+                               ctladdr->q_uid, errstring(ret));
+               return ret;
        }
 
        fp = fopen(fname, "r");
        }
 
        fp = fopen(fname, "r");
@@ -702,7 +684,7 @@ include(fname, forwarding, ctladdr, sendq, e)
        {
                int ret = errno;
 
        {
                int ret = errno;
 
-               usrerr("Cannot open %s", fname);
+               clrevent(ev);
                return ret;
        }
 
                return ret;
        }
 
@@ -711,7 +693,13 @@ include(fname, forwarding, ctladdr, sendq, e)
                struct stat st;
 
                if (fstat(fileno(fp), &st) < 0)
                struct stat st;
 
                if (fstat(fileno(fp), &st) < 0)
+               {
+                       int ret = errno;
+
+                       clrevent(ev);
                        syserr("Cannot fstat %s!", fname);
                        syserr("Cannot fstat %s!", fname);
+                       return ret;
+               }
                ctladdr->q_uid = st.st_uid;
                ctladdr->q_gid = st.st_gid;
                ctladdr->q_flags |= QGOODUID;
                ctladdr->q_uid = st.st_uid;
                ctladdr->q_gid = st.st_gid;
                ctladdr->q_flags |= QGOODUID;
@@ -719,9 +707,20 @@ include(fname, forwarding, ctladdr, sendq, e)
 
        clrevent(ev);
 
 
        clrevent(ev);
 
+       if (bitset(EF_VRFYONLY, e->e_flags))
+       {
+               /* don't do any more now */
+               ctladdr->q_flags |= QVERIFIED;
+               e->e_nrcpts++;
+               xfclose(fp, "include", fname);
+               return 0;
+       }
+
        /* read the file -- each line is a comma-separated list. */
        FileName = fname;
        LineNumber = 0;
        /* read the file -- each line is a comma-separated list. */
        FileName = fname;
        LineNumber = 0;
+       ctladdr->q_flags &= ~QSELFREF;
+       nincludes = 0;
        while (fgets(buf, sizeof buf, fp) != NULL)
        {
                register char *p = strchr(buf, '\n');
        while (fgets(buf, sizeof buf, fp) != NULL)
        {
                register char *p = strchr(buf, '\n');
@@ -732,10 +731,10 @@ include(fname, forwarding, ctladdr, sendq, e)
                if (buf[0] == '#' || buf[0] == '\0')
                        continue;
                e->e_to = NULL;
                if (buf[0] == '#' || buf[0] == '\0')
                        continue;
                e->e_to = NULL;
-               message(Arpa_Info, "%s to %s",
+               message("%s to %s",
                        forwarding ? "forwarding" : "sending", buf);
 #ifdef LOG
                        forwarding ? "forwarding" : "sending", buf);
 #ifdef LOG
-               if (forwarding && LogLevel >= 10)
+               if (forwarding && LogLevel > 9)
                        syslog(LOG_INFO, "%s: forward %s => %s",
                                e->e_id, oldto, buf);
 #endif
                        syslog(LOG_INFO, "%s: forward %s => %s",
                                e->e_id, oldto, buf);
 #endif
@@ -744,8 +743,17 @@ include(fname, forwarding, ctladdr, sendq, e)
                sendto(buf, 1, ctladdr, 0);
                AliasLevel--;
        }
                sendto(buf, 1, ctladdr, 0);
                AliasLevel--;
        }
+       if (nincludes > 0 && !bitset(QSELFREF, ctladdr->q_flags))
+       {
+               if (tTd(27, 5))
+               {
+                       printf("include: QDONTSEND ");
+                       printaddr(ctladdr, FALSE);
+               }
+               ctladdr->q_flags |= QDONTSEND;
+       }
 
 
-       (void) fclose(fp);
+       (void) xfclose(fp, "include", fname);
        FileName = oldfilename;
        LineNumber = oldlinenumber;
        return 0;
        FileName = oldfilename;
        LineNumber = oldlinenumber;
        return 0;
@@ -761,6 +769,7 @@ includetimeout()
 **
 **     Parameters:
 **             argv -- argument vector to send to.
 **
 **     Parameters:
 **             argv -- argument vector to send to.
+**             e -- the current envelope.
 **
 **     Returns:
 **             none.
 **
 **     Returns:
 **             none.
@@ -778,21 +787,6 @@ sendtoargv(argv, e)
 
        while ((p = *argv++) != NULL)
        {
 
        while ((p = *argv++) != NULL)
        {
-               if (argv[0] != NULL && argv[1] != NULL && !strcasecmp(argv[0], "at"))
-               {
-                       char nbuf[MAXNAME];
-
-                       if (strlen(p) + strlen(argv[1]) + 2 > sizeof nbuf)
-                               usrerr("address overflow");
-                       else
-                       {
-                               (void) strcpy(nbuf, p);
-                               (void) strcat(nbuf, "@");
-                               (void) strcat(nbuf, argv[1]);
-                               p = newstr(nbuf);
-                               argv += 2;
-                       }
-               }
                sendto(p, 0, (ADDRESS *) NULL, 0);
        }
 }
                sendto(p, 0, (ADDRESS *) NULL, 0);
        }
 }