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

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