|
|
coherent
alias(pargc, argv)
int *pargc;
char **argv;
v_search(user)
char *user;
h_search(head, str)
node *head;
char *str;
load_alias(head, filename)
node *head;
char *filename;
** add each word in a string (*p) of recipients
** to the (horizontal) linked list associated with 'h'
*/
recipients(h, p)
node *h;
char *p;
** strip out the stuff in ()'s
**
*/
void
strip_comments(p)
char *p;
add_vert(head, str)
node *head;
char *str;
add_horz(head, str)
node *head;
char *str;
pop(head)
node *head;
** at a time (e.g., 4.1 /bin/mail). To disable the batching, set MAXCLEN
** a small value (like 0).
*/
#define MAXCLEN 512 /* longest command allowed (approx.)
/* this is to keep other's buffers
** from overflowing
*/
/* GATEWAY_NAME should only be used on gateway machines into the .ATT.COM
** domain. Since mail will appear to come from att.ATT.COM, there is no
** way of knowing WHICH gateway it came from. deliver.c was changed
** such that the GATEWAY_NAME was placed in the headers in a non-dangerous
** place so that it could be determined which gateway was used.
** If smail is not being run on a gateway, don't use this definition,
**
** T. G. Thompson Thu Apr 7 13:47:36 EDT 1988
*/
/* #define GATEWAY_NAME "att-ih" /* gateway name other than "att" */
/*
** PLEASE DON'T TOUCH THE REST
*/
#define SMLBUF 512 /* small buffer (handle one item) */
#define BIGBUF 4096 /* handle lots of items */
#define MAXPATH 32 /* number of elements in ! path */
#define MAXDOMS 16 /* number of subdomains in . domain */
#define MAXARGS 500 /* number of arguments */
#define WS " \t" /* white space for paths file */
#ifndef NULL
#define NULL 0
#endif
#define DEBUG if (debug==YES) (void) printf
#define ADVISE if (debug!=NO) (void) printf
#define error(stat,msg,a) { (void) fprintf(stderr, msg, a); exit(stat); }
#define lower(c) ( isupper(c) ? c-'A'+'a' : c )
enum eform { /* format of addresses */
ERROR, /* bad or invalidated format */
LOCAL, /* just a local name */
DOMAIN, /* user@domain or domain!user */
UUCP, /* host!address */
ROUTE, /* intermediate form - to be routed */
SENT /* sent to a mailer on a previous pass */
};
enum ehandle { /* what addresses can we handle? (don't kick to LMAIL) */
ALL, /* UUCP and DOMAIN addresses */
JUSTUUCP, /* UUCP only; set by -l */
NONE /* all mail is LOCAL; set by -L */
};
enum erouting { /* when to route A!B!C!D */
JUSTDOMAIN, /* route A if A is a domain */
ALWAYS, /* route A always; set by -r */
REROUTE /* route C, B, or A (whichever works); set by -R */
};
enum edebug { /* debug modes */
NO, /* normal deliver */
VERBOSE, /* talk alot */
YES /* talk and don't deliver */
};
#ifdef BSD
#include <strings.h>
#include <sysexits.h>
#else
#include <string.h>
#include "sysexits.h"
#define index strchr
#define rindex strrchr
#endif
extern void exit(), perror();
extern unsigned sleep();
** deliver(): hand the letter to the proper mail programs.
**
** Issues one command for each different host of <hostv>,
** constructing the proper command for LOCAL or UUCP mail.
** Note that LOCAL mail has blank host names.
**
** The <userv> names for each host are arguments to the command.
**
** Prepends a "From" line to the letter just before going
** out, with a "remote from <hostname>" if it is a UUCP letter.
**
*/
deliver(argc, hostv, userv, formv, costv)
int argc; /* number of addresses */
char *hostv[]; /* host names */
char *userv[]; /* user names */
enum eform formv[]; /* form for each address */
int costv[]; /* cost vector */
return_mail(from, fcommand, form)
char *from, *fcommand;
enum eform form;
int gethostname(name, bufsize)
unsigned char *name;
int bufsize;
int getdomain(name, bufsize)
unsigned char *name;
int bufsize;
getopt(argc, argv, opts)
int argc;
char **argv, *opts;
** getpath(): look up key in ascii sorted path database.
**
*/
getpath( key, path , cost)
char *key; /* what we are looking for */
char *path; /* where the path results go */
int *cost; /* where the cost results go */
** parse(): parse <address> into <domain, user, form>.
**
** input form
** ----- ----
** user LOCAL
** domain!user DOMAIN
** user@domain DOMAIN
** @domain,address LOCAL (just for sendmail)
** host!address UUCP
**
*/
enum eform
parse(address, domain, user)
char *address; /* input address */
char *domain; /* output domain */
char *user; /* output user */
build(domain, user, form, result)
char *domai
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.