forked from mridulsingh8390/DevOps-Tools-Installation
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPostFix-Installation
More file actions
81 lines (56 loc) · 2.32 KB
/
PostFix-Installation
File metadata and controls
81 lines (56 loc) · 2.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
Install Postfix on Ubuntu:
==========================
sudo apt update
sudo apt install postfix -y
sudo dpkg-reconfigure postfix
sudo apt install libsasl2-modules postfix
vi /etc/postfix/sasl_passwd
[smtp.domain.com]:587 email_id:Password
postmap /etc/postfix/sasl_passwd
vi /etc/postfix/main.cf
relayhost = [SMTP.domain.com]:587
#myhostname = ip-172-31-7-96.us-east-2.compute.internal
smtp_sasl_auth_enable = yes
smtp_sasl_security_options = noanonymous
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_use_tls = yes
smtp_tls_CAfile = /etc/ssl/certs/ca-certificates.crt
sudo chown root:root /etc/postfix/sasl_passwd /etc/postfix/sasl_passwd.db
sudo chmod 0600 /etc/postfix/sasl_passwd /etc/postfix/sasl_passwd.db
sudo systemctl restart postfix
apt install net-tools -y
netstat -tulpn | grep :25
echo "This is the email body." | mail -s "Email subject" user@domain.com
sudo tail -f /var/log/mail.log
================================================================================
sudo yum update -y
sudo yum install postfix -y
sudo service postfix status
sudo service postfix restart
sudo yum install cyrus-sasl-plain -y
vi /etc/postfix/sasl_passwd
[smtppro.domain.com]:587 email_id:password
postmap /etc/postfix/sasl_passwd
vi /etc/postfix/main.cf
relayhost = [smtppro.domain.com]:587
myhostname = ip-172-31-7-96.us-east-2.compute.internal
smtp_sasl_auth_enable = yes
smtp_sasl_security_options = noanonymous
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_use_tls = yes
smtp_tls_CAfile = /etc/ssl/certs/ca-certificates.crt
sudo chown root:root /etc/postfix/sasl_passwd /etc/postfix/sasl_passwd.db
sudo chmod 0600 /etc/postfix/sasl_passwd /etc/postfix/sasl_passwd.db
sudo systemctl restart postfix
yum install net-tools -y
netstat -tulpn | grep :25
echo "This is the email body." | mail -s "Email subject" user@domain.com
tailf /var/log/maillog
========================================================================
References:
-----------
https://oracle-base.com/articles/linux/configure-postfix-as-an-email-relay-on-oracle-linux-servers
https://docs.oracle.com/en-us/iaas/Content/Email/Reference/postfix.htm
https://docs.oracle.com/en/learn/oracle-linux-postfix-starttls/#generate-a-tls-certificate
https://docs.oracle.com/en/learn/oracle-linux-postfix/#configure-postfix
https://phoenixnap.com/kb/postfix-smtp