]> Cypherpunks.ru repositories - nncp.git/blob - doc/postfix.texi
Update 0.11 release in FreeBSD port
[nncp.git] / doc / postfix.texi
1 @node Postfix
2 @unnumbered Integration with Postfix
3
4 This section is taken from @url{http://www.postfix.org/nncp_README.html,
5 Postfix and UUCP} manual and just replaces UUCP-related calls with NNCP
6 ones.
7
8 @strong{Setting up a Postfix Internet to NNCP gateway}
9
10 Here is how to set up a machine that sits on the Internet and that forwards
11 mail to a LAN that is connected via NNCP.
12
13 @itemize
14
15 @item You need an @ref{nncp-mail} program that extracts the sender
16 address from mail that arrives via NNCP, and that feeds the mail into
17 the Postfix @command{sendmail} command.
18
19 @item Define a @command{pipe(8)} based mail delivery transport for
20 delivery via NNCP:
21 @verbatim
22 /usr/local/etc/postfix/master.cf:
23 nncp      unix  -       n       n       -       -       pipe
24           flags=F user=nncp argv=nncp-mail -quiet $nexthop $recipient
25 @end verbatim
26
27 This runs the @command{nncp-mail} command to place outgoing mail into
28 the NNCP queue after replacing @var{$nexthop} by the the receiving NNCP
29 node and after replacing @var{$recipient} by the recipients. The
30 @command{pipe(8)} delivery agent executes the @command{nncp-mail}
31 command without assistance from the shell, so there are no problems with
32 shell meta characters in command-line parameters.
33
34 @item Specify that mail for @emph{example.com}, should be delivered via
35 NNCP, to a host named @emph{nncp-host}:
36
37 @verbatim
38 /usr/local/etc/postfix/transport:
39     example.com     nncp:nncp-host
40     .example.com    nncp:nncp-host
41 @end verbatim
42
43 See the @command{transport(5)} manual page for more details.
44
45 @item Execute the command @command{postmap /etc/postfix/transport}
46 whenever you change the @file{transport} file.
47
48 @item Enable @file{transport} table lookups:
49
50 @verbatim
51 /usr/local/etc/postfix/main.cf:
52     transport_maps = hash:$config_directory/transport
53 @end verbatim
54
55 @item Add @emph{example.com} to the list of domains that your site is
56 willing to relay mail for.
57
58 @verbatim
59 /usr/local/etc/postfix/main.cf:
60     relay_domains = example.com ...other relay domains...
61 @end verbatim
62
63 See the @option{relay_domains} configuration parameter description for
64 details.
65
66 @item Execute the command @command{postfix reload} to make the changes
67 effective.
68
69 @end itemize
70
71 @strong{Setting up a Postfix LAN to NNCP gateway}
72
73 Here is how to relay mail from a LAN via NNCP to the Internet.
74
75 @itemize
76
77 @item You need an @ref{nncp-mail} program that extracts the sender
78 address from mail that arrives via NNCP, and that feeds the mail into
79 the Postfix @command{sendmail} command.
80
81 @item Specify that all remote mail must be sent via the @command{nncp}
82 mail transport to your NNCP gateway host, say, @emph{nncp-gateway}:
83
84 @verbatim
85 /usr/local/etc/postfix/main.cf:
86     relayhost = nncp-gateway
87     default_transport = nncp
88 @end verbatim
89
90 Postfix 2.0 and later also allows the following more succinct form:
91
92 @verbatim
93 /usr/local/etc/postfix/main.cf:
94     default_transport = nncp:nncp-gateway
95 @end verbatim
96
97 @item Define a @command{pipe(8)} based message delivery transport for
98 mail delivery via NNCP:
99
100 @verbatim
101 /usr/local/etc/postfix/master.cf:
102 nncp      unix  -       n       n       -       -       pipe
103           flags=F user=nncp argv=nncp-mail -quiet $nexthop $recipient
104 @end verbatim
105
106 This runs the @command{nncp-mail} command to place outgoing mail into
107 the NNCP queue. It substitutes the hostname (@emph{nncp-gateway}, or
108 whatever you specified) and the recipients before executing the command.
109 The @command{nncp-mail} command is executed without assistance from the
110 shell, so there are no problems with shell meta characters.
111
112 @item Execute the command @command{postfix reload} to make the changes
113 effective.
114
115 @end itemize