167 #include <sys/time.h>
217 static void post_mail_init(
VSTREAM *stream,
const char *sender,
218 const char *recipient,
219 int source_class,
int trace_flags,
220 int utf8_flags,
VSTRING *queue_id)
280 int source_class,
int trace_flags,
281 int utf8_flags,
VSTRING *queue_id)
286 post_mail_init(stream, sender, recipient, source_class, trace_flags,
287 utf8_flags, queue_id);
294 int source_class,
int trace_flags,
295 int utf8_flags,
VSTRING *queue_id)
301 post_mail_init(stream, sender, recipient, source_class, trace_flags,
302 utf8_flags, queue_id);
311 static void post_mail_open_event(
int event,
void *context)
314 const char *myname =
"post_mail_open_event";
375 msg_panic(
"%s: unknown event type %d", myname, event);
382 int source_class,
int trace_flags,
383 int utf8_flags,
VSTRING *queue_id,
384 void (*notify) (
VSTREAM *,
void *),
423 va_start(ap, format);
441 ssize_t len = str ? strlen(str) : 0;
473 static void post_mail_fclose_event(
int event,
void *context)
476 int status = state->
status;
520 void (*notify) (
int status,
void *context),
void event_enable_read(int fd, EVENT_NOTIFY_RDWR_FN callback, void *context)
int rec_vfprintf(VSTREAM *stream, int type, const char *format, va_list ap)
VSTREAM * mail_connect_wait(const char *class, const char *name)
int post_mail_fprintf(VSTREAM *cleanup, const char *format,...)
#define MAIL_ATTR_TRACE_FLAGS
char * mystrdup(const char *str)
#define CLEANUP_FLAG_SMTPUTF8
char * var_cleanup_service
int smtputf8_autodetect(int class)
const char * mail_date(time_t when)
NORETURN msg_panic(const char *fmt,...)
VSTREAM * mail_connect(const char *class, const char *name, int block_mode)
#define ATTR_FLAG_MISSING
#define RECV_ATTR_INT(name, val)
#define MAIL_ATTR_ORG_LOCAL
#define SMTPUTF8_FLAG_REQUESTED
void post_mail_fclose_async(VSTREAM *stream, void(*notify)(int status, void *context), void *context)
#define MAIL_CLASS_PUBLIC
VSTREAM * post_mail_fopen(const char *sender, const char *recipient, int source_class, int trace_flags, int utf8_flags, VSTRING *queue_id)
#define MAIL_ATTR_LOG_ORIGIN
VSTREAM * post_mail_fopen_nowait(const char *sender, const char *recipient, int source_class, int trace_flags, int utf8_flags, VSTRING *queue_id)
#define VSTREAM_CTL_BUFSIZE
int vstream_fclose(VSTREAM *stream)
#define REC_TYPE_TIME_FORMAT
int rec_fputs(VSTREAM *stream, int type, const char *str)
void msg_warn(const char *fmt,...)
VSTRING * vstring_alloc(ssize_t len)
int post_mail_fclose(VSTREAM *cleanup)
POST_MAIL_FCLOSE_NOTIFY notify
#define SEND_ATTR_INT(name, val)
int rec_put(VSTREAM *stream, int type, const char *data, ssize_t len)
NORETURN msg_fatal(const char *fmt,...)
int vstream_fflush(VSTREAM *stream)
int post_mail_fputs(VSTREAM *cleanup, const char *str)
#define CLEANUP_FLAG_MASK_INTERNAL
void(* POST_MAIL_FCLOSE_NOTIFY)(int, void *)
int post_mail_buffer(VSTREAM *cleanup, const char *buf, int len)
int non_blocking(int, int)
void post_mail_fopen_async(const char *sender, const char *recipient, int source_class, int trace_flags, int utf8_flags, VSTRING *queue_id, void(*notify)(VSTREAM *, void *), void *context)
VSTRING * vstring_free(VSTRING *vp)
time_t event_request_timer(EVENT_NOTIFY_TIME_FN callback, void *context, int delay)
#define vstream_fileno(vp)
#define CLEANUP_STAT_WRITE
#define MAIL_ATTR_QUEUEID
void vstream_control(VSTREAM *stream, int name,...)
void event_disable_readwrite(int fd)
#define vstream_ferror(vp)
int rec_fprintf(VSTREAM *stream, int type, const char *format,...)
int event_cancel_timer(EVENT_NOTIFY_TIME_FN callback, void *context)
#define REC_TYPE_TIME_ARG(tv)
void(* POST_MAIL_NOTIFY)(VSTREAM *, void *)
int int_filt_flags(int class)
#define RECV_ATTR_STR(name, val)
void * mymalloc(ssize_t len)
void msg_info(const char *fmt,...)