setforward(1) setforward(1) NNAAMMEE setforward - create a forwarding database SSYYNNOOPPSSIISS sseettffoorrwwaarrdd _c_d_b _t_m_p DDEESSCCRRIIPPTTIIOONN sseettffoorrwwaarrdd reads a table of forwarding instructions from its standard input. It converts the table into a forwarding database. The forward- ing database can be used by ffaassttffoorrwwaarrdd. sseettffoorrwwaarrdd writes the forwarding database to _t_m_p; it then moves _t_m_p to _c_d_b. _t_m_p and _c_d_b must be on the same filesystem. If there is a problem creating _t_m_p, sseettffoorrwwaarrdd complains and leaves _c_d_b alone. The forwarding database format is portable across machines. IINNSSTTRRUUCCTTIIOONN FFOORRMMAATT A forwarding instruction contains a _t_a_r_g_e_t, a colon, a series of com- mands, and a semicolon. Each command is a _r_e_c_i_p_i_e_n_t _a_d_d_r_e_s_s, _o_w_n_e_r _a_d_d_r_e_s_s, _e_x_t_e_r_n_a_l _m_a_i_l_i_n_g _l_i_s_t, or _p_r_o_g_r_a_m. Commands are separated by commas. For example, root@yp.to: god@heaven.af.mil, staff@af.mil; says that mail for rroooott@@yypp..ttoo should be forwarded to the recipient addresses ggoodd@@hheeaavveenn..aaff..mmiill and ssttaaffff@@aaff..mmiill. When sseettffoorrwwaarrdd sees # it ignores all text from # to the end of the line: # this is a comment sseettffoorrwwaarrdd ignores all other line endings, so you can split a forward- ing instruction across lines. It also ignores spaces and tabs. Excep- tion: you can put a space (or tab or comma or whatever) into a target or command by putting a backslash in front of it. (However, NUL bytes are not permitted anywhere.) TTAARRGGEETTSS When ffaassttffoorrwwaarrdd sees the incoming address _u_s_e_r_@_h_o_s_t_._d_o_m, it tries three targets: _u_s_e_r_@_h_o_s_t_._d_o_m, _@_h_o_s_t_._d_o_m, and _u_s_e_r_@. It obeys the com- mands for the first target that it finds. Target names are interpreted without regard to case. All the commands for a single target must be listed in a single instruction. Exception: an owner address can be listed in a separate instruction. RREECCIIPPIIEENNTT AADDDDRREESSSSEESS If a command begins with an ampersand, sseettffoorrwwaarrdd takes the remaining bytes in the command as a recipient address: boss@yp.to: &god@heaven.af.mil; ffaassttffoorrwwaarrdd sends each incoming mail message to the recipient address. The recipient address must include a fully qualified domain name. It cannot be longer than 800 bytes. If a recipient address is itself a target in the forwarding table, ffaassttffoorrwwaarrdd will recursively handle the instructions for that target. Note that _@_h_o_s_t_._d_o_m and _u_s_e_r_@ wildcards do not apply here; they apply only to the incoming address. If a command begins with a letter or number, sseettffoorrwwaarrdd takes the entire command as a recipient address: boss@yp.to: god@heaven.af.mil; OOWWNNEERR AADDDDRREESSSSEESS If a command begins with a question mark, sseettffoorrwwaarrdd takes the remain- ing bytes in the command as an owner address: sos@heaven.af.mil: ?owner-sos@heaven.af.mil; ffaassttffoorrwwaarrdd uses that address as the envelope sender for forwarded mail, so bounces will go back to that address. (Normally, if a message is forwarded to a bad address, it will bounce back to the original envelope sender.) EEXXTTEERRNNAALL MMAAIILLIINNGG LLIISSTTSS If a command begins with a dot or slash, sseettffoorrwwaarrdd takes the entire command as the name of a binary mailing list file created by sseettmmaaiill-- lliisstt: sos@heaven.af.mil: /etc/lists/sos.bin; ffaassttffoorrwwaarrdd will read and obey the commands in that file. The file must be world-readable and accessible to ffaassttffoorrwwaarrdd. PPRROOGGRRAAMMSS If a command begins with a vertical bar or exclamation point, sseettffoorr-- wwaarrdd takes the rest of the command as the name of a program to run: dew@: |dew-monitor; For a vertical bar, ffaassttffoorrwwaarrdd feeds the message to that program. An exclamation point works the same way except that ffaassttffoorrwwaarrdd inserts $$UUFFLLIINNEE, $$RRPPLLIINNEE, and $$DDTTLLIINNEE in front of the message. DDUUPPLLIICCAATTEESS When ffaassttffoorrwwaarrdd is building the recipient list for a message, it keeps track of the recipient addresses and external mailing lists it has used. If the same command shows up again, it skips it. For example: everybody@yp.to: programmers@yp.to, testers@yp.to; programmers@yp.to: joe@yp.to, bob@yp.to; testers@yp.to: joe@yp.to, fred@yp.to; A message to eevveerryybbooddyy@@yypp..ttoo will be sent to jjooee@@yypp..ttoo only once. (This also means that addresses in an internal forwarding loop are dis- carded.) Exception: If a target has an owner address, commands for that target are considered different from commands for ``outside'' targets. SSEEEE AALLSSOO newaliases(1), preline(1), printforward(1), setmaillist(1) setforward(1)