only catch filenames if the "/" is leading
[unix-history] / usr / src / usr.sbin / sendmail / src / recipient.c
index d562048..737c875 100644 (file)
@@ -2,7 +2,7 @@
 # include "sendmail.h"
 # include <sys/stat.h>
 
 # include "sendmail.h"
 # include <sys/stat.h>
 
-static char SccsId[] = "@(#)recipient.c        3.30    %G%";
+SCCSID(@(#)recipient.c 3.33            %G%);
 
 /*
 **  SENDTO -- Designate a send list.
 
 /*
 **  SENDTO -- Designate a send list.
@@ -41,6 +41,7 @@ sendto(list, copyf, ctladdr, qflags)
        char *list;
        int copyf;
        ADDRESS *ctladdr;
        char *list;
        int copyf;
        ADDRESS *ctladdr;
+       ADDRESS **sendq;
        u_short qflags;
 {
        register char *p;
        u_short qflags;
 {
        register char *p;
@@ -235,7 +236,7 @@ recipient(a, sendq)
                {
                        a->q_mailer = m = ProgMailer;
                        a->q_user++;
                {
                        a->q_mailer = m = ProgMailer;
                        a->q_user++;
-                       if (a->q_alias == NULL && Debug == 0 && !QueueRun)
+                       if (a->q_alias == NULL && Debug == 0 && !QueueRun && !ForceMail)
                        {
                                usrerr("Cannot mail directly to programs");
                                a->q_flags |= QDONTSEND;
                        {
                                usrerr("Cannot mail directly to programs");
                                a->q_flags |= QDONTSEND;
@@ -288,7 +289,7 @@ recipient(a, sendq)
                if (strncmp(a->q_user, ":include:", 9) == 0)
                {
                        a->q_flags |= QDONTSEND;
                if (strncmp(a->q_user, ":include:", 9) == 0)
                {
                        a->q_flags |= QDONTSEND;
-                       if (a->q_alias == NULL && Debug == 0 && !QueueRun)
+                       if (a->q_alias == NULL && Debug == 0 && !QueueRun && !ForceMail)
                                usrerr("Cannot mail directly to :include:s");
                        else
                        {
                                usrerr("Cannot mail directly to :include:s");
                        else
                        {
@@ -326,10 +327,11 @@ recipient(a, sendq)
                stripquotes(buf, TRUE);
 
                /* see if this is to a file */
                stripquotes(buf, TRUE);
 
                /* see if this is to a file */
-               if ((p = rindex(buf, '/')) != NULL)
+               if (buf[0] == '/')
                {
                {
+                       p = rindex(buf, '/');
                        /* check if writable or creatable */
                        /* check if writable or creatable */
-                       if (a->q_alias == NULL && Debug == 0 && !QueueRun)
+                       if (a->q_alias == NULL && Debug == 0 && !QueueRun && !ForceMail)
                        {
                                usrerr("Cannot mail directly to files");
                                a->q_flags |= QDONTSEND;
                        {
                                usrerr("Cannot mail directly to files");
                                a->q_flags |= QDONTSEND;