home *** CD-ROM | disk | FTP | other *** search
/ Gold Fish 2 / goldfish_vol2_cd1.bin / files / comm / mail / smail / src / rcs / defs.h,v < prev    next >
Text File  |  1993-12-21  |  15KB  |  621 lines

  1. head    1.12;
  2. access;
  3. symbols
  4.     C_1:1.12;
  5. locks; strict;
  6. comment    @ * @;
  7.  
  8.  
  9. 1.12
  10. date    93.11.16.23.39.58;    author Aussem;    state Exp;
  11. branches;
  12. next    1.11;
  13.  
  14. 1.11
  15. date    93.11.13.23.13.20;    author Aussem;    state Exp;
  16. branches;
  17. next    1.10;
  18.  
  19. 1.10
  20. date    93.11.13.22.11.07;    author Aussem;    state Exp;
  21. branches;
  22. next    1.9;
  23.  
  24. 1.9
  25. date    93.11.13.21.44.00;    author Aussem;    state Exp;
  26. branches;
  27. next    1.8;
  28.  
  29. 1.8
  30. date    93.11.12.23.04.42;    author Aussem;    state Exp;
  31. branches;
  32. next    1.7;
  33.  
  34. 1.7
  35. date    93.10.18.19.58.28;    author Aussem;    state Exp;
  36. branches;
  37. next    1.6;
  38.  
  39. 1.6
  40. date    93.10.17.23.24.25;    author Aussem;    state Exp;
  41. branches;
  42. next    1.5;
  43.  
  44. 1.5
  45. date    93.10.17.21.48.50;    author Aussem;    state Exp;
  46. branches;
  47. next    1.4;
  48.  
  49. 1.4
  50. date    93.10.10.19.28.46;    author Aussem;    state Exp;
  51. branches;
  52. next    1.3;
  53.  
  54. 1.3
  55. date    93.09.18.16.47.47;    author Aussem;    state Exp;
  56. branches;
  57. next    1.2;
  58.  
  59. 1.2
  60. date    93.09.10.01.50.41;    author Aussem;    state Exp;
  61. branches;
  62. next    1.1;
  63.  
  64. 1.1
  65. date    93.09.08.16.25.48;    author Aussem;    state Exp;
  66. branches;
  67. next    ;
  68.  
  69.  
  70. desc
  71. @defnition modul for smail
  72. @
  73.  
  74.  
  75. 1.12
  76. log
  77. @MAXPATH and MAXDOM make bigger
  78. @
  79. text
  80. @/*
  81.  *
  82.  *  Defs.h:  header file for rmail/smail.
  83.  *
  84.  * This program is free software; you can redistribute it and/or
  85.  * modify it under the terms of the GNU General Public License as
  86.  * published by the Free Software Foundation; either version 2 of
  87.  * the License, or (at your option) any later version.
  88.  *
  89.  * This program is distributed in the hope that it will be useful,
  90.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  91.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  92.  * General Public License for more details.
  93.  *
  94.  * You should have received a copy of the GNU General Public License
  95.  * along with this program; if not, write to the Free Software
  96.  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  97.  *
  98.  * $Log: defs.h,v $
  99.  * Revision 1.11  1993/11/13  23:13:20  Aussem
  100.  * MAXLINE inserted
  101.  *
  102.  * Revision 1.10  1993/11/13  22:11:07  Aussem
  103.  * VERSION is now again in defs.h
  104.  *
  105.  * Revision 1.9  1993/11/13  21:44:00  Aussem
  106.  * VERSION defined removed
  107.  * now stored in global var version
  108.  *
  109.  * Revision 1.8  1993/11/12  23:04:42  Aussem
  110.  * Version string rewritten
  111.  *
  112.  * Revision 1.7  1993/10/18  19:58:28  Aussem
  113.  * insert BSMTPSITES and UUBATCH
  114.  *
  115.  * Revision 1.6  1993/10/17  23:24:25  Aussem
  116.  * insert in BARG a \n
  117.  *
  118.  * Revision 1.5  1993/10/17  21:48:50  Aussem
  119.  * BARG and BMAIL for bsmtp mails inserted
  120.  *
  121.  * Revision 1.4  1993/10/10  19:28:46  Aussem
  122.  * define for uumail:
  123.  *
  124.  * Revision 1.3  1993/09/18  16:47:47  Aussem
  125.  * insert GNU license text in the header
  126.  *
  127.  * Revision 1.2  1993/09/10  01:50:41  Aussem
  128.  * moved uulib:-files to uulib:mail/-files
  129.  * new support for wCNews styled logfile as MAILLOG
  130.  *
  131.  * Revision 1.1  1993/09/08  16:25:48  Aussem
  132.  * Initial revision
  133.  *
  134.  *
  135.  */
  136.  
  137. /* actual version */
  138. #define SMAIL_VERSION "1.0"
  139.  
  140. #if defined(AMIGA)
  141. #define GETHOSTNAME            /* use gethostname() */
  142. #else
  143. #define UNAME                 /* use uname() */
  144. #endif
  145.  
  146. /* if defined, HOSTNAME overrides UNAME and GETHOSTNAME */
  147. /*#define HOSTNAME    "nadia"        /* literal name */
  148.  
  149. /* #define HOSTDOMAIN    "host.dom"    /* overrides default HOSTNAME.MYDOM */
  150.  
  151. /*
  152.  * .UUCP here is just for testing, GET REGISTERED in COM, EDU, etc.
  153.  * See INFO.REGISTRY for details.
  154.  */
  155.  
  156. /*#define MYDOM        ".UUCP"        /* literal domain suffix */
  157.  
  158. /*
  159.  * WARNING: DOMGATE is only for qualified gateways - use caution.
  160.  * If you don't fully understand it - don't use it!
  161.  * If you are not completely sure you need it - don't use it!
  162.  * If you are not prepared to handle all addresses to MYDOM - don't use it!
  163.  *
  164.  * if defined, DOMGATE (DOMain GATEway) will cause addresses of the form
  165.  *
  166.  *    user@@MYDOM or MYDOM!user
  167.  *
  168.  * (with and without the leading '.' on MYDOM)
  169.  * to be seen treated simply 'user' - a purely local address.
  170.  * Then, it is left to the aliasing code to map it back to a
  171.  * non-local address if necessary.
  172.  */
  173.  
  174. /* #define DOMGATE        /* Act as Domain Gateway */
  175.  
  176. /*
  177.  * HIDDENHOSTS allows hosts that serve as domain gateways to hide
  178.  * the subdomains beneath them.  Mail that originates at any of
  179.  * the hosts in the subdomain will appear to come from the gateway host.
  180.  * Hence, mail from
  181.  *
  182.  *         anything.hostdomain!user
  183.  *
  184.  * will appear to come from 
  185.  *
  186.  *         hostdomain!user
  187.  *
  188.  * A consequence is that return mail to hostdomain!user would need to
  189.  * be forwarded to the proper subdomain via aliases or other forwarding
  190.  * facilities.
  191.  *
  192.  * If you're using sendmail, then if defined here,
  193.  * it should be used in ruleset 4 of the sendmail.cf, too.
  194.  */
  195.  
  196. /* #define HIDDENHOSTS            /* hide subdomains of hostdomain */
  197.  
  198. /*
  199.  * Mail that would otherwise be undeliverable will be passed to the
  200.  * aliased SMARTHOST for potential delivery.
  201.  *
  202.  * Be sure that the host you specify in your pathalias input knows that you're
  203.  * using it as a relay, or you might upset somebody when they find out some
  204.  * other way.  If you're using 'foovax' as your relay, and below you have
  205.  * #define SMARTHOST "smart-host", then the pathalias alias would be:
  206.  *
  207.  *    smart-host = foovax
  208.  * 
  209.  * You can use SMSmarthost in uulib:config to determinate an smarthost
  210.  */
  211.  
  212. /*#define SMARTHOST  "unido"    /* pathalias alias for relay host */
  213.  
  214. /*  SMARTMAIL
  215. **  if no paths file does not exists or the path to smarthost
  216. **  is not found, all mails will be directly be send to SMARTHOST
  217. **  (or the SMSmarthost in uulib:config)
  218. **           <smarthost>!<searched_domain>!<user>
  219. */
  220. #define SMARTMAIL
  221.  
  222. /*
  223. **  ALIAS and CASEALIAS are used only if SENDMAIL is NOT defined.
  224. **  Sites using sendmail have to let sendmail do the aliasing.
  225. **  LOWERLOGNAME maps all local login names into lower case.  This
  226. **  helps sites who have only upper case send mail to mixed case sites.
  227. */
  228.  
  229. #define ALIAS    "uulib:Mail/aliases"    /* location of mail aliases       */
  230. /* #define CASEALIAS            /* make aliases case sensitive    */
  231. /* #define LOWERLOGNAME            /* map local logins to lower case */
  232.  
  233. /*
  234.  * defining FULLNAME means that Full Name resolution
  235.  * will be attempted when necessary.
  236.  *
  237.  * the Full Name information will be taken from a
  238.  * list of {Full Name, address} pairs.
  239.  * The names in the list must be sorted
  240.  * without regard to upper/lower case.
  241.  *
  242.  * defining DOT_REQD says that the user name must contain a '.' for
  243.  * the Full Name search to be done.
  244.  *
  245.  * All full name searches are case insensitive.
  246.  *
  247.  */
  248.  
  249. #define FULLNAME    "uulib:Mail/fullnames" /* list of Full Name, address pairs */
  250.  
  251. /* #define DOT_REQD            /* Must be George.P.Burdell@@gatech.EDU
  252.                     ** not just  Burdell@@gatech.EDU
  253.                     */
  254.  
  255. /*
  256. **    PATHS is name of pathalias file.  This is mandatory.
  257. **    Define LOG if you want a log of mail.  This can be handy for
  258. **    debugging and traffic analysis.
  259. **    Define RECORD for a copy of all mail.  This uses much time and
  260. **    space and is only used for extreme debugging cases.
  261. */
  262.  
  263. #ifndef PATHS
  264. #define PATHS    "uulib:Mail/paths" /* location of the path database */
  265. #endif
  266.  
  267. /* Style ala DUUCP logfile */
  268. #define LOG    "uuspool:maillog"    /* log of uucp mail */
  269.  
  270. /* Attenttion all mails are logged here */
  271. #define RECORD    "NIL:"        /* record of uucp mail */
  272.  
  273. /* style ala wCNews logfile */
  274. #define MAILLOG "uulib:Mail/logfile"
  275.  
  276. /* File for BSMTP sites you directly call */
  277. #define BSMTPSITES "uulib:mail/bsmtp_sites"
  278.  
  279. /*
  280. **  Mailer options:
  281. **    RMAIL is the command to invoke rmail on machine sys.
  282. **    RARG is how to insulate metacharacters from RMAIL.
  283. **    LMAIL is the command to invoke the local mail transfer agent.
  284. **    BMAIL is the command to invoke the bsmtp mail transfer agent.
  285. **    LARG is how to insulate metacharacters from LMAIL.
  286. **    BARG is how to insulate metacharacters from BMAIL.
  287. **    RLARG is LARG with host! on the front - to pass a uux addr to sendmail.
  288. **    SENDMAIL selects one of two sets of defines below for either
  289. **    using sendmail or /bin/lmail.
  290. */    
  291.  
  292. #ifndef UUX
  293. #define UUX        "uux"    /* location of uux command   */
  294. #endif
  295.  
  296. #ifndef SMAIL
  297. #define SMAIL        "smail"    /* location of smail command */
  298. #endif
  299.  
  300. #ifndef UUMAIL
  301. #define UUMAIL "uumail:"
  302. #endif
  303.  
  304. #ifndef UUBATCH
  305. #define UUBATCH "uuspool:batch/"
  306. #endif
  307.  
  308. /*
  309. ** command used to retry failed mail, flag is used to set the routing level.
  310. */
  311. #define VFLAG        ((debug == VERBOSE)?"-v":"")
  312. #define RETRY(flag)    "%s %s %s -F %s ", SMAIL, VFLAG, flag, spoolfile
  313.  
  314. /*
  315. ** use the -a if you have it.  This sometimes helps failed mail and warning
  316. ** messages get back to where the mail originated.
  317. **
  318. ** some versions of uux can't do '-a' - pick one of the next two definitions
  319. */
  320.  
  321. /* #define RMAIL(flags,from,sys) "%s -a%s %s - %s!rmail",UUX,from,flags,sys /* */
  322. /*#define RMAIL(flags,from,sys) "%s %s - %s!rmail",UUX,flags,sys /* */
  323. #define RMAIL(flags,from,sys) "%s %s %%s \"%s!rmail",UUX,flags,sys /* */
  324.  
  325. #define RARG(user)        " %s",user
  326. #define RFROM(frm,now,host)     "From %s  %.24s remote from %s\n",frm,now,host
  327.  
  328. #define HANDLE    ALL
  329. #define ROUTING REROUTE
  330.  
  331. #define LMAIL(frm,sys)        "mail %%s ",frm
  332. #define BMAIL(sys,myhost)        "batch_smtp %%s %s %s",sys,myhost
  333. #define LARG(user)        " %s",postmaster(user)
  334. #define BARG(user)        "RCPT TO:<%s>\n",user
  335. #define RLARG(sys,frm)        " %s!%s",sys,frm
  336. #define LFROM(frm,now,host)    "From %s %.24s\n",frm,now
  337.  
  338. /*
  339. **    The following definitions affect the queueing algorithm for uux.
  340. **
  341. **    DEFQUEUE    if defined the default is to queue uux mail
  342. **
  343. **    QUEUECOST    remote mail with a cost of less than QUEUECOST
  344. **            will be handed to uux for immediate delivery.
  345. **
  346. **    MAXNOQUEUE    don't allow more than 'n' immediate delivery
  347. **            jobs to be started on a single invocation of smail.
  348. **    
  349. **    GETCOST        if defined, the paths file will be searched for
  350. **            each address to discover the cost of the route.
  351. **            this allows informed decisions about whether to
  352. **            use the queue flags when calling uux.  The price
  353. **            is in the overhead of a paths file search for
  354. **            addresses that are not going to be routed.
  355. */
  356.  
  357. #define DEFQUEUE            /* default is to queue uux jobs */
  358.  
  359. #define QUEUECOST        300    /* deliver immediately if the cost
  360.                     /* is DEMAND or better */
  361.  
  362. #define MAXNOQUEUE        2    /* max UUX_NOQUEUE jobs         */
  363.  
  364. #define GETCOST                /* search for cost        */
  365.  
  366. #define UUX_QUEUE        ""    /* uux flag for queueing    */
  367. #define UUX_NOQUEUE        ""    /* uux with immediate delivery    */
  368.  
  369. /*
  370. ** Normally, all mail destined for the local host is delivered with a single
  371. ** call to the local mailer, and all remote mail is delivered with one call
  372. ** to the remote mailer for each remote host.  This kind of 'batching' saves
  373. ** on the cpu overhead.
  374. **
  375. ** MAXCLEN is used to limit the length of commands that are exec'd by smail.
  376. ** This is done to keep other program's buffers from overflowing, or to
  377. ** allow for less intelligent commands which can take only one argument
  378. ** at a time (e.g., 4.1 /bin/mail).  To disable the batching, set MAXCLEN
  379. ** a small value (like 0).
  380. */
  381.  
  382. #define MAXCLEN            0    /* longest command allowed (approx.)
  383.                     /* this is to keep other's buffers
  384.                     ** from overflowing
  385.                     */
  386.  
  387. /*
  388. ** PLEASE DON'T TOUCH THE REST
  389. */
  390.  
  391. #define SMLBUF    512    /* small buffer (handle one item) */
  392. #define BIGBUF    4096    /* handle lots of items */
  393.  
  394. #define MAXPATH    128    /* number of elements in ! path */
  395. #define MAXDOMS    64    /* number of subdomains in . domain */
  396. #define MAXARGS    500    /* number of arguments */
  397. #ifndef NULL
  398. #define NULL    0
  399. #endif
  400.  
  401. #define DEBUG         if (debug==YES) (void) printf
  402. #define ADVISE         if (debug!=NO) (void) printf
  403. #define error(stat,msg,a)    { (void) fprintf(stderr, msg, a); exit(stat); }
  404. #define lower(c)         ( isupper(c) ? c-'A'+'a' : c )
  405. /* max line length */
  406. #define MAXLINE 60
  407.  
  408. enum eform {    /* format of addresses */
  409.     ERROR,         /* bad or invalidated format */
  410.     LOCAL,         /* just a local name */
  411.     DOMAIN,     /* user@@domain or domain!user */
  412.     UUCP,        /* host!address */
  413.     ROUTE,        /* intermediate form - to be routed */
  414.     SENT        /* sent to a mailer on a previous pass */
  415. };
  416.  
  417. enum ehandle {     /* what addresses can we handle? (don't kick to LMAIL) */
  418.     ALL,        /* UUCP and DOMAIN addresses */
  419.     JUSTUUCP,    /* UUCP only; set by -l  */
  420.     NONE        /* all mail is LOCAL; set by -L */
  421. };
  422.  
  423. enum erouting {    /* when to route A!B!C!D */
  424.     JUSTDOMAIN,    /* route A if A is a domain */
  425.     ALWAYS,        /* route A always; set by -r */
  426.     REROUTE        /* route C, B, or A (whichever works); set by -R */
  427. };
  428.  
  429. enum edebug {    /* debug modes */
  430.     NO,        /* normal deliver */
  431.     VERBOSE,    /* talk alot */
  432.     YES        /* talk and don't deliver */
  433. };
  434.  
  435.  
  436. #include <string.h>
  437. #include "sysexits.h"
  438. #ifndef GENPROTO
  439. #include "pwd.h"
  440. typedef struct alias_node node;
  441. typedef struct pw_node pwlist;
  442.  
  443. #include "protos.h"
  444. #endif
  445. @
  446.  
  447.  
  448. 1.11
  449. log
  450. @MAXLINE inserted
  451. @
  452. text
  453. @d20 3
  454. d315 2
  455. a316 2
  456. #define MAXPATH    32    /* number of elements in ! path */
  457. #define MAXDOMS    16    /* number of subdomains in . domain */
  458. @
  459.  
  460.  
  461. 1.10
  462. log
  463. @VERSION is now again in defs.h
  464. @
  465. text
  466. @d20 3
  467. d323 2
  468. a324 1
  469.  
  470. @
  471.  
  472.  
  473. 1.9
  474. log
  475. @VERSION defined removed
  476. now stored in global var version
  477. @
  478. text
  479. @d20 4
  480. d52 2
  481. a53 1
  482. /*#define SENDMAIL "sendmail"    /* Turn off to use /bin/(l)mail only */
  483. a242 12
  484. #ifdef SENDMAIL
  485.  
  486. #define HANDLE    JUSTUUCP    /* see HANDLE definition below */
  487. #define ROUTING JUSTDOMAIN    /* see ROUTING definition below */
  488.  
  489. #define LMAIL(frm,sys)     "%s -em -f%s",SENDMAIL,frm
  490. #define LARG(user)        " %s",postmaster(user)
  491. #define RLARG(sys,frm)        " %s!%s",sys,frm
  492. #define LFROM(frm,now,host)    "From %s %.24s\n",frm,now
  493.  
  494. #else
  495.  
  496. a251 2
  497.  
  498. #endif
  499. @
  500.  
  501.  
  502. 1.8
  503. log
  504. @Version string rewritten
  505. @
  506. text
  507. @d20 3
  508. a46 5
  509.  
  510.  
  511. #ifndef VERSION
  512. #define    VERSION    "Smail Amiga"
  513. #endif
  514. @
  515.  
  516.  
  517. 1.7
  518. log
  519. @insert BSMTPSITES and UUBATCH
  520. @
  521. text
  522. @d20 3
  523. d47 1
  524. a47 1
  525. #define    VERSION    "smail 2.5/Amiga"
  526. @
  527.  
  528.  
  529. 1.6
  530. log
  531. @insert in BARG a \n
  532. @
  533. text
  534. @d20 3
  535. d185 3
  536. d211 4
  537. @
  538.  
  539.  
  540. 1.5
  541. log
  542. @BARG and BMAIL for bsmtp mails inserted
  543. @
  544. text
  545. @d20 3
  546. d245 1
  547. a245 1
  548. #define BARG(user)        "RCPT TO:<%s>",user
  549. @
  550.  
  551.  
  552. 1.4
  553. log
  554. @define for uumail:
  555. @
  556. text
  557. @d20 3
  558. d184 1
  559. d186 1
  560. d240 1
  561. d242 1
  562. @
  563.  
  564.  
  565. 1.3
  566. log
  567. @insert GNU license text in the header
  568. @
  569. text
  570. @d20 3
  571. d181 1
  572. a181 1
  573. **    LARG is how to insulate metacharacters from LMAIL. 
  574. d193 4
  575. @
  576.  
  577.  
  578. 1.2
  579. log
  580. @moved uulib:-files to uulib:mail/-files
  581. new support for wCNews styled logfile as MAILLOG
  582. @
  583. text
  584. @d5 4
  585. a8 5
  586.  *  Configuration options for rmail/smail.
  587.  *    default configuration is:
  588.  *    full domain name is 'hostname.uucp' (get registered!)
  589.  *    path file is /usr/lib/uucp/paths.
  590.  *    no log, no record, use sendmail.
  591. d10 4
  592. a13 1
  593.  *  You can change these in the next few blocks.
  594. d15 4
  595. d20 4
  596. @
  597.  
  598.  
  599. 1.1
  600. log
  601. @Initial revision
  602. @
  603. text
  604. @d13 3
  605. a15 1
  606.  * $Log$
  607. d17 1
  608. d116 1
  609. a116 1
  610. #define ALIAS    "uulib:aliases"    /* location of mail aliases       */
  611. d136 1
  612. a136 1
  613. #define FULLNAME    "uulib:fullnames" /* list of Full Name, address pairs */
  614. d151 1
  615. a151 1
  616. #define PATHS    "uulib:paths" /* location of the path database */
  617. d154 1
  618. d156 2
  619. d159 3
  620. @
  621.