Postfix3.3.1
postdrop.c
[詳解]
1 /*++
2 /* NAME
3 /* postdrop 1
4 /* SUMMARY
5 /* Postfix mail posting utility
6 /* SYNOPSIS
7 /* \fBpostdrop\fR [\fB-rv\fR] [\fB-c \fIconfig_dir\fR]
8 /* DESCRIPTION
9 /* The \fBpostdrop\fR(1) command creates a file in the \fBmaildrop\fR
10 /* directory and copies its standard input to the file.
11 /*
12 /* Options:
13 /* .IP "\fB-c \fIconfig_dir\fR"
14 /* The \fBmain.cf\fR configuration file is in the named directory
15 /* instead of the default configuration directory. See also the
16 /* MAIL_CONFIG environment setting below.
17 /* .IP \fB-r\fR
18 /* Use a Postfix-internal protocol for reading the message from
19 /* standard input, and for reporting status information on standard
20 /* output. This is currently the only supported method.
21 /* .IP \fB-v\fR
22 /* Enable verbose logging for debugging purposes. Multiple \fB-v\fR
23 /* options make the software increasingly verbose. As of Postfix 2.3,
24 /* this option is available for the super-user only.
25 /* SECURITY
26 /* .ad
27 /* .fi
28 /* The command is designed to run with set-group ID privileges, so
29 /* that it can write to the \fBmaildrop\fR queue directory and so that
30 /* it can connect to Postfix daemon processes.
31 /* DIAGNOSTICS
32 /* Fatal errors: malformed input, I/O error, out of memory. Problems
33 /* are logged to \fBsyslogd\fR(8) and to the standard error stream.
34 /* When the input is incomplete, or when the process receives a HUP,
35 /* INT, QUIT or TERM signal, the queue file is deleted.
36 /* ENVIRONMENT
37 /* .ad
38 /* .fi
39 /* .IP MAIL_CONFIG
40 /* Directory with the \fBmain.cf\fR file. In order to avoid exploitation
41 /* of set-group ID privileges, a non-standard directory is allowed only
42 /* if:
43 /* .RS
44 /* .IP \(bu
45 /* The name is listed in the standard \fBmain.cf\fR file with the
46 /* \fBalternate_config_directories\fR configuration parameter.
47 /* .IP \(bu
48 /* The command is invoked by the super-user.
49 /* .RE
50 /* CONFIGURATION PARAMETERS
51 /* .ad
52 /* .fi
53 /* The following \fBmain.cf\fR parameters are especially relevant to
54 /* this program.
55 /* The text below provides only a parameter summary. See
56 /* \fBpostconf\fR(5) for more details including examples.
57 /* .IP "\fBalternate_config_directories (empty)\fR"
58 /* A list of non-default Postfix configuration directories that may
59 /* be specified with "-c config_directory" on the command line, or
60 /* via the MAIL_CONFIG environment parameter.
61 /* .IP "\fBconfig_directory (see 'postconf -d' output)\fR"
62 /* The default location of the Postfix main.cf and master.cf
63 /* configuration files.
64 /* .IP "\fBimport_environment (see 'postconf -d' output)\fR"
65 /* The list of environment parameters that a Postfix process will
66 /* import from a non-Postfix parent process.
67 /* .IP "\fBqueue_directory (see 'postconf -d' output)\fR"
68 /* The location of the Postfix top-level queue directory.
69 /* .IP "\fBsyslog_facility (mail)\fR"
70 /* The syslog facility of Postfix logging.
71 /* .IP "\fBsyslog_name (see 'postconf -d' output)\fR"
72 /* A prefix that is prepended to the process name in syslog
73 /* records, so that, for example, "smtpd" becomes "prefix/smtpd".
74 /* .IP "\fBtrigger_timeout (10s)\fR"
75 /* The time limit for sending a trigger to a Postfix daemon (for
76 /* example, the \fBpickup\fR(8) or \fBqmgr\fR(8) daemon).
77 /* .PP
78 /* Available in Postfix version 2.2 and later:
79 /* .IP "\fBauthorized_submit_users (static:anyone)\fR"
80 /* List of users who are authorized to submit mail with the \fBsendmail\fR(1)
81 /* command (and with the privileged \fBpostdrop\fR(1) helper command).
82 /* FILES
83 /* /var/spool/postfix/maildrop, maildrop queue
84 /* SEE ALSO
85 /* sendmail(1), compatibility interface
86 /* postconf(5), configuration parameters
87 /* syslogd(8), system logging
88 /* LICENSE
89 /* .ad
90 /* .fi
91 /* The Secure Mailer license must be distributed with this software.
92 /* AUTHOR(S)
93 /* Wietse Venema
94 /* IBM T.J. Watson Research
95 /* P.O. Box 704
96 /* Yorktown Heights, NY 10598, USA
97 /*
98 /* Wietse Venema
99 /* Google, Inc.
100 /* 111 8th Avenue
101 /* New York, NY 10011, USA
102 /*--*/
103 
104 /* System library. */
105 
106 #include <sys_defs.h>
107 #include <sys/stat.h>
108 #include <unistd.h>
109 #include <stdlib.h>
110 #include <stdio.h> /* remove() */
111 #include <string.h>
112 #include <stdlib.h>
113 #include <signal.h>
114 #include <syslog.h>
115 #include <errno.h>
116 #include <warn_stat.h>
117 
118 /* Utility library. */
119 
120 #include <msg.h>
121 #include <mymalloc.h>
122 #include <vstream.h>
123 #include <vstring.h>
124 #include <msg_vstream.h>
125 #include <msg_syslog.h>
126 #include <argv.h>
127 #include <iostuff.h>
128 #include <stringops.h>
129 
130 /* Global library. */
131 
132 #include <mail_proto.h>
133 #include <mail_queue.h>
134 #include <mail_params.h>
135 #include <mail_version.h>
136 #include <mail_conf.h>
137 #include <mail_task.h>
138 #include <clean_env.h>
139 #include <mail_stream.h>
140 #include <cleanup_user.h>
141 #include <record.h>
142 #include <rec_type.h>
143 #include <mail_dict.h>
144 #include <user_acl.h>
145 #include <rec_attr_map.h>
146 #include <mail_parm_split.h>
147 
148 /* Application-specific. */
149 
150  /*
151  * WARNING WARNING WARNING
152  *
153  * This software is designed to run set-gid. In order to avoid exploitation of
154  * privilege, this software should not run any external commands, nor should
155  * it take any information from the user unless that information can be
156  * properly sanitized. To get an idea of how much information a process can
157  * inherit from a potentially hostile user, examine all the members of the
158  * process structure (typically, in /usr/include/sys/proc.h): the current
159  * directory, open files, timers, signals, environment, command line, umask,
160  * and so on.
161  */
162 
163  /*
164  * Local mail submission access list.
165  */
167 
168 static const CONFIG_STR_TABLE str_table[] = {
170  0,
171 };
172 
173  /*
174  * Queue file name. Global, so that the cleanup routine can find it when
175  * called by the run-time error handler.
176  */
177 static char *postdrop_path;
178 
179 /* postdrop_sig - catch signal and clean up */
180 
181 static void postdrop_sig(int sig)
182 {
183 
184  /*
185  * This is the fatal error handler. Don't try to do anything fancy.
186  *
187  * msg_vstream does not allocate memory, but msg_syslog may indirectly in
188  * syslog(), so it should not be called from a user-triggered signal
189  * handler.
190  *
191  * Assume atomic signal() updates, even when emulated with sigaction(). We
192  * use the in-kernel SIGINT handler address as an atomic variable to
193  * prevent nested postdrop_sig() calls. For this reason, main() must
194  * configure postdrop_sig() as SIGINT handler before other signal
195  * handlers are allowed to invoke postdrop_sig().
196  */
197  if (signal(SIGINT, SIG_IGN) != SIG_IGN) {
198  (void) signal(SIGQUIT, SIG_IGN);
199  (void) signal(SIGTERM, SIG_IGN);
200  (void) signal(SIGHUP, SIG_IGN);
201  if (postdrop_path) {
202  (void) remove(postdrop_path);
203  postdrop_path = 0;
204  }
205  /* Future proofing. If you need exit() here then you broke Postfix. */
206  if (sig)
207  _exit(sig);
208  }
209 }
210 
211 /* postdrop_cleanup - callback for the runtime error handler */
212 
213 static void postdrop_cleanup(void)
214 {
215  postdrop_sig(0);
216 }
217 
219 
220 /* main - the main program */
221 
222 int main(int argc, char **argv)
223 {
224  struct stat st;
225  int fd;
226  int c;
227  VSTRING *buf;
228  int status;
229  MAIL_STREAM *dst;
230  int rec_type;
231  static char *segment_info[] = {
233  };
234  char **expected;
235  uid_t uid = getuid();
236  ARGV *import_env;
237  const char *error_text;
238  char *attr_name;
239  char *attr_value;
240  const char *errstr;
241  char *junk;
242  struct timeval start;
243  int saved_errno;
244  int from_count = 0;
245  int rcpt_count = 0;
246  int validate_input = 1;
247 
248  /*
249  * Fingerprint executables and core dumps.
250  */
252 
253  /*
254  * Be consistent with file permissions.
255  */
256  umask(022);
257 
258  /*
259  * To minimize confusion, make sure that the standard file descriptors
260  * are open before opening anything else. XXX Work around for 44BSD where
261  * fstat can return EBADF on an open file descriptor.
262  */
263  for (fd = 0; fd < 3; fd++)
264  if (fstat(fd, &st) == -1
265  && (close(fd), open("/dev/null", O_RDWR, 0)) != fd)
266  msg_fatal("open /dev/null: %m");
267 
268  /*
269  * Set up logging. Censor the process name: it is provided by the user.
270  */
271  argv[0] = "postdrop";
272  msg_vstream_init(argv[0], VSTREAM_ERR);
273  msg_syslog_init(mail_task("postdrop"), LOG_PID, LOG_FACILITY);
275 
276  /*
277  * Check the Postfix library version as soon as we enable logging.
278  */
280 
281  /*
282  * Parse JCL. This program is set-gid and must sanitize all command-line
283  * arguments. The configuration directory argument is validated by the
284  * mail configuration read routine. Don't do complex things until we have
285  * completed initializations.
286  */
287  while ((c = GETOPT(argc, argv, "c:rv")) > 0) {
288  switch (c) {
289  case 'c':
290  if (setenv(CONF_ENV_PATH, optarg, 1) < 0)
291  msg_fatal("out of memory");
292  break;
293  case 'r': /* forward compatibility */
294  break;
295  case 'v':
296  if (geteuid() == 0)
297  msg_verbose++;
298  break;
299  default:
300  msg_fatal("usage: %s [-c config_dir] [-v]", argv[0]);
301  }
302  }
303 
304  /*
305  * Read the global configuration file and extract configuration
306  * information. Some claim that the user should supply the working
307  * directory instead. That might be OK, given that this command needs
308  * write permission in a subdirectory called "maildrop". However we still
309  * need to reliably detect incomplete input, and so we must perform
310  * record-level I/O. With that, we should also take the opportunity to
311  * perform some sanity checks on the input.
312  */
313  mail_conf_read();
314  /* Re-evaluate mail_task() after reading main.cf. */
315  msg_syslog_init(mail_task("postdrop"), LOG_PID, LOG_FACILITY);
316  get_mail_conf_str_table(str_table);
317 
318  /*
319  * Mail submission access control. Should this be in the user-land gate,
320  * or in the daemon process?
321  */
322  mail_dict_init();
324  uid)) != 0)
325  msg_fatal("User %s(%ld) is not allowed to submit mail",
326  errstr, (long) uid);
327 
328  /*
329  * Stop run-away process accidents by limiting the queue file size. This
330  * is not a defense against DOS attack.
331  */
334 
335  /*
336  * This program is installed with setgid privileges. Strip the process
337  * environment so that we don't have to trust the C library.
338  */
340  clean_env(import_env->argv);
341  argv_free(import_env);
342 
343  if (chdir(var_queue_dir))
344  msg_fatal("chdir %s: %m", var_queue_dir);
345  if (msg_verbose)
346  msg_info("chdir %s", var_queue_dir);
347 
348  /*
349  * Set up signal handlers and a runtime error handler so that we can
350  * clean up incomplete output.
351  *
352  * postdrop_sig() uses the in-kernel SIGINT handler address as an atomic
353  * variable to prevent nested postdrop_sig() calls. For this reason, the
354  * SIGINT handler must be configured before other signal handlers are
355  * allowed to invoke postdrop_sig().
356  */
357  signal(SIGPIPE, SIG_IGN);
358  signal(SIGXFSZ, SIG_IGN);
359 
360  signal(SIGINT, postdrop_sig);
361  signal(SIGQUIT, postdrop_sig);
362  if (signal(SIGTERM, SIG_IGN) == SIG_DFL)
363  signal(SIGTERM, postdrop_sig);
364  if (signal(SIGHUP, SIG_IGN) == SIG_DFL)
365  signal(SIGHUP, postdrop_sig);
366  msg_cleanup(postdrop_cleanup);
367 
368  /* End of initializations. */
369 
370  /*
371  * Don't trust the caller's time information.
372  */
373  GETTIMEOFDAY(&start);
374 
375  /*
376  * Create queue file. mail_stream_file() never fails. Send the queue ID
377  * to the caller. Stash away a copy of the queue file name so we can
378  * clean up in case of a fatal error or an interrupt.
379  */
381  var_pickup_service, 0444);
384  ATTR_TYPE_END);
386  postdrop_path = mystrdup(VSTREAM_PATH(dst->stream));
387 
388  /*
389  * Copy stdin to file. The format is checked so that we can recognize
390  * incomplete input and cancel the operation. With the sanity checks
391  * applied here, the pickup daemon could skip format checks and pass a
392  * file descriptor to the cleanup daemon. These are by no means all
393  * sanity checks - the cleanup service and queue manager services will
394  * reject messages that lack required information.
395  *
396  * If something goes wrong, slurp up the input before responding to the
397  * client, otherwise the client will give up after detecting SIGPIPE.
398  *
399  * Allow attribute records if the attribute specifies the MIME body type
400  * (sendmail -B).
401  */
403  buf = vstring_alloc(100);
404  expected = segment_info;
405  /* Override time information from the untrusted caller. */
407  REC_TYPE_TIME_ARG(start));
408  for (;;) {
409  /* Don't allow PTR records. */
411  if (rec_type == REC_TYPE_EOF) { /* request cancelled */
412  mail_stream_cleanup(dst);
413  if (remove(postdrop_path))
414  msg_warn("uid=%ld: remove %s: %m", (long) uid, postdrop_path);
415  else if (msg_verbose)
416  msg_info("remove %s", postdrop_path);
417  myfree(postdrop_path);
418  postdrop_path = 0;
419  exit(0);
420  }
421  if (rec_type == REC_TYPE_ERROR)
422  msg_fatal("uid=%ld: malformed input", (long) uid);
423  if (strchr(*expected, rec_type) == 0)
424  msg_fatal("uid=%ld: unexpected record type: %d", (long) uid, rec_type);
425  if (rec_type == **expected)
426  expected++;
427  /* Override time information from the untrusted caller. */
428  if (rec_type == REC_TYPE_TIME)
429  continue;
430  /* Check these at submission time instead of pickup time. */
431  if (rec_type == REC_TYPE_FROM)
432  from_count++;
433  if (rec_type == REC_TYPE_RCPT)
434  rcpt_count++;
435  /* Limit the attribute types that users may specify. */
436  if (rec_type == REC_TYPE_ATTR) {
437  if ((error_text = split_nameval(vstring_str(buf), &attr_name,
438  &attr_value)) != 0) {
439  msg_warn("uid=%ld: ignoring malformed record: %s: %.200s",
440  (long) uid, error_text, vstring_str(buf));
441  continue;
442  }
443 #define STREQ(x,y) (strcmp(x,y) == 0)
444 
445  if ((STREQ(attr_name, MAIL_ATTR_ENCODING)
446  && (STREQ(attr_value, MAIL_ATTR_ENC_7BIT)
447  || STREQ(attr_value, MAIL_ATTR_ENC_8BIT)
448  || STREQ(attr_value, MAIL_ATTR_ENC_NONE)))
449  || STREQ(attr_name, MAIL_ATTR_DSN_ENVID)
450  || STREQ(attr_name, MAIL_ATTR_DSN_NOTIFY)
451  || rec_attr_map(attr_name)
452  || (STREQ(attr_name, MAIL_ATTR_RWR_CONTEXT)
453  && (STREQ(attr_value, MAIL_ATTR_RWR_LOCAL)
454  || STREQ(attr_value, MAIL_ATTR_RWR_REMOTE)))
455  || STREQ(attr_name, MAIL_ATTR_TRACE_FLAGS)) { /* XXX */
456  rec_fprintf(dst->stream, REC_TYPE_ATTR, "%s=%s",
457  attr_name, attr_value);
458  } else {
459  msg_warn("uid=%ld: ignoring attribute record: %.200s=%.200s",
460  (long) uid, attr_name, attr_value);
461  }
462  continue;
463  }
464  if (REC_PUT_BUF(dst->stream, rec_type, buf) < 0) {
465  /* rec_get() errors must not clobber errno. */
466  saved_errno = errno;
467  while ((rec_type = rec_get_raw(VSTREAM_IN, buf, var_line_limit,
469  && rec_type != REC_TYPE_EOF)
470  if (rec_type == REC_TYPE_ERROR)
471  msg_fatal("uid=%ld: malformed input", (long) uid);
472  validate_input = 0;
473  errno = saved_errno;
474  break;
475  }
476  if (rec_type == REC_TYPE_END)
477  break;
478  }
479  vstring_free(buf);
480 
481  /*
482  * As of Postfix 2.7 the pickup daemon discards mail without recipients.
483  * Such mail may enter the maildrop queue when "postsuper -r" is invoked
484  * before the queue manager deletes an already delivered message. Looking
485  * at file ownership is not a good way to make decisions on what mail to
486  * discard. Instead, the pickup server now requires that new submissions
487  * always have at least one recipient record.
488  *
489  * The Postfix sendmail command already rejects mail without recipients.
490  * However, in the future postdrop may receive mail via other programs,
491  * so we add a redundant recipient check here for future proofing.
492  *
493  * The test for the sender address is just for consistency of error
494  * reporting (report at submission time instead of pickup time). Besides
495  * the segment terminator records, there aren't any other mandatory
496  * records in a Postfix submission queue file.
497  */
498  if (validate_input && (from_count == 0 || rcpt_count == 0)) {
499  status = CLEANUP_STAT_BAD;
500  mail_stream_cleanup(dst);
501  }
502 
503  /*
504  * Finish the file.
505  */
506  else if ((status = mail_stream_finish(dst, (VSTRING *) 0)) != 0) {
507  msg_warn("uid=%ld: %m", (long) uid);
508  postdrop_cleanup();
509  }
510 
511  /*
512  * Disable deletion on fatal error before reporting success, so the file
513  * will not be deleted after we have taken responsibility for delivery.
514  */
515  if (postdrop_path) {
516  junk = postdrop_path;
517  postdrop_path = 0;
518  myfree(junk);
519  }
520 
521  /*
522  * Send the completion status to the caller and terminate.
523  */
527  ATTR_TYPE_END);
529  exit(status);
530 }
int mail_stream_finish(MAIL_STREAM *info, VSTRING *why)
Definition: mail_stream.c:398
int msg_verbose
Definition: msg.c:177
#define ATTR_FLAG_NONE
Definition: attr.h:98
#define MAIL_ATTR_DSN_NOTIFY
Definition: mail_proto.h:275
void myfree(void *ptr)
Definition: mymalloc.c:207
char * id
Definition: mail_stream.h:37
#define MAIL_ATTR_TRACE_FLAGS
Definition: mail_proto.h:149
const char * mail_task(const char *argv0)
Definition: mail_task.c:49
char * var_procname
Definition: mail_params.c:252
#define STREQ(x, y)
MAIL_STREAM * mail_stream_file(const char *queue, const char *class, const char *service, int mode)
Definition: mail_stream.c:405
char * mystrdup(const char *str)
Definition: mymalloc.c:225
#define MAIL_ATTR_ENCODING
Definition: mail_proto.h:202
#define DEF_SUBMIT_ACL
Definition: mail_params.h:118
char * var_import_environ
Definition: mail_params.c:296
void mail_stream_cleanup(MAIL_STREAM *info)
Definition: mail_stream.c:151
void set_mail_conf_str(const char *, const char *)
ARGV * argv_free(ARGV *argvp)
Definition: argv.c:136
Definition: argv.h:17
#define VAR_IMPORT_ENVIRON
Definition: mail_params.h:2506
#define vstring_str(vp)
Definition: vstring.h:71
#define VSTREAM_OUT
Definition: vstream.h:67
#define stat(p, s)
Definition: warn_stat.h:18
#define VAR_PROCNAME
Definition: mail_params.h:2435
#define LOG_FACILITY
Definition: mail_params.h:357
#define REC_FLAG_NONE
Definition: record.h:45
char ** argv
Definition: argv.h:20
#define MAIL_ATTR_RWR_CONTEXT
Definition: mail_proto.h:163
#define ATTR_TYPE_END
Definition: attr.h:39
#define MAIL_ATTR_RWR_LOCAL
Definition: mail_proto.h:166
#define VSTREAM_PATH(vp)
Definition: vstream.h:126
void set_file_limit(off_t limit)
Definition: file_limit.c:80
#define REC_TYPE_FROM
Definition: rec_type.h:43
#define VSTREAM_IN
Definition: vstream.h:66
#define MAIL_ATTR_RWR_REMOTE
Definition: mail_proto.h:167
#define REC_TYPE_END
Definition: rec_type.h:77
int main(int argc, char **argv)
Definition: postdrop.c:222
const char * split_nameval(char *buf, char **name, char **value)
Definition: split_nameval.c:61
#define REC_TYPE_EOF
Definition: rec_type.h:23
void mail_conf_read(void)
Definition: mail_conf.c:178
off_t get_file_limit(void)
Definition: file_limit.c:58
long var_message_limit
Definition: mail_params.c:265
void clean_env(char **preserve_list)
Definition: clean_env.c:59
#define MAIL_CLASS_PUBLIC
Definition: mail_proto.h:95
#define REC_PUT_BUF(v, t, b)
Definition: record.h:43
int rec_get_raw(VSTREAM *stream, VSTRING *buf, ssize_t maxsize, int flags)
Definition: record.c:236
#define attr_print
Definition: attr.h:109
#define CONF_ENV_PATH
Definition: mail_conf.h:22
#define MAIL_ATTR_ENC_NONE
Definition: mail_proto.h:205
#define REC_TYPE_POST_ENVELOPE
Definition: rec_type.h:113
ARGV * mail_parm_split(const char *name, const char *value)
#define REC_TYPE_TIME_FORMAT
Definition: rec_type.h:148
#define REC_TYPE_RCPT
Definition: rec_type.h:45
#define MAIL_ATTR_WHY
Definition: mail_proto.h:135
void msg_warn(const char *fmt,...)
Definition: msg.c:215
VSTRING * vstring_alloc(ssize_t len)
Definition: vstring.c:353
void mail_dict_init(void)
Definition: mail_dict.c:81
#define MAIL_VERSION_STAMP_ALLOCATE
Definition: mail_version.h:67
#define MAIL_ATTR_DSN_ENVID
Definition: mail_proto.h:273
#define MAIL_ATTR_STATUS
Definition: mail_proto.h:126
#define SEND_ATTR_INT(name, val)
Definition: attr.h:63
int rec_attr_map(const char *attr_name)
Definition: rec_attr_map.c:39
#define MAIL_QUEUE_MAILDROP
Definition: mail_queue.h:28
void get_mail_conf_str_table(const CONFIG_STR_TABLE *)
int var_line_limit
Definition: mail_params.c:263
NORETURN msg_fatal(const char *fmt,...)
Definition: msg.c:249
VSTREAM * stream
Definition: mail_stream.h:35
char * var_pickup_service
Definition: mail_params.c:304
#define MAIL_VERSION_CHECK
Definition: mail_version.h:90
int vstream_fflush(VSTREAM *stream)
Definition: vstream.c:1257
#define CLEANUP_STAT_BAD
Definition: cleanup_user.h:57
#define GETOPT(argc, argv, str)
Definition: sys_defs.h:1313
void msg_syslog_init(const char *name, int logopt, int facility)
Definition: msg_syslog.c:173
MAIL_VERSION_STAMP_DECLARE
Definition: postdrop.c:218
char * var_submit_acl
Definition: postdrop.c:166
#define REC_TYPE_POST_CONTENT
Definition: rec_type.h:114
VSTRING * vstring_free(VSTRING *vp)
Definition: vstring.c:380
const char * check_user_acl_byuid(const char *pname, const char *acl, uid_t uid)
Definition: user_acl.c:65
char * var_queue_dir
Definition: mail_params.c:246
#define REC_TYPE_ATTR
Definition: rec_type.h:49
void msg_vstream_init(const char *name, VSTREAM *vp)
Definition: msg_vstream.c:77
#define REC_TYPE_ERROR
Definition: rec_type.h:24
#define CA_VSTREAM_CTL_END
Definition: vstream.h:155
#define REC_TYPE_POST_EXTRACT
Definition: rec_type.h:115
#define REC_TYPE_TIME
Definition: rec_type.h:38
#define CA_VSTREAM_CTL_PATH(v)
Definition: vstream.h:158
#define MAIL_ATTR_QUEUEID
Definition: mail_proto.h:130
void vstream_control(VSTREAM *stream, int name,...)
Definition: vstream.c:1372
#define MAIL_ATTR_ENC_8BIT
Definition: mail_proto.h:203
#define VAR_SUBMIT_ACL
Definition: mail_params.h:117
int rec_fprintf(VSTREAM *stream, int type, const char *format,...)
Definition: record.c:391
#define SEND_ATTR_STR(name, val)
Definition: attr.h:64
MSG_CLEANUP_FN msg_cleanup(MSG_CLEANUP_FN cleanup_fn)
Definition: msg.c:317
#define VSTREAM_ERR
Definition: vstream.h:68
#define REC_TYPE_TIME_ARG(tv)
Definition: rec_type.h:149
#define MAIL_ATTR_ENC_7BIT
Definition: mail_proto.h:204
#define fstat(f, s)
Definition: warn_stat.h:20
void msg_info(const char *fmt,...)
Definition: msg.c:199