Commit c02f8c0e c02f8c0e054fc601496690f4fef65a85abd83216 by Alain Magloire

Updatint some of the programs, mail/pop3d. The documentation

still have a lot to go.
1 parent 3211c993
...@@ -30,13 +30,10 @@ The validation is base on the scheme of the url @var{name} or @var{id}. ...@@ -30,13 +30,10 @@ The validation is base on the scheme of the url @var{name} or @var{id}.
30 30
31 The return value is @code{0} on success and a code number on error conditions: 31 The return value is @code{0} on success and a code number on error conditions:
32 @table @code 32 @table @code
33 @item MU_ERROR_INVALID_NAME 33 @item EINVAL
34 The url @var{name} supply is invalid or not supported. 34 The url @var{name} supply is invalid or not supported.
35 @item MU_ERROR_INVALID_ID
36 The @var{id} is not pointing to a valid reference.
37 @item MU_ERROR_INVALID_ARG
38 @var{pmbox} is NULL. 35 @var{pmbox} is NULL.
39 @item MU_ERROR_OUT_OF_MEMORY 36 @item ENOMEM
40 Not enough memory to allocate resources. 37 Not enough memory to allocate resources.
41 @end table 38 @end table
42 @end deftypefun 39 @end deftypefun
...@@ -52,7 +49,7 @@ The mailbox stream is put in @var{pstream}. ...@@ -52,7 +49,7 @@ The mailbox stream is put in @var{pstream}.
52 49
53 The return value is @code{0} on success and a code number on error conditions: 50 The return value is @code{0} on success and a code number on error conditions:
54 @table @code 51 @table @code
55 @item MU_ERROR_INVALID_ARG 52 @item EINVAL
56 @var{mbox} is invalid or @var{pstream} is NULL. 53 @var{mbox} is invalid or @var{pstream} is NULL.
57 @end table 54 @end table
58 @end deftypefun 55 @end deftypefun
...@@ -62,7 +59,7 @@ Set the @var{stream} connection to use for the mailbox. ...@@ -62,7 +59,7 @@ Set the @var{stream} connection to use for the mailbox.
62 59
63 The return value is @code{0} on success and a code number on error conditions: 60 The return value is @code{0} on success and a code number on error conditions:
64 @table @code 61 @table @code
65 @item MU_ERROR_INVALID_ARG 62 @item EINVAL
66 @var{mbox} or @var{stream} are NULL. 63 @var{mbox} or @var{stream} are NULL.
67 @end table 64 @end table
68 @end deftypefun 65 @end deftypefun
...@@ -74,14 +71,14 @@ See @code{stream_create} for @var{flag} description. ...@@ -74,14 +71,14 @@ See @code{stream_create} for @var{flag} description.
74 71
75 The return value is @code{0} on success and a code number on error conditions: 72 The return value is @code{0} on success and a code number on error conditions:
76 @table @code 73 @table @code
77 @item MU_ERROR_EAGAIN 74 @item EAGAIN
78 @itemx MU_ERROR_EINPROGRESS 75 @itemx EINPROGRESS
79 Operation in progress. 76 Operation in progress.
80 @item MU_ERROR_BUSY 77 @item EBUSY
81 Resource busy. 78 Resource busy.
82 @item MU_ERROR_INVALID_ARG 79 @item EINVAL
83 @var{mbox} is null or flag is invalid. 80 @var{mbox} is null or flag is invalid.
84 @item MU_ERROR_OUT_OF_MEMORY 81 @item ENOMEM
85 Not enough memory. 82 Not enough memory.
86 @end table 83 @end table
87 @end deftypefun 84 @end deftypefun
...@@ -91,7 +88,7 @@ The stream attach to @var{mbox} is close. ...@@ -91,7 +88,7 @@ The stream attach to @var{mbox} is close.
91 88
92 The return value is @code{0} on success and a code number on error conditions: 89 The return value is @code{0} on success and a code number on error conditions:
93 @table @code 90 @table @code
94 @item MU_ERROR_INVALID_ARG 91 @item EINVAL
95 @var{mbox} is null. 92 @var{mbox} is null.
96 @end table 93 @end table
97 @end deftypefun 94 @end deftypefun
...@@ -106,9 +103,9 @@ initialize. ...@@ -106,9 +103,9 @@ initialize.
106 103
107 The return value is @code{0} on success and a code number on error conditions: 104 The return value is @code{0} on success and a code number on error conditions:
108 @table @code 105 @table @code
109 @item MU_ERROR_INVALID_ARG 106 @item EINVAL
110 @var{mbox} is null or @var{msgno} is invalid. 107 @var{mbox} is null or @var{msgno} is invalid.
111 @item MU_ERROR_OUT_OF_MEMORY 108 @item ENOMEM
112 Not enough memory. 109 Not enough memory.
113 @end table 110 @end table
114 @end deftypefun 111 @end deftypefun
...@@ -118,7 +115,7 @@ The @var{message} is append to the mailbox @var{mbox}. ...@@ -118,7 +115,7 @@ The @var{message} is append to the mailbox @var{mbox}.
118 115
119 The return value is @code{0} on success and a code number on error conditions: 116 The return value is @code{0} on success and a code number on error conditions:
120 @table @code 117 @table @code
121 @item MU_ERROR_INVALID_ARG 118 @item EINVAL
122 @var{mbox} is null or @var{message} is invalid. 119 @var{mbox} is null or @var{message} is invalid.
123 @end table 120 @end table
124 @end deftypefun 121 @end deftypefun
...@@ -128,7 +125,7 @@ Give the number of message is @var{mbox}. ...@@ -128,7 +125,7 @@ Give the number of message is @var{mbox}.
128 125
129 The return value is @code{0} on success and a code number on error conditions: 126 The return value is @code{0} on success and a code number on error conditions:
130 @table @code 127 @table @code
131 @item MU_ERROR_INVALID_ARG 128 @item EINVAL
132 @var{mbox} is null. 129 @var{mbox} is null.
133 @end table 130 @end table
134 @end deftypefun 131 @end deftypefun
...@@ -138,7 +135,7 @@ All the messages set deleted are removed. ...@@ -138,7 +135,7 @@ All the messages set deleted are removed.
138 135
139 The return value is @code{0} on success and a code number on error conditions: 136 The return value is @code{0} on success and a code number on error conditions:
140 @table @code 137 @table @code
141 @item MU_ERROR_INVALID_ARG 138 @item EINVAL
142 @var{mbox} is null. 139 @var{mbox} is null.
143 @end table 140 @end table
144 @end deftypefun 141 @end deftypefun
...@@ -148,7 +145,7 @@ Return the @var{locker} object. ...@@ -148,7 +145,7 @@ Return the @var{locker} object.
148 145
149 The return value is @code{0} on success and a code number on error conditions: 146 The return value is @code{0} on success and a code number on error conditions:
150 @table @code 147 @table @code
151 @item MU_ERROR_INVALID_ARG 148 @item EINVAL
152 @var{mbox} is null. 149 @var{mbox} is null.
153 @end table 150 @end table
154 @end deftypefun 151 @end deftypefun
...@@ -158,7 +155,7 @@ Set the type of locking done by the @var{mbox}. ...@@ -158,7 +155,7 @@ Set the type of locking done by the @var{mbox}.
158 155
159 The return value is @code{0} on success and a code number on error conditions: 156 The return value is @code{0} on success and a code number on error conditions:
160 @table @code 157 @table @code
161 @item MU_ERROR_INVALID_ARG 158 @item EINVAL
162 @var{mbox} is null. 159 @var{mbox} is null.
163 @end table 160 @end table
164 @end deftypefun 161 @end deftypefun
...@@ -168,7 +165,7 @@ Retriever the @var{*pauth} of the @var{mbox}. ...@@ -168,7 +165,7 @@ Retriever the @var{*pauth} of the @var{mbox}.
168 165
169 The return value is @code{0} on success and a code number on error conditions: 166 The return value is @code{0} on success and a code number on error conditions:
170 @table @code 167 @table @code
171 @item MU_ERROR_INVALID_ARG 168 @item EINVAL
172 @var{mbox} is null. 169 @var{mbox} is null.
173 @end table 170 @end table
174 @end deftypefun 171 @end deftypefun
...@@ -178,7 +175,7 @@ Set the type of authaurity for the mailbox. ...@@ -178,7 +175,7 @@ Set the type of authaurity for the mailbox.
178 175
179 The return value is @code{0} on success and a code number on error conditions: 176 The return value is @code{0} on success and a code number on error conditions:
180 @table @code 177 @table @code
181 @item MU_ERROR_INVALID_ARG 178 @item EINVAL
182 @var{mbox} is null. 179 @var{mbox} is null.
183 @end table 180 @end table
184 @end deftypefun 181 @end deftypefun
...@@ -188,7 +185,7 @@ Check if the mailbox is uptodate. ...@@ -188,7 +185,7 @@ Check if the mailbox is uptodate.
188 185
189 The return value is @code{0} on success and a code number on error conditions: 186 The return value is @code{0} on success and a code number on error conditions:
190 @table @code 187 @table @code
191 @item MU_ERROR_INVALID_ARG 188 @item EINVAL
192 @var{mbox} is null. 189 @var{mbox} is null.
193 @end table 190 @end table
194 @end deftypefun 191 @end deftypefun
...@@ -198,9 +195,9 @@ Scan the mailbox for new messages starting at message @var{msgno}. ...@@ -198,9 +195,9 @@ Scan the mailbox for new messages starting at message @var{msgno}.
198 195
199 The return value is @code{0} on success and a code number on error conditions: 196 The return value is @code{0} on success and a code number on error conditions:
200 @table @code 197 @table @code
201 @item MU_ERROR_INVALID_ARG 198 @item EINVAL
202 @var{mbox} is null. 199 @var{mbox} is null.
203 @item MU_ERROR_OUT_OF_MEMORY 200 @item ENOMEM
204 Not enough memory. 201 Not enough memory.
205 @end table 202 @end table
206 @end deftypefun 203 @end deftypefun
...@@ -210,7 +207,7 @@ Gives the @var{mbox} size. ...@@ -210,7 +207,7 @@ Gives the @var{mbox} size.
210 207
211 The return value is @code{0} on success and a code number on error conditions: 208 The return value is @code{0} on success and a code number on error conditions:
212 @table @code 209 @table @code
213 @item MU_ERROR_INVALID_ARG 210 @item EINVAL
214 @var{mbox} is null. 211 @var{mbox} is null.
215 @end table 212 @end table
216 @end deftypefun 213 @end deftypefun
...@@ -220,79 +217,31 @@ Gives the constructed @var{url}. ...@@ -220,79 +217,31 @@ Gives the constructed @var{url}.
220 217
221 The return value is @code{0} on success and a code number on error conditions: 218 The return value is @code{0} on success and a code number on error conditions:
222 @table @code 219 @table @code
223 @item MU_ERROR_INVALID_ARG 220 @item EINVAL
224 @var{mbox} is null. 221 @var{mbox} is null.
225 @end table 222 @end table
226 @end deftypefun 223 @end deftypefun
227 224
228 225
229 @deftypefun int mailbox_register (mailbox_t mbox @var{mbox}, size_t @var{type}, int (*@var{action}) (size_t @var{type}, void *@var{arg}), void *@var{arg}) 226 @deftypefun int mailbox_get_observable (mailbox_t mbox @var{mbox}, observable_t*@var{observable})
230 227
231 Register a notification for a event @var{type}: 228 Get the observable object.
232 @table @code
233 @item MU_EVT_MBX_DESTROY
234 Mailbox destruction.
235 @item MU_EVT_MBX_CORRUPTED
236 When doing expunge an error condition occured.
237 @item MU_EVT_MBX_MSG_ADD
238 On every new message when scanning.
239 @item MU_EVT_MBX_PROGRESS
240 When scanning notification is send.
241 @end table
242 @var{action} will be call when the event occured.
243 229
244 The return value is @code{0} on success and a code number on error conditions: 230 The return value is @code{0} on success and a code number on error conditions:
245 @table @code 231 @table @code
246 @item MU_ERROR_INVALID_ARG 232 @item EINVAL
247 @var{mbox} is null. 233 @var{mbox} is null.
248 @item MU_ERROR_OUT_OF_MEMORY 234 @item ENOMEM
249 Not enough memory. 235 Not enough memory.
250 @end table 236 @end table
251 @end deftypefun 237 @end deftypefun
252 238
253 @deftypefun int mailbox_deregister (mailbox_t @var{mbox}, void *@var{action}) 239 @deftypefun int mailbox_get_debug (mailbox_t @var{mbox}, debug_t *@var{debug})
254 Delete a register @var{action} for an event. 240 Get a debug object.
255
256 The return value is @code{0} on success and a code number on error conditions:
257 @table @code
258 @item MU_ERROR_INVALID_ARG
259 @var{mbox} is null.
260 @end table
261 @end deftypefun
262
263 @deftypefun int mailbox_set_debug_level (mailbox_t @var{mbox}, size_t @var{level})
264 Set a trace @var{level}:
265 @table @code
266 @item MU_MAILBOX_DEBUG_TRACE
267 Trace the functions.
268 @item MU_MAILBOX_DEBUG_PROT
269 Trace the protocol.
270 @end table
271
272 The return value is @code{0} on success and a code number on error conditions:
273 @table @code
274 @table @code
275 @item MU_ERROR_INVALID_ARG
276 @var{mbox} is null.
277 @end table
278 @end table
279 @end deftypefun
280
281 @deftypefun int mailbox_get_debug_level (mailbox_t @var{mbox}, size_t *@var{plevel})
282
283 The return value is @code{0} on success and a code number on error conditions:
284 @table @code
285 @item MU_ERROR_INVALID_ARG
286 @var{mbox} is null.
287 @end table
288 @end deftypefun
289
290 @deftypefun int mailbox_set_debug_print (mailbox_t @var{mbox}, int (*@var{debug_print}) (void *@var{arg}, const char *@var{buffer}, size_t @var{buffler_length}), void *@var{arg})
291 Set the function @var{debug_print} being call for the trace.
292
293 The return value is @code{0} on success and a code number on error conditions: 241 The return value is @code{0} on success and a code number on error conditions:
294 @table @code 242 @table @code
295 @item MU_ERROR_INVALID_ARG 243 @item EINVAL
296 @var{mbox} is null. 244 @var{mbox} is null.
245 @item ENOMEM
297 @end table 246 @end table
298 @end deftypefun 247 @end deftypefun
......
...@@ -90,14 +90,7 @@ Return non-zero value if message is multi-part. ...@@ -90,14 +90,7 @@ Return non-zero value if message is multi-part.
90 @deftypefun int message_set_uidl (message_t @var{msg}, int (*@var{_get_uidl})(message_t, char *, size_t, size_t *), void *@var{owner}) 90 @deftypefun int message_set_uidl (message_t @var{msg}, int (*@var{_get_uidl})(message_t, char *, size_t, size_t *), void *@var{owner})
91 @end deftypefun 91 @end deftypefun
92 92
93 @deftypefun int message_register (message_t @var{msg}, size_t @var{type}, int (*@var{action}) (size_t, void *), void *@var{arg}) 93 @deftypefun int message_get_observable (message_t @var{msg}, observable_t *@var{observable})
94 @table @code
95 @item MU_EVT_MSG_DESTROY
96 Message destruction.
97 @end table
98 @end deftypefun
99
100 @deftypefun int message_deregister (message_t @var{msg}, void *@var{action})
101 @end deftypefun 94 @end deftypefun
102 95
103 @deftypefun int message_create_attachment (const char *@var{content_type}, const char *@var{encoding}, const char *@var{filename}, message_t *@var{newmsg}) 96 @deftypefun int message_create_attachment (const char *@var{content_type}, const char *@var{encoding}, const char *@var{filename}, message_t *@var{newmsg})
......
...@@ -33,19 +33,8 @@ ...@@ -33,19 +33,8 @@
33 #include <string.h> 33 #include <string.h>
34 #include <unistd.h> 34 #include <unistd.h>
35 35
36 #ifdef HAVE_PATHS_H
37 # include <paths.h>
38 #endif
39
40 #include <mailutils/mailbox.h> 36 #include <mailutils/mailbox.h>
41 37 #include <mailutils/registrar.h>
42 #ifndef _PATH_MAILDIR
43 # define _PATH_MAILDIR "/var/spool/mail"
44 #endif
45
46 #ifndef VERSION
47 # define VERSION "unknow"
48 #endif
49 38
50 int 39 int
51 main(int argc, char **argv) 40 main(int argc, char **argv)
...@@ -62,15 +51,31 @@ main(int argc, char **argv) ...@@ -62,15 +51,31 @@ main(int argc, char **argv)
62 if (argc > 1) 51 if (argc > 1)
63 mailbox_name = argv[1]; 52 mailbox_name = argv[1];
64 53
54 /* Register the desire formats. */
55 {
56 list_t bookie;
57 registrar_get_list (&bookie);
58 list_append (bookie, mbox_record);
59 list_append (bookie, path_record);
60 list_append (bookie, pop_record);
61 }
62
65 if ((status = mailbox_create_default (&mbox, mailbox_name)) != 0 63 if ((status = mailbox_create_default (&mbox, mailbox_name)) != 0
66 || (status = mailbox_open (mbox, MU_MAILBOX_RDONLY)) != 0) 64 || (status = mailbox_open (mbox, MU_STREAM_READ)) != 0)
67 { 65 {
68 fprintf (stderr, "could not create/open: %s\n", strerror (status)); 66 fprintf (stderr, "could not create/open: %s\n", strerror (status));
69 exit (1); 67 exit (1);
70 } 68 }
71 69
70 /* Debuging Trace. */
71 {
72 //debug_t debug;
73 //mailbox_get_debug (mbox, &debug);
74 //debug_set_level (debug, MU_DEBUG_TRACE|MU_DEBUG_PROT);
75 }
76
72 mailbox_messages_count (mbox, &count); 77 mailbox_messages_count (mbox, &count);
73 for(i = 1; i <= count; ++i) 78 for (i = 1; i <= count; ++i)
74 { 79 {
75 message_t msg; 80 message_t msg;
76 header_t hdr; 81 header_t hdr;
...@@ -83,9 +88,8 @@ main(int argc, char **argv) ...@@ -83,9 +88,8 @@ main(int argc, char **argv)
83 header_get_value (hdr, MU_HEADER_FROM, from, 30, NULL); 88 header_get_value (hdr, MU_HEADER_FROM, from, 30, NULL);
84 header_get_value (hdr, MU_HEADER_SUBJECT, subject, 40, NULL); 89 header_get_value (hdr, MU_HEADER_SUBJECT, subject, 40, NULL);
85 90
86 fprintf(stdout, "%s\t%s\n", from, subject); 91 fprintf (stdout, "%s\t%s\n", from, subject);
87
88 } 92 }
89 mailbox_close(mbox); 93 mailbox_close (mbox);
90 return 0; 94 return 0;
91 } 95 }
......
...@@ -122,6 +122,15 @@ main (int argc, char **argv) ...@@ -122,6 +122,15 @@ main (int argc, char **argv)
122 cursor = 1; 122 cursor = 1;
123 realcursor = cursor; 123 realcursor = cursor;
124 124
125 /* Register the desire formats. */
126 {
127 list_t bookie;
128 registrar_get_list (&bookie);
129 list_append (bookie, mbox_record);
130 list_append (bookie, path_record);
131 list_append (bookie, pop_record);
132 }
133
125 signal (SIGPIPE, SIG_IGN); 134 signal (SIGPIPE, SIG_IGN);
126 135
127 /* set up the default environment */ 136 /* set up the default environment */
......
1 /* GNU mailutils - a suite of utilities for electronic mail 1 /* GNU mailutils - a suite of utilities for electronic mail
2 Copyright (C) 1999 Free Software Foundation, Inc. 2 Copyright (C) 1999, 2000 Free Software Foundation, Inc.
3 3
4 This program is free software; you can redistribute it and/or modify 4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by 5 it under the terms of the GNU General Public License as published by
...@@ -41,6 +41,7 @@ ...@@ -41,6 +41,7 @@
41 #include <mailutils/message.h> 41 #include <mailutils/message.h>
42 #include <mailutils/header.h> 42 #include <mailutils/header.h>
43 #include <mailutils/body.h> 43 #include <mailutils/body.h>
44 #include <mailutils/registrar.h>
44 45
45 #include <argcv.h> 46 #include <argcv.h>
46 #include <getline.h> 47 #include <getline.h>
......
1 /* GNU mailutils - a suite of utilities for electronic mail 1 /* GNU mailutils - a suite of utilities for electronic mail
2 Copyright (C) 1999 Free Software Foundation, Inc. 2 Copyright (C) 1999, 2000 Free Software Foundation, Inc.
3 3
4 This program is free software; you can redistribute it and/or modify 4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by 5 it under the terms of the GNU General Public License as published by
...@@ -34,7 +34,7 @@ mail_top (int argc, char **argv) ...@@ -34,7 +34,7 @@ mail_top (int argc, char **argv)
34 size_t n; 34 size_t n;
35 off_t off; 35 off_t off;
36 int lines = strtol ((util_find_env("toplines"))->value, NULL, 10); 36 int lines = strtol ((util_find_env("toplines"))->value, NULL, 10);
37 37
38 if (lines < 0) 38 if (lines < 0)
39 return 1; 39 return 1;
40 40
...@@ -56,5 +56,3 @@ mail_top (int argc, char **argv) ...@@ -56,5 +56,3 @@ mail_top (int argc, char **argv)
56 } 56 }
57 return 1; 57 return 1;
58 } 58 }
59
60
......
...@@ -104,7 +104,11 @@ ticket_pop (ticket_t ticket, const char *challenge, char **parg) ...@@ -104,7 +104,11 @@ ticket_pop (ticket_t ticket, const char *challenge, char **parg)
104 echo_off (&stored_settings); 104 echo_off (&stored_settings);
105 fgets (arg, sizeof (arg), stdin); 105 fgets (arg, sizeof (arg), stdin);
106 if (!echo) 106 if (!echo)
107 echo_on (&stored_settings); 107 {
108 echo_on (&stored_settings);
109 putchar ('\n');
110 fflush (stdout);
111 }
108 arg [strlen (arg) - 1] = '\0'; /* nuke the trailing line. */ 112 arg [strlen (arg) - 1] = '\0'; /* nuke the trailing line. */
109 *parg = strdup (arg); 113 *parg = strdup (arg);
110 } 114 }
......
...@@ -1177,10 +1177,6 @@ pop_top (stream_t is, char *buffer, size_t buflen, ...@@ -1177,10 +1177,6 @@ pop_top (stream_t is, char *buffer, size_t buflen,
1177 1177
1178 mpd = mpm->mpd; 1178 mpd = mpm->mpd;
1179 1179
1180 /* We do not carry the offset backward(for pop), should be doc somewhere. */
1181 if ((size_t)offset < mpm->header_size)
1182 return ESPIPE;
1183
1184 /* Busy ? */ 1180 /* Busy ? */
1185 CHECK_BUSY (mpd->mbox, mpd, func, msg); 1181 CHECK_BUSY (mpd->mbox, mpd, func, msg);
1186 1182
...@@ -1380,11 +1376,6 @@ pop_retr (pop_message_t mpm, char *buffer, size_t buflen, off_t offset, ...@@ -1380,11 +1376,6 @@ pop_retr (pop_message_t mpm, char *buffer, size_t buflen, off_t offset,
1380 return 0; 1376 return 0;
1381 } 1377 }
1382 1378
1383 /* We do not carry the offset backward(for pop), should be doc somewhere. */
1384 /*if (offset < mpm->header_size)
1385 return ESPIPE;
1386 */
1387
1388 /* pop_retr() is not call directly so we assume that the locks were set. */ 1379 /* pop_retr() is not call directly so we assume that the locks were set. */
1389 1380
1390 switch (mpd->state) 1381 switch (mpd->state)
...@@ -1453,7 +1444,7 @@ pop_retr (pop_message_t mpm, char *buffer, size_t buflen, off_t offset, ...@@ -1453,7 +1444,7 @@ pop_retr (pop_message_t mpm, char *buffer, size_t buflen, off_t offset,
1453 if (!mpm->skip_header) 1444 if (!mpm->skip_header)
1454 { 1445 {
1455 ssize_t pos = offset - mpm->header_size; 1446 ssize_t pos = offset - mpm->header_size;
1456 if (pos) 1447 if (pos > 0)
1457 { 1448 {
1458 nread = fill_buffer (mpd, NULL, pos); 1449 nread = fill_buffer (mpd, NULL, pos);
1459 mpm->header_size += nread; 1450 mpm->header_size += nread;
......
...@@ -24,6 +24,7 @@ pop3_list (const char *arg) ...@@ -24,6 +24,7 @@ pop3_list (const char *arg)
24 { 24 {
25 size_t mesgno; 25 size_t mesgno;
26 size_t size = 0; 26 size_t size = 0;
27 size_t lines = 0;
27 message_t msg; 28 message_t msg;
28 attribute_t attr; 29 attribute_t attr;
29 30
...@@ -47,7 +48,8 @@ pop3_list (const char *arg) ...@@ -47,7 +48,8 @@ pop3_list (const char *arg)
47 if (!attribute_is_deleted (attr)) 48 if (!attribute_is_deleted (attr))
48 { 49 {
49 message_size (msg, &size); 50 message_size (msg, &size);
50 fprintf (ofile, "%d %d\r\n", mesgno, size); 51 message_lines (msg, &lines);
52 fprintf (ofile, "%d %d\r\n", mesgno, size + lines);
51 } 53 }
52 } 54 }
53 fprintf (ofile, ".\r\n"); 55 fprintf (ofile, ".\r\n");
...@@ -61,7 +63,8 @@ pop3_list (const char *arg) ...@@ -61,7 +63,8 @@ pop3_list (const char *arg)
61 if (attribute_is_deleted (attr)) 63 if (attribute_is_deleted (attr))
62 return ERR_MESG_DELE; 64 return ERR_MESG_DELE;
63 message_size (msg, &size); 65 message_size (msg, &size);
64 fprintf (ofile, "+OK %d %d\r\n", mesgno, size); 66 message_lines (msg, &lines);
67 fprintf (ofile, "+OK %d %d\r\n", mesgno, size + lines);
65 } 68 }
66 69
67 return OK; 70 return OK;
......
...@@ -92,6 +92,15 @@ main (int argc, char **argv) ...@@ -92,6 +92,15 @@ main (int argc, char **argv)
92 exit (1); 92 exit (1);
93 } 93 }
94 94
95 /* Register the desire formats. */
96 {
97 list_t bookie;
98 registrar_get_list (&bookie);
99 list_append (bookie, mbox_record);
100 list_append (bookie, path_record);
101 list_append (bookie, pop_record);
102 }
103
95 /* Set the signal handlers */ 104 /* Set the signal handlers */
96 signal (SIGINT, pop3_signal); 105 signal (SIGINT, pop3_signal);
97 signal (SIGQUIT, pop3_signal); 106 signal (SIGQUIT, pop3_signal);
......
...@@ -99,6 +99,7 @@ ...@@ -99,6 +99,7 @@
99 #include <mailutils/message.h> 99 #include <mailutils/message.h>
100 #include <mailutils/header.h> 100 #include <mailutils/header.h>
101 #include <mailutils/body.h> 101 #include <mailutils/body.h>
102 #include <mailutils/registrar.h>
102 103
103 /* For Berkley DB2 APOP password file */ 104 /* For Berkley DB2 APOP password file */
104 #ifdef BDB2 105 #ifdef BDB2
......