WHERE char Quotebuf[STRING];
-WHERE char *MuttDotlock;
-
WHERE address_t *EnvFrom;
WHERE address_t *From;
WHERE char *QueryCmd;
WHERE char *Realname;
WHERE char *SendCharset;
-WHERE char *Sendmail;
WHERE char *SidebarDelim;
WHERE char *SidebarNumberFormat;
WHERE char *SidebarBoundary;
** is viewed it is passed as standard input to $$display_filter, and the
** filtered message is read from the standard output.
*/
- {"dotlock_program", DT_PATH, R_NONE, UL &MuttDotlock, "$madmutt_bindir/muttng_dotlock"},
- /*
- ** .pp
- ** Contains the path of the \fTmadmutt_dotlock(1)\fP binary to be used by
- ** Madmutt.
- */
{"dsn_notify", DT_STR, R_NONE, UL &DsnNotify, ""},
/*
** .pp
** \fTiso-8859-2\fP, \fTkoi8-r\fP or \fTiso-2022-jp\fP) either
** instead of or after \fTiso-8859-1\fP.
*/
- {"sendmail", DT_PATH, R_NONE, UL &Sendmail, SENDMAIL " -oem -oi"},
- /*
- ** .pp
- ** Specifies the program and arguments used to deliver mail sent by Madmutt.
- ** Madmutt expects that the specified program interprets additional
- ** arguments as recipient addresses.
- */
{"sendmail_wait", DT_NUM, R_NONE, UL &SendmailWait, "0" },
/*
** .pp
exit 0
############ Put tokens here ############
-## shell
+## dotlock
## sendmail
+## shell
luaL_error(L, "bad subscript to madmutt: %s", val);
return 0;
+ case LTK_DOTLOCK:
case LTK_SENDMAIL:
case LTK_SHELL:
_mutt_expand_path(buf, sizeof(buf), val, 0);
** header chaching's database backend.\fP
*/
#endif
+
+ {"dotlock", "/mutt_dotlock"},
+ /*
+ ** .pp
+ ** Contains the path of the \fTmadmutt_dotlock(1)\fP binary to be used by
+ ** Madmutt.
+ */
+ {"sendmail", SENDMAIL " -oem -oi"},
+ /*
+ ** .pp
+ ** Specifies the program and arguments used to deliver mail sent by Madmutt.
+ ** Madmutt expects that the specified program interprets additional
+ ** arguments as recipient addresses.
+ */
};
static void madmutt_init_shell(char *buf, ssize_t len)
#include <utime.h>
+#include <lib-lua/lib-lua.h>
#include <lib-sys/unix.h>
#include <lib-mime/mime.h>
#include <lib-ui/sidebar.h>
+#include <lib-crypt/crypt.h>
#include "mutt.h"
#include "pattern.h"
#include <nntp/nntp.h>
#endif
-#include <lib-crypt/crypt.h>
-
static mx_t const *mxfmts[] = {
&mbox_mx,
&mmdf_mx,
char cmd[LONG_STRING + _POSIX_PATH_MAX];
char f[STRING + _POSIX_PATH_MAX];
char r[STRING];
+ int pos;
if (flags & DL_FL_RETRY)
snprintf (r, sizeof (r), "-r %d ", retry ? MAXLOCKATTEMPT : 0);
mutt_quote_filename (f, sizeof (f), path);
- snprintf (cmd, sizeof (cmd),
- "%s %s%s%s%s%s%s%s",
- NONULL (MuttDotlock),
+ pos = mlua_value(cmd, sizeof(cmd), "madmutt", "dotlock");
+
+ snprintf(cmd + pos, sizeof(cmd) - pos,
+ " %s%s%s%s%s%s%s",
flags & DL_FL_TRY ? "-t " : "",
flags & DL_FL_UNLOCK ? "-u " : "",
flags & DL_FL_USEPRIV ? "-p " : "",
#include <signal.h>
#include <sys/utsname.h>
+#include <lib-lua/lib-lua.h>
#include <lib-sys/exit.h>
#include <lib-sys/mutt_signal.h>
#include <lib-mime/mime.h>
const char *msg, /* file containing message */
int eightbit)
{ /* message contains 8bit chars */
- char *ps = NULL, *path = NULL, *s = NULL, *childout = NULL;
+ char cmd[LONG_STRING];
+ char *ps = NULL, *path = NULL, *childout = NULL;
const char **args = NULL;
ssize_t argslen = 0, argsmax = 0;
int i;
#ifdef USE_NNTP
if (option (OPTNEWSSEND)) {
- char cmd[LONG_STRING];
-
m_strformat(cmd, sizeof(cmd), 0, Inews, nntp_format_str, 0, 0);
if (m_strisempty(cmd)) {
i = nntp_post (msg);
unlink (msg);
return i;
}
-
- s = m_strdup(cmd);
- }
- else
+ } else
#endif
- s = m_strdup(Sendmail);
+ {
+ mlua_value(cmd, sizeof(cmd), "madmutt", "sendmail");
+ }
- ps = s;
+ ps = cmd;
i = 0;
- while ((ps = strtok (ps, " "))) {
+ while ((ps = strtok(ps, " "))) {
if (argslen == argsmax)
p_realloc(&args, argsmax += 5);
p_delete(&childout);
p_delete(&path);
- p_delete(&s);
p_delete(&args);
if (i == (EX_OK & 0xff))