ezmlmx 0.68
ezmlmx
Loading...
Searching...
No Matches
hdr_datemsgid.c
Go to the documentation of this file.
1#include <unistd.h>
2#include "hdr.h"
3#include "qmail.h"
4#include "stralloc.h"
5#include "datetime.h"
6#include "fmt.h"
7#include "date822fmt.h"
8#include "makehash.h"
9#include "idx.h"
10#include "logmsg.h"
11#include "errtxt.h"
12#include "ezmlm.h"
13
14#define WHO "hdr_datemsgid"
15
21
22static char strnum[FMT_ULONG];
23// struct qmail qq;
24static stralloc line = {0};
25
26static void die_nomem() { logmsg(WHO,111,FATAL,ERR_NOMEM); }
27
28void hdr_datemsgid(unsigned long when)
29{
30 char date[DATE822FMT];
31 struct datetime dt;
32
33 qmail_puts(&qq,"Date: ");
35 qmail_put(&qq,date,date822fmt(date,&dt));
36 qmail_puts(&qq,"Message-ID: <");
37 if (!stralloc_copyb(&line,strnum,fmt_ulong(strnum,(unsigned long) when))) die_nomem();
38 if (!stralloc_append(&line,".")) die_nomem();
39 if (!stralloc_catb(&line,strnum,fmt_ulong(strnum,(unsigned long) getpid()))) die_nomem();
40 if (!stralloc_cats(&line,".ezmlm@")) die_nomem();
41 if (!stralloc_cats(&line,outhost.s)) die_nomem();
42 if (!stralloc_0(&line)) die_nomem();
43
44 qmail_puts(&qq,line.s);
45 qmail_puts(&qq,">\n");
46 /* "unique" MIME boundary as hash of messageid */
47 makehash(line.s,line.len,hboundary);
48}
void makehash(const char *indata, unsigned int inlen, char *hash)
Definition makehash.c:104
#define DATE822FMT
Definition date822fmt.h:4
Error messages. If you translate these, I would urge you to keep the English version as well....
#define ERR_NOMEM
Definition errtxt.h:14
void qmail_puts(struct qmail *, const char *)
Definition qmail.c:94
void qmail_put(struct qmail *, const char *, int)
Definition qmail.c:87
charset, outhost, outlocal and flagcd are shared
void die_nomem()
Definition getconf.c:17
#define WHO
Definition author.c:1
void hdr_datemsgid(unsigned long when)
unsigned int date822fmt(char *s, const struct datetime *dt)
Definition date822fmt.c:9
datetime_sec when
Definition ezmlm-cgi.c:173
struct datetime dt
Definition ezmlm-cgi.c:174
char hboundary[HASHLEN]
Definition ezmlm-clean.c:86
struct qmail qq
Definition ezmlm-clean.c:73
void datetime_tai(struct datetime *dt, datetime_sec t)
Definition datetime.c:9
const char * logmsg(const char *dir, unsigned long num, unsigned long listno, unsigned long subs, int done)
Definition loginfo.c:32