Home » Archimedes archive » Acorn User » AU 1995-07.adf » !Internet_StarterPak » !Newsbase/Support/taylor/csrc/c/lmail

!Newsbase/Support/taylor/csrc/c/lmail

This website contains an archive of files for the Acorn Electron, BBC Micro, Acorn Archimedes, Commodore 16 and Commodore 64 computers, which Dominic Ford has rescued from his private collection of floppy disks and cassettes.

Some of these files were originally commercial releases in the 1980s and 1990s, but they are now widely available online. I assume that copyright over them is no longer being asserted. If you own the copyright and would like files to be removed, please contact me.

Tape/disk: Home » Archimedes archive » Acorn User » AU 1995-07.adf » !Internet_StarterPak
Filename: !Newsbase/Support/taylor/csrc/c/lmail
Read OK:
File size: 0319 bytes
Load address: 0000
Exec address: 0000
File contents
/* lmail.c
 *
 * Author:  	    Gunnar Z�tl
 * Date:    	    14-Sep-1994
 * Last Modified:   15-Sep-1994
 *
 * Usage: lmail recipient < mail
 * 	  where recipient is a user _local_ to this system. It may not be
 *	  a uucp- or internet adress.
 */

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include "upath.h"
#include "config.h"

#ifndef FALSE
#define FALSE 0
#define TRUE (!FALSE)
#endif

#ifdef DEBUG
#undef DEBUG
#define DEBUG(x) printf x
#else
#undef DEBUG
#define DEBUG(x)
#endif

/* this global variable gets filled with the reply adress of the originator
 * of the mail currently being processed during lrnews_saveto() or
 * lrnews_appendto()
 */
char *originator = NULL;

/* explain the user how to use this program.
 */
void usage(void)
{
    fputs(
00000000  2f 2a 20 6c 6d 61 69 6c  2e 63 0a 20 2a 0a 20 2a  |/* lmail.c. *. *|
00000010  20 41 75 74 68 6f 72 3a  20 20 09 20 20 20 20 47  | Author:  .    G|
00000020  75 6e 6e 61 72 20 5a f6  74 6c 0a 20 2a 20 44 61  |unnar Z.tl. * Da|
00000030  74 65 3a 20 20 20 20 09  20 20 20 20 31 34 2d 53  |te:    .    14-S|
00000040  65 70 2d 31 39 39 34 0a  20 2a 20 4c 61 73 74 20  |ep-1994. * Last |
00000050  4d 6f 64 69 66 69 65 64  3a 20 20 20 31 35 2d 53  |Modified:   15-S|
00000060  65 70 2d 31 39 39 34 0a  20 2a 0a 20 2a 20 55 73  |ep-1994. *. * Us|
00000070  61 67 65 3a 20 6c 6d 61  69 6c 20 72 65 63 69 70  |age: lmail recip|
00000080  69 65 6e 74 20 3c 20 6d  61 69 6c 0a 20 2a 20 09  |ient < mail. * .|
00000090  20 20 77 68 65 72 65 20  72 65 63 69 70 69 65 6e  |  where recipien|
000000a0  74 20 69 73 20 61 20 75  73 65 72 20 5f 6c 6f 63  |t is a user _loc|
000000b0  61 6c 5f 20 74 6f 20 74  68 69 73 20 73 79 73 74  |al_ to this syst|
000000c0  65 6d 2e 20 49 74 20 6d  61 79 20 6e 6f 74 20 62  |em. It may not b|
000000d0  65 0a 20 2a 09 20 20 61  20 75 75 63 70 2d 20 6f  |e. *.  a uucp- o|
000000e0  72 20 69 6e 74 65 72 6e  65 74 20 61 64 72 65 73  |r internet adres|
000000f0  73 2e 0a 20 2a 2f 0a 0a  23 69 6e 63 6c 75 64 65  |s.. */..#include|
00000100  20 3c 73 74 64 69 6f 2e  68 3e 0a 23 69 6e 63 6c  | <stdio.h>.#incl|
00000110  75 64 65 20 3c 73 74 64  6c 69 62 2e 68 3e 0a 23  |ude <stdlib.h>.#|
00000120  69 6e 63 6c 75 64 65 20  3c 73 74 72 69 6e 67 2e  |include <string.|
00000130  68 3e 0a 23 69 6e 63 6c  75 64 65 20 3c 74 69 6d  |h>.#include <tim|
00000140  65 2e 68 3e 0a 23 69 6e  63 6c 75 64 65 20 22 75  |e.h>.#include "u|
00000150  70 61 74 68 2e 68 22 0a  23 69 6e 63 6c 75 64 65  |path.h".#include|
00000160  20 22 63 6f 6e 66 69 67  2e 68 22 0a 0a 23 69 66  | "config.h"..#if|
00000170  6e 64 65 66 20 46 41 4c  53 45 0a 23 64 65 66 69  |ndef FALSE.#defi|
00000180  6e 65 20 46 41 4c 53 45  20 30 0a 23 64 65 66 69  |ne FALSE 0.#defi|
00000190  6e 65 20 54 52 55 45 20  28 21 46 41 4c 53 45 29  |ne TRUE (!FALSE)|
000001a0  0a 23 65 6e 64 69 66 0a  0a 23 69 66 64 65 66 20  |.#endif..#ifdef |
000001b0  44 45 42 55 47 0a 23 75  6e 64 65 66 20 44 45 42  |DEBUG.#undef DEB|
000001c0  55 47 0a 23 64 65 66 69  6e 65 20 44 45 42 55 47  |UG.#define DEBUG|
000001d0  28 78 29 20 70 72 69 6e  74 66 20 78 0a 23 65 6c  |(x) printf x.#el|
000001e0  73 65 0a 23 75 6e 64 65  66 20 44 45 42 55 47 0a  |se.#undef DEBUG.|
000001f0  23 64 65 66 69 6e 65 20  44 45 42 55 47 28 78 29  |#define DEBUG(x)|
00000200  0a 23 65 6e 64 69 66 0a  0a 2f 2a 20 74 68 69 73  |.#endif../* this|
00000210  20 67 6c 6f 62 61 6c 20  76 61 72 69 61 62 6c 65  | global variable|
00000220  20 67 65 74 73 20 66 69  6c 6c 65 64 20 77 69 74  | gets filled wit|
00000230  68 20 74 68 65 20 72 65  70 6c 79 20 61 64 72 65  |h the reply adre|
00000240  73 73 20 6f 66 20 74 68  65 20 6f 72 69 67 69 6e  |ss of the origin|
00000250  61 74 6f 72 0a 20 2a 20  6f 66 20 74 68 65 20 6d  |ator. * of the m|
00000260  61 69 6c 20 63 75 72 72  65 6e 74 6c 79 20 62 65  |ail currently be|
00000270  69 6e 67 20 70 72 6f 63  65 73 73 65 64 20 64 75  |ing processed du|
00000280  72 69 6e 67 20 6c 72 6e  65 77 73 5f 73 61 76 65  |ring lrnews_save|
00000290  74 6f 28 29 20 6f 72 0a  20 2a 20 6c 72 6e 65 77  |to() or. * lrnew|
000002a0  73 5f 61 70 70 65 6e 64  74 6f 28 29 0a 20 2a 2f  |s_appendto(). */|
000002b0  0a 63 68 61 72 20 2a 6f  72 69 67 69 6e 61 74 6f  |.char *originato|
000002c0  72 20 3d 20 4e 55 4c 4c  3b 0a 0a 2f 2a 20 65 78  |r = NULL;../* ex|
000002d0  70 6c 61 69 6e 20 74 68  65 20 75 73 65 72 20 68  |plain the user h|
000002e0  6f 77 20 74 6f 20 75 73  65 20 74 68 69 73 20 70  |ow to use this p|
000002f0  72 6f 67 72 61 6d 2e 0a  20 2a 2f 0a 76 6f 69 64  |rogram.. */.void|
00000300  20 75 73 61 67 65 28 76  6f 69 64 29 0a 7b 0a 20  | usage(void).{. |
00000310  20 20 20 66 70 75 74 73  28                       |   fputs(|
00000319