home *** CD-ROM | disk | FTP | other *** search
/ Media Share 9 / MEDIASHARE_09.ISO / hamradio / s920603.zip / SMTP.H < prev    next >
C/C++ Source or Header  |  1992-05-01  |  3KB  |  90 lines

  1. #ifndef    _SMTP_H
  2. #define    _SMTP_H
  3.  
  4. #define SMTPTRACE            /* enable tracing for smtp */
  5. #define MAXSESSIONS    10        /* most connections allowed */
  6. #define JOBNAME        13        /* max size of a job name with null */
  7. #define    LINELEN        256
  8. #define SLINELEN    64
  9. #define MBOXLEN        8        /* max size of a mail box name */
  10.  
  11. /* types of address used by smtp in an address list */
  12. #define BADADDR    0
  13. #define LOCAL    1
  14. #define DOMAIN    2
  15.  
  16. /* a list entry */
  17. struct list {
  18.     struct list *next;
  19.     char *val;
  20.     char type;
  21. };
  22.  
  23. /* Per-session control block  used by smtp server */
  24. struct smtpsv {
  25.     FILE *network;        /* The network stream for this connection */
  26.     char *system;        /* Name of remote system */
  27.     char *from;        /* sender address */
  28.     struct list *to;    /* Linked list of recipients */
  29.     FILE *data;        /* Temporary input file pointer */
  30. };
  31.  
  32. /* used by smtpcli as a queue entry for a single message */
  33. struct smtp_job {
  34.     struct     smtp_job *next;    /* pointer to next mail job for this system */
  35.     char    jobname[9];    /* the prefix of the job file name */
  36.     char    *from;        /* address of sender */
  37.     struct list *to;    /* Linked list of recipients */
  38. };
  39.  
  40. /* control structure used by an smtp client session */
  41. struct smtpcli {
  42.     FILE *network;        /* The network stream for this connection */
  43.     int32    ipdest;        /* address of forwarding system */
  44.     char    *destname;    /* domain address of forwarding system */
  45.     char    *wname;        /* name of workfile */
  46.     char    *tname;        /* name of data file */
  47.     char    buf[LINELEN];    /* Output buffer */
  48.     char    cnt;        /* Length of input buffer */
  49.     FILE    *tfile;
  50.     struct    smtp_job *jobq;
  51.     struct    list     *errlog;    
  52.     int lock;        /* In use */
  53. };
  54.  
  55. /* smtp server routing mode */
  56. #define    QUEUE    1
  57.  
  58. #define    NULLLIST    (struct list *)0
  59. #define    NULLSMTPSV    (struct smtpsv *)0
  60. #define    NULLSMTPCLI    (struct smtpcli *)0
  61. #define NULLJOB        (struct smtp_job *)0
  62.  
  63. extern int Smtpmode;
  64. extern char *Mailspool;
  65. extern char *Maillog;
  66. extern char *Mailqdir;        /* Outgoing spool directory */
  67. extern char *Routeqdir;    /* spool directory for a router program */
  68. extern char *Mailqueue;    /* Prototype of work file */
  69. extern char *Maillock;        /* Mail system lock */
  70. extern char *Alias;        /* File of local aliases */
  71.  
  72. /* In smtpserv.c: */
  73. char *ptime __ARGS((long *t));
  74. long get_msgid __ARGS((void));
  75. char *getname __ARGS((char *cp));
  76. int validate_address __ARGS((char *s));
  77. int queuejob __ARGS((FILE *dfile,char *host,struct list *to,char *from));
  78. struct list *addlist __ARGS((struct list **head,char *val,int type));
  79. int mdaemon __ARGS((FILE *data,char *to,struct list *lp,int bounce));
  80.  
  81. /* In smtpcli.c: */
  82. int smtptick __ARGS((void *t));
  83. int mlock __ARGS((char *dir,char *id));
  84. int rmlock __ARGS((char *dir,char *id));
  85. void del_list __ARGS((struct list *lp));
  86. int32 mailroute __ARGS((char *dest));
  87.  
  88. #endif    /* _SMTP_H */
  89.  
  90.