23
|
1 /* movemail foo bar -- move file foo to file bar,
|
|
2 locking file foo the way /bin/mail respects.
|
|
3 Copyright (C) 1986 Free Software Foundation, Inc.
|
|
4
|
|
5 This file is part of GNU Emacs.
|
|
6
|
|
7 GNU Emacs is distributed in the hope that it will be useful,
|
|
8 but without any warranty. No author or distributor
|
|
9 accepts responsibility to anyone for the consequences of using it
|
|
10 or for whether it serves any particular purpose or works at all,
|
|
11 unless he says so in writing.
|
|
12
|
|
13 Everyone is granted permission to copy, modify and redistribute
|
|
14 GNU Emacs, but only under the conditions described in the
|
|
15 document "GNU Emacs copying permission notice". An exact copy
|
|
16 of the document is supposed to have been given to you along with
|
|
17 GNU Emacs so that you can know how you may redistribute it all.
|
|
18 It should be in a file named COPYING. Among other things, the
|
|
19 copyright notice and this notice must be preserved on all copies. */
|
|
20
|
|
21 /*
|
|
22 * Modified January, 1986 by Michael R. Gretzinger (Project Athena)
|
|
23 *
|
|
24 * Added POP (Post Office Protocol) service. When compiled -DPOP
|
|
25 * movemail will accept input filename arguments of the form
|
|
26 * "po:username". This will cause movemail to open a connection to
|
|
27 * a pop server running on $MAILHOST (environment variable). Movemail
|
|
28 * must be setuid to root in order to work with POP.
|
|
29 *
|
|
30 * New module: popmail.c
|
|
31 * Modified routines:
|
|
32 * main - added code within #ifdef MAIL_USE_POP; added setuid(getuid())
|
|
33 * after POP code.
|
|
34 * New routines in movemail.c:
|
|
35 * get_errmsg - return pointer to system error message
|
|
36 *
|
|
37 */
|
|
38
|
|
39 #include <sys/types.h>
|
|
40 #include <sys/stat.h>
|
|
41 #include <sys/file.h>
|
|
42 #include <errno.h>
|
|
43 #define NO_SHORTNAMES /* Tell config not to load remap.h */
|
|
44 #include "../src/config.h"
|
|
45
|
|
46 #ifdef USG
|
|
47 #include <fcntl.h>
|
|
48 #include <unistd.h>
|
|
49 #endif /* USG */
|
|
50
|
|
51 #ifdef XENIX
|
|
52 #include <sys/locking.h>
|
|
53 #endif
|
|
54
|
25
|
55 #ifdef MAIL_USE_MMDF
|
|
56 extern int lk_open (), lk_close ();
|
|
57 #endif
|
|
58
|
23
|
59 /* Cancel substitutions made by config.h for Emacs. */
|
|
60 #undef open
|
|
61 #undef read
|
|
62 #undef write
|
|
63 #undef close
|
|
64
|
|
65 char *concat ();
|
|
66 extern int errno;
|
|
67
|
|
68 /* Nonzero means this is name of a lock file to delete on fatal error. */
|
|
69 char *delete_lockname;
|
|
70
|
|
71 main (argc, argv)
|
|
72 int argc;
|
|
73 char **argv;
|
|
74 {
|
|
75 char *inname, *outname;
|
|
76 int indesc, outdesc;
|
|
77 char buf[1024];
|
|
78 int nread;
|
|
79
|
|
80 #ifndef MAIL_USE_FLOCK
|
|
81 struct stat st;
|
|
82 long now;
|
|
83 int tem;
|
|
84 char *lockname, *p;
|
|
85 char tempname[40];
|
|
86 int desc;
|
|
87 #endif /* not MAIL_USE_FLOCK */
|
|
88
|
|
89 delete_lockname = 0;
|
|
90
|
|
91 if (argc < 3)
|
|
92 fatal ("two arguments required");
|
|
93
|
|
94 inname = argv[1];
|
|
95 outname = argv[2];
|
|
96
|
25
|
97 #ifdef MAIL_USE_MMDF
|
|
98 mmdf_init (argv[0]);
|
|
99 #endif
|
|
100
|
23
|
101 /* Check access to input and output file. */
|
|
102 if (access (inname, R_OK | W_OK) != 0)
|
|
103 pfatal_with_name (inname);
|
|
104 if (access (outname, F_OK) == 0 && access (outname, W_OK) != 0)
|
|
105 pfatal_with_name (outname);
|
|
106
|
|
107 /* Also check that outname's directory is writeable to the real uid. */
|
|
108 {
|
|
109 char *buf = (char *) malloc (strlen (outname) + 1);
|
|
110 char *p, q;
|
|
111 strcpy (buf, outname);
|
|
112 p = buf + strlen (buf);
|
|
113 while (p > buf && p[-1] != '/')
|
|
114 *--p = 0;
|
|
115 if (p == buf)
|
|
116 *p++ = '.';
|
|
117 if (access (buf, W_OK) != 0)
|
|
118 pfatal_with_name (buf);
|
|
119 free (buf);
|
|
120 }
|
|
121
|
|
122 #ifdef MAIL_USE_POP
|
|
123 if (!bcmp (inname, "po:", 3))
|
|
124 {
|
|
125 int status; char *user;
|
|
126
|
|
127 user = (char *) rindex (inname, ':') + 1;
|
|
128 status = popmail (user, outname);
|
|
129 exit (status);
|
|
130 }
|
|
131
|
|
132 setuid (getuid());
|
|
133 #endif /* MAIL_USE_POP */
|
|
134
|
25
|
135 #ifndef MAIL_USE_MMDF
|
23
|
136 #ifndef MAIL_USE_FLOCK
|
|
137 /* Use a lock file named /usr/spool/mail/$USER.lock:
|
|
138 If it exists, the mail file is locked. */
|
|
139 lockname = concat (inname, ".lock", "");
|
|
140 strcpy (tempname, inname);
|
|
141 p = tempname + strlen (tempname);
|
|
142 while (p != tempname && p[-1] != '/')
|
|
143 p--;
|
|
144 *p = 0;
|
|
145 strcpy (p, "EXXXXXX");
|
|
146 mktemp (tempname);
|
|
147 (void) unlink (tempname);
|
|
148
|
|
149 while (1)
|
|
150 {
|
|
151 /* Create the lock file, but not under the lock file name. */
|
|
152 /* Give up if cannot do that. */
|
|
153 desc = open (tempname, O_WRONLY | O_CREAT, 0666);
|
|
154 if (desc < 0)
|
|
155 pfatal_with_name (concat ("temporary file \"", tempname, "\""));
|
|
156 close (desc);
|
|
157
|
|
158 tem = link (tempname, lockname);
|
|
159 (void) unlink (tempname);
|
|
160 if (tem >= 0)
|
|
161 break;
|
|
162 sleep (1);
|
|
163
|
|
164 /* If lock file is a minute old, unlock it. */
|
|
165 if (stat (lockname, &st) >= 0)
|
|
166 {
|
|
167 now = time (0);
|
|
168 if (st.st_ctime < now - 60)
|
|
169 (void) unlink (lockname);
|
|
170 }
|
|
171 }
|
|
172
|
|
173 delete_lockname = lockname;
|
|
174 #endif /* not MAIL_USE_FLOCK */
|
|
175
|
|
176 #ifdef MAIL_USE_FLOCK
|
|
177 indesc = open (inname, O_RDWR);
|
|
178 #else /* if not MAIL_USE_FLOCK */
|
|
179 indesc = open (inname, O_RDONLY);
|
|
180 #endif /* not MAIL_USE_FLOCK */
|
25
|
181 #else /* MAIL_USE_MMDF */
|
|
182 indesc = lk_open (inname, O_RDONLY, 0, 0, 10);
|
|
183 #endif /* MAIL_USE_MMDF */
|
|
184
|
23
|
185 if (indesc < 0)
|
|
186 pfatal_with_name (inname);
|
|
187
|
|
188 #if defined(BSD) || defined(XENIX)
|
|
189 /* In case movemail is setuid to root, make sure the user can
|
|
190 read the output file. */
|
|
191 /* This is desirable for all systems
|
|
192 but I don't want to assume all have the umask system call */
|
|
193 umask (umask (0) & 0333);
|
|
194 #endif /* BSD or Xenix */
|
|
195 outdesc = open (outname, O_WRONLY | O_CREAT | O_EXCL, 0666);
|
|
196 if (outdesc < 0)
|
|
197 pfatal_with_name (outname);
|
|
198 #ifdef MAIL_USE_FLOCK
|
|
199 #ifdef XENIX
|
|
200 if (locking (indesc, LK_RLCK, 0L) < 0) pfatal_with_name (inname);
|
|
201 #else
|
|
202 if (flock (indesc, LOCK_EX) < 0) pfatal_with_name (inname);
|
|
203 #endif
|
|
204 #endif /* MAIL_USE_FLOCK */
|
|
205
|
|
206 while (1)
|
|
207 {
|
|
208 nread = read (indesc, buf, sizeof buf);
|
|
209 if (nread != write (outdesc, buf, nread))
|
|
210 {
|
|
211 int saved_errno = errno;
|
|
212 (void) unlink (outname);
|
|
213 errno = saved_errno;
|
|
214 pfatal_with_name (outname);
|
|
215 }
|
|
216 if (nread < sizeof buf)
|
|
217 break;
|
|
218 }
|
|
219
|
|
220 #ifdef BSD
|
|
221 fsync (outdesc);
|
|
222 #endif
|
|
223
|
|
224 /* Check to make sure no errors before we zap the inbox. */
|
|
225 if (close (outdesc) != 0)
|
|
226 {
|
|
227 int saved_errno = errno;
|
|
228 (void) unlink (outname);
|
|
229 errno = saved_errno;
|
|
230 pfatal_with_name (outname);
|
|
231 }
|
|
232
|
|
233 #ifdef MAIL_USE_FLOCK
|
|
234 #if defined(STRIDE) || defined(XENIX)
|
|
235 /* Stride, xenix have file locking, but no ftruncate. This mess will do. */
|
|
236 (void) close (open (inname, O_CREAT | O_TRUNC | O_RDWR, 0666));
|
|
237 #else
|
|
238 (void) ftruncate (indesc, 0L);
|
|
239 #endif /* STRIDE or XENIX */
|
|
240 #endif /* MAIL_USE_FLOCK */
|
25
|
241
|
|
242 #ifdef MAIL_USE_MMDF
|
|
243 lk_close (indesc, 0, 0, 0);
|
|
244 #else
|
23
|
245 close (indesc);
|
25
|
246 #endif
|
23
|
247
|
|
248 #ifndef MAIL_USE_FLOCK
|
|
249 /* Delete the input file; if we can't, at least get rid of its contents. */
|
|
250 if (unlink (inname) < 0)
|
|
251 if (errno != ENOENT)
|
|
252 creat (inname, 0666);
|
25
|
253 #ifndef MAIL_USE_MMDF
|
|
254 unlink (lockname);
|
|
255 #endif /* not MAIL_USE_MMDF */
|
23
|
256 #endif /* not MAIL_USE_FLOCK */
|
|
257 exit (0);
|
|
258 }
|
|
259
|
|
260 /* Print error message and exit. */
|
|
261
|
|
262 fatal (s1, s2)
|
|
263 char *s1, *s2;
|
|
264 {
|
|
265 if (delete_lockname)
|
|
266 unlink (delete_lockname);
|
|
267 error (s1, s2);
|
|
268 exit (1);
|
|
269 }
|
|
270
|
|
271 /* Print error message. `s1' is printf control string, `s2' is arg for it. */
|
|
272
|
|
273 error (s1, s2)
|
|
274 char *s1, *s2;
|
|
275 {
|
|
276 printf ("movemail: ");
|
|
277 printf (s1, s2);
|
|
278 printf ("\n");
|
|
279 }
|
|
280
|
|
281 pfatal_with_name (name)
|
|
282 char *name;
|
|
283 {
|
|
284 extern int errno, sys_nerr;
|
|
285 extern char *sys_errlist[];
|
|
286 char *s;
|
|
287
|
|
288 if (errno < sys_nerr)
|
|
289 s = concat ("", sys_errlist[errno], " for %s");
|
|
290 else
|
|
291 s = "cannot open %s";
|
|
292 fatal (s, name);
|
|
293 }
|
|
294
|
|
295 /* Return a newly-allocated string whose contents concatenate those of s1, s2, s3. */
|
|
296
|
|
297 char *
|
|
298 concat (s1, s2, s3)
|
|
299 char *s1, *s2, *s3;
|
|
300 {
|
|
301 int len1 = strlen (s1), len2 = strlen (s2), len3 = strlen (s3);
|
|
302 char *result = (char *) xmalloc (len1 + len2 + len3 + 1);
|
|
303
|
|
304 strcpy (result, s1);
|
|
305 strcpy (result + len1, s2);
|
|
306 strcpy (result + len1 + len2, s3);
|
|
307 *(result + len1 + len2 + len3) = 0;
|
|
308
|
|
309 return result;
|
|
310 }
|
|
311
|
|
312 /* Like malloc but get fatal error if memory is exhausted. */
|
|
313
|
|
314 int
|
|
315 xmalloc (size)
|
|
316 int size;
|
|
317 {
|
|
318 int result = malloc (size);
|
|
319 if (!result)
|
|
320 fatal ("virtual memory exhausted", 0);
|
|
321 return result;
|
|
322 }
|
|
323
|
|
324 /* This is the guts of the interface to the Post Office Protocol. */
|
|
325
|
|
326 #ifdef MAIL_USE_POP
|
|
327
|
|
328 #include <sys/socket.h>
|
|
329 #include <netinet/in.h>
|
|
330 #include <netdb.h>
|
|
331 #include <stdio.h>
|
|
332
|
|
333 #ifdef USG
|
|
334 #include <fcntl.h>
|
|
335 /* Cancel substitutions made by config.h for Emacs. */
|
|
336 #undef open
|
|
337 #undef read
|
|
338 #undef write
|
|
339 #undef close
|
|
340 #endif /* USG */
|
|
341
|
|
342 #define NOTOK (-1)
|
|
343 #define OK 0
|
|
344 #define DONE 1
|
|
345
|
|
346 char *progname;
|
|
347 FILE *sfi;
|
|
348 FILE *sfo;
|
|
349 char Errmsg[80];
|
|
350
|
|
351 static int debug = 0;
|
|
352
|
|
353 popmail(user, outfile)
|
|
354 char *user;
|
|
355 char *outfile;
|
|
356 {
|
|
357 char *host;
|
|
358 int nmsgs, nbytes;
|
|
359 char response[128];
|
|
360 register int i;
|
|
361 int mbfi;
|
|
362 FILE *mbf;
|
|
363 char *getenv();
|
|
364 int mbx_write();
|
|
365 char *get_errmsg();
|
|
366
|
|
367 host = getenv("MAILHOST");
|
|
368 if (host == NULL) {
|
|
369 fatal("no MAILHOST defined");
|
|
370 }
|
|
371
|
|
372 if (pop_init(host) == NOTOK) {
|
|
373 error(Errmsg);
|
|
374 return(1);
|
|
375 }
|
|
376
|
|
377 if (getline(response, sizeof response, sfi) != OK) {
|
|
378 error(response);
|
|
379 return(1);
|
|
380 }
|
|
381
|
|
382 if (pop_command("USER %s", user) == NOTOK ||
|
|
383 pop_command("RPOP %s", user) == NOTOK) {
|
|
384 error(Errmsg);
|
|
385 pop_command("QUIT");
|
|
386 return(1);
|
|
387 }
|
|
388
|
|
389 if (pop_stat(&nmsgs, &nbytes) == NOTOK) {
|
|
390 error(Errmsg);
|
|
391 pop_command("QUIT");
|
|
392 return(1);
|
|
393 }
|
|
394
|
|
395 if (!nmsgs)
|
|
396 {
|
|
397 pop_command("QUIT");
|
|
398 return(0);
|
|
399 }
|
|
400
|
|
401 mbfi = open (outfile, O_WRONLY | O_CREAT | O_EXCL, 0666);
|
|
402 if (mbfi < 0)
|
|
403 {
|
|
404 pop_command("QUIT");
|
|
405 error("Error in open: %s, %s", get_errmsg(), outfile);
|
|
406 return(1);
|
|
407 }
|
|
408 fchown(mbfi, getuid(), -1);
|
|
409
|
|
410 if ((mbf = fdopen(mbfi, "w")) == NULL)
|
|
411 {
|
|
412 pop_command("QUIT");
|
|
413 error("Error in fdopen: %s", get_errmsg());
|
|
414 close(mbfi);
|
|
415 unlink(outfile);
|
|
416 return(1);
|
|
417 }
|
|
418
|
|
419 for (i = 1; i <= nmsgs; i++) {
|
|
420 mbx_delimit_begin(mbf);
|
|
421 if (pop_retr(i, mbx_write, mbf) != OK) {
|
|
422 error(Errmsg);
|
|
423 pop_command("QUIT");
|
|
424 close(mbfi);
|
|
425 return(1);
|
|
426 }
|
|
427 mbx_delimit_end(mbf);
|
|
428 fflush(mbf);
|
|
429 }
|
|
430
|
|
431 for (i = 1; i <= nmsgs; i++) {
|
|
432 if (pop_command("DELE %d", i) == NOTOK) {
|
|
433 error(Errmsg);
|
|
434 pop_command("QUIT");
|
|
435 close(mbfi);
|
|
436 return(1);
|
|
437 }
|
|
438 }
|
|
439
|
|
440 pop_command("QUIT");
|
|
441 close(mbfi);
|
|
442 return(0);
|
|
443 }
|
|
444
|
|
445 pop_init(host)
|
|
446 char *host;
|
|
447 {
|
|
448 register struct hostent *hp;
|
|
449 register struct servent *sp;
|
|
450 int lport = IPPORT_RESERVED - 1;
|
|
451 struct sockaddr_in sin;
|
|
452 register int s;
|
|
453 char *get_errmsg();
|
|
454
|
|
455 hp = gethostbyname(host);
|
|
456 if (hp == NULL) {
|
|
457 sprintf(Errmsg, "MAILHOST unknown: %s", host);
|
|
458 return(NOTOK);
|
|
459 }
|
|
460
|
|
461 sp = getservbyname("pop", "tcp");
|
|
462 if (sp == 0) {
|
|
463 strcpy(Errmsg, "tcp/pop: unknown service");
|
|
464 return(NOTOK);
|
|
465 }
|
|
466
|
|
467 sin.sin_family = hp->h_addrtype;
|
|
468 bcopy(hp->h_addr, (char *)&sin.sin_addr, hp->h_length);
|
|
469 sin.sin_port = sp->s_port;
|
|
470 s = rresvport(&lport);
|
|
471 if (s < 0) {
|
|
472 sprintf(Errmsg, "error creating socket: %s", get_errmsg());
|
|
473 return(NOTOK);
|
|
474 }
|
|
475
|
|
476 if (connect(s, (char *)&sin, sizeof sin) < 0) {
|
|
477 sprintf(Errmsg, "error during connect: %s", get_errmsg());
|
|
478 close(s);
|
|
479 return(NOTOK);
|
|
480 }
|
|
481
|
|
482 sfi = fdopen(s, "r");
|
|
483 sfo = fdopen(s, "w");
|
|
484 if (sfi == NULL || sfo == NULL) {
|
|
485 sprintf(Errmsg, "error in fdopen: %s", get_errmsg());
|
|
486 close(s);
|
|
487 return(NOTOK);
|
|
488 }
|
|
489
|
|
490 return(OK);
|
|
491 }
|
|
492
|
|
493 pop_command(fmt, a, b, c, d)
|
|
494 char *fmt;
|
|
495 {
|
|
496 char buf[128];
|
|
497 char errmsg[64];
|
|
498
|
|
499 sprintf(buf, fmt, a, b, c, d);
|
|
500
|
|
501 if (debug) fprintf(stderr, "---> %s\n", buf);
|
|
502 if (putline(buf, Errmsg, sfo) == NOTOK) return(NOTOK);
|
|
503
|
|
504 if (getline(buf, sizeof buf, sfi) != OK) {
|
|
505 strcpy(Errmsg, buf);
|
|
506 return(NOTOK);
|
|
507 }
|
|
508
|
|
509 if (debug) fprintf(stderr, "<--- %s\n", buf);
|
|
510 if (*buf != '+') {
|
|
511 strcpy(Errmsg, buf);
|
|
512 return(NOTOK);
|
|
513 } else {
|
|
514 return(OK);
|
|
515 }
|
|
516 }
|
|
517
|
|
518
|
|
519 pop_stat(nmsgs, nbytes)
|
|
520 int *nmsgs, *nbytes;
|
|
521 {
|
|
522 char buf[128];
|
|
523
|
|
524 if (debug) fprintf(stderr, "---> STAT\n");
|
|
525 if (putline("STAT", Errmsg, sfo) == NOTOK) return(NOTOK);
|
|
526
|
|
527 if (getline(buf, sizeof buf, sfi) != OK) {
|
|
528 strcpy(Errmsg, buf);
|
|
529 return(NOTOK);
|
|
530 }
|
|
531
|
|
532 if (debug) fprintf(stderr, "<--- %s\n", buf);
|
|
533 if (*buf != '+') {
|
|
534 strcpy(Errmsg, buf);
|
|
535 return(NOTOK);
|
|
536 } else {
|
|
537 sscanf(buf, "+OK %d %d", nmsgs, nbytes);
|
|
538 return(OK);
|
|
539 }
|
|
540 }
|
|
541
|
|
542 pop_retr(msgno, action, arg)
|
|
543 int (*action)();
|
|
544 {
|
|
545 char buf[128];
|
|
546
|
|
547 sprintf(buf, "RETR %d", msgno);
|
|
548 if (debug) fprintf(stderr, "%s\n", buf);
|
|
549 if (putline(buf, Errmsg, sfo) == NOTOK) return(NOTOK);
|
|
550
|
|
551 if (getline(buf, sizeof buf, sfi) != OK) {
|
|
552 strcpy(Errmsg, buf);
|
|
553 return(NOTOK);
|
|
554 }
|
|
555
|
|
556 while (1) {
|
|
557 switch (multiline(buf, sizeof buf, sfi)) {
|
|
558 case OK:
|
|
559 (*action)(buf, arg);
|
|
560 break;
|
|
561 case DONE:
|
|
562 return (OK);
|
|
563 case NOTOK:
|
|
564 strcpy(Errmsg, buf);
|
|
565 return (NOTOK);
|
|
566 }
|
|
567 }
|
|
568 }
|
|
569
|
|
570 getline(buf, n, f)
|
|
571 char *buf;
|
|
572 register int n;
|
|
573 FILE *f;
|
|
574 {
|
|
575 register char *p;
|
|
576 int c;
|
|
577
|
|
578 p = buf;
|
|
579 while (--n > 0 && (c = fgetc(f)) != EOF)
|
|
580 if ((*p++ = c) == '\n') break;
|
|
581
|
|
582 if (ferror(f)) {
|
|
583 strcpy(buf, "error on connection");
|
|
584 return (NOTOK);
|
|
585 }
|
|
586
|
|
587 if (c == EOF && p == buf) {
|
|
588 strcpy(buf, "connection closed by foreign host");
|
|
589 return (DONE);
|
|
590 }
|
|
591
|
|
592 *p = NULL;
|
|
593 if (*--p == '\n') *p = NULL;
|
|
594 if (*--p == '\r') *p = NULL;
|
|
595 return(OK);
|
|
596 }
|
|
597
|
|
598 multiline(buf, n, f)
|
|
599 char *buf;
|
|
600 register int n;
|
|
601 FILE *f;
|
|
602 {
|
|
603 if (getline(buf, n, f) != OK) return (NOTOK);
|
|
604 if (*buf == '.') {
|
|
605 if (*(buf+1) == NULL) {
|
|
606 return (DONE);
|
|
607 } else {
|
|
608 strcpy(buf, buf+1);
|
|
609 }
|
|
610 }
|
|
611 return(OK);
|
|
612 }
|
|
613
|
|
614 char *
|
|
615 get_errmsg()
|
|
616 {
|
|
617 extern int errno, sys_nerr;
|
|
618 extern char *sys_errlist[];
|
|
619 char *s;
|
|
620
|
|
621 if (errno < sys_nerr)
|
|
622 s = sys_errlist[errno];
|
|
623 else
|
|
624 s = "unknown error";
|
|
625 return(s);
|
|
626 }
|
|
627
|
|
628 putline(buf, err, f)
|
|
629 char *buf;
|
|
630 char *err;
|
|
631 FILE *f;
|
|
632 {
|
|
633 fprintf(f, "%s\r\n", buf);
|
|
634 fflush(f);
|
|
635 if (ferror(f)) {
|
|
636 strcpy(err, "lost connection");
|
|
637 return(NOTOK);
|
|
638 }
|
|
639 return(OK);
|
|
640 }
|
|
641
|
|
642 mbx_write(line, mbf)
|
|
643 char *line;
|
|
644 FILE *mbf;
|
|
645 {
|
|
646 fputs(line, mbf);
|
|
647 fputc(0x0a, mbf);
|
|
648 }
|
|
649
|
|
650 mbx_delimit_begin(mbf)
|
|
651 FILE *mbf;
|
|
652 {
|
|
653 fputs("\f\n0,unseen,,\n", mbf);
|
|
654 }
|
|
655
|
|
656 mbx_delimit_end(mbf)
|
|
657 FILE *mbf;
|
|
658 {
|
|
659 putc('\037', mbf);
|
|
660 }
|
|
661
|
|
662 #endif /* MAIL_USE_POP */
|