100 #include <sys/stat.h>
127 static int deliver_request_initial(
VSTREAM *stream)
138 msg_info(
"deliver_request_initial: send initial status");
144 msg_warn(
"send initial status: %m");
157 static DSN dummy_dsn = {
"",
"",
"",
"",
"",
"",
""};
163 hop_status = &dummy_dsn;
165 msg_info(
"deliver_request_final: send: \"%s\" %d",
166 hop_status->
reason, status);
190 const char *myname =
"deliver_request_get";
207 static VSTRING *rewrite_context;
219 if (queue_name == 0) {
271 msg_warn(
"%s: error receiving common attributes", myname);
306 while (rcpt_count-- > 0) {
310 msg_warn(
"%s: error receiving recipient attributes", myname);
320 msg_warn(
"%s: no recipients in delivery request for destination %s",
343 #define DELIVER_LOCK_MODE (MYFLOCK_OP_SHARED | MYFLOCK_OP_NOWAIT)
347 if (request->
fp == 0) {
446 if (deliver_request_initial(stream) != 0)
460 #define XXX_DEFER_STATUS -1
462 request = deliver_request_alloc();
463 if (deliver_request_get(stream, request) < 0) {
476 err = deliver_request_final(stream, request, status);
477 deliver_request_free(request);
int dsn_print(ATTR_PRINT_MASTER_FN print_fn, VSTREAM *fp, int flags, void *ptr)
char * mystrdup(const char *str)
#define MAIL_ATTR_ENCODING
int rcpb_scan(ATTR_SCAN_MASTER_FN scan_fn, VSTREAM *fp, int flags, void *ptr)
#define MAIL_ATTR_RWR_CONTEXT
#define RECV_ATTR_INT(name, val)
#define MAIL_ATTR_SASL_METHOD
#define MAIL_ATTR_LOG_HELO_NAME
#define MAIL_ATTR_LOG_PROTO_NAME
#define RCPT_LIST_INIT_STATUS
RCPT_BUF * rcpb_create(void)
int msg_stats_scan(ATTR_SCAN_MASTER_FN, VSTREAM *, int, void *)
int vstream_fclose(VSTREAM *stream)
#define MAIL_ATTR_SMTPUTF8
#define RECV_ATTR_LONG(name, val)
VSTREAM * mail_queue_open(const char *queue_name, const char *queue_id, int flags, mode_t mode)
#define MAIL_ATTR_SASL_SENDER
int mail_open_ok(const char *queue_name, const char *queue_id, struct stat *statp, const char **path)
#define read_wait(fd, timeout)
void msg_warn(const char *fmt,...)
VSTRING * vstring_alloc(ssize_t len)
int myflock(int fd, int lock_style, int operation)
#define MAIL_ATTR_DSN_RET
#define MAIL_ATTR_LOG_IDENT
#define MAIL_ATTR_DSN_ENVID
#define MAIL_ATTR_LOG_CLIENT_ADDR
#define SEND_ATTR_INT(name, val)
NORETURN msg_fatal(const char *fmt,...)
#define MAIL_ATTR_NEXTHOP
int vstream_fflush(VSTREAM *stream)
void recipient_list_init(RECIPIENT_LIST *list, int variant)
int deliver_request_done(VSTREAM *stream, DELIVER_REQUEST *request, int status)
#define MAIL_ATTR_SASL_USERNAME
#define MAIL_ATTR_RCPT_COUNT
#define SEND_ATTR_FUNC(func, val)
#define DELIVER_LOCK_MODE
#define MAIL_ATTR_LOG_CLIENT_NAME
void recipient_list_free(RECIPIENT_LIST *list)
#define vstream_fileno(vp)
#define RECV_ATTR_FUNC(func, val)
#define MAIL_ATTR_QUEUEID
DELIVER_REQUEST * deliver_request_read(VSTREAM *stream)
void recipient_list_add(RECIPIENT_LIST *list, long offset, const char *dsn_orcpt, int dsn_notify, const char *orig_rcpt, const char *rcpt)
struct timeval agent_handoff
int close_on_exec(int fd, int on)
#define MAIL_ATTR_LOG_CLIENT_PORT
#define RECV_ATTR_STR(name, val)
void * mymalloc(ssize_t len)
void msg_info(const char *fmt,...)