diff -u -r zmailer-2.99.48p1/BUGS zmailer-2.99.48p2/BUGS --- zmailer-2.99.48p1/BUGS Wed Apr 23 21:44:31 1997 +++ zmailer-2.99.48p2/BUGS Fri May 2 16:10:41 1997 @@ -10,12 +10,18 @@ - check peoples directory ownerships and permissions - check peoples .forward ownerships and permissions +- scheduler: + Have two waiting threads (one message each): + - start both of them with ETRN + - both issue report of "retryat +nn" + - both are rescheduled about immediately.. + - system spins on those two... + - transports/sm/sm.c: - "localize" the destination address properly. That is, strip quotes from around a quoted destination address according to the RFC822 syntax. - Is this always correct ? - - transports/smtp/smtp.c: - pipelined mode needs a recheck to the status analysis of the diff -u -r zmailer-2.99.48p1/ChangeLog zmailer-2.99.48p2/ChangeLog --- zmailer-2.99.48p1/ChangeLog Thu Apr 24 21:11:36 1997 +++ zmailer-2.99.48p2/ChangeLog Fri May 2 21:00:44 1997 @@ -1,3 +1,44 @@ +Fri May 2 16:10:28 1997 Matti Aarnio + + * Makefile.in: + - Version 2.99.48p2 + + * BUGS + Noticed problem at scheduler ETRN -> results in + busy spin... + + * man/aliases.5: + A new man-page... + + * proto/cf/fqdnaliases.c: + Missing quotes from the script + + * proto/scheduler.conf: + Sample scheduler.conf file with tags for three + different channel = local -cases: + - local/file* + - local/pipe* + - local/* + The "local/*" may be run with "sm" to use procmail, + or cyrus (for example) for deliveries to users. + The "sm" (procmail in particular?) is unable to do + pipe-feeds, nor storing to files, it seems. + (Also gave an example of 'punt' on smtp..) + + * smtpserver/smtpcmds.c: + Removed obsolete special case ESMTP token: X-TURNME + + * transports/errormail/errormail.c, transports/sm/sm.c, + transports/mailbox/mailbox.c, transports/hold/hold.c, + transports/fuzzyalias/fuzzyaliases.c, transports/libta/lockaddr.c, + transports/smtp/smtp.c: + "Make sure we are properly positioned at the start + of the message body" (lseek() things) + + * transports/mailbox/mailbox.c: + Save errno before doing library calls -- did yield wrong + error in case the 'dotlock' was busy. + Thu Apr 24 21:00:28 1997 Matti Aarnio * Makefile.in: diff -u -r zmailer-2.99.48p1/Makefile zmailer-2.99.48p2/Makefile --- zmailer-2.99.48p1/Makefile Thu Apr 24 21:13:47 1997 +++ zmailer-2.99.48p2/Makefile Fri May 2 21:13:03 1997 @@ -3,7 +3,7 @@ MAJORVERSION = 2 MINORVERSION = 99 -PATCHLEVEL = 48 +PATCHLEVEL = 48p2 srcdir = . diff -u -r zmailer-2.99.48p1/Makefile.in zmailer-2.99.48p2/Makefile.in --- zmailer-2.99.48p1/Makefile.in Thu Apr 24 21:13:14 1997 +++ zmailer-2.99.48p2/Makefile.in Fri May 2 13:10:36 1997 @@ -2,7 +2,7 @@ MAJORVERSION = 2 MINORVERSION = 99 -PATCHLEVEL = 48 +PATCHLEVEL = 48p2 srcdir = @srcdir@ VPATH = @srcdir@ diff -u -r zmailer-2.99.48p1/man/Makefile.in zmailer-2.99.48p2/man/Makefile.in --- zmailer-2.99.48p1/man/Makefile.in Mon Dec 30 22:08:11 1996 +++ zmailer-2.99.48p2/man/Makefile.in Fri May 2 21:02:12 1997 @@ -8,25 +8,26 @@ MAN1= mailq.1 mailrm.1 newaliases.1 rmail.1 ssl.1 vacation.1 zmailer.1 zmsh.1 MAN3= zmailer.3 +MAN5= aliases.5 MAN8= errormail.8 hold.8 router.8 scheduler.8 sendmail.8 sm.8 smtp.8 smtpserver.8 MAN1ps= mailq.1.ps mailrm.1.ps newaliases.1.ps rmail.1.ps ssl.1.ps vacation.1.ps zmailer.1.ps zmsh.1.ps MAN3ps= zmailer.3.ps +MAN5ps= aliases.5.ps MAN8ps= errormail.8.ps hold.8.ps router.8.ps scheduler.8.ps sendmail.8.ps sm.8.ps smtp.8.ps smtpserver.8.ps FRC: @echo "make install prefix=XXXX" install: + $(INSTALL) -m444 aliases.5 ${MANDIR}/man5 $(INSTALL) -m444 errormail.8 ${MANDIR}/man8 $(INSTALL) -m444 hold.8 ${MANDIR}/man8 - $(INSTALL) -m444 zmailer.3 ${MANDIR}/man3 $(INSTALL) -m444 mailbox.8 ${MANDIR}/man8 $(INSTALL) -m444 mailq.1 ${MANDIR}/man1 $(INSTALL) -m444 mailrm.1 ${MANDIR}/man1 $(INSTALL) -m444 newaliases.1 ${MANDIR}/man1 $(INSTALL) -m444 rmail.1 ${MANDIR}/man1 - $(INSTALL) -m444 vacation.1 ${MANDIR}/man1 $(INSTALL) -m444 router.8 ${MANDIR}/man8 $(INSTALL) -m444 scheduler.8 ${MANDIR}/man8 $(INSTALL) -m444 sendmail.8 ${MANDIR}/man8 @@ -34,11 +35,15 @@ $(INSTALL) -m444 smtp.8 ${MANDIR}/man8 $(INSTALL) -m444 smtpserver.8 ${MANDIR}/man8 $(INSTALL) -m444 ssl.1 ${MANDIR}/man1 + $(INSTALL) -m444 vacation.1 ${MANDIR}/man1 $(INSTALL) -m444 zmailer.1 ${MANDIR}/man1 + $(INSTALL) -m444 zmailer.3 ${MANDIR}/man3 $(INSTALL) -m444 zmsh.1 ${MANDIR}/man1 -groff: $(MAN1ps) $(MAN3ps) $(MAN8ps) +groff: $(MAN1ps) $(MAN3ps) $(MAN5ps) $(MAN8ps) +aliases.5.ps: aliases.5 + groff -man aliases.5 > aliases.5.ps mailq.1.ps: mailq.1 groff -man mailq.1 > mailq.1.ps mailrm.1.ps: mailrm.1 diff -u -r zmailer-2.99.48p1/man/aliases.5 zmailer-2.99.48p2/man/aliases.5 --- zmailer-2.99.48p1/man/aliases.5 Fri May 2 20:51:55 1997 +++ zmailer-2.99.48p2/man/aliases.5 Fri May 2 20:59:48 1997 @@ -0,0 +1,72 @@ +.\" $Header$ +.ds ]W ZMailer 2.99 +.TH ZMAILER 5 "2 May 1997" +.SH NAME +.B aliases +\- aliases file for ZMailer +.P +.B .forward +\- user's +.B .forward +file for ZMailer +.SH SYNOPSIS +.B aliases +.SH DESCRIPTION (aliases) +All lines beging with `#' are comments. +.P +Lines begining with white space are extensions to previous +line. +.P +This file describes user ID aliases used by +.IR zmailer (1). +The file resides in ZMailer's database directory, which +usually has a symlink to this file from +.I /etc. +Content of the file is formatted as a series of lines of form: +.sp +.nf + name: name2, name3, name4, . . . +.fi +.sp +Each "name:" label must be valid RFC-822 header type object, and the +colon must not have white-space in between 'name', and itself. +.PP +The targets must be valid RFC-822 address type objects; specifically +following BSD-Sendmail type things do not work, and must be converted +to RFC-822 format: +.sp +.nf + bsd-name: |/path/to/foo/faa, \\bsd-name + zm-name: "|/path/to/foo/faa", "\\zm-name" + both-name: user@somewhere, another@elsewere +.fi +.sp +.SH DESCRIPTION (.forward) +The +.B .forward +file contains addresses that users want their incoming email +to be sent to. It may be some program (like procmail), or +it may be another address. Some examples for user "user": +.sp +.nf + "\\user", "|/path/to/vacation" + + "\\user", another@address +.fi +.sp +BSD-Sendmail lets those addresses be written without quotes, +however it is against RFC-822 rules. +.SH SEE ALSO +zmailer(1), sendmail(8) +.br +RFC822 +.SH HISTORY +The +.B aliases +file format appeared in 4.0BSD. +.SH AUTHOR +This software authored and copyright by: +.br +Rayan Zachariassen ,, +.br +and by Matti Aarnio diff -u -r zmailer-2.99.48p1/man/aliases.5.ps zmailer-2.99.48p2/man/aliases.5.ps --- zmailer-2.99.48p1/man/aliases.5.ps Fri May 2 20:51:56 1997 +++ zmailer-2.99.48p2/man/aliases.5.ps Fri May 2 21:00:13 1997 @@ -0,0 +1,253 @@ +%!PS-Adobe-3.0 +%%Creator: groff version 1.10 +%%CreationDate: Fri May 2 21:00:13 1997 +%%DocumentNeededResources: font Times-Roman +%%+ font Times-Bold +%%+ font Times-Italic +%%DocumentSuppliedResources: procset grops 1.10 0 +%%Pages: 1 +%%PageOrder: Ascend +%%Orientation: Portrait +%%EndComments +%%BeginProlog +%%BeginResource: procset grops 1.10 0 +/setpacking where{ +pop +currentpacking +true setpacking +}if +/grops 120 dict dup begin +/SC 32 def +/A/show load def +/B{0 SC 3 -1 roll widthshow}bind def +/C{0 exch ashow}bind def +/D{0 exch 0 SC 5 2 roll awidthshow}bind def +/E{0 rmoveto show}bind def +/F{0 rmoveto 0 SC 3 -1 roll widthshow}bind def +/G{0 rmoveto 0 exch ashow}bind def +/H{0 rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def +/I{0 exch rmoveto show}bind def +/J{0 exch rmoveto 0 SC 3 -1 roll widthshow}bind def +/K{0 exch rmoveto 0 exch ashow}bind def +/L{0 exch rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def +/M{rmoveto show}bind def +/N{rmoveto 0 SC 3 -1 roll widthshow}bind def +/O{rmoveto 0 exch ashow}bind def +/P{rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def +/Q{moveto show}bind def +/R{moveto 0 SC 3 -1 roll widthshow}bind def +/S{moveto 0 exch ashow}bind def +/T{moveto 0 exch 0 SC 5 2 roll awidthshow}bind def +/SF{ +findfont exch +[exch dup 0 exch 0 exch neg 0 0]makefont +dup setfont +[exch/setfont cvx]cvx bind def +}bind def +/MF{ +findfont +[5 2 roll +0 3 1 roll +neg 0 0]makefont +dup setfont +[exch/setfont cvx]cvx bind def +}bind def +/level0 0 def +/RES 0 def +/PL 0 def +/LS 0 def +/MANUAL{ +statusdict begin/manualfeed true store end +}bind def +/PLG{ +gsave newpath clippath pathbbox grestore +exch pop add exch pop +}bind def +/BP{ +/level0 save def +1 setlinecap +1 setlinejoin +72 RES div dup scale +LS{ +90 rotate +}{ +0 PL translate +}ifelse +1 -1 scale +}bind def +/EP{ +level0 restore +showpage +}bind def +/DA{ +newpath arcn stroke +}bind def +/SN{ +transform +.25 sub exch .25 sub exch +round .25 add exch round .25 add exch +itransform +}bind def +/DL{ +SN +moveto +SN +lineto stroke +}bind def +/DC{ +newpath 0 360 arc closepath +}bind def +/TM matrix def +/DE{ +TM currentmatrix pop +translate scale newpath 0 0 .5 0 360 arc closepath +TM setmatrix +}bind def +/RC/rcurveto load def +/RL/rlineto load def +/ST/stroke load def +/MT/moveto load def +/CL/closepath load def +/FL{ +currentgray exch setgray fill setgray +}bind def +/BL/fill load def +/LW/setlinewidth load def +/RE{ +findfont +dup maxlength 1 index/FontName known not{1 add}if dict begin +{ +1 index/FID ne{def}{pop pop}ifelse +}forall +/Encoding exch def +dup/FontName exch def +currentdict end definefont pop +}bind def +/DEFS 0 def +/EBEGIN{ +moveto +DEFS begin +}bind def +/EEND/end load def +/CNT 0 def +/level1 0 def +/PBEGIN{ +/level1 save def +translate +div 3 1 roll div exch scale +neg exch neg exch translate +0 setgray +0 setlinecap +1 setlinewidth +0 setlinejoin +10 setmiterlimit +[]0 setdash +/setstrokeadjust where{ +pop +false setstrokeadjust +}if +/setoverprint where{ +pop +false setoverprint +}if +newpath +/CNT countdictstack def +userdict begin +/showpage{}def +}bind def +/PEND{ +clear +countdictstack CNT sub{end}repeat +level1 restore +}bind def +end def +/setpacking where{ +pop +setpacking +}if +%%EndResource +%%IncludeResource: font Times-Roman +%%IncludeResource: font Times-Bold +%%IncludeResource: font Times-Italic +grops begin/DEFS 1 dict def DEFS begin/u{.001 mul}bind def end/RES 72 +def/PL 792 def/LS false def/ENC0[/asciicircum/asciitilde/Scaron/Zcaron +/scaron/zcaron/Ydieresis/trademark/quotesingle/.notdef/.notdef/.notdef +/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef +/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef +/.notdef/.notdef/space/exclam/quotedbl/numbersign/dollar/percent +/ampersand/quoteright/parenleft/parenright/asterisk/plus/comma/hyphen +/period/slash/zero/one/two/three/four/five/six/seven/eight/nine/colon +/semicolon/less/equal/greater/question/at/A/B/C/D/E/F/G/H/I/J/K/L/M/N/O +/P/Q/R/S/T/U/V/W/X/Y/Z/bracketleft/backslash/bracketright/circumflex +/underscore/quoteleft/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y +/z/braceleft/bar/braceright/tilde/.notdef/quotesinglbase/guillemotleft +/guillemotright/bullet/florin/fraction/perthousand/dagger/daggerdbl +/endash/emdash/ff/fi/fl/ffi/ffl/dotlessi/dotlessj/grave/hungarumlaut +/dotaccent/breve/caron/ring/ogonek/quotedblleft/quotedblright/oe/lslash +/quotedblbase/OE/Lslash/.notdef/exclamdown/cent/sterling/currency/yen +/brokenbar/section/dieresis/copyright/ordfeminine/guilsinglleft +/logicalnot/minus/registered/macron/degree/plusminus/twosuperior +/threesuperior/acute/mu/paragraph/periodcentered/cedilla/onesuperior +/ordmasculine/guilsinglright/onequarter/onehalf/threequarters +/questiondown/Agrave/Aacute/Acircumflex/Atilde/Adieresis/Aring/AE +/Ccedilla/Egrave/Eacute/Ecircumflex/Edieresis/Igrave/Iacute/Icircumflex +/Idieresis/Eth/Ntilde/Ograve/Oacute/Ocircumflex/Otilde/Odieresis +/multiply/Oslash/Ugrave/Uacute/Ucircumflex/Udieresis/Yacute/Thorn +/germandbls/agrave/aacute/acircumflex/atilde/adieresis/aring/ae/ccedilla +/egrave/eacute/ecircumflex/edieresis/igrave/iacute/icircumflex/idieresis +/eth/ntilde/ograve/oacute/ocircumflex/otilde/odieresis/divide/oslash +/ugrave/uacute/ucircumflex/udieresis/yacute/thorn/ydieresis]def +/Times-Italic@0 ENC0/Times-Italic RE/Times-Bold@0 ENC0/Times-Bold RE +/Times-Roman@0 ENC0/Times-Roman RE +%%EndProlog +%%Page: 1 1 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF 353.3(ZMAILER\(5\) ZMAILER\(5\))72 48 R/F1 9 +/Times-Bold@0 SF -.18(NA)72 84 S(ME).18 E/F2 10/Times-Bold@0 SF(aliases) +108 96 Q F0 2.52.5 G(liases \214le for ZMailer)-2.5 E F2(.f)108 +112.8 Q(orward)-.25 E F0 2.52.5 G(ser')-2.5 E(s)-.55 E F2(.f)2.5 E +(orward)-.25 E F0(\214le for ZMailer)2.5 E F1(SYNOPSIS)72 129.6 Q F2 +(aliases)108 141.6 Q F1(DESCRIPTION \(aliases\))72 158.4 Q F0 +(All lines be)108 170.4 Q(ging with `#' are comments.)-.15 E(Lines be) +108 187.2 Q(gining with white space are e)-.15 E(xtensions to pre)-.15 E +(vious line.)-.25 E 1.43(This \214le describes user ID aliases used by) +108 204 R/F3 10/Times-Italic@0 SF(zmailer)3.929 E F0 3.929(\(1\). The) +.73 F 1.429(\214le resides in ZMailer')3.929 F 3.929(sd)-.55 G 1.429 +(atabase directory)-3.929 F(,)-.65 E .983 +(which usually has a symlink to this \214le from)108 216 R F3(/etc.) +3.483 E F0 .983 +(Content of the \214le is formatted as a series of lines of)5.983 F +(form:)108 228 Q(name: name2, name3, name4, . . .)123 252 Q .33 +(Each "name:" label must be v)108 276 R .33 +(alid RFC-822 header type object, and the colon must not ha)-.25 F .63 +-.15(ve w)-.2 H .33(hite-space in).15 F(between 'name', and itself.)108 +288 Q .527(The tar)108 304.8 R .527(gets must be v)-.18 F .528 +(alid RFC-822 address type objects; speci\214cally follo)-.25 F .528 +(wing BSD-Sendmail type things)-.25 F(do not w)108 316.8 Q +(ork, and must be con)-.1 E -.15(ve)-.4 G(rted to RFC-822 format:).15 E +2.5(bsd-name: |/path/to/foo/f)118 340.8 R 5(aa, \\bsd-name)-.1 F 2.5 +(zm-name: "|/path/to/foo/f)118 352.8 R(aa", "\\zm-name")-.1 E +(both-name: user@some)118 364.8 Q(where, another@else)-.25 E(were)-.25 E +F1(DESCRIPTION \(.f)72 393.6 Q(orward\))-.225 E F0(The)108 405.6 Q F2 +(.f)3.421 E(orward)-.25 E F0 .921 +(\214le contains addresses that users w)3.421 F .92 +(ant their incoming email to be sent to.)-.1 F .92(It may be some)5.92 F +(program \(lik)108 417.6 Q 2.5(ep)-.1 G +(rocmail\), or it may be another address.)-2.5 E(Some e)5 E +(xamples for user "user":)-.15 E("\\user", "|/path/to/v)118 441.6 Q +(acation")-.25 E("\\user", another@address)118 465.6 Q +(BSD-Sendmail lets those addresses be written without quotes, ho)108 +489.6 Q(we)-.25 E -.15(ve)-.25 G 2.5(ri).15 G 2.5(ti)-2.5 G 2.5(sa)-2.5 +G -.05(ga)-2.5 G(inst RFC-822 rules.).05 E F1(SEE ALSO)72 506.4 Q F0 +(zmailer\(1\), sendmail\(8\))108 518.4 Q(RFC822)108 530.4 Q F1(HIST)72 +547.2 Q(OR)-.162 E(Y)-.315 E F0(The)108 559.2 Q F2(aliases)2.5 E F0 +(\214le format appeared in 4.0BSD.)2.5 E F1 -.45(AU)72 576 S(THOR).45 E +F0(This softw)108 588 Q(are authored and cop)-.1 E(yright by:)-.1 E +(Rayan Zachariassen ,,)108 600 Q +(and by Matti Aarnio )108 612 Q 2.5(2M)281.835 768 S +(ay 1997)-2.5 E(1)204.835 E EP +%%Trailer +end +%%EOF diff -u -r zmailer-2.99.48p1/proto/cf/fqdnalias.cf zmailer-2.99.48p2/proto/cf/fqdnalias.cf --- zmailer-2.99.48p1/proto/cf/fqdnalias.cf Mon Feb 17 23:09:16 1997 +++ zmailer-2.99.48p2/proto/cf/fqdnalias.cf Fri May 2 13:01:23 1997 @@ -94,7 +94,7 @@ a="$MAILVAR/fqlists/$lcaddress" l="$preowner$user$postowner@$host" nattr=() - [ -f $a ] && + [ -f "$a" ] && db add expansions "$lcaddress" fqlist && priv=$(getpriv "644" $priv "$a" maillist) && nattr=$(newattribute $A privilege $priv sender "$l") && diff -u -r zmailer-2.99.48p1/proto/scheduler.conf zmailer-2.99.48p2/proto/scheduler.conf --- zmailer-2.99.48p1/proto/scheduler.conf Mon Mar 24 18:22:35 1997 +++ zmailer-2.99.48p2/proto/scheduler.conf Mon Apr 28 11:37:24 1997 @@ -72,16 +72,44 @@ maxchannel=3 command="sm -c $channel bsmtp3nd" -# Local delivery: user mail, files, processes +# Local delivery: files, processes, user mail +local/file* + interval=5m + idlemax=9m + # Originally we had 3 hour expiry, but if your local system goes to + # a fizz (freezes, that is), your local mail may start to bounce + # before anybody notices anything... + expiry=3d + # want 20 channel slots, but only one HOST + maxchannel=15 + maxring=5 + # + # Do MIME text/plain; Quoted-Printable -> text/plain; 8BIT + # conversion on flight! (Can't use CYRUS, nor PROCMAIL here!) + command="mailbox -8" +local/pipe* + interval=5m + idlemax=9m + # Originally we had 3 hour expiry, but if your local system goes to + # a fizz (freezes, that is), your local mail may start to bounce + # before anybody notices anything... + expiry=3d + # want 20 channel slots, but only one HOST + maxchannel=15 + maxring=5 + # + # Do MIME text/plain; Quoted-Printable -> text/plain; 8BIT + # conversion on flight! (Can't use CYRUS, nor PROCMAIL here!) + command="mailbox -8" local/* - interval=60s - idlemax=90s + interval=5m + idlemax=9m # Originally we had 3 hour expiry, but if your local system goes to # a fizz (freezes, that is), your local mail may start to bounce # before anybody notices anything... expiry=3d # want 20 channel slots, but only one HOST - maxchannel=10 + maxchannel=15 maxring=5 # # Do MIME text/plain; Quoted-Printable -> text/plain; 8BIT @@ -99,6 +127,14 @@ maxring=10 command="smtp -c smtpx -x -s" + +# Sometimes we may want to PUNT all out to somewhere without regarding +# on what the routing said: +# +# smtp/* +# maxchannel=199 +# maxring=5 +# command="smtp -F [192.89.123.25] -l /var/log/mail/smtp.punt" # This is a FAST EXPIRY test case.. Will always cause bounce, btw.. smtp/*-gw.funet.fi diff -u -r zmailer-2.99.48p1/smtpserver/smtpcmds.c zmailer-2.99.48p2/smtpserver/smtpcmds.c --- zmailer-2.99.48p1/smtpserver/smtpcmds.c Thu Apr 17 14:28:38 1997 +++ zmailer-2.99.48p2/smtpserver/smtpcmds.c Mon Apr 28 11:44:16 1997 @@ -214,7 +214,6 @@ type(SS,-250,NULL, "VRFY"); type(SS,-250,NULL, "DSN"); type(SS,-250,NULL, "X-RCPTLIMIT 10000"); /* VERY HIGH figure, normal is 100 */ - type(SS,-250,NULL, "X-TURNME"); type(SS,-250,NULL, "ETRN"); type(SS, 250,NULL, "HELP"); SS->with_protocol = WITH_ESMTP; diff -u -r zmailer-2.99.48p1/transports/errormail/errormail.c zmailer-2.99.48p2/transports/errormail/errormail.c --- zmailer-2.99.48p1/transports/errormail/errormail.c Wed Apr 23 20:13:03 1997 +++ zmailer-2.99.48p2/transports/errormail/errormail.c Fri May 2 13:02:08 1997 @@ -399,8 +399,10 @@ rp = dp->recipients; /* copy original message file */ + /* seek to message body -- try it anyway */ - lseek(dp->msgfd, (off_t)(dp->msgbodyoffset), 0 /* L_SET -- usually */); + lseek(dp->msgfd, (off_t)(dp->msgbodyoffset), SEEK_SET); + /* write the (new) headers with local "Received:"-line.. */ writeheaders(rp,mfp,"\n",0,0); diff -u -r zmailer-2.99.48p1/transports/fuzzyalias/fuzzyalias.c zmailer-2.99.48p2/transports/fuzzyalias/fuzzyalias.c --- zmailer-2.99.48p1/transports/fuzzyalias/fuzzyalias.c Wed Dec 25 02:04:09 1996 +++ zmailer-2.99.48p2/transports/fuzzyalias/fuzzyalias.c Fri May 2 13:25:46 1997 @@ -18,6 +18,10 @@ #include "fuzzy.h" +#ifndef SEEK_SET +#define SEEK_SET 0 +#endif + #define PROGNAME "fuzzyalias" #define CHANNEL "fuzzy" /* the default channel name we deliver for */ @@ -220,8 +224,10 @@ /* Cc: The Postoffice managers */ buf = ++s; s = strrchr(buf,'>'); - if (s) *s = 0; - else return; /* No trailing '>' ? BAD BAD! */ + if (s) + *s = 0; + else + return; /* No trailing '>' ? BAD BAD! */ fprintf(mfp,"to <%s>\n",buf); } else { /* Cc: some-address */ @@ -439,8 +445,10 @@ rp = dp->recipients; /* copy original message file */ + /* seek to message body -- try it anyway */ - lseek(dp->msgfd, dp->msgbodyoffset, 0 /* L_SET -- usually */); + lseek(dp->msgfd, dp->msgbodyoffset, SEEK_SET); + /* write the (new) headers with local "Received:"-line.. */ writeheaders(rp,mfp,"\n",0,0); diff -u -r zmailer-2.99.48p1/transports/hold/hold.c zmailer-2.99.48p2/transports/hold/hold.c --- zmailer-2.99.48p1/transports/hold/hold.c Wed Apr 23 20:13:14 1997 +++ zmailer-2.99.48p2/transports/hold/hold.c Fri May 2 13:03:02 1997 @@ -100,9 +100,9 @@ # define WIFEXITED(stat_val) (((stat_val) & 255) == 0) #endif -#ifndef L_SET -#define L_SET 0 -#endif /* L_SET */ +#ifndef SEEK_SET +#define SEEK_SET 0 +#endif /* SEEK_SET */ #define PROGNAME "hold" /* for logging */ #define CHANNEL "hold" /* the default channel name we look at */ @@ -287,7 +287,7 @@ if (!sawok) return; - if (lseek(dp->msgfd, (off_t)(dp->msgbodyoffset), L_SET) < 0L) + if (lseek(dp->msgfd, (off_t)(dp->msgbodyoffset), SEEK_SET) < 0L) warning("Cannot seek to message body! (%m)", (char *)NULL); setreuid(-1, atoi(dp->senders->misc)); diff -u -r zmailer-2.99.48p1/transports/libta/lockaddr.c zmailer-2.99.48p2/transports/libta/lockaddr.c --- zmailer-2.99.48p1/transports/libta/lockaddr.c Mon Mar 31 20:02:36 1997 +++ zmailer-2.99.48p2/transports/libta/lockaddr.c Fri May 2 13:23:07 1997 @@ -21,9 +21,9 @@ #include "mail.h" #include "ta.h" -#ifndef L_SET -#define L_SET 0 -#endif /* L_SET */ +#ifndef SEEK_SET +#define SEEK_SET 0 +#endif /* SEEK_SET */ int lockaddr(fd, map, offset, was, new, file, host, mypid) @@ -68,7 +68,7 @@ /* MMAP()ed block helps.. */ memcpy(lockbuf,map+offset,sizeof(lockbuf)); } else { - if (lseek(fd, offset, L_SET) < 0L) { + if (lseek(fd, offset, SEEK_SET) < 0L) { warning("lockaddr: lseek() failure"); return 0; } @@ -80,7 +80,7 @@ newlock = ((lockbuf[1] == ' ') || (lockbuf[1] >= '0' && lockbuf[1] <= '9')); if (lockbuf[0] == was) { - if (!map && lseek(fd, offset, L_SET) < 0L) { + if (!map && lseek(fd, offset, SEEK_SET) < 0L) { warning("lockaddr: lseek() failure 2"); return 0; } diff -u -r zmailer-2.99.48p1/transports/mailbox/mailbox.c zmailer-2.99.48p2/transports/mailbox/mailbox.c --- zmailer-2.99.48p1/transports/mailbox/mailbox.c Thu Apr 24 20:39:55 1997 +++ zmailer-2.99.48p2/transports/mailbox/mailbox.c Fri May 2 21:16:11 1997 @@ -110,12 +110,12 @@ }; #endif -#ifndef L_SET -#define L_SET 0 -#endif /* !L_SET */ -#ifndef L_XTND -#define L_XTND 2 -#endif /* !L_XTND */ +#ifndef SEEK_SET +#define SEEK_SET 0 +#endif /* !SEEK_SET */ +#ifndef SEEK_END +#define SEEK_END 2 +#endif /* !SEEK_END */ #ifndef F_OK #define F_OK 0 #endif /* !F_OK */ @@ -668,7 +668,7 @@ ts = ctime(&curtime); /* seek to message body start on each iteration */ - if (lseek(dp->msgfd, (off_t)dp->msgbodyoffset, L_SET) < 0L) { + if (lseek(dp->msgfd, (off_t)dp->msgbodyoffset, SEEK_SET) < 0L) { warning("Cannot seek to message body in %s! (%m)", dp->msgfile); DIAGNOSTIC(rp, user, EX_TEMPFAIL, @@ -809,13 +809,23 @@ havedotlock = (dotlock(file) == 0); if (!havedotlock) { char mbuf[256]; - sprintf(mbuf, "\"%s\": %s", file, strerror(errno)); + int rc, err = errno; + sprintf(mbuf, "\"%s\": %s", file, strerror(err)); notaryreport(file,"failed", "5.4.5 (File locking with dotlock failed)", "x-local; 550 (File locking with dotlock failed)"); - DIAGNOSTIC(rp, file, errno == EBUSY ? EX_TEMPFAIL : - (errno == EACCES ? EX_NOPERM : EX_UNAVAILABLE), - "can't dotlock %s", mbuf); + rc = EX_UNAVAILABLE; + switch (err) { + case EBUSY: + rc = EX_TEMPFAIL; + break; + case EACCES: + rc = EX_NOPERM; + break; + default: + break; + } + DIAGNOSTIC(rp, file, rc, "can't dotlock %s", mbuf); return 1; } #endif /* HAVE_DOTLOCK */ @@ -850,7 +860,7 @@ { #if defined(HAVE_LOCKF) && defined(F_LOCK) /* Seek to begining for locking! [mea@utu.fi] */ - if (lseek(fdmail, (off_t)0, L_SET) < 0 || + if (lseek(fdmail, (off_t)0, SEEK_SET) < 0 || lockf(fdmail, F_LOCK, 0) < 0) { alarm(0); notaryreport(file,"failed", @@ -860,7 +870,7 @@ "can't lockf() \"%s\"", file); return 1; } - lseek(fdmail, (off_t)0, L_XTND); /* To the end of the file */ + lseek(fdmail, (off_t)0, SEEK_END); /* To the end of the file */ #endif /* HAVE_LOCKF */ return 0; } @@ -1054,16 +1064,16 @@ /* Does not exist, or is not a directory */ continue; hasdir = 1; - if ((file = exists(*maild, usernam, rp)) != NULL) + if ((file = exists(*maild, pw->pw_name, rp)) != NULL) break; /* found it */ if (rp->status != EX_OK) return; } if (hasdir && *maild == 0 && - !creatembox(rp, usernam, &file, &st.st_uid, &st.st_gid, pw)) + !creatembox(rp, pw->pw_name, &file, &st.st_uid, &st.st_gid, pw)) return; /* creatembox() sets status */ - + if (!hasdir) { /* No directory ?? */ char *mailbox = getzenv("MAILBOX"); @@ -1286,7 +1296,7 @@ case 'L': case 'l': #if defined(HAVE_LOCKF) && defined(F_LOCK) /* If one, also the other */ - lseek(fdmail,(off_t)0,L_SET); + lseek(fdmail,(off_t)0,SEEK_SET); lockf(fdmail, F_ULOCK, 0); #endif /* HAVE_LOCKF */ break; @@ -1312,7 +1322,7 @@ /* Where is the end of file -- before we write anything */ - eofindex = lseek(fdmail, (off_t)0, L_XTND); + eofindex = lseek(fdmail, (off_t)0, SEEK_END); #if defined(HAVE_SOCKET) if (nbp != NULL) nbp->offset = eofindex; @@ -1354,7 +1364,7 @@ case 'L': case 'l': #if defined(HAVE_LOCKF) && defined(F_LOCK) - lseek(fdmail,(off_t)0,L_SET); + lseek(fdmail,(off_t)0,SEEK_SET); lockf(fdmail, F_ULOCK, 0); #endif /* HAVE_LOCKF */ break; @@ -1442,7 +1452,7 @@ } else if (eofindex > 0L && eofindex < (sizeof "From x\n")) { /* A mail message *cannot* be this small. It must be a corrupted mailbox file. Ignore the trash bytes. */ - fseek(fp, (off_t)0, L_SET); + fseek(fp, (off_t)0, SEEK_SET); eofindex = 0; } @@ -1564,9 +1574,9 @@ * login etc. can distinguish new mail from old. * The mtime will be set to now by the following write() calls. */ - fseek(fp, (off_t)-2, L_XTND); + fseek(fp, (off_t)-2, SEEK_END); len = fread(buf, 1, 2, fp); - fseek(fp, (off_t)0, L_XTND); /* to end of file, again */ + fseek(fp, (off_t)0, SEEK_END); /* to end of file, again */ if (len == 1 || len == 2) { int err; @@ -2231,8 +2241,9 @@ return WS.lastch; } - /* we are assumed to be positioned properly - at the start of the message body */ + /* Make sure we are properly positioned at the start + of the message body */ + lseek(mfd, dp->msgbodyoffset, SEEK_SET); bufferfull = 0; while ((i = read(mfd, buffer, BUFSIZ)) != 0) { if (i < 0) { diff -u -r zmailer-2.99.48p1/transports/sm/sm.c zmailer-2.99.48p2/transports/sm/sm.c --- zmailer-2.99.48p1/transports/sm/sm.c Wed Apr 23 20:15:47 1997 +++ zmailer-2.99.48p2/transports/sm/sm.c Fri May 2 13:07:36 1997 @@ -44,9 +44,9 @@ # define WSIGNALSTATUS(s) ((s) & 0177) #endif -#ifndef L_SET -#define L_SET 0 -#endif /* !L_SET */ +#ifndef SEEK_SET +#define SEEK_SET 0 +#endif /* !SEEK_SET */ /* as in: SKIPWHILE(isascii,cp) */ #define SKIPWHILE(X,Y) while (*Y != '\0' && isascii(*Y) && X(*Y)) { ++Y; } @@ -340,10 +340,10 @@ FILE *tafp, *errfp; char *cp, *ds, *s, buf[BUFSIZ], buf2[BUFSIZ]; char **av; - int status; + int status; int content_kind, conversion_prohibited, convertmode, ascii_clean = 0; - if (lseek(dp->msgfd, (off_t)(dp->msgbodyoffset), L_SET) < 0L) + if (lseek(dp->msgfd, (off_t)(dp->msgbodyoffset), SEEK_SET) < 0L) warning("Cannot seek to message body! (%m)", (char *)NULL); i = 0; @@ -661,9 +661,9 @@ if (mp->flags & MO_BSMTP) { if (mp->flags & MO_CRLF) - fprintf(tafp,".\r\nQUIT\r\n"); + fprintf(tafp,".\r\n"); else - fprintf(tafp,".\nQUIT\n"); + fprintf(tafp,".\n"); } fclose(tafp); @@ -769,11 +769,11 @@ } #endif - /* we are assumed to be positioned properly at start of message body */ bufferfull = 0; lastch = -1; if (convertmode == _CONVERT_NONE) { #ifndef HAVE_MMAP + lseek(mfd, dp->msgbodyoffset, SEEK_SET); while ((i = read(mfd, let_buffer, sizeof let_buffer)) != 0) { #else char *let_buffer = dp->let_buffer + dp->msgbodyoffset; @@ -804,7 +804,7 @@ char iobuf[BUFSIZ]; FILE *mfp = fdopen(mfd,"r"); - fseek(mfp,(off_t)(dp->msgbodyoffset),L_SET); + fseek(mfp,(off_t)(dp->msgbodyoffset),SEEK_SET); setvbuf(mfp, iobuf, _IOFBF, sizeof(iobuf)); diff -u -r zmailer-2.99.48p1/transports/smtp/smtp.c zmailer-2.99.48p2/transports/smtp/smtp.c --- zmailer-2.99.48p1/transports/smtp/smtp.c Fri May 2 13:11:01 1997 +++ zmailer-2.99.48p2/transports/smtp/smtp.c Fri May 2 13:00:53 1997 @@ -1462,36 +1462,8 @@ } -#if 0 /* This is broken - the lseek() below broke it, but it fixed a lot - of other problems.. Thus possible 'cache' goes away.. */ -#ifndef HAVE_MMAP - /* can we use cache of message body data */ - if (convertmode == _CONVERT_NONE && - readalready != 0) { - rc = writebuf(SS, let_buffer, readalready); - SS->hsize += rc; - if (statusreport) - report(SS,"DATA %d/%d (%d%%)", - SS->hsize, SS->msize, (SS->hsize*100+SS->msize/2)/SS->msize); - if (rc != readalready || gotalarm) { - alarm(0); - if (gotalarm) { - sprintf(SS->remotemsg,"smtp; 500 (let_buffer write timeout! DATA %d/%d [%d%%])", - SS->hsize, SS->msize, (SS->hsize*100+SS->msize/2)/SS->msize); - /* return EX_IOERR; */ - } - return EX_IOERR; - } - lastwasnl = (let_buffer[readalready-1] != '\n'); - if (statusreport) - report(SS,"DATA %d (100%%)", readalready+SS->hsize); - if (fflush(fp) != 0) { - alarm(0); - return EX_IOERR; - } - } -#endif /* !HAVE_MMAP */ -#endif /* 0 */ + /* Makeing sure we are properly positioned + at the begin of the message body */ if (lseek(dp->msgfd, (off_t)dp->msgbodyoffset, SEEK_SET) < 0L) warning("Cannot seek to message body! (%m)", (char *)NULL); @@ -4008,7 +3980,8 @@ return 0; /* Not clean ! */ } - /* we are assumed to be positioned properly at start of message body */ + /* make sure we are properly positioned at the start + of the message body */ bufferfull = 0; mfd_pos = lseek(mfd, (off_t)dp->msgbodyoffset, SEEK_SET);