-
Notifications
You must be signed in to change notification settings - Fork 0
/
Postfix-GMAIL.doc
42 lines (28 loc) · 1.51 KB
/
Postfix-GMAIL.doc
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
-- No passo 3 altere "[email protected]:password" por seu e-mail e senha separados por ":"; ficando assim: [email protected]:senha
-- In step 3 change "[email protected]:password" to your email and password separated by ":"; looking like this: [email protected]:password
-- No passo 9 Substitua [email protected] pelo seu e-mail no seguinte código e teste o envio de e-mail.
-- In step 9 Replace [email protected] with your email in the following code and test sending mail
1 - install postfix and mailutils:
apt-get install postfix mailutils libsasl2-2 ca-certificates libsasl2-modules -y
2 - Create your password file with:
nano /etc/postfix/sasl_passwd
3 - Populate the password file. Example:
[smtp.gmail.com]:587 [email protected]:password
4 - Secure the file by running:
chmod 600 /etc/postfix/sasl_passwd
5 - Replace the contents of the config file by running:
nano /etc/postfix/main.cf
6 - Place the following in the file:
relayhost = [smtp.gmail.com]:587
smtp_use_tls = yes
smtp_sasl_auth_enable = yes
smtp_sasl_security_options =
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_tls_CAfile = /etc/ssl/certs/ca-certificates.crt
7 - Encode password file by running:
postmap /etc/postfix/sasl_passwd
8 - Restart postfix:
systemctl restart postfix.service
9 - Replace [email protected] with your email in the following code and test sending mail:
echo "Test mail from postfix" | mail -s "Test Postfix" [email protected]
Fonte: https://serverfault.com/questions/510251/postfix-gmail-authentication-required-error