X("tls", TLSminc(-3), TLSSW) \
X("initialtls", TLSminc(-10), INITTLSSW) \
X("notls", TLSminc(-5), NTLSSW) \
+ X("sendmail program", 0, MTSSM) \
X("mts smtp|sendmail/smtp|sendmail/pipe", 2, MTSSW) \
X("messageid localname|random", 2, MESSAGEIDSW) \
struct msgs *mp;
struct stat st;
-#ifdef LOCALE
- setlocale(LC_ALL, "");
-#endif
- invo_name = r1bindex (argv[0], '/');
-
- /* read user profile/context */
- context_read();
+ if (nmh_init(argv[0], 1)) { return 1; }
arguments = getarguments (invo_name, argc, argv, 1);
argp = arguments;
case SASLMXSSFSW:
case USERSW:
case PORTSW:
+ case MTSSM:
case MTSSW:
case MESSAGEIDSW:
vec[vecp++] = --cp;
adios (msgs[0], "unable to stat draft file");
cp = concat ("Use \"", msgs[0], "\"? ", NULL);
for (status = LISTDSW; status != YESW;) {
- if (!(argp = getans (cp, anyl)))
+ if (!(argp = read_switch_multiword (cp, anyl)))
done (1);
switch (status = smatch (*argp, anyl)) {
case NOSW:
&& (distsw = atoi (cp))
&& altmsg) {
vec[vecp++] = "-dist";
- distfile = getcpy (m_mktemp2 (altmsg, invo_name, NULL, NULL));
- unlink(distfile);
+ if ((cp = m_mktemp2(altmsg, invo_name, NULL, NULL)) == NULL) {
+ adios(NULL, "unable to create temporary file in %s",
+ get_temp_dir());
+ }
+ distfile = getcpy (cp);
+ (void) m_unlink(distfile);
if (link (altmsg, distfile) == NOTOK) {
/* Cygwin with FAT32 filesystem produces EPERM. */
if (errno != EXDEV && errno != EPERM
)
adios (distfile, "unable to link %s to", altmsg);
free (distfile);
- distfile = getcpy (m_mktemp2(NULL, invo_name, NULL, NULL));
+ if ((cp = m_mktemp2(NULL, invo_name, NULL, NULL)) == NULL) {
+ adios(NULL, "unable to create temporary file in %s",
+ get_temp_dir());
+ }
+ distfile = getcpy (cp);
{
int in, out;
struct stat st;