Michael Tokarev: > 28.04.2011 15:08, Wietse Venema wrote: > > Michael Tokarev: > >> postfix/cleanup: warning: milter8_message: vstream_fseek > >> incoming/4BE085028D: File too large > > > > Why is this reported as a "450 4.3.0" error? This should > > be a permanent error instead. > > No it shouldn't. Ok, _this_ very condition - EFBIG - > should be, indeed, but not other possible I/O errors.
Indeed. There is code that correctly flags EFBIG as a permanent error in cleanup_milter.c, cleanup_final.c, and cleanup_out.c. This is easy enough to patch into the Milter client but it seems wrong to have EFBIG checks in so many different places, because it is easy to overlook an EFBIG check. As I researched the problem I found that milter_header_checks also missed this check. All this is supposedly fixed with the attachedd patch. Wietse [attached: 20110418-milter-efbig-patch]
diff --exclude=man --exclude=html --exclude=README_FILES --exclude=.indent.pro --exclude=Makefile.in -bcr /var/tmp/postfix-2.9-20110415/src/milter/milter8.c ./src/milter/milter8.c *** /var/tmp/postfix-2.9-20110415/src/milter/milter8.c Tue Mar 23 13:53:47 2010 --- ./src/milter/milter8.c Thu Apr 28 10:09:30 2011 *************** *** 2500,2505 **** --- 2500,2506 ---- int mime_errs = 0; MILTER_MSG_CONTEXT msg_ctx; VSTRING *buf; + int saved_errno; switch (milter->state) { case MILTER8_STAT_ERROR: *************** *** 2513,2520 **** if (msg_verbose) msg_info("%s: message to milter %s", myname, milter->m.name); if (vstream_fseek(qfile, data_offset, SEEK_SET) < 0) { msg_warn("%s: vstream_fseek %s: %m", myname, VSTREAM_PATH(qfile)); ! return ("450 4.3.0 Queue file write error"); } msg_ctx.milter = milter; msg_ctx.eoh_macros = eoh_macros; --- 2514,2525 ---- if (msg_verbose) msg_info("%s: message to milter %s", myname, milter->m.name); if (vstream_fseek(qfile, data_offset, SEEK_SET) < 0) { + saved_errno = errno; msg_warn("%s: vstream_fseek %s: %m", myname, VSTREAM_PATH(qfile)); ! /* XXX This should be available from cleanup_strerror.c. */ ! return (saved_errno == EFBIG ? ! "552 5.3.4 Message file too big" : ! "451 4.3.0 Queue file write error"); } msg_ctx.milter = milter; msg_ctx.eoh_macros = eoh_macros; diff --exclude=man --exclude=html --exclude=README_FILES --exclude=.indent.pro --exclude=Makefile.in -bcr /var/tmp/postfix-2.9-20110415/src/cleanup/cleanup_milter.c ./src/cleanup/cleanup_milter.c *** /var/tmp/postfix-2.9-20110415/src/cleanup/cleanup_milter.c Wed Nov 3 20:11:22 2010 --- ./src/cleanup/cleanup_milter.c Thu Apr 28 10:15:54 2011 *************** *** 214,219 **** --- 214,221 ---- /*#define msg_verbose 2*/ + static void cleanup_milter_set_error(CLEANUP_STATE *, int); + #define STR(x) vstring_str(x) #define LEN(x) VSTRING_LEN(x) *************** *** 431,438 **** * later. */ if ((new_meta_offset = vstream_fseek(state->dst, (off_t) 0, SEEK_END)) < 0) { ! msg_warn("%s: seek file %s: %m", myname, cleanup_path); ! state->errs |= CLEANUP_STAT_WRITE; return; } if (state->filter != 0) --- 433,439 ---- * later. */ if ((new_meta_offset = vstream_fseek(state->dst, (off_t) 0, SEEK_END)) < 0) { ! cleanup_milter_set_error(state, errno); return; } if (state->filter != 0) *************** *** 452,459 **** * value with the location of the new meta record. */ if (vstream_fseek(state->dst, state->append_meta_pt_offset, SEEK_SET) < 0) { ! msg_warn("%s: seek file %s: %m", myname, cleanup_path); ! state->errs |= CLEANUP_STAT_WRITE; return; } cleanup_out_format(state, REC_TYPE_PTR, REC_TYPE_PTR_FORMAT, --- 453,459 ---- * value with the location of the new meta record. */ if (vstream_fseek(state->dst, state->append_meta_pt_offset, SEEK_SET) < 0) { ! cleanup_milter_set_error(state, errno); return; } cleanup_out_format(state, REC_TYPE_PTR, REC_TYPE_PTR_FORMAT,