The first step is therefore to write the mapping file:
代码: 全选
carlo@ape.insetti.net alan@bignet.it
root@ape.insetti.net alan@bignet.it
news@ape.insetti.net alan@bignet.itThese entries will map the mail sent from the users given on the left side into the globally valid email addresses given on the right, making it appear as if the mail was really sent from that address.
For the sake of efficiency, generic must be transformed into a binary file with the following command:
代码: 全选
# postmap /etc/postfix/genericNow it's time to create the prototype configuration file which we'll use to create the postfix configuration file.
代码: 全选
# vi /etc/postfix/main.cfFor the sake of simplicity, we'll only show the variables you need change:
relayhost = mail.bignet.it
smtp_generic_maps = hash:/etc/postfix/generic
This configuration tells postfix to rewrite the addresses of type “ape.insetti.net” using the real names found in the /etc/postfix/generic file. It also says that mail should be sent to the “mail.bignet.it” server. The meaning of the options is described in detail in postconf(5).
The last step is to reload the configuration. You can do that easily with:
代码: 全选
# /etc/rc.d/postfix reload
postfix/postfix-script: refreshing the Postfix mail systemNow everything is ready to start sending mail.