[Raw Msg Headers][Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Bug in sm truncates messages on AIX (New bug)




OS: AIX 4.1.5
zmailer version: 2.99.48 patch1 added.

description:
A bug in sm cleares some message bodies to size zero.

detail:
In sm.c appendlet():

	/* we are assumed to be positioned properly at start of message body */

This is not always true. In certain cases (I've been able to reproduce but
haven't checked the cause) mfd is positioned way outside the file's range.
When this happens no body can be read and thus no body written to the delivery
agent either. 

Kludge:

Check that mfd file position equals dp->msgbodyoffset, if not make new
lseek with dp->msgbodyoffset and SEEK_SET:




Example from log (extra logging added):

Apr 29 13:27:31 uria sm[42818]: 18603-12326 stat size=2145, 
Apr 29 13:27:31 uria sm[42818]: 18603-12326 seek offset=536920728, 
msgbodyoffset=919
Apr 29 13:27:31 uria sm[42818]: 18603-12326 lseek SEEK_SET set to 919
Apr 29 13:27:31 uria sm[42818]: 18603-12326 read i=6, errno=0, bodyoffset=919, 
sizeestimate=2067
Apr 29 13:27:31 uria sm[42818]: 18603-12326 size=1226, convertmode=1, 
let_buffer=32768


# grep "seek offset" maillog
Apr 29 13:14:05 uria sm[22312]: 18535-8876 seek offset=536921688, 
msgbodyoffset=1056
Apr 29 13:14:21 uria sm[13614]: 18502-30998 seek offset=536921496, 
msgbodyoffset=968
Apr 29 13:14:23 uria sm[22312]: 18535-8876 seek offset=536921688, 
msgbodyoffset=1056
Apr 29 13:14:51 uria sm[22312]: 12515-14868 seek offset=536921688, 
msgbodyoffset=718
Apr 29 13:15:03 uria sm[22312]: 18535-8876 seek offset=536999648, 
msgbodyoffset=1056
Apr 29 13:15:21 uria sm[22312]: 16610-10256 seek offset=536997488, 
msgbodyoffset=852
Apr 29 13:17:21 uria sm[23112]: 18502-14868 seek offset=536920668, 
msgbodyoffset=1559




-- 
E-Mail: Martin.Wendel@ITS.UU.SE        Snail-Mail:  ITS
Tel:    018 18 77 80                                Box 887
Int:    +46 18 18 77 80                             S-751 08 Uppsala
Fax:    +46 18 18 79 10                             Sweden
http://www.uu.se/Internservice/ue/personal/MartinWendel.html