]> diplodocus.org Git - mdeliver/commit
Support qmail if the QMAIL macro is defined. This entails exiting 111
authorepg <>
Thu, 30 Mar 2006 01:59:47 +0000 (01:59 +0000)
committerepg <>
Thu, 30 Mar 2006 01:59:47 +0000 (01:59 +0000)
commit4b409c7fc9029ba2e279bd689c29f4d46ca1a892
tree4ff4db77418431df959ab063bf8af3f324c20aa5
parentf05e512a112bc9236499eac55764fd4343434fc6
Support qmail if the QMAIL macro is defined.  This entails exiting 111
on failure, not having to worry about dumbass /^From /, and handling
RPLINE and DTLINE.

Say EX_TEMPFAIL instead of MDELIVER_EXITCODE.

s/TMPNAMLEN/LEN_FILENAME/; it's not just used for the tmp file.

Random cleanup:
- drop some redundant comments
- s/statbuf/st/
- s/STDIN_FILENO/0/
- cleanup error messages
- other style nits

Drop <err.h> and implement custom err and errx, which doesn't need to
be passed an exit code.

Implement and use full_sleep to really sleep the specified time.

(get_filename): Don't break when gethostname truncates.

(strip_from): Don't even compile this for QMAIL.

(deliver): Take a new parameter, the subdirectory to deliver to,
instead of "new".  #ifdef QMAIL, write RPLINE and DTLINE to tmp file
before copying stdin.

(deliver): Also had a huge problem: it was using the logic i came up
with for minc, to open an empty file for the target and then rename
onto that.  That's fine for mh, which already loses mail this way
(once i switch refile to be like minc this will be fine), but since
other Maildir MDAs follow the official algorithm, this could clobber
mail.  Switch to the official algorithm.

(run_processor): Use better error message format.

(main): If .mdeliver-processor exists, pass deliver "mdb" as the
subdirectory and then call run_processor, else pass "new".
mdeliver.c