You are on page 1of 6

SERVER1 - RECEIVING EMAIL

rpm -qa | grep postfix


systemctl is-active postfix
systemctl is-enabled postfix.service

firewall-cmd --list-all
firewall-cmd --permanent --add-service=smtp
firewall-cmd --reload

vim /etc/postfix/main.cf
receiving mail
inet_interface = 10.10.10.147
IPV6 -> inet_protocol = ipv4
mydestination -> example.com

systemctl restart postfix

SERVER2 - send mail


rpm -qa | grep postfix

vim /etc/postfix/main.cf
sending mail -> myorigin
inet_interface = no change as we are not accepting
any email
inet_protocol = ipv4
mydestination -> delete all as we are not accepting
any email
relayhost = [server1.example.com]

systemctl restart postfix

mail sri@example.com
subject:test 10
hello
.
tail -f /var/maillog

server1
su sri@example
vim /etc/postfix
master.cf
main.cf
inet_inteface = localhost --> all
myorigin = IS used rw coming from particular domain
myorigin = mydomain --> is better

vim /etc/postfix
master.cf
main.cf
inet_inteface = localhost --> all
myorigin = IS used rw coming from particular domain
myorigin = mydomain --> is better

relayhost
relayhost = 10.0.0.19 to forward the message to further
processing
mydestination = receiving messages eg: myexample.com
myexample.org

local_transport

mynetworks - is a security option


mynetwork = 192.168.100.102
this will prevent email coming from other than that ip

command
postconf | wc
postconf inet_inteface
postconf -e 'myorigin = example.com'

man 5 postconf

postqueue
postqueue -p
postqueue -f
tail -f /var/log/maillog

201 to send email


main.cf
inet_inteface = all
myorigin = $mydomain
mydestination = example.com, google.com, yahoo.com
systemctl restart postfix

202
postconf
postconf -e "relayhost=[server201.ex.com]"
postconf -e "inet_inteface=loopback-only"
postconf -e "mynetwork=127.0.0.0/8"
postconf -e "mydestination="
mail -s mailtolisa1 lisa@server201.ex.com < .

201
lisa@server201
202
postqueue -p
ping server201 = working

main.cf
inet_protocols = ipv4
systemctl restart postfix

201
inet_protocols = ipv4
systemctl restart postfix

postqueue -f = to flush postqueue


tail /var/log/maillog

main.cf
relayhost = #d all = nofix

vim /etc/resolv.conf
nameserver 192.168.4.201 - which is ipa server

202
dig 201.example.com which is ipa server
postqueue -f
tail /var/log/maillog

postqueue -p

mail -s attempt2 lisa@server201.example.com < .

You might also like