home *** CD-ROM | disk | FTP | other *** search
/ Media Share 9 / MEDIASHARE_09.ISO / network / wnos4doc.zip / WNOS4DOC.EXE / NOSMBOX.TXT < prev    next >
Text File  |  1991-02-22  |  24KB  |  793 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.       NOS mail docs -- G4AMJ/NQ0I and SM0RGV (Rev. 3)
  8.  
  9.  
  10. 1.  Introduction
  11.  
  12.  
  13. This section of the NOS docs deals with the intricacies of
  14. mail forwarding. You should read and understand this
  15. documentation thoroughly before attempting to forward mail
  16. through your NOS box to the AX.25 BBS world, otherwise you
  17. might grossly misconfigure your system and be the unhappy
  18. recipient of flames from BBS sysops.
  19.  
  20. This section does NOT deal with the minutae of the mailbox
  21. and its various commands; it assumes that you understand
  22. concepts such as user areas (both public and private) and
  23. how to list and send mail. If you need help with these,
  24. please look elsewhere in the NOS docs.
  25.  
  26. Apart from the usual domain.txt and other files necessary
  27. for ordinary functionality of NOS, three files are important
  28. in the mail forwarding process. These are :
  29. /spool/forward.bbs, /alias and /spool/rewrite. The contents
  30. of these will now be addressed individually.
  31.  
  32.  
  33. 2.  /spool/forward.bbs
  34.  
  35.  
  36. This file describes the actions taken by NOS in forwarding
  37. to AX.25 BBSes. The file contains a series of forwarding
  38. records, each record being separated by a line containing
  39. two or more hyphens. The template for a forwarding record
  40. is:
  41.  
  42. BBS callsign
  43. Connection route
  44. Connection commands                <zero or more lines>
  45. List of areas to be forwarded      <one per line>
  46. ------------                       <end of record>
  47.  
  48.  
  49. 2.1.  BBS callsign
  50.  
  51.  
  52. This is simply the ordinary call of the remote BBS. A
  53. typical (but not random!) entry might be simply the line:
  54.  
  55. sm0rgv
  56.  
  57. The callsign may be followed, on the same line, by a comma
  58. separated list of valid intervals when forwarding is to take
  59. place. Each valid interval is a four digit number: the first
  60. two digits are the beginning hour of the valid interval, the
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.                            - 2 -
  71.  
  72.  
  73. last two digits are the final hour of the valid interval.
  74. For example, if the first line of a forwarding record looks
  75. like:
  76.  
  77. sm0rgv 0006,1414
  78.  
  79. then forwarding to sm0rgv will take place only during hours
  80. numbered 00, 01, 02, 03, 04, 05, 06 and 14. Ticks of the
  81. mbox timer outside of these times will not cause mail to be
  82. forwarded to sm0rgv. The default interval for forwarding is
  83. 0023.
  84.  
  85.  
  86. 2.2.  Connection route
  87.  
  88.  
  89. This is the method by which communication is to be
  90. established with the remote BBS. The first token on the line
  91. is the type of protocol to be used. This is one of ax25,
  92. netrom or tcp. Following this is whatever further
  93. information the chosen protocol requires to make the
  94. connection. An example connection route for a simple ax25
  95. connection on interface ax0 is:
  96.  
  97. ax25 ax0 g3dlh
  98.  
  99.  
  100. 2.3.  Connection commands
  101.  
  102.  
  103. Connection commands may, optionally, follow the connection
  104. route. These take the form of a full stop (period), followed
  105. by the command which will be transmitted once the connection
  106. defined in the first line of the connection route is
  107. established.
  108.  
  109. For example, suppose that we wish to establish a netrom
  110. connection with sm0rgv-2, through the netrom node #sth67.
  111. Then the connection route and connection command portion of
  112. the record would look like:
  113.  
  114. netrom #sth67
  115.  .c sm0rgv-2     [ Please note that the full stop would be placed at
  116.                    the beginning of the line; I have placed it here
  117.                    indented by one column simply so that gateways
  118.                    which handle this message do not complain at
  119.                    having a line beginning with a full stop; this
  120.                    convention is followed throughout this documentation]
  121.  
  122.  
  123. If the station is reached through digipeating, then the
  124. digipeater callsigns should be in the ax25 route to the
  125. destination callsign. That is, if you wish to forward
  126. traffic to w0ljf, using k2na as a digipeater, then you
  127.  
  128.  
  129.  
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.                            - 3 -
  137.  
  138.  
  139. should have the line:
  140.  
  141. ax25 route add w0ljf k2na
  142.  
  143. in your autoexec file.
  144.  
  145.  
  146. 2.4.  List of areas to be forwarded
  147.  
  148.  
  149. This is a list, one per line, of entries in the /spool/mail
  150. directory which will be forwarded to the remote BBS. An
  151. entry of the form:
  152.  
  153. callsign
  154.  
  155. will cause the file /spool/mail/callsign.txt to be scanned
  156. for unread messages. Any such messages are sent to the
  157. remote BBS and deleted from the file.
  158.  
  159. One can also forward user areas using this mechanism. To do
  160. this, simply place a line containing the name of the area in
  161. the record. So, to forward amsat bulletins to the BBS, one
  162. would have a line:
  163.  
  164. amsat
  165.  
  166. This will search the /spool/mail/amsat.txt file; any
  167. messages contained therein which have not been forwarded to
  168. the BBS in question will be forwarded. They will NOT be
  169. deleted. The determining factor as to whether or not entries
  170. are deleted is that if the filename is present in the
  171. /spool/areas file, then there is NO deletion, otherwise
  172. there is.
  173.  
  174. Please note that ONLY FILES IN /spool/mail are checked. In
  175. particular, the outbound SMTP mail queue is NOT checked.
  176.  
  177.  
  178. 2.5.  Changing the recipient address
  179.  
  180.  
  181. Normally, NOS uses the information in the To: header line to
  182. determine the parameters used by the "S" command during BBS
  183. forwarding. As the To: header is unchanged by all /alias and
  184. /spool/rewrite machinations, the mail will be sent to the
  185. BBS addressed precisely as the originator of the message
  186. typed it. Occasionally, one might want to change this
  187. behaviour. In this case, a line of the form:
  188.  
  189. area  newaddress
  190.  
  191. in the list of areas to be forwarded will replace the
  192. originally typed destination with the string newaddress
  193.  
  194.  
  195.  
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202.                            - 4 -
  203.  
  204.  
  205. instead.
  206.  
  207.  
  208. 3.  /alias
  209.  
  210.  
  211. The alias file is used to map LOCAL names to other names,
  212. which may be either local or remote; additionally, from a
  213. single input message, the alias file permits one to produce
  214. multiple output messages. Thus, typical uses for the /alias
  215. file are: converting one local name to another, converting a
  216. local name to a remote name, and exploding a mail message so
  217. that it is passed on to several recipients.
  218.  
  219. The format of a record in the alias file is very simple:
  220.  
  221. aliasname       recipient1 recipient2 recipient3
  222. <tab> or <SP>   recipient4 ... recipientN
  223.  
  224.  
  225. There is no separation between records in the /alias file
  226. other than a newline.
  227.  
  228. The aliasname is a local username; that is, it does not
  229. contain an "@" symbol. When the alias file is processed, if
  230. the destination of the message matches precisely the
  231. aliasname, then the mail is redirected to ALL of the
  232. alieased recipients.
  233.  
  234. Scanning of the /alias file is performed by the SMTP server.
  235. The SMTP timer (which controls the SMTP client) is kicked
  236. whenever the mailbox or SMTP server queues something for
  237. delivery by SMTP. Mail transport within a single NOS system
  238. is performed through the SMTP client/server mechanism. The
  239. result of these facts is that as soon as a piece of mail is
  240. entered to the mailbox, the SMTP client is kicked and
  241. attempts to deliver the mail (which has already been scanned
  242. by the rewrite mechanism - see below). If the mail is local
  243. to the NOS system (i.e. no "@" sign in the address), then
  244. the /alias file will be scanned and the name mappings take
  245. place.
  246.  
  247. A few lines in the /alias file might look something like:
  248.  
  249. bdale   bdale@n3eua
  250. local   fred@k0yum bdale@n3eua bill@ai0c.co.usa.na
  251.         n5op@n5op jim@k0jtz n0esg@n0esg
  252. g4bki   g4bki@gb7bil.2712.gbr.eu
  253.  
  254.  
  255. The system must know how to deliver traffic to each of the
  256. individual addresses in the style in which they are entered
  257. in the /alias file. If the system does not know how to
  258. deliver one of the new addresses, then it will send it to
  259.  
  260.  
  261.  
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268.                            - 5 -
  269.  
  270.  
  271. the SMTP gateway station defined by the 'smtp gateway'
  272. command.
  273.  
  274. Note that it is reasonable, and sometimes desireable, to
  275. have alias records of the form:
  276.  
  277. area    area dest1 dest2 ...
  278.  
  279. As the /alias file is scanned only once (see below), this
  280. does not result in an infinite recursion.
  281.  
  282.  
  283. 4.  /spool/rewrite
  284.  
  285.  
  286. The rewrite file is used to perform a one-to-one mapping
  287. between destination addresses as received by NOS and
  288. destination addresses as actually used by NOS. Each record
  289. within the rewrite file comprises a single line, containing
  290. either two or three entries separated by spaces. The first
  291. field is the template field; if a destination address
  292. matches the template, it is replaced by the second field.
  293. The third field, which is optional, is the single letter
  294. "r", which, if present, tells NOS to rescan the rewrite
  295. file, using the new destination address to attempt to match
  296. against the templates.
  297.  
  298. A template may contain asterisks. These stand for a match of
  299. any number of characters (including zero). In the second
  300. field, the character "$", followed by a single digit in the
  301. range 1 to 9, represents the string that matched the
  302. respective asterisk in the template. By way of example,
  303. suppose that there is a line in the rewrite file which looks
  304. like:
  305.  
  306. *@* $1%$2@g1emm.ampr.org
  307.  
  308. Then, any traffic reaching the system through the mailbox or
  309. the SMTP server, but which is supposed to go to a remote
  310. system, will be redirected to go through g1emm.ampr.org.
  311. Suppose that a user logs on, and sends a message to
  312. n0gbe@nq0i. Then the rewrite file attempts to match
  313. "n0gbe@nq0i" against the entry *@*. It matches, and assignes
  314. $1 the value n0gbe, and $2 the value nq0i. The mail file as
  315. written to the disk will no longer be to n0gbe@nq0i, but,
  316. rather, to n0gbe%nq0i@g1emm.ampr.org. [The nomenclature
  317. station1%station2@station3 means the final destination is
  318. station1@station2, and this traffic is to be routed through
  319. the gateway station3.]
  320.  
  321. As soon as a template match is found, the conversion is
  322. performed and scanning is stopped, unless the third "r"
  323. field is present, in which case scanning restarts from the
  324. top of the file.
  325.  
  326.  
  327.  
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334.                            - 6 -
  335.  
  336.  
  337. N.B. It is a good idea to have a line of the form:
  338.  
  339. *@*.ampr.org $1@$2.ampr.org
  340.  
  341. at the beginning of your rewrite file. This will cause all
  342. amprnet traffic to be caught early in the rewrite scan, and
  343. no further scanning (and, hence, no unexpected
  344. substitutions) will take place.
  345.  
  346.  
  347. 5.  Scanning procedure
  348.  
  349.  
  350. The two files which are used to determine the disposition of
  351. traffic are scanned under slightly different circumstances.
  352. Note that neither the /alias nor the /spool/rewrite scan
  353. makes any actual changes to the contents of the traffic. In
  354. particular, the To: field remains exactly as it was first
  355. entered into the system.
  356.  
  357. There are four possible entry routes for traffic into the
  358. system: SMTP, through the mailbox by a user, through the
  359. mailbox by a BBS, and via an external program (like BM) or
  360. creation of the files manually. NOS determines if a piece of
  361. traffic was entered into the system by a BBS by looking for
  362. a BBS system ID (like the "[NET-H$]" block issued by NOS) on
  363. the incoming connection prior to messages being uploaded.
  364.  
  365.  
  366. 5.1.  Traffic received by SMTP server
  367.  
  368.  
  369. 1. The rewrite file is scanned and any changes applied
  370. (unless the traffic was recieved through the local mailbox;
  371. in that case, this step does not occur);
  372. 2. If the traffic appears to be local then the alias file is
  373. scanned and any changes or explosions applied.
  374. 3. Any copies local to the system are delivered; copies for
  375. remote delivery are placed in the SMTP queue.
  376.  
  377.  
  378. 5.2.  Traffic received by mailbox from user
  379.  
  380.  
  381. 1. The rewrite file is scanned and any changes applied;
  382. 2. The traffic is passed to the SMTP client.
  383.  
  384.  
  385. 5.3.  Traffic received by mailbox from BBS
  386.  
  387.  
  388. 1. The rewrite file is scanned and any changes applied;
  389. 2. The traffic is passed to the SMTP client.
  390.  
  391.  
  392.  
  393.  
  394.  
  395.  
  396.  
  397.  
  398.  
  399.  
  400.                            - 7 -
  401.  
  402.  
  403. 5.4.  Traffic entered by external mechanism
  404.  
  405.  
  406. 1. No scanning occurs;
  407.  
  408. 2. The traffic is passed to the SMTP client.
  409.  
  410.  
  411. 6.  Headers
  412.  
  413.  
  414. Appropriate RFC-822 headers are added to all incoming
  415. traffic. Traffic entering through the mailbox recieves a
  416. full complement of RFC-822 headers; traffic coming through
  417. the SMTP server has only a "Received:" header applied. On
  418. forwarding to a BBS, if an item of traffic contains BBS R:
  419. headers, the RFC-822 header is converted to an appropriate
  420. R: line at the time that NOS forwards the message. (This
  421. change only occurs for BBS forwarding; forwarding by SMTP
  422. retains the RFC-822 headers.)
  423.  
  424.  
  425. 7.  Bulletin Identifiers (BIDs)
  426.  
  427.  
  428. The AX.25 BBS system has evolved a reasonably efficient way
  429. of reducing overhead when forwarding bulletins. When a
  430. bulletin is originated on a BBS, it is given a unique
  431. bulletin identifier (BID). This BID should (theoretically)
  432. travel with the bulletin, and should never be changed during
  433. the distribution of the bulletin. Each system keeps track of
  434. all received BIDs. If a forwarding station wishes to forward
  435. a bulletin to a BBS, then the receiving station checks its
  436. local list of known BIDs and informs the transmitting
  437. station if it already posesses the bulletin in question. The
  438. NOS mailbox conforms to this protocol. Received BIDs are
  439. stored in the file /spool/history, and are encoded in the
  440. Message-ID: header line of the message by NOS. Messages
  441. forwarded from areas listed in the /areas file will have
  442. their BID (re)generated from the Message-ID: line. Note that
  443. ALL messages from public areas are forwarded with a BID,
  444. whether or not the message was produced with the "SB"
  445. command. Like other BBSes, NOS will inform a transmitting
  446. station not to transmit a bulletin if it is one that NOS
  447. already has locally; likewise, it understands similar
  448. messages from other stations to which it tries to forward.
  449.  
  450. Note that the BID mechanism is not a part of the SMTP world.
  451. If you are forwarding bulletins through SMTP, there is no
  452. mechanism by which the receiving station can reject the
  453. attempted delivery of a bulletin, even if it already exists
  454. on the recipient system. (Note that a possible workaround is
  455. to deliver bulletins to TCP/IP stations using TCP instead of
  456. SMTP. Alternatively, one could use NNTP, as NNTP commands
  457.  
  458.  
  459.  
  460.  
  461.  
  462.  
  463.  
  464.  
  465.  
  466.                            - 8 -
  467.  
  468.  
  469. utilise the Message-ID: line, from which the BID is
  470. derived.) The BID is preserved no matter which mechanism is
  471. used to deliver the bulletin.
  472.  
  473.  
  474. 8.  Traffic in practice
  475.  
  476.  
  477. Now, the big question is, how does one set up these various
  478. files to perform intelligent manipulation of mail? A number
  479. of examples follow. Note that, often, there is more than one
  480. way to accomplish an objective. The following are merely
  481. examples (and not necessarily the most efficient method
  482. possible for any given case). The format used will be:
  483.  
  484. typed destination -> intended destination
  485.  
  486. followed by the necessary entries in the alias (/alias),
  487. rewrite (/spool/rewrite) and forwarding (/spool/forward.bbs)
  488. files.
  489.  
  490.  
  491. 8.1.  Using familiar names - SMTP destination
  492.  
  493.  
  494. bdale -> bdale@n3eua.ampr.org
  495.  
  496. alias:
  497. bdale   bdale@n3eua.ampr.org
  498.  
  499. rewrite:
  500. forward:
  501.  
  502.  
  503. 8.2.  Exploding local mail
  504.  
  505.  
  506. sysops -> nq0i, n5op@n5op.ampr.org
  507.  
  508. alias:
  509. sysops  nq0i n5op@n5op@ampr.org
  510.  
  511. rewrite:
  512. forward:
  513.  
  514.  
  515. 8.3.  Using familiar names - BBS forwarding
  516.  
  517.  
  518. g4bki -> g4bki@gb7bil.2712.gbr.eu, to be forwarded by ai0c
  519.  
  520. alias:
  521. rewrite:
  522. forward:
  523.  
  524.  
  525.  
  526.  
  527.  
  528.  
  529.  
  530.  
  531.  
  532.                            - 9 -
  533.  
  534.  
  535. ai0c
  536. ax25 ax1 ai0c
  537. g4bki g4bki@gb7bil.2712.gbr.eu
  538. ai0c
  539.  
  540.  
  541. 8.4.  Handling incoming bulletins by subject
  542.  
  543.  
  544. tcpip@* -> nq0i, tcpip, bdale@n3eua.ampr.org, ai0c@ai0c [a BBS]
  545.  
  546. alias:
  547. tcpip   nq0i tcpip bdale@n3eua.ampr.org ai0c
  548.  
  549. rewrite:
  550. tcpip@* tcpip
  551.  
  552. forward:
  553. ai0c
  554. ax25 ai0c
  555. ai0c
  556.  
  557. Let's walk through the above example. An incoming item comes
  558. in addressed to TCPIP@ALLUS. A scan is made through the
  559. rewrite file, and a match is found. The item is redirected
  560. to tcpip. The alias file is scanned; a total of four copies
  561. of the item exist after this, three in local areas tcpip,
  562. nq0i and ai0c, and one on the SMTP queue (for
  563. bdale@n3eua.ampr.org). When the mailbox timer next ticks,
  564. the mail in the local ai0c area will be forwarded on the ax1
  565. interface to ai0c.
  566.  
  567.  
  568. 8.5.  Routing based on Hierarchical addressing
  569.  
  570.  
  571. Wyoming -> KE7VS (SMTP)
  572. Nebraska -> AG0N (BBS over the NETROM, NETROM ID WNBBS)
  573. Europe -> W0LJF (BBS over AX.25)
  574.  
  575. alias:
  576. rewrite:
  577. *.noam            $1.na r
  578. *.us              $1.usa.na r
  579. *.usa             $1.usa.na r
  580.  
  581. *.ne              $1.ne.usa.na r
  582. *.wy              $1.wy.usa.na r
  583.  
  584. *@*.*.wy.usa.na   $1%$2.$3.wy.usa.na@ke7vs
  585. *@*.wy.usa.na     $1%$2.wy.usa.na@ke7vs
  586.  
  587. *.ne.usa.na     ag0n
  588.  
  589.  
  590.  
  591.  
  592.  
  593.  
  594.  
  595.  
  596.  
  597.  
  598.                            - 10 -
  599.  
  600.  
  601. *.eu            w0ljf
  602.  
  603. forward:
  604. ag0n
  605. netrom ax0 wnbbs
  606. ag0n
  607. ----------
  608. w0ljf
  609. ax25 ax1 w0ljf
  610. w0ljf
  611. ----------
  612.  
  613. Why is the example rewrite file apparently so complicated?
  614. This is to handle poorly constructed hierarchical addresses
  615. in a reasonable way. A full U.S. hierarchical address has
  616. the form: callsign@BBS.#localid.state.usa.na. Many states
  617. have no #localid field. In the example rewrite file above,
  618. the first three lines convert non-standard, but frequently
  619. used, U.S. designators to the more standard format. It is
  620. common for users not to use a full hierarchical address if
  621. the destination is relatively local. For eample, a user
  622. might easily use only .wy instead of the full .wy.usa.na if
  623. he is geographically close to Wyoming. The second grouping
  624. of two lines handles this problem. Note the third, "r",
  625. field in all the entries so far.
  626.  
  627. The remainder of the file handles properly formatted
  628. hierarchical addresses. The two Wyoming entries handle the
  629. cases with and without a #localid field. Differentiation
  630. between these cases is not necessary for BBS forwarding.
  631.  
  632.  
  633. 8.6.  General bulletin handling
  634.  
  635.  
  636. The details of bulletin handling will vary somewhat from
  637. place to place, as there are several distinct styles of
  638. bulletin handling currently in use in the AX.25 BBS world.
  639. In general, it is necessary to arrange one's system so that
  640. it accepts bulletins from BBSes, forwards them to one or
  641. more stations, and also handles intelligently bulletins
  642. input by users into NOS.
  643.  
  644. Suppose that we sish to handle bulletins @JUNK. We are to
  645. deposit them locally in the junk area, and also forward to
  646. BBS g4bki. We also know that we generally receive @JUNK
  647. bulletins from g4amj, a local BBS which handles much
  648. bulletin traffic.
  649.  
  650.  
  651. alias:
  652. rewrite:
  653. *@junk   junk
  654.  
  655.  
  656.  
  657.  
  658.  
  659.  
  660.  
  661.  
  662.  
  663.  
  664.                            - 11 -
  665.  
  666.  
  667. forward:
  668. g4bki
  669. ax25 ax1 g4bki
  670. g4bki
  671. junk
  672. ----------
  673. g4amj
  674. ax25 ax1 g4amj
  675. g4amj
  676. junk
  677. ----------
  678.  
  679. All incoming @JUNK traffic is written to the junk area
  680. (which should be an explicit entry in the /spool/areas
  681. file). Each tick of the mailbox timer, NOS scans the junk
  682. area for traffic not forwarded to g4bki or g4amj and
  683. attempts to deliver unforwarded bulletins. Usually, g4amj
  684. will respond with a "Have it" message and the bulletin will
  685. not be forwarded. Any bulletins @JUNK deposited locally by
  686. users will automatically be sent to both g4bki and g4amj.
  687.  
  688.  
  689. 9.  Questions and Answers
  690.  
  691.  
  692. Q. Under what circumstances does NOS request reverse
  693. forwarding from a BBS?
  694.  
  695. A. NOS requests a reverse forward after completing any
  696. forwards of its own to the BBS. If no traffic was queued for
  697. a given BBS, then no connection is attempted, so no reverse
  698. forward request is issued.
  699.  
  700.  
  701. Q. What kinds of message types does the NOS mbox support?
  702.  
  703. A. Basically, NOS supports all two letter commands starting
  704. with an "S". If the mailbox has not received an SID banner
  705. (the "[NET-H$]") from a connected station, then an SF
  706. command will send a followup to the address specified on the
  707. command line. The SR command will send a reply to the
  708. current message. One can also issue the command "SR
  709. <number>", where <number> is the number of the message to
  710. which you want to generate a reply. All other variations
  711. cause an X-BBS-Msg-Type: header to be added to the message.
  712. When a message with such a line is forwarded to a BBS, it is
  713. sent to the BBS with the appropriate message type as the
  714. second letter in the "S" command to the BBS.
  715.  
  716. If NOS has received a valid SID, then ALL S commands are
  717. handled by the X-BBS-Msg-Type: mechanism outlined above.
  718.  
  719.  
  720.  
  721.  
  722.  
  723.  
  724.  
  725.  
  726.  
  727.  
  728.  
  729.  
  730.                            - 12 -
  731.  
  732.  
  733. 10.  Logic map of the mailbox
  734.  
  735.  
  736. ============== AX.25 === NET/ROM === Ethernet === Loopback =================
  737.        |                   |                   |                   |
  738.        |                   |                   |                   |
  739. +--------------+    +--------------+    +--------------+    +--------------+
  740. |              |    |              |    |              |    |              |
  741. |   Mailbox    |    | SMTP client  |    | SMTP server  |    | BBS Forward  |
  742. |              |    |              |    |              |    |              |
  743. +--------------+    +--------------+    +--------------+    +--------------+
  744.        |                   ^                   |                   ^
  745.        |                   |                   |                   |
  746.        v                   |                   v                   |
  747. +--------------+    +--------------+    +--------------+    +--------------+
  748. |              |    |              |    |              |    |              |
  749. | Add RFC822   |    | Use MX or A  |    | Add Received |    | Add own R:   |
  750. | header suite |    | type records |    | line         |  +>| line         |
  751. |              |    |              |    |              |  | |              |
  752. +--------------+    +--------------+    +--------------+  | +--------------+
  753.        |                   ^                   |          |        ^
  754.        |                   |                   |          |        |
  755.        v                   |                   v          |        |
  756. +--------------+    +--------------+    +--------------+  | +--------------+
  757. |              |    |              |    |              |  | |              |
  758. | Get Rewrite  |    | Use optional |    | Apply Rewrite|  | | Strip RFC822 |
  759. | file address |    | SMTP gateway |    | file address |  | | header suite |
  760. |              |    |              |    |              |  | |              |
  761. +--------------+    +--------------+    +--------------+  | +--------------+
  762.        |                   ^                   |          |        ^
  763.        |                   |                   |          |        | Yes
  764.        v                   |                   v          |        |
  765. +--------------+           |            +--------------+  | +--------------+
  766. |              |   No      |            |              |  | |              |
  767. | Local addr?  |-------+   |            | Alias file   |  +-| Any R: lines?|
  768. |              |       |   |            |              | No |              |
  769. +--------------+       |   |            +--------------+    +--------------+
  770.        |               |   |                |  |  |                ^
  771.        | Yes           |   |                |  |  |                |
  772.        v               |   |                v  v  v                |
  773. +--------------+       v   |            +--------------+    +--------------+
  774. |              |    +--------------+    |              |    |              |
  775. | Apply Rewrite|    |              | No | Local        |Yes | /spool/mail/ |
  776. | file address |--->| SMTP queue   |<---| address?     |--->| directory    |
  777. |              |    |              |    |              |    |              |
  778. +--------------+    +--------------+    +--------------+    +--------------+
  779.  
  780.  
  781.  
  782.  
  783.  
  784.  
  785.  
  786.  
  787.  
  788.  
  789.  
  790.  
  791.  
  792.  
  793.