#include <time.h>

extern int lock_fd(int);
#define LF 0x0a
#define CR 0x0d

struct milter* milter_init(char*);
int milter_dohelo(struct milter*,ENVELOPE*,char*,char*,char*,char*);
int milter_dofrom(struct milter*,ENVELOPE*,char*,char*);
int milter_dorcpt(struct milter*,ENVELOPE*,char*,char*);
int milter_data(struct milter*, ENVELOPE *, char *);
int milter_quit_filter(struct milter*);

HDR* milter_read_header(int);
void add_header(ENVELOPE*, HDR*);
HDR* make_header(const char*,const char*);
ENVELOPE* milter_envelope_new(void);
int milter_rebuild_msg(ENVELOPE*,char*);

void free_envelope (ENVELOPE *);
void free_milter(struct milter *);

