home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / misc / volume2 / final-xenix-smail / X.patches < prev    next >
Encoding:
Text File  |  1991-08-07  |  10.7 KB  |  439 lines

  1. Index: alias.c
  2. *** smail2.5/alias.c    Mon Dec 21 18:29:55 1987
  3. --- smail/alias.c    Thu Sep 24 13:00:56 1987
  4. ***************
  5. *** 460,462 ****
  6.   
  7. !     while((*p != NULL) && (*p != '#')) {
  8.           b = p;
  9. --- 460,462 ----
  10.   
  11. !     while((*p != '\0') && (*p != '#')) {
  12.           b = p;
  13. Index: defs.h
  14. *** smail2.5/defs.h    Mon Dec 21 18:29:57 1987
  15. --- smail/defs.h    Wed Dec 30 11:30:40 1987
  16. ***************
  17. *** 18,19 ****
  18. --- 18,47 ----
  19.   
  20. + /*
  21. + **    Modified for SCO Xenix by Chip Salzenberg (chip@ateng.UUCP).
  22. + **    Released to Usenet on 01 Dec 1987.
  23. + **    Further modified 23 Dec 1987.
  24. + **
  25. + **    Additions:
  26. + **
  27. + **        EXECMAIL is defined as the renamed /usr/lib/mail/execmail.
  28. + **        Under Xenix, this is the local delivery agent.
  29. + **
  30. + **        SMARTMAILER is now automatically defined if either SENDMAIL
  31. + **        or EXECMAIL is defined.  This is useful for code that depends
  32. + **        on properties that these programs have in common (automatic
  33. + **        bouncing of failed mail, for example).
  34. + **
  35. + **        MICNET should be defined if Micnet or Xenix-Net is in use.
  36. + **        In this case, execmail is used for _all_ mail, which allows
  37. + **        the automatic routing of UUCP mail to a gateway.  However,
  38. + **        execmail sends one file per recipient, even if the recipients
  39. + **        are all on the same (remote) machine.  This is not exactly
  40. + **        a bug; it just increases UUCP connect time.  I personally
  41. + **        leave MICNET undefined.
  42. + **
  43. + **        HOSTFILE is the name of a file containing the hostname.
  44. + **        Under Xenix, this is "/etc/systemid".  HOSTFILE overrides
  45. + **        UNAME/GETHOSTNAME.
  46. + */
  47.   #ifndef VERSION
  48. ***************
  49. *** 32,34 ****
  50.   
  51. ! /* if defined, HOSTNAME overrides UNAME and GETHOSTNAME */
  52.   /*#define HOSTNAME    "host"        /* literal name */
  53. --- 60,69 ----
  54.   
  55. ! /* if defined, HOSTFILE overrides UNAME and GETHOSTNAME */
  56. ! #ifndef HOSTFILE
  57. ! #ifdef M_XENIX
  58. ! #define HOSTFILE    "/etc/systemid"    /* read host name from this file */
  59. ! #endif
  60. ! #endif
  61. ! /* if defined, HOSTNAME overrides HOSTFILE, UNAME, and GETHOSTNAME */
  62.   /*#define HOSTNAME    "host"        /* literal name */
  63. ***************
  64. *** 105,107 ****
  65.   
  66. ! #define ALIAS    "/usr/lib/aliases"    /* location of mail aliases       */
  67.   /*#define CASEALIAS            /* make aliases case sensitive    */
  68. --- 140,147 ----
  69.   
  70. !     /* Location of mail aliases */
  71. ! #ifdef M_XENIX
  72. ! #define ALIAS   "/usr/lib/mail/saliases"
  73. ! #else
  74. ! #define ALIAS   "/usr/lib/aliases"
  75. ! #endif
  76.   /*#define CASEALIAS            /* make aliases case sensitive    */
  77. ***************
  78. *** 125,126 ****
  79. --- 165,170 ----
  80.   
  81. +     /* list of Full Name, address pairs */
  82. + #ifdef M_XENIX
  83. + #define FULLNAME        "/usr/lib/mail/fullnames"
  84. + #else
  85.   #define FULLNAME    "/usr/lib/fullnames"
  86. ***************
  87. *** 126,128 ****
  88.   #define FULLNAME    "/usr/lib/fullnames"
  89. !                     /* list of Full Name, address pairs */
  90.   
  91. --- 170,172 ----
  92.   #define FULLNAME    "/usr/lib/fullnames"
  93. ! #endif
  94.   
  95. ***************
  96. *** 144,146 ****
  97.   
  98. ! /*#define LOG    "/usr/spool/uucp/mail.log"    /* log of uucp mail */
  99.   /*#define RECORD    "/tmp/mail.log"        /* record of uucp mail */
  100. --- 188,190 ----
  101.   
  102. ! #define LOG    "/usr/spool/uucp/mail.log"    /* log of uucp mail */
  103.   /*#define RECORD    "/tmp/mail.log"        /* record of uucp mail */
  104. ***************
  105. *** 162,165 ****
  106.   
  107. ! #ifndef SMAIL
  108. ! #define SMAIL        "/bin/smail"    /* location of smail command */
  109.   #endif
  110. --- 206,212 ----
  111.   
  112. ! #ifndef SMAIL       /* location of smail command */
  113. ! #ifdef M_XENIX
  114. ! #define SMAIL        "/usr/bin/smail"
  115. ! #else
  116. ! #define SMAIL        "/bin/smail"
  117.   #endif
  118. ***************
  119. *** 165,166 ****
  120. --- 212,214 ----
  121.   #endif
  122. + #endif
  123.   
  124. ***************
  125. *** 179,182 ****
  126.   
  127. ! #define RMAIL(flags,from,sys) "%s -a%s %s - %s!rmail",UUX,from,flags,sys /* */
  128. ! /*#define RMAIL(flags,from,sys) "%s %s - %s!rmail",UUX,flags,sys /* */
  129.   
  130. --- 227,230 ----
  131.   
  132. ! /*#define RMAIL(flags,from,sys) "%s -a%s %s - %s!rmail",UUX,from,flags,sys /* */
  133. ! #define RMAIL(flags,from,sys) "%s %s - %s!rmail",UUX,flags,sys /* */
  134.   
  135. ***************
  136. *** 187,188 ****
  137. --- 235,238 ----
  138.   
  139. +     /* We're letting sendmail do lots of work for us. */
  140.   #define HANDLE    JUSTUUCP    /* see HANDLE definition below */
  141. ***************
  142. *** 195,197 ****
  143.   
  144. ! #else
  145.   
  146. --- 245,247 ----
  147.   
  148. ! #else  /* !SENDMAIL */
  149.   
  150. ***************
  151. *** 197,200 ****
  152.   
  153. ! #define HANDLE    ALL
  154. ! #define ROUTING JUSTDOMAIN
  155.   
  156. --- 247,249 ----
  157.   
  158. !     /* We don't have sendmail, so we'll do the work ourselves. */
  159.   
  160. ***************
  161. *** 200,205 ****
  162.   
  163. ! #ifdef BSD
  164. ! #define LMAIL(frm,sys)        "/bin/mail"    /* BSD local delivery agent */
  165. ! #else
  166. ! #define LMAIL(frm,sys)        "/bin/lmail"    /* SV  local delivery agent */
  167.   #endif
  168. --- 249,255 ----
  169.   
  170. ! #define HANDLE  ALL             /* see HANDLE definition below */
  171. ! #define ROUTING ALWAYS          /* see ROUTING definition below */
  172. ! #ifdef BSD              /* BSD local delivery agent */
  173. ! #define LMAIL(frm,sys)          "/bin/mail"
  174.   #endif
  175. ***************
  176. *** 206,207 ****
  177. --- 256,267 ----
  178.   
  179. + #ifdef M_XENIX          /* Xenix local delivery agent (renamed) */
  180. + #define EXECMAIL                "/usr/lib/mail/execmail.x"
  181. + #define LMAIL(frm,sys)          "%s -m -f '%s'",EXECMAIL,frm
  182. + /*#define MICNET                  /* give all mail to execmail, never uux */
  183. + #endif
  184. + #ifndef LMAIL           /* Default local delivery agent */
  185. + #define LMAIL(frm,sys)          "/bin/lmail"
  186. + #endif
  187.   #define LARG(user)        " '%s'",postmaster(user)
  188. ***************
  189. *** 210,211 ****
  190. --- 270,280 ----
  191.   
  192. + #endif  /* !SENDMAIL */
  193. + /* Sendmail and Execmail are "smart" mailers */
  194. + #ifdef SENDMAIL
  195. + #define SMARTMAILER
  196. + #endif
  197. + #ifdef EXECMAIL
  198. + #define SMARTMAILER
  199.   #endif
  200. Index: deliver.c
  201. *** smail2.5/deliver.c    Mon Dec 21 18:29:59 1987
  202. --- smail/deliver.c    Wed Dec 23 12:19:33 1987
  203. ***************
  204. *** 7,8 ****
  205. --- 7,24 ----
  206.   
  207. + /*
  208. + **    Modified for SCO Xenix by Chip Salzenberg (chip@ateng.UUCP).
  209. + **    Released to Usenet on 01 Dec 1987.
  210. + **    Further modified 23 Dec 1987.
  211. + **
  212. + **    Additions:
  213. + **
  214. + **        If MICNET is defined, then LMAIL (execmail) is used to
  215. + **        deliver all mail, even remote mail.  See defs.h for a
  216. + **        discussion of the tradeoffs of this feature.
  217. + **
  218. + **        Some #ifdefs are now SMARTMAILER instead of SENDMAIL.
  219. + **        This is because execmail has some of the intelligent
  220. + **        features of sendmail, i.e. automatic mail return.
  221. + */
  222.   #ifndef lint
  223. ***************
  224. *** 219,222 ****
  225.               command = scommand;
  226. -         } else if (form == LOCAL) {
  227. -             command = lcommand;
  228.           } else {
  229. --- 235,236 ----
  230. ***************
  231. *** 222,226 ****
  232.           } else {
  233. !             command = rcommand;
  234. !             if(flags == uux_noqueue) {
  235. !                 noqcnt++;
  236.               }
  237. --- 236,250 ----
  238.           } else {
  239. ! #ifdef MICNET
  240. !             /* Xenix system running Micnet -- let execmail
  241. !              * handle all messages except retries.
  242. !              */
  243. !             command = lcommand;
  244. ! #else
  245. !             if (form == LOCAL) {
  246. !                 command = lcommand;
  247. !             } else {
  248. !                 command = rcommand;
  249. !                 if(flags == uux_noqueue) {
  250. !                     noqcnt++;
  251. !                 }
  252.               }
  253. ***************
  254. *** 226,227 ****
  255. --- 250,252 ----
  256.               }
  257. + #endif
  258.           }
  259. ***************
  260. *** 271,273 ****
  261.           if (form == LOCAL) {
  262. ! #ifdef SENDMAIL
  263.               (void) sprintf(buf, LFROM(from, nows, hostname));
  264. --- 296,298 ----
  265.           if (form == LOCAL) {
  266. ! #ifdef SMARTMAILER
  267.               (void) sprintf(buf, LFROM(from, nows, hostname));
  268. ***************
  269. *** 283,285 ****
  270.               } else {
  271. !                 *p = NULL;
  272.                   (void) sprintf(buf, RFROM(p+1, nows, from));
  273. --- 308,310 ----
  274.               } else {
  275. !                 *p = '\0';
  276.                   (void) sprintf(buf, RFROM(p+1, nows, from));
  277. ***************
  278. *** 372,378 ****
  279.                       (void) fseek(spoolfp, message, 0);
  280. ! #ifdef SENDMAIL
  281. !                     /* if we have sendmail, then it
  282. !                     ** was handed the mail, which failed.
  283. !                     ** sendmail returns the failed mail
  284. !                     ** for us, so we need not do it again.
  285.                       */
  286. --- 397,402 ----
  287.                       (void) fseek(spoolfp, message, 0);
  288. ! #ifdef SMARTMAILER
  289. !                     /* Mail is automatically returned
  290. !                     ** by sendmail and execmail, so we
  291. !                     ** need not do it again.
  292.                       */
  293. Index: headers.c
  294. *** smail2.5/headers.c    Mon Dec 21 18:30:06 1987
  295. --- smail/headers.c    Wed Dec 23 12:26:43 1987
  296. ***************
  297. *** 5,6 ****
  298. --- 5,18 ----
  299.   
  300. + /*
  301. + **    Modified for SCO Xenix by Chip Salzenberg (chip@ateng.UUCP).
  302. + **    Released to Usenet on 01 Dec 1987.
  303. + **    Further modified 23 Dec 1987.
  304. + **
  305. + **    Additions:
  306. + **
  307. + **        Understand "a%b" to mean "a@b".  (This is a judgement call.
  308. + **        I prefer to accept any mail that I can understand, not just
  309. + **        that which is "correct.")
  310. + */
  311.   #ifndef lint
  312. ***************
  313. *** 155,156 ****
  314. --- 167,179 ----
  315.       }
  316. + /*
  317. + **  Try splitting at %.  If it works, this is user%domain, which we choose
  318. + **  to understand as user@domain.  Prefer the righthand % in a%b%c.
  319. + **  (This code allows 'user%foo@mydom' to mean '@mydom,user@foo'.)
  320. + */
  321. +     if ((parts = ssplit(address, '%', partv)) >= 2) {
  322. +         (void) strcpy(domain, partv[parts-1]);
  323. +         (void) strncpy(user, partv[0], partv[parts-1]-partv[0]-1);
  324. +         user[partv[parts-1]-partv[0]-1] = '\0';
  325. +         return (DOMAIN);
  326. +     } 
  327.   /* 
  328. Index: misc.c
  329. *** smail2.5/misc.c    Mon Dec 21 18:30:19 1987
  330. --- smail/misc.c    Wed Dec 23 12:30:02 1987
  331. ***************
  332. *** 5,6 ****
  333. --- 5,21 ----
  334.   
  335. + /*
  336. + **    Modified for SCO Xenix by Chip Salzenberg (chip@ateng.UUCP).
  337. + **    Released to Usenet on 01 Dec 1987.
  338. + **    Further modified 23 Dec 1987.
  339. + **
  340. + **    Additions:
  341. + **
  342. + **        If HOSTFILE is defined, read it to look for the hostname.
  343. + **        (This file is typically "/etc/systemid" on Xenix systems.)
  344. + **        If HOSTFILE is missing, try uname() or gethostname().
  345. + **
  346. + **        Write only the basename of the program in the log file,
  347. + **        just to make the log file easier to read.
  348. + */
  349.   #ifndef lint
  350. ***************
  351. *** 53,57 ****
  352.   
  353. !     logtime = strcpy(tbuf, nows);
  354. !     logtime[16] = '\0';
  355. !     logtime += 4;
  356.   
  357. --- 68,75 ----
  358.   
  359. !     /* To make the log file look nicer, show only the basename of
  360. !      * the command.
  361. !      */
  362. !     if (*command == '/')
  363. !     {
  364. !         char *p, *ecmd;
  365.   
  366. ***************
  367. *** 57,58 ****
  368. --- 75,92 ----
  369.   
  370. +         if ( (ecmd = index(command, ' ')) != 0 )
  371. +             *ecmd = '\0';
  372. +         if ( (p = rindex(command, '/')) != 0 )
  373. +             command = p + 1;
  374. +         if ( ecmd != 0 )
  375. +             *ecmd = ' ';
  376. +     }
  377. +     /* Time (now).
  378. +      */
  379. +     strcpy(tbuf, nows);
  380. +     tbuf[16] = '\0';
  381. +     logtime = &tbuf[4];
  382.       cmask = umask(0);
  383. ***************
  384. *** 313,314 ****
  385. --- 347,363 ----
  386.           (void) strcpy(hostname, HOSTNAME);
  387. + #endif
  388. + #ifdef HOSTFILE
  389. +     if (!*hostname) {
  390. +         FILE *fp;
  391. +         char *p;
  392. +         if ((fp = fopen(HOSTFILE, "r")) != NULL) {
  393. +             if (fgets(hostname, SMLBUF - 1, fp) != NULL
  394. +              && (p = index(hostname, '\n')) != NULL)
  395. +                 *p = '\0';
  396. +             else
  397. +                 *hostname = '\0';
  398. +             fclose(fp);
  399. +         }
  400. +     }
  401.   #endif
  402. Index: nptx.c
  403. *** smail2.5/nptx.c    Mon Dec 21 18:30:20 1987
  404. --- smail/nptx.c    Thu Sep 24 13:07:13 1987
  405. ***************
  406. *** 127,129 ****
  407.           (void) strcpy(nl[i], p+1);
  408. !         *p = NULL;
  409.       }
  410. --- 127,129 ----
  411.           (void) strcpy(nl[i], p+1);
  412. !         *p = '\0';
  413.       }
  414. ***************
  415. *** 164,166 ****
  416.               (void) strcpy(il[ii], pi+1);
  417. !             *pi = NULL;
  418.           }
  419. --- 164,166 ----
  420.               (void) strcpy(il[ii], pi+1);
  421. !             *pi = '\0';
  422.           }
  423.