#include <fcntl.h>
#include <sys/utsname.h>
+#ifdef USE_LIBESMTP
+# include "mutt_libesmtp.h"
+#endif /* USE_LIBESMTP */
+
#ifdef USE_NNTP
#include <nntp.h>
#endif
linelen = 3;
}
-#ifdef USE_LIBESMTP
-# include "mutt_libesmtp.h"
-#endif /* USE_LIBESMTP */
if (c == '\n' && istext)
{
if(!(fqdn = mutt_fqdn(0)))
fqdn = NONULL(Hostname);
- snprintf (buf, sizeof (buf), "<%d%02d%02d%02d%02d%02d.G%c%d@%s>",
+ snprintf (buf, sizeof (buf), "<%d%02d%02d%02d%02d%02d.G%c%u@%s>",
tm->tm_year + 1900, tm->tm_mon + 1, tm->tm_mday, tm->tm_hour,
- tm->tm_min, tm->tm_sec, MsgIdPfx, getpid (), fqdn);
+ tm->tm_min, tm->tm_sec, MsgIdPfx, (unsigned int)getpid (), fqdn);
MsgIdPfx = (MsgIdPfx == 'Z') ? 'A' : MsgIdPfx + 1;
return (safe_strdup (buf));
}
/* given a list of addresses, return a list of unique addresses */
ADDRESS *mutt_remove_duplicates (ADDRESS *addr)
{
- ADDRESS *top = NULL;
+ ADDRESS *top = addr;
+ ADDRESS **last = ⊤
ADDRESS *tmp;
-
- if ((top = addr) == NULL)
- return (NULL);
- addr = addr->next;
- top->next = NULL;
+ int dup;
+
while (addr)
{
- tmp = top;
- do {
- if (addr->mailbox && tmp->mailbox &&
+ for (tmp = top, dup = 0; tmp && tmp != addr; tmp = tmp->next)
+ {
+ if (tmp->mailbox && addr->mailbox &&
!ascii_strcasecmp (addr->mailbox, tmp->mailbox))
{
- /* duplicate address, just ignore it */
- tmp = addr;
- addr = addr->next;
- tmp->next = NULL;
- rfc822_free_address (&tmp);
- }
- else if (!tmp->next)
- {
- /* unique address. add it to the list */
- tmp->next = addr;
- addr = addr->next;
- tmp = tmp->next;
- tmp->next = NULL;
- tmp = NULL; /* so we exit the loop */
+ dup = 1;
+ break;
}
- else
- tmp = tmp->next;
- } while (tmp);
- }
+ }
+
+ if (dup)
+ {
+ dprint (2, (debugfile, "mutt_remove_duplicates: Removing %s\n",
+ addr->mailbox));
+
+ *last = addr->next;
+ addr->next = NULL;
+ rfc822_free_address(&addr);
+
+ addr = *last;
+ }
+ else
+ {
+ last = &addr->next;
+ addr = addr->next;
+ }
+ }
+
return (top);
}
if (PgpSignAs && *PgpSignAs)
fprintf (msg->fp, "<%s>", PgpSignAs);
}
+ if (hdr->security & INLINE)
+ fputc ('I', msg->fp);
fputc ('\n', msg->fp);
}
if (SmimeDefaultKey && *SmimeDefaultKey)
fprintf (msg->fp, "<%s>", SmimeDefaultKey);
}
+ if (hdr->security & INLINE)
+ fputc ('I', msg->fp);
fputc ('\n', msg->fp);
}