home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / unix / volume25 / listserv5.31 / part01 / src / listserv.h < prev    next >
Encoding:
C/C++ Source or Header  |  1991-12-12  |  4.1 KB  |  109 lines

  1. /*
  2.   AGREEMENT: This software can be used and distributed freely as long
  3.   as you do not remove or alter the Copyright notice in the file defs.h;
  4.   this notice is #define'd in the symbol VERSION. Although you may alter
  5.   the code provided, you may not alter the functions create_header()
  6.   and create_multi_recipient_header() in list.c and listserv.c.
  7.   By using this software you are bound by this agreement.
  8.   This software comes with no warranties and cannot be sold for profit.
  9.   The AGREEMENT and COPYRIGHT notices should be included in all source
  10.   files when distributing this software.
  11.   COPYRIGHT: Copyright (c) 1991, Anastasios C. Kotsikonas
  12.  
  13.   Below are the #define's pertinent to listserv.c
  14.  
  15.   Preserve any quotes and new lines that appear below; change only path names.
  16.  
  17.   ALWAYS SPECIFY ABSOLUTE PATHS.
  18.  
  19. */
  20.  
  21. #define UPDATE_DATE      "December 9, 1991"
  22. #define MAIL_COPY         PATH/.messages"
  23. #define OLD_SUBSCRIBERS   PATH/.oldsubscribers"
  24. #define MAILFORWARD       PATH/.mailforward"
  25. #define MSG_NO            PATH/.msgno"
  26. #define RECIP_FILE      ".recip"
  27. #define AWK_PROG      PATH/.awk"
  28. #define STATS_PROG      PATH/.stats"
  29. #define SERVER_MBOX       PATH/mbox"    /* place to save server's messages */
  30. #define STATS_FILE        "/tmp/stats"
  31. #define USERS_FILE      "/tmp/users"
  32. #define HELP_GENERAL      PATH/help/general"
  33. #define HELP_SET      PATH/help/set"
  34. #define HELP_SUBSCRIBE      PATH/help/subscribe"
  35. #define HELP_UNSUBSCRIBE  PATH/help/unsubscribe"
  36. #define HELP_RECIPIENTS      PATH/help/recipients"
  37. #define HELP_INFORMATION  PATH/help/information"
  38. #define HELP_STATISTICS      PATH/help/statistics"
  39. #define HELP_LISTS      PATH/help/lists"
  40. #define HELP_INDEX      PATH/help/index"
  41. #define HELP_GET      PATH/help/get"
  42. #define HELP_RELEASE      PATH/help/release"
  43. #define ARCHIVE_DIR      PATH/archives"
  44. #define DEFAULT_ARCHIVE      "listserv"
  45. #define INDEX          "INDEX"
  46. #define DIR          "DIR"
  47. #define PEER_SERVER_REQUEST "Peer Server Request: "
  48. #define START_OF_SIGNATURE "--"
  49. #define MAX_SET_OPTIONS      1 
  50.  
  51. #define DELIVER_MAIL(recipient) \
  52.   if (sys.options & USE_SYSMAIL) \
  53.     sysmail (MAILFORWARD); \
  54.   else \
  55.     syscom ("%s %s < %s", sys.mail.method, \
  56.             (((sys.options & USE_TELNET) == 0) ? locase (recipient) : ""), \
  57.             MAILFORWARD)
  58.  
  59. #define APPEND_TELNET(func) \
  60.   if (sys.options & USE_TELNET) {\
  61.     if ((f = fopen (MAILFORWARD, "a")) == NULL)\
  62.       sprintf (error, "%s(): Could not open %s", func, MAILFORWARD),\
  63.       report_progress (report, error, TRUE),\
  64.       exit (1);\
  65.     COMPLETE_FILE (f);\
  66.     fclose (f);\
  67.   }
  68.  
  69. #define NOTIFY_MANAGER(msg) \
  70.   create_header (&f, MAILFORWARD, sys.server.address, sys.manager, sender);\
  71.   fprintf (f, "%s %s\n", msg, sender);\
  72.   COMPLETE_TELNET (f);\
  73.   fclose (f);\
  74.   DELIVER_MAIL (sys.manager);\
  75.   sprintf (error, "%s %s; forwarding message to %s\n", msg, sender,\
  76.        sys.manager);\
  77.   report_progress (report, error, FALSE)
  78.  
  79. #define NOTIFY_OF_BAD_ARCHIVE(msg, archive) \
  80.   create_header (&f, MAILFORWARD, sys.server.address, sender, request);\
  81.   fprintf (f, msg, archive);\
  82.   COMPLETE_TELNET (f);\
  83.   fclose (f);\
  84.   DELIVER_MAIL (sender)
  85.  
  86.  
  87. char recipf [MAX_LINE];      /* path to list + RECIP_FILE */
  88.  
  89. FILE *mail        = NULL; /* Source of messages */
  90. FILE *report      = NULL; /* Progress report to the administrator */
  91. FILE *subscribers = NULL; /* List of subscribers */
  92. FILE *ignored     = NULL; /* List of people whose messages are ignored */
  93. FILE *msg_no      = NULL; /* Last message count */
  94. FILE *message_ids = NULL; /* List of message ids */
  95.  
  96. int     listid = -1;
  97. int     request_no = 0;             /* Counts the public messages */
  98. int     restricted_commands = 0;    /* Mask of restrictions */
  99. int    disabled_commands = 0;        /* Mask for disabling commands */
  100. int     nlists = -1;                /* # of lists defined in CONFIG */
  101. BOOLEAN one_rejection = FALSE;
  102. BOOLEAN restart_sys = FALSE;
  103. BOOLEAN tty_echo = FALSE;        /* -e option off */
  104. BOOLEAN do_not_notify_peer_server = FALSE;
  105. BOOLEAN peer_server_request = FALSE;
  106. char    *options [] = { "MAIL" }; /* valid SET options */
  107. char    *values [] = { "ACK|NOACK|NEVERACK|POSTPONE" }; /* and values */
  108. char    *default_values [] = { "NOACK" };
  109.