{ "fileproc", -4 },
#define MHLPROCSW 39
{ "mhlproc", -3 },
+#define MTSSW 40
+ { "mts smtp|sendmail/smtp|sendmail/pipe", 2 },
+#define MESSAGEIDSW 41
+ { "messageid localname|random", 2 },
{ NULL, 0 }
};
adios (NULL, "missing argument to %s", argp[-2]);
mhlproc = cp;
continue;
+
+ case MTSSW:
+ if (!(cp = *argp++) || *cp == '-')
+ adios (NULL, "missing argument to %s", argp[-2]);
+ save_mts_method (cp);
+ continue;
+
+ case MESSAGEIDSW:
+ if (!(cp = *argp++) || *cp == '-')
+ adios (NULL, "missing argument to %s", argp[-2]);
+ if (save_message_id_style (cp) != 0)
+ adios (NULL, "unsupported messageid \"%s\"", cp);
+ continue;
}
}
if (msg)
fprintf (out, "Date: %s\n", dtime (&tclock, 0));
if (msgid)
- fprintf (out, "Message-ID: <%d.%ld@%s>\n",
- (int) getpid (), (long) tclock, LocalName (1));
+ fprintf (out, "Message-ID: %s\n", message_id (tclock, 0));
/*
* If we have multiple From: addresses, make sure we have an
* Sender: header. If we don't have one, then generate one
fprintf (out, "Resent-Date: %s\n", dtime (&tclock, 0));
if (msgid)
- fprintf (out, "Resent-Message-ID: <%d.%ld@%s>\n",
- (int) getpid (), (long) tclock, LocalName (1));
+ fprintf (out, "Resent-Message-ID: %s\n",
+ message_id (tclock, 0));
/*
* If we have multiple Resent-From: addresses, make sure we have an
* Resent-Sender: header. If we don't have one, then generate one
fprintf (out, "Date: %s\n", dtime (&tclock, 0));
if (msgid)
- fprintf (out, "Message-ID: <%d.%ld@%s>\n",
- (int) getpid (), (long) tclock, LocalName (1));
+ fprintf (out, "Message-ID: %s\n", message_id (tclock, 0));
if (subject)
fprintf (out, "Subject: %s", subject);
fprintf (out, "BCC:\n");
static void
post (char *file, int bccque, int talk, char *envelope)
{
- int fd, onex;
+ int fd;
int retval, i;
pid_t child_id;
- onex = !(msgflags & MINV) || bccque;
if (verbose) {
if (msgflags & MINV)
printf (" -- Posting for %s Recipients --\n",
argp = sargv;
*argp++ = "sendmail";
- *argp++ = "-m"; /* send to me too */
*argp++ = "-t"; /* read msg for recipients */
*argp++ = "-i"; /* don't stop on "." */
if (whomsw)
}
} else {
if (rp_isbad (retval = sm_init (clientsw, serversw, port, watch,
- verbose, snoop, onex, queued, sasl,
+ verbose, snoop, queued, sasl,
saslssf, saslmech, user, tls)) ||
rp_isbad (retval = sm_winit (envelope)))
die (NULL, "problem initializing server; %s", rp_string (retval));
close (fd);
fflush (stdout);
- sm_end (onex ? OK : DONE);
+ sm_end (!(msgflags & MINV) || bccque ? OK : DONE);
sigoff ();
if (verbose) {
if (!whomsw || checksw)
if (rp_isbad (retval = sm_init (clientsw, serversw, port, watch,
- verbose, snoop, 0, queued, sasl,
+ verbose, snoop, queued, sasl,
saslssf, saslmech, user, tls))
|| rp_isbad (retval = sm_winit (envelope)))
die (NULL, "problem initializing server; %s", rp_string (retval));