From: Wietse Venema Date: Mon, 20 Dec 2004 05:00:00 +0000 (-0500) Subject: postfix-2.2-20041220 X-Git-Tag: v2.2.0-RC1~21 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=712d9c82938b3a87186037e9dc81a9f8ded3b884;p=thirdparty%2Fpostfix.git postfix-2.2-20041220 --- diff --git a/postfix/HISTORY b/postfix/HISTORY index f986ee5c6..036b06aa7 100644 --- a/postfix/HISTORY +++ b/postfix/HISTORY @@ -9980,6 +9980,15 @@ Apologies for any names omitted. util/name_mask.[hc], global/ehlo_mask.[hc], smtpd/smtpd.c, smtp/smtp.c, smtp/smtp_proto.c. +20041219 + + Bugfix: postcat without -o was broken. File: postcat/postcat.c. + +20041220 + + Dummy VSTREAM read-write routines. Files: util/dummy_read.c, + util/dummy_write.c. + Open problems: Med: implement ${name[?:]value} in main.cf or update the diff --git a/postfix/src/global/mail_version.h b/postfix/src/global/mail_version.h index bca7472cd..c8832a4bc 100644 --- a/postfix/src/global/mail_version.h +++ b/postfix/src/global/mail_version.h @@ -20,7 +20,7 @@ * Patches change the patchlevel and the release date. Snapshots change the * release date only. */ -#define MAIL_RELEASE_DATE "20041219" +#define MAIL_RELEASE_DATE "20041220" #define MAIL_VERSION_NUMBER "2.2" #define VAR_MAIL_VERSION "mail_version" diff --git a/postfix/src/postcat/postcat.c b/postfix/src/postcat/postcat.c index c9b6961ff..5de23acbc 100644 --- a/postfix/src/postcat/postcat.c +++ b/postfix/src/postcat/postcat.c @@ -105,6 +105,7 @@ static void postcat(VSTREAM *fp, VSTRING *buffer, int flags) int first = 1; int ch; off_t offset; + int in_message = 0; #define TEXT_RECORD(rec_type) \ (rec_type == REC_TYPE_CONT || rec_type == REC_TYPE_NORM) @@ -135,8 +136,8 @@ static void postcat(VSTREAM *fp, VSTRING *buffer, int flags) vstream_printf("*** ENVELOPE RECORDS %s ***\n", VSTREAM_PATH(fp)); first = 0; } - if ((prev_type == REC_TYPE_CONT && !TEXT_RECORD(rec_type)) - || !(flags & PC_FLAG_OFFSET)) + if (prev_type == REC_TYPE_CONT && in_message && !msg_verbose + && ((flags & PC_FLAG_OFFSET) != 0 || !TEXT_RECORD(rec_type))) VSTREAM_PUTCHAR('\n'); if (flags & PC_FLAG_OFFSET) vstream_printf("%9lu ", (unsigned long) offset); @@ -147,9 +148,9 @@ static void postcat(VSTREAM *fp, VSTRING *buffer, int flags) vstream_printf("%s: %s", rec_type_name(rec_type), asctime(localtime(&time))); break; - case REC_TYPE_CONT: + case REC_TYPE_CONT: /* REC_TYPE_FILT collision */ if (msg_verbose) - vstream_printf("%s: ", rec_type_name(rec_type)); + vstream_printf("unterminated_text: "); vstream_fwrite(VSTREAM_OUT, STR(buffer), LEN(buffer)); if (msg_verbose) VSTREAM_PUTCHAR('\n'); @@ -162,9 +163,11 @@ static void postcat(VSTREAM *fp, VSTRING *buffer, int flags) break; case REC_TYPE_MESG: vstream_printf("*** MESSAGE CONTENTS %s ***\n", VSTREAM_PATH(fp)); + in_message = 1; break; case REC_TYPE_XTRA: vstream_printf("*** HEADER EXTRACTED %s ***\n", VSTREAM_PATH(fp)); + in_message = 0; break; case REC_TYPE_END: vstream_printf("*** MESSAGE FILE END %s ***\n", VSTREAM_PATH(fp)); diff --git a/postfix/src/util/Makefile.in b/postfix/src/util/Makefile.in index f3afec784..a271eb5ab 100644 --- a/postfix/src/util/Makefile.in +++ b/postfix/src/util/Makefile.in @@ -29,7 +29,7 @@ SRCS = alldig.c argv.c argv_split.c attr_print0.c attr_print64.c \ write_buf.c write_wait.c auto_clnt.c attr_clnt.c attr_scan_plain.c \ attr_print_plain.c sane_connect.c neuter.c name_code.c \ uppercase.c unix_recv_fd.c stream_recv_fd.c unix_send_fd.c \ - stream_send_fd.c dict_sdbm.c hex_code.c + stream_send_fd.c dict_sdbm.c hex_code.c dummy_read.c dummy_write.c OBJS = alldig.o argv.o argv_split.o attr_print0.o attr_print64.o \ attr_scan0.o attr_scan64.o base64_code.o basename.o binhash.o \ chroot_uid.o clean_env.o close_on_exec.o concatenate.o ctable.o \ @@ -60,7 +60,7 @@ OBJS = alldig.o argv.o argv_split.o attr_print0.o attr_print64.o \ write_buf.o write_wait.o auto_clnt.o attr_clnt.o attr_scan_plain.o \ attr_print_plain.o sane_connect.o $(STRCASE) neuter.o name_code.o \ uppercase.o unix_recv_fd.o stream_recv_fd.o unix_send_fd.o \ - stream_send_fd.o dict_sdbm.o hex_code.o + stream_send_fd.o dict_sdbm.o hex_code.o dummy_read.o dummy_write.o HDRS = argv.h attr.h base64_code.h binhash.h chroot_uid.h clean_env.h \ connect.h ctable.h dict.h dict_db.h dict_cdb.h dict_dbm.h dict_env.h \ dict_cidr.h dict_ht.h dict_ni.h dict_nis.h \ @@ -842,6 +842,14 @@ doze.o: doze.c doze.o: sys_defs.h doze.o: msg.h doze.o: iostuff.h +dummy_read.o: dummy_read.c +dummy_read.o: sys_defs.h +dummy_read.o: msg.h +dummy_read.o: iostuff.h +dummy_write.o: dummy_write.c +dummy_write.o: sys_defs.h +dummy_write.o: msg.h +dummy_write.o: iostuff.h dup2_pass_on_exec.o: dup2_pass_on_exec.c duplex_pipe.o: duplex_pipe.c duplex_pipe.o: sys_defs.h diff --git a/postfix/src/util/dummy_read.c b/postfix/src/util/dummy_read.c new file mode 100644 index 000000000..f70dc38cb --- /dev/null +++ b/postfix/src/util/dummy_read.c @@ -0,0 +1,61 @@ +/*++ +/* NAME +/* dummy_read 3 +/* SUMMARY +/* dummy read operation +/* SYNOPSIS +/* #include +/* +/* int dummy_read(fd, buf, buf_len, timeout, context) +/* int fd; +/* void *buf; +/* unsigned len; +/* int timeout; +/* void *context; +/* DESCRIPTION +/* dummy_read() reports an EOF condition without side effects. +/* +/* Arguments: +/* .IP fd +/* File descriptor in the range 0..FD_SETSIZE. Its value is logged +/* when verbose logging is turned on. +/* .IP buf +/* Read buffer pointer. Not used. +/* .IP buf_len +/* Read buffer size. Its value is logged when verbose logging is +/* turned on. +/* .IP timeout +/* The deadline in seconds. Not used. +/* .IP context +/* Application context. Not used. +/* DIAGNOSTICS +/* None. +/* LICENSE +/* .ad +/* .fi +/* The Secure Mailer license must be distributed with this software. +/* AUTHOR(S) +/* Wietse Venema +/* IBM T.J. Watson Research +/* P.O. Box 704 +/* Yorktown Heights, NY 10598, USA +/*--*/ + +/* System library. */ + +#include + +/* Utility library. */ + +#include +#include + +/* dummy_read - dummy read operation */ + +int dummy_read(int fd, void *unused_buf, unsigned len, + int unused_timeout, void *unused_context) +{ + if (msg_verbose) + msg_info("dummy_read: fd %d, len %d", fd, len); + return (0); +} diff --git a/postfix/src/util/dummy_write.c b/postfix/src/util/dummy_write.c new file mode 100644 index 000000000..a9e69695b --- /dev/null +++ b/postfix/src/util/dummy_write.c @@ -0,0 +1,61 @@ +/*++ +/* NAME +/* dummy_write 3 +/* SUMMARY +/* dummy write operation +/* SYNOPSIS +/* #include +/* +/* int dummy_write(fd, buf, buf_len, timeout, context) +/* int fd; +/* void *buf; +/* unsigned len; +/* int timeout; +/* void *context; +/* DESCRIPTION +/* dummy_write() implements a data sink without side effects. +/* +/* Arguments: +/* .IP fd +/* File descriptor in the range 0..FD_SETSIZE. Its value is logged +/* when verbose logging is turned on. +/* .IP buf +/* Write buffer pointer. Not used. +/* .IP buf_len +/* Write buffer size. Its value is logged when verbose logging is +/* turned on. +/* .IP timeout +/* The deadline in seconds. Not used. +/* .IP context +/* Application context. Not used. +/* DIAGNOSTICS +/* None. +/* LICENSE +/* .ad +/* .fi +/* The Secure Mailer license must be distributed with this software. +/* AUTHOR(S) +/* Wietse Venema +/* IBM T.J. Watson Research +/* P.O. Box 704 +/* Yorktown Heights, NY 10598, USA +/*--*/ + +/* System library. */ + +#include + +/* Utility library. */ + +#include +#include + +/* dummy_write - dummy write operation */ + +int dummy_write(int fd, void *unused_buf, unsigned len, + int unused_timeout, void *unused_context) +{ + if (msg_verbose) + msg_info("dummy_write: fd %d, len %d", fd, len); + return (len); +} diff --git a/postfix/src/util/iostuff.h b/postfix/src/util/iostuff.h index 05c57d1cb..7d04346c8 100644 --- a/postfix/src/util/iostuff.h +++ b/postfix/src/util/iostuff.h @@ -33,6 +33,8 @@ extern int stream_recv_fd(int); extern int stream_send_fd(int, int); extern int unix_recv_fd(int); extern int unix_send_fd(int, int); +extern int dummy_read(int, void *, unsigned, int, void *); +extern int dummy_write(int, void *, unsigned, int, void *); #define BLOCKING 0 #define NON_BLOCKING 1