updated on Mon Jan 16 00:01:41 UTC 2012
[aur-mirror.git] / qmail / qmail-1.03-pop3d-stat.patch
blob19bd0855385fc5814c2d9364b3743c72b1558905
1 Mailing-List: contact djb-qmail-help@koobera.math.uic.edu; run by ezmlm
2 Date: Wed, 5 Aug 1998 14:33:30 -0500 (CDT)
3 From: "I. Dwayne Koonce" <dwayne@txcyber.com>
4 To: djb-qmail@koobera.math.uic.edu
5 Subject: stat command in qmail-pop3d
6 Message-ID: <Pine.LNX.3.96.980805132829.31864h-100000@hal.txcyber.com>
8 I'm getting ready to move a site to qmail, and earlier today, while
9 pondering how best to patch qmail-pop3d to do some logging, I noticed that
10 its STAT command lists the total number of all messages, then the total
11 size of only the non-deleted messages. This seemed odd, so I checked RFC
12 1939, which specifies deleted messages aren't counted in either total.
13 So, I came up with the trivial patch appended here. This fix, or one like
14 it, should probably go into the main distribution.
16 Also--does anyone still use the LAST command? While trying to figure out
17 what it was supposed to do, I finally found it in one of the obsoleted
18 RFCs, which said that it should return the number of the highest-numbered
19 message accessed (RETR'd or DELE'd--it's not explicitly stated whether
20 TOP'ing a message counts). qmail-pop3d simply returns the highest message
21 number DELE'd. (qpopper does precisely the opposite--it gives the highest
22 number RETR'd [but not DELE'd or TOP'd].) It also says (opaquely, but not
23 really vaguely) that the "highest number accessed" should be set, on start
24 of transaction state, not to zero, but to the number of the
25 highest-numbered message accessed by previous sessions (ie, the last
26 occurence of /^Status: RO/ in mbox-speak).
28 Does anyone care whether or not LAST gets fixed?
31 --- qmail-1.03-orig/qmail-pop3d.c Wed Aug 5 12:52:11 1998
32 +++ qmail-1.03/qmail-pop3d.c Wed Aug 5 13:24:41 1998
33 @@ -148,13 +148,13 @@
35 void pop3_stat()
37 - int i;
38 + int i, j=0;
39 unsigned long total;
41 total = 0;
42 - for (i = 0;i < numm;++i) if (!m[i].flagdeleted) total += m[i].size;
43 + for (i = 0;i < numm;++i) if (!m[i].flagdeleted) { total += m[i].size; j++; }
44 puts("+OK ");
45 - put(strnum,fmt_uint(strnum,numm));
46 + put(strnum,fmt_uint(strnum,j));
47 puts(" ");
48 put(strnum,fmt_ulong(strnum,total));
49 puts("\r\n");
52 ____________________________________________________________________________
53 I. Dwayne Koonce E-mail: dwayne@txcyber.com
54 Network Administrator Phone: (409) 268-6800
55 Cybercom Corporation Fax: (409) 260-2652
56 ____________________________________________________________________________