This section is taken from Postfix and UUCP manual and just replaces UUCP-related calls with NNCP ones.
Setting up a Postfix Internet to NNCP gateway
Here is how to set up a machine that sits on the Internet and that forwards mail to a LAN that is connected via NNCP.
sendmail
command.
pipe(8)
based mail delivery transport for
delivery via NNCP:
/usr/local/etc/postfix/master.cf: nncp unix - n n - - pipe flags=F user=nncp argv=nncp-exec -quiet $nexthop sendmail $recipient
This runs the nncp-exec
command to place outgoing mail into
the NNCP queue after replacing $nexthop by the the receiving NNCP
node and after replacing $recipient by the recipients. The
pipe(8)
delivery agent executes the nncp-exec
command without assistance from the shell, so there are no problems with
shell meta characters in command-line parameters.
/usr/local/etc/postfix/transport: example.com nncp:nncp-host .example.com nncp:nncp-host
See the transport(5)
manual page for more details.
postmap /etc/postfix/transport
whenever you change the transport file.
/usr/local/etc/postfix/main.cf: transport_maps = hash:$config_directory/transport
/usr/local/etc/postfix/main.cf: relay_domains = example.com ...other relay domains...
See the relay_domains configuration parameter description for details.
postfix reload
to make the changes
effective.
Setting up a Postfix LAN to NNCP gateway
Here is how to relay mail from a LAN via NNCP to the Internet.
sendmail
command.
nncp
mail transport to your NNCP gateway host, say, nncp-gateway:
/usr/local/etc/postfix/main.cf: relayhost = nncp-gateway default_transport = nncp
Postfix 2.0 and later also allows the following more succinct form:
/usr/local/etc/postfix/main.cf: default_transport = nncp:nncp-gateway
pipe(8)
based message delivery transport for
mail delivery via NNCP:
/usr/local/etc/postfix/master.cf: nncp unix - n n - - pipe flags=F user=nncp argv=nncp-exec -quiet $nexthop sendmail $recipient
This runs the nncp-exec
command to place outgoing mail into
the NNCP queue. It substitutes the hostname (nncp-gateway, or
whatever you specified) and the recipients before execution of the
command. The nncp-exec
command is executed without assistance
from the shell, so there are no problems with shell meta characters.
postfix reload
to make the changes
effective.