]> diplodocus.org Git - nmh/blobdiff - uip/post.c
Removed temporary probes added in commit
[nmh] / uip / post.c
index 9c7af29e7623e01f616b77bf6083f0642ac5228d..858946354ba2e55a5ec7e0c2242cf1720e3e519e 100644 (file)
 #include <h/dropsbr.h>
 #include <h/mime.h>
 #include <h/utils.h>
 #include <h/dropsbr.h>
 #include <h/mime.h>
 #include <h/utils.h>
-
 #include <h/tws.h>
 #include <h/mts.h>
 
 #include <h/tws.h>
 #include <h/mts.h>
 
-#include <errno.h>
-#include <signal.h>
-
 #ifdef HAVE_SYS_TIME_H
 # include <sys/time.h>
 #endif
 #ifdef HAVE_SYS_TIME_H
 # include <sys/time.h>
 #endif
@@ -93,6 +89,7 @@
     X("fileproc", -4, FILEPROCSW) \
     X("mhlproc", -3, MHLPROCSW) \
     X("mts smtp|sendmail/smtp|sendmail/pipe", 2, MTSSW) \
     X("fileproc", -4, FILEPROCSW) \
     X("mhlproc", -3, MHLPROCSW) \
     X("mts smtp|sendmail/smtp|sendmail/pipe", 2, MTSSW) \
+    X("credentials legacy|file:filename", 0, CREDENTIALSSW) \
     X("messageid localname|random", 2, MESSAGEIDSW) \
 
 #define X(sw, minchars, id) id,
     X("messageid localname|random", 2, MESSAGEIDSW) \
 
 #define X(sw, minchars, id) id,
@@ -226,7 +223,6 @@ static char from[BUFSIZ];   /* my network address            */
 static char sender[BUFSIZ];    /* my Sender: header             */
 static char efrom[BUFSIZ];     /* my Envelope-From: header      */
 static char fullfrom[BUFSIZ];  /* full contents of From header  */
 static char sender[BUFSIZ];    /* my Sender: header             */
 static char efrom[BUFSIZ];     /* my Envelope-From: header      */
 static char fullfrom[BUFSIZ];  /* full contents of From header  */
-static char signature[BUFSIZ]; /* my signature                  */
 static char *filter = NULL;    /* the filter for BCC'ing        */
 static char *subject = NULL;   /* the subject field for BCC'ing */
 static char *fccfold[FCCS];    /* foldernames for FCC'ing       */
 static char *filter = NULL;    /* the filter for BCC'ing        */
 static char *subject = NULL;   /* the subject field for BCC'ing */
 static char *fccfold[FCCS];    /* foldernames for FCC'ing       */
@@ -498,6 +494,13 @@ main (int argc, char **argv)
                     save_mts_method (cp);
                    continue;
 
                     save_mts_method (cp);
                    continue;
 
+               case CREDENTIALSSW: {
+                   if (!(cp = *argp++) || *cp == '-')
+                       adios (NULL, "missing argument to %s", argp[-2]);
+                   add_profile_entry ("credentials", cp);
+                   continue;
+               }
+
                case MESSAGEIDSW:
                    if (!(cp = *argp++) || *cp == '-')
                        adios (NULL, "missing argument to %s", argp[-2]);
                case MESSAGEIDSW:
                    if (!(cp = *argp++) || *cp == '-')
                        adios (NULL, "missing argument to %s", argp[-2]);
@@ -645,9 +648,13 @@ main (int argc, char **argv)
     p_refile (tmpfil);
     unlink (tmpfil);
 
     p_refile (tmpfil);
     unlink (tmpfil);
 
-    if (verbose)
-       printf (partno ? "Partial Message #%s Processed\n" : "Message Processed\n",
-               partno);
+    if (verbose) {
+       if (partno)
+           printf ("Partial Message #%s Processed\n", partno);
+       else
+           printf ("Message Processed\n");
+    }
+
     done (0);
     return 1;
 }
     done (0);
     return 1;
 }
@@ -662,7 +669,7 @@ putfmt (char *name, char *str, FILE *out)
 {
     int count, grp, i, keep;
     char *cp, *pp, *qp;
 {
     int count, grp, i, keep;
     char *cp, *pp, *qp;
-    char namep[BUFSIZ];
+    char namep[BUFSIZ], error[BUFSIZ];
     struct mailname *mp = NULL, *np = NULL;
     struct headers *hdr;
 
     struct mailname *mp = NULL, *np = NULL;
     struct headers *hdr;
 
@@ -725,18 +732,20 @@ putfmt (char *name, char *str, FILE *out)
 
     tmpaddrs.m_next = NULL;
     for (count = 0; (cp = getname (str)); count++)
 
     tmpaddrs.m_next = NULL;
     for (count = 0; (cp = getname (str)); count++)
-       if ((mp = getm (cp, NULL, 0, AD_HOST, NULL))) {
+       if ((mp = getm (cp, NULL, 0, error, sizeof(error)))) {
            if (tmpaddrs.m_next)
                np->m_next = mp;
            else
                tmpaddrs.m_next = mp;
            np = mp;
        }
            if (tmpaddrs.m_next)
                np->m_next = mp;
            else
                tmpaddrs.m_next = mp;
            np = mp;
        }
-       else
+       else {
+           admonish(cp, "%s", error);
            if (hdr->flags & HTRY)
                badadr++;
            else
                badmsg++;
            if (hdr->flags & HTRY)
                badadr++;
            else
                badmsg++;
+       }
 
     if (count < 1) {
        if (hdr->flags & HNIL)
 
     if (count < 1) {
        if (hdr->flags & HNIL)
@@ -777,7 +786,8 @@ putfmt (char *name, char *str, FILE *out)
            if (np->m_gname)
                putgrp (namep, np->m_gname, out, hdr->flags);
            while ((cp = getname (pp))) {
            if (np->m_gname)
                putgrp (namep, np->m_gname, out, hdr->flags);
            while ((cp = getname (pp))) {
-               if (!(mp = getm (cp, NULL, 0, AD_HOST, NULL))) {
+               if (!(mp = getm (cp, NULL, 0, error, sizeof(error)))) {
+                   admonish(cp, "%s", error);
                    badadr++;
                    continue;
                }
                    badadr++;
                    continue;
                }
@@ -926,9 +936,6 @@ putfmt (char *name, char *str, FILE *out)
 static void
 start_headers (void)
 {
 static void
 start_headers (void)
 {
-    char  *cp, sigbuf[BUFSIZ];
-    struct mailname *mp;
-
     time (&tclock);
 
     /*
     time (&tclock);
 
     /*
@@ -939,21 +946,6 @@ start_headers (void)
     efrom[0] = '\0';
     sender[0] = '\0';
     fullfrom[0] = '\0';
     efrom[0] = '\0';
     sender[0] = '\0';
     fullfrom[0] = '\0';
-
-    if ((cp = getfullname ()) && *cp) {
-       strncpy (sigbuf, cp, sizeof(sigbuf));
-       snprintf (signature, sizeof(signature), "%s <%s>",
-               sigbuf, getlocaladdr());
-       if ((cp = getname (signature)) == NULL)
-           adios (NULL, "getname () failed -- you lose extraordinarily big");
-       if ((mp = getm (cp, NULL, 0, AD_HOST, NULL)) == NULL)
-           adios (NULL, "bad signature '%s'", sigbuf);
-       mnfree (mp);
-       while (getname (""))
-           continue;
-    } else {
-       strncpy (signature, getlocaladdr(), sizeof(signature));
-    }
 }
 
 
 }