projects
/
apps
/
madmutt.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
make lua packages interfaces be *.li.
[apps/madmutt.git]
/
sendlib.c
diff --git
a/sendlib.c
b/sendlib.c
index
b8ece6d
..
666ccba
100644
(file)
--- a/
sendlib.c
+++ b/
sendlib.c
@@
-12,6
+12,7
@@
#include <signal.h>
#include <sys/utsname.h>
#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>
#include <lib-sys/exit.h>
#include <lib-sys/mutt_signal.h>
#include <lib-mime/mime.h>
@@
-339,8
+340,8
@@
int mutt_write_mime_header (BODY * a, FILE * f)
int mutt_write_mime_body (BODY * a, FILE * f)
{
const char *p;
int mutt_write_mime_body (BODY * a, FILE * f)
{
const char *p;
- char boundary[S
HORT_S
TRING];
- char send_charset[S
HORT_S
TRING];
+ char boundary[STRING];
+ char send_charset[STRING];
FILE *fpin;
BODY *t;
fgetconv_t *fc;
FILE *fpin;
BODY *t;
fgetconv_t *fc;
@@
-828,7
+829,7
@@
int mutt_lookup_mime_type (BODY * att, const char *path)
*/
switch (count) {
case 0:
*/
switch (count) {
case 0:
- snprintf
(buf, sizeof (buf), "%s/.mime.types", NONULL (H
omedir));
+ snprintf
(buf, sizeof (buf), "%s/.mime.types", NONULL(MCore.h
omedir));
break;
case 1:
m_strcpy(buf, sizeof(buf), SYSCONFDIR "/madmutt-mime.types");
break;
case 1:
m_strcpy(buf, sizeof(buf), SYSCONFDIR "/madmutt-mime.types");
@@
-924,7
+925,7
@@
void mutt_message_to_7bit (BODY * a, FILE * fp)
a->length = sb.st_size;
}
a->length = sb.st_size;
}
- fpout = m_tempfile(temp, sizeof(temp), NONULL(
Te
mpdir), NULL);
+ fpout = m_tempfile(temp, sizeof(temp), NONULL(
MCore.t
mpdir), NULL);
if (!fpout) {
mutt_error(_("Could not create temporary file"));
goto cleanup;
if (!fpout) {
mutt_error(_("Could not create temporary file"));
goto cleanup;
@@
-989,7
+990,7
@@
static void transform_to_7bit (BODY * a, FILE * fpin)
a->noconv = 1;
a->force_charset = 1;
a->noconv = 1;
a->force_charset = 1;
- s.fpout = m_tempfile(buff, sizeof(buff), NONULL(
Te
mpdir), NULL);
+ s.fpout = m_tempfile(buff, sizeof(buff), NONULL(
MCore.t
mpdir), NULL);
if (!s.fpout) {
mutt_error(_("Could not create temporary file"));
return;
if (!s.fpout) {
mutt_error(_("Could not create temporary file"));
return;
@@
-1018,7
+1019,7
@@
static void transform_to_7bit (BODY * a, FILE * fpin)
/* determine which Content-Transfer-Encoding to use */
static void mutt_set_encoding (BODY * b, CONTENT * info)
{
/* determine which Content-Transfer-Encoding to use */
static void mutt_set_encoding (BODY * b, CONTENT * info)
{
- char send_charset[S
HORT_S
TRING];
+ char send_charset[STRING];
if (b->type == TYPETEXT) {
char *chsname =
if (b->type == TYPETEXT) {
char *chsname =
@@
-1113,7
+1114,7
@@
BODY *mutt_make_message_attach (CONTEXT * ctx, HEADER * hdr, int attach_msg)
return (NULL);
}
return (NULL);
}
- fp = m_tempfile(buffer, sizeof(buffer), NONULL(
Te
mpdir), NULL);
+ fp = m_tempfile(buffer, sizeof(buffer), NONULL(
MCore.t
mpdir), NULL);
if (!fp)
return NULL;
if (!fp)
return NULL;
@@
-1505,7
+1506,7
@@
int mutt_write_rfc822_header (FILE * fp, ENVELOPE * env, BODY * attach,
os = (uname(&un) == -1) ? "UNIX" : un.sysname;
}
/* Add a vanity header */
os = (uname(&un) == -1) ? "UNIX" : un.sysname;
}
/* Add a vanity header */
- fprintf (fp, "User-Agent: %s (%s)\n", mutt_make_version
(0
), os);
+ fprintf (fp, "User-Agent: %s (%s)\n", mutt_make_version
(
), os);
}
return (ferror (fp) == 0 ? 0 : -1);
}
return (ferror (fp) == 0 ? 0 : -1);
@@
-1650,8
+1651,8
@@
static void mutt_gen_localpart(char *buf, unsigned int len, const char *fmt)
static char *mutt_gen_msgid (void)
{
static char *mutt_gen_msgid (void)
{
- char buf[S
HORT_S
TRING];
- char localpart[S
HORT_S
TRING];
+ char buf[STRING];
+ char localpart[STRING];
const char *fqdn;
if (!(fqdn = mutt_fqdn(0)))
const char *fqdn;
if (!(fqdn = mutt_fqdn(0)))
@@
-1831,32
+1832,29
@@
static int mutt_invoke_sendmail (address_t * from, /* the sender */
const char *msg, /* file containing message */
int eightbit)
{ /* message contains 8bit chars */
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)) {
const char **args = NULL;
ssize_t argslen = 0, argsmax = 0;
int i;
#ifdef USE_NNTP
if (option (OPTNEWSSEND)) {
- char cmd[LONG_STRING];
-
- mutt_FormatString (cmd, sizeof (cmd), NONULL (Inews), nntp_format_str, 0,
- 0);
+ m_strformat(cmd, sizeof(cmd), 0, Inews, nntp_format_str, 0, 0);
if (m_strisempty(cmd)) {
i = nntp_post (msg);
unlink (msg);
return i;
}
if (m_strisempty(cmd)) {
i = nntp_post (msg);
unlink (msg);
return i;
}
-
- s = m_strdup(cmd);
- }
- else
+ } else
#endif
#endif
- s = m_strdup(Sendmail);
+ {
+ m_strcpy(cmd, sizeof(cmd), MTransport.sendmail);
+ }
- ps =
s
;
+ ps =
cmd
;
i = 0;
i = 0;
- while ((ps = strtok
(ps, " "))) {
+ while ((ps = strtok(ps, " "))) {
if (argslen == argsmax)
p_realloc(&args, argsmax += 5);
if (argslen == argsmax)
p_realloc(&args, argsmax += 5);
@@
-1892,13
+1890,13
@@
static int mutt_invoke_sendmail (address_t * from, /* the sender */
args = add_args (args, &argslen, &argsmax, f);
}
}
args = add_args (args, &argslen, &argsmax, f);
}
}
- if (
DsnN
otify) {
+ if (
MTransport.dsn_n
otify) {
args = add_option (args, &argslen, &argsmax, "-N");
args = add_option (args, &argslen, &argsmax, "-N");
- args = add_option (args, &argslen, &argsmax,
DsnN
otify);
+ args = add_option (args, &argslen, &argsmax,
MTransport.dsn_n
otify);
}
}
- if (
DsnR
eturn) {
+ if (
MTransport.dsn_r
eturn) {
args = add_option (args, &argslen, &argsmax, "-R");
args = add_option (args, &argslen, &argsmax, "-R");
- args = add_option (args, &argslen, &argsmax,
DsnR
eturn);
+ args = add_option (args, &argslen, &argsmax,
MTransport.dsn_r
eturn);
}
args = add_option (args, &argslen, &argsmax, "--");
args = add_args (args, &argslen, &argsmax, to);
}
args = add_option (args, &argslen, &argsmax, "--");
args = add_args (args, &argslen, &argsmax, to);
@@
-1931,7
+1929,6
@@
static int mutt_invoke_sendmail (address_t * from, /* the sender */
p_delete(&childout);
p_delete(&path);
p_delete(&childout);
p_delete(&path);
- p_delete(&s);
p_delete(&args);
if (i == (EX_OK & 0xff))
p_delete(&args);
if (i == (EX_OK & 0xff))
@@
-2021,7
+2018,7
@@
static int _mutt_bounce_message (FILE * fp, HEADER * h, address_t * to,
{
int i, ret = 0;
FILE *f;
{
int i, ret = 0;
FILE *f;
- char date[S
HORT_S
TRING], tempfile[_POSIX_PATH_MAX];
+ char date[STRING], tempfile[_POSIX_PATH_MAX];
MESSAGE *msg = NULL;
if (!h) {
MESSAGE *msg = NULL;
if (!h) {
@@
-2041,7
+2038,7
@@
static int _mutt_bounce_message (FILE * fp, HEADER * h, address_t * to,
if (!fp)
fp = msg->fp;
if (!fp)
fp = msg->fp;
- f = m_tempfile(tempfile, sizeof(tempfile), NONULL(
Te
mpdir), NULL);
+ f = m_tempfile(tempfile, sizeof(tempfile), NONULL(
MCore.t
mpdir), NULL);
if (f) {
int ch_flags = CH_XMIT | CH_NONEWLINE | CH_NOQFROM;
if (f) {
int ch_flags = CH_XMIT | CH_NONEWLINE | CH_NOQFROM;
@@
-2131,7
+2128,7
@@
int mutt_write_fcc (const char *path, HEADER * hdr, const char *msgid,
* the message body begins with "From "
*/
if (f.magic == M_MMDF || f.magic == M_MBOX) {
* the message body begins with "From "
*/
if (f.magic == M_MMDF || f.magic == M_MBOX) {
- tempfp = m_tempfile(tempfile, sizeof(tempfile), NONULL(
Te
mpdir), NULL);
+ tempfp = m_tempfile(tempfile, sizeof(tempfile), NONULL(
MCore.t
mpdir), NULL);
if (!tempfp) {
mutt_error(_("Could not create temporary file"));
mx_close_mailbox (&f, NULL);
if (!tempfp) {
mutt_error(_("Could not create temporary file"));
mx_close_mailbox (&f, NULL);