projects
/
apps
/
madmutt.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Rocco Rutte:
[apps/madmutt.git]
/
sendlib.c
diff --git
a/sendlib.c
b/sendlib.c
index
12f8df5
..
c9c5874
100644
(file)
--- a/
sendlib.c
+++ b/
sendlib.c
@@
-362,7
+362,7
@@
int mutt_write_mime_header (BODY * a, FILE * f)
fprintf (f, "Content-Type: %s/%s", TYPE (a), a->subtype);
if (a->parameter) {
fprintf (f, "Content-Type: %s/%s", TYPE (a), a->subtype);
if (a->parameter) {
- len = 25 +
safe
_strlen (a->subtype); /* approximate len. of content-type */
+ len = 25 +
mutt
_strlen (a->subtype); /* approximate len. of content-type */
for (p = a->parameter; p; p = p->next) {
char *tmp;
for (p = a->parameter; p; p = p->next) {
char *tmp;
@@
-388,7
+388,7
@@
int mutt_write_mime_header (BODY * a, FILE * f)
FREE (&tmp);
FREE (&tmp);
- tmplen =
safe_strlen (buffer) + safe
_strlen (p->attribute) + 1;
+ tmplen =
mutt_strlen (buffer) + mutt
_strlen (p->attribute) + 1;
if (len + tmplen + 2 > 76) {
fputs ("\n\t", f);
if (len + tmplen + 2 > 76) {
fputs ("\n\t", f);
@@
-479,7
+479,7
@@
int mutt_write_mime_body (BODY * a, FILE * f)
/* This is pretty gross, but it's the best solution for now... */
if ((WithCrypto & APPLICATION_PGP)
&& a->type == TYPEAPPLICATION
/* This is pretty gross, but it's the best solution for now... */
if ((WithCrypto & APPLICATION_PGP)
&& a->type == TYPEAPPLICATION
- &&
safe
_strcmp (a->subtype, "pgp-encrypted") == 0) {
+ &&
mutt
_strcmp (a->subtype, "pgp-encrypted") == 0) {
fputs ("Version: 1\n", f);
return 0;
}
fputs ("Version: 1\n", f);
return 0;
}
@@
-958,7
+958,7
@@
int mutt_lookup_mime_type (BODY * att, const char *path)
type = TYPEOTHER;
cur_sze = 0;
type = TYPEOTHER;
cur_sze = 0;
- szf =
safe
_strlen (path);
+ szf =
mutt
_strlen (path);
for (count = 0; count < 3; count++) {
/*
for (count = 0; count < 3; count++) {
/*
@@
-998,7
+998,7
@@
int mutt_lookup_mime_type (BODY * att, const char *path)
/* cycle through the file extensions */
while ((p = strtok (p, " \t\n"))) {
/* cycle through the file extensions */
while ((p = strtok (p, " \t\n"))) {
- sze =
safe
_strlen (p);
+ sze =
mutt
_strlen (p);
if ((sze > cur_sze) && (szf >= sze) &&
(safe_strcasecmp (path + szf - sze, p) == 0
|| ascii_strcasecmp (path + szf - sze, p) == 0) && (szf == sze
if ((sze > cur_sze) && (szf >= sze) &&
(safe_strcasecmp (path + szf - sze, p) == 0
|| ascii_strcasecmp (path + szf - sze, p) == 0) && (szf == sze
@@
-1465,7
+1465,7
@@
void mutt_write_address_list (ADDRESS * adr, FILE * fp, int linelen,
adr->next = NULL;
buf[0] = 0;
rfc822_write_address (buf, sizeof (buf), adr, display);
adr->next = NULL;
buf[0] = 0;
rfc822_write_address (buf, sizeof (buf), adr, display);
- len =
safe
_strlen (buf);
+ len =
mutt
_strlen (buf);
if (count && linelen + len > 74) {
fputs ("\n\t", fp);
linelen = len + 8; /* tab is usually about 8 spaces... */
if (count && linelen + len > 74) {
fputs ("\n\t", fp);
linelen = len + 8; /* tab is usually about 8 spaces... */
@@
-1683,7
+1683,7
@@
int mutt_write_rfc822_header (FILE * fp, ENVELOPE * env, BODY * attach,
}
}
/* Add a vanity header */
}
}
/* Add a vanity header */
- fprintf (fp, "User-Agent: mutt-ng
%s (%s)\n", MUTT_VERSION, os);
+ fprintf (fp, "User-Agent: mutt-ng
/
%s (%s)\n", MUTT_VERSION, os);
}
return (ferror (fp) == 0 ? 0 : -1);
}
return (ferror (fp) == 0 ? 0 : -1);
@@
-1709,7
+1709,7
@@
static void encode_headers (LIST * h)
rfc2047_encode_string (&tmp);
safe_realloc (&h->data,
rfc2047_encode_string (&tmp);
safe_realloc (&h->data,
-
safe_strlen (h->data) + 2 + safe
_strlen (tmp) + 1);
+
mutt_strlen (h->data) + 2 + mutt
_strlen (tmp) + 1);
sprintf (h->data + i, ": %s", NONULL (tmp)); /* __SPRINTF_CHECKED__ */
sprintf (h->data + i, ": %s", NONULL (tmp)); /* __SPRINTF_CHECKED__ */
@@
-1783,11
+1783,11
@@
static void mutt_gen_localpart (char *buf, unsigned int len, char *fmt)
break;
case 'O':
snprintf (tmp, sizeof (tmp), "%lo", (unsigned long) now);
break;
case 'O':
snprintf (tmp, sizeof (tmp), "%lo", (unsigned long) now);
- safe_strncat (buf, len, tmp,
safe
_strlen (tmp));
+ safe_strncat (buf, len, tmp,
mutt
_strlen (tmp));
break;
case 'p':
snprintf (tmp, sizeof (tmp), "%u", (unsigned int) getpid ());
break;
case 'p':
snprintf (tmp, sizeof (tmp), "%u", (unsigned int) getpid ());
- safe_strncat (buf, len, tmp,
safe
_strlen (tmp));
+ safe_strncat (buf, len, tmp,
mutt
_strlen (tmp));
break;
case 'P':
snprintf (tmp, sizeof (tmp), "%c", MsgIdPfx);
break;
case 'P':
snprintf (tmp, sizeof (tmp), "%c", MsgIdPfx);
@@
-1796,11
+1796,11
@@
static void mutt_gen_localpart (char *buf, unsigned int len, char *fmt)
break;
case 'r':
snprintf (tmp, sizeof (tmp), "%u", (unsigned int) rand ());
break;
case 'r':
snprintf (tmp, sizeof (tmp), "%u", (unsigned int) rand ());
- safe_strncat (buf, len, tmp,
safe
_strlen (tmp));
+ safe_strncat (buf, len, tmp,
mutt
_strlen (tmp));
break;
case 'R':
snprintf (tmp, sizeof (tmp), "%x", (unsigned int) rand ());
break;
case 'R':
snprintf (tmp, sizeof (tmp), "%x", (unsigned int) rand ());
- safe_strncat (buf, len, tmp,
safe
_strlen (tmp));
+ safe_strncat (buf, len, tmp,
mutt
_strlen (tmp));
break;
case 's':
snprintf (tmp, sizeof (tmp), "%02d", tm->tm_sec);
break;
case 's':
snprintf (tmp, sizeof (tmp), "%02d", tm->tm_sec);
@@
-1808,11
+1808,11
@@
static void mutt_gen_localpart (char *buf, unsigned int len, char *fmt)
break;
case 'T':
snprintf (tmp, sizeof (tmp), "%u", (unsigned int) now);
break;
case 'T':
snprintf (tmp, sizeof (tmp), "%u", (unsigned int) now);
- safe_strncat (buf, len, tmp,
safe
_strlen (tmp));
+ safe_strncat (buf, len, tmp,
mutt
_strlen (tmp));
break;
case 'X':
snprintf (tmp, sizeof (tmp), "%x", (unsigned int) now);
break;
case 'X':
snprintf (tmp, sizeof (tmp), "%x", (unsigned int) now);
- safe_strncat (buf, len, tmp,
safe
_strlen (tmp));
+ safe_strncat (buf, len, tmp,
mutt
_strlen (tmp));
break;
case 'Y':
snprintf (tmp, sizeof (tmp), "%04d", tm->tm_year + 1900); /* this will break in the year 10000 ;-) */
break;
case 'Y':
snprintf (tmp, sizeof (tmp), "%04d", tm->tm_year + 1900); /* this will break in the year 10000 ;-) */
@@
-1840,16
+1840,12
@@
char *mutt_gen_msgid (void)
char buf[SHORT_STRING];
char localpart[SHORT_STRING];
unsigned int localpart_length;
char buf[SHORT_STRING];
char localpart[SHORT_STRING];
unsigned int localpart_length;
- time_t now;
- struct tm *tm;
const char *fqdn;
const char *fqdn;
- now = time (NULL);
- tm = gmtime (&now);
if (!(fqdn = mutt_fqdn (0)))
fqdn = NONULL (Hostname);
if (!(fqdn = mutt_fqdn (0)))
fqdn = NONULL (Hostname);
- localpart_length = sizeof (buf) -
safe
_strlen (fqdn) - 4; /* the 4 characters are '<', '@', '>' and '\0' */
+ localpart_length = sizeof (buf) -
mutt
_strlen (fqdn) - 4; /* the 4 characters are '<', '@', '>' and '\0' */
mutt_gen_localpart (localpart, localpart_length, MsgIdFormat);
mutt_gen_localpart (localpart, localpart_length, MsgIdFormat);
@@
-2174,9
+2170,9
@@
int mutt_invoke_mta (ADDRESS * from, /* the sender */
string. */
char *mutt_append_string (char *a, const char *b)
{
string. */
char *mutt_append_string (char *a, const char *b)
{
- size_t la =
safe
_strlen (a);
+ size_t la =
mutt
_strlen (a);
- safe_realloc (&a, la +
safe
_strlen (b) + 1);
+ safe_realloc (&a, la +
mutt
_strlen (b) + 1);
strcpy (a + la, b); /* __STRCPY_CHECKED__ */
return (a);
}
strcpy (a + la, b); /* __STRCPY_CHECKED__ */
return (a);
}
@@
-2204,7
+2200,7
@@
char *mutt_quote_string (const char *s)
char *r, *pr;
size_t rlen;
char *r, *pr;
size_t rlen;
- rlen =
safe
_strlen (s) + 3;
+ rlen =
mutt
_strlen (s) + 3;
pr = r = (char *) safe_malloc (rlen);
*pr++ = '"';
while (*s) {
pr = r = (char *) safe_malloc (rlen);
*pr++ = '"';
while (*s) {
@@
-2246,7
+2242,7
@@
void mutt_prepare_envelope (ENVELOPE * env, int final)
mutt_set_followup_to (env);
mutt_set_followup_to (env);
- if (!env->message_id)
+ if (!env->message_id
&& MsgIdFormat && *MsgIdFormat
)
env->message_id = mutt_gen_msgid ();
}
env->message_id = mutt_gen_msgid ();
}
@@
-2321,7
+2317,8
@@
static int _mutt_bounce_message (FILE * fp, HEADER * h, ADDRESS * to,
fseek (fp, h->offset, 0);
fprintf (f, "Resent-From: %s", resent_from);
fprintf (f, "\nResent-%s", mutt_make_date (date, sizeof (date)));
fseek (fp, h->offset, 0);
fprintf (f, "Resent-From: %s", resent_from);
fprintf (f, "\nResent-%s", mutt_make_date (date, sizeof (date)));
- fprintf (f, "Resent-Message-ID: %s\n", mutt_gen_msgid ());
+ if (MsgIdFormat && *MsgIdFormat)
+ fprintf (f, "Resent-Message-ID: %s\n", mutt_gen_msgid ());
fputs ("Resent-To: ", f);
mutt_write_address_list (to, f, 11, 0);
mutt_copy_header (fp, h, f, ch_flags, NULL);
fputs ("Resent-To: ", f);
mutt_write_address_list (to, f, 11, 0);
mutt_copy_header (fp, h, f, ch_flags, NULL);