A null client is a machine that can only send mail. It receives no mail from the network, and it does not deliver any mail locally.
Configuring Postfix as a null client we need to remember few directive in the Postfix. Here are they:
inet_interfaces - This setting controls which interfaces postfix will LISTEN on for inbound email.
myorigin - This setting will rewrite local email to appear to come from the domain specified.
relayhost - The smart host to which to send all outbound mail.
mydestination - A list of domains that are to be delivered locally, that should not pass to the local relay.
local_transport - The default mail delivery transport and next-hop destination for final delivery to domains listed with $mydestination
mynetworks - list of ips and networks that can relay through an MTA.
Here I am configuring postfix using the postconf command alternatively you can edit /etc/postfix/main.cf file. This configuration is pretty simple you could setup and null client within minutes.
Postfix package will be available in system by default, however if you want to install you can install it using yum or rpm. my system has the postfix installed.
Lets configure the null client using postconf command. as mentioned earlier all the above mentioned directives we need to configure.
Adjust the relayhost directive to point the corporate mail server.
Mail server details -
IP Adress : 192.168.1.4
Hostname : mail.vinzlinux.com
Lets configure relay host in postfix using the following command.
#postconf -e "relayhost=[foundation.vinzlinux.com]"
NOTE: Hostname of the mail server to be enclosed in the square brackets to prevent and MX record lookup with the DNS server.
Let the Postfix listen only on the loopback interface for email to deliver. update the inet_interfaces directive .
run the following command :
# postconf -e "inet_interfaces=loopback-only"
Change the configuration of the null client so that mails originating from 127.0.0.0/8 IPv4 network and [::]/128 IPv6 network are forwarded to the relay host by the local null client.
Run the following command :
# postconf -e "mynetworks=127.0.0.0/8 [::]/128"
Now configure Postfix so all the outgoing mails must have their send domain rewritten to the company domain vinzlinux.com. Run the following command.
# postconf -e "myorigin=vinzlinux.com"
Prohibit Postfix mail server from delivering any messages to local account. Configure the null client to not act as an end point for any domain. set the mydestination directive to empty.
Run the following command :
# postconf -e "mydestination="
Configure the local null client to not sort any mails into mailboxes on the local system. Local mail delivery is turned off.
# postconf -e "local_transport=error: local delivery disabled"
And finally restart your Postfix service and enable it on startup.
# systemctl restart postfix
# systemctl enable postfix
All the above commands will update the information in /etc/postfix/main.cf file.
Thats all about the null client. Hope this will be useful to you. Please share your feedback if any.
Configuring Postfix as a null client we need to remember few directive in the Postfix. Here are they:
inet_interfaces - This setting controls which interfaces postfix will LISTEN on for inbound email.
myorigin - This setting will rewrite local email to appear to come from the domain specified.
relayhost - The smart host to which to send all outbound mail.
mydestination - A list of domains that are to be delivered locally, that should not pass to the local relay.
local_transport - The default mail delivery transport and next-hop destination for final delivery to domains listed with $mydestination
mynetworks - list of ips and networks that can relay through an MTA.
Here I am configuring postfix using the postconf command alternatively you can edit /etc/postfix/main.cf file. This configuration is pretty simple you could setup and null client within minutes.
Postfix package will be available in system by default, however if you want to install you can install it using yum or rpm. my system has the postfix installed.
Lets configure the null client using postconf command. as mentioned earlier all the above mentioned directives we need to configure.
Adjust the relayhost directive to point the corporate mail server.
Mail server details -
IP Adress : 192.168.1.4
Hostname : mail.vinzlinux.com
Lets configure relay host in postfix using the following command.
#postconf -e "relayhost=[foundation.vinzlinux.com]"
NOTE: Hostname of the mail server to be enclosed in the square brackets to prevent and MX record lookup with the DNS server.
Let the Postfix listen only on the loopback interface for email to deliver. update the inet_interfaces directive .
run the following command :
# postconf -e "inet_interfaces=loopback-only"
Change the configuration of the null client so that mails originating from 127.0.0.0/8 IPv4 network and [::]/128 IPv6 network are forwarded to the relay host by the local null client.
Run the following command :
# postconf -e "mynetworks=127.0.0.0/8 [::]/128"
Now configure Postfix so all the outgoing mails must have their send domain rewritten to the company domain vinzlinux.com. Run the following command.
# postconf -e "myorigin=vinzlinux.com"
Prohibit Postfix mail server from delivering any messages to local account. Configure the null client to not act as an end point for any domain. set the mydestination directive to empty.
Run the following command :
# postconf -e "mydestination="
Configure the local null client to not sort any mails into mailboxes on the local system. Local mail delivery is turned off.
# postconf -e "local_transport=error: local delivery disabled"
And finally restart your Postfix service and enable it on startup.
# systemctl restart postfix
# systemctl enable postfix
All the above commands will update the information in /etc/postfix/main.cf file.
Thats all about the null client. Hope this will be useful to you. Please share your feedback if any.
No comments:
Post a Comment