gmail_as_a_relay_on_linux
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
gmail_as_a_relay_on_linux [2015/11/04 18:24] – juckins | gmail_as_a_relay_on_linux [2016/10/22 08:10] – juckins | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | Directions [[http:// | + | ===== Using Gmail as a Relay on CentOS Linux ===== |
- | 1. Make a backup copy of /etc/postfix/main.cf | + | Required packages if CentOS6 6.7: \\ |
+ | * postfix | ||
+ | * ca-certificates.noarch (tested version 2015.2.4-65.0.1.el6_6) | ||
- | 2. Edit / | + | Required packages if CentOS7 7.1.1503: \\ |
+ | * postfix (tested version | ||
+ | * ca-certificates.noarch (tested version 2015.2.4-70.0.el7_1) | ||
+ | |||
+ | Other CentOS 7 Notes: | ||
+ | * May need to use [[http:// | ||
+ | |||
+ | Directions [[http:// | ||
+ | |||
+ | 1. If installed, make sure / | ||
+ | |||
+ | 2. Make a backup copy of / | ||
+ | |||
+ | 3. Edit / | ||
< | < | ||
Line 9: | Line 24: | ||
relayhost = [smtp.gmail.com]: | relayhost = [smtp.gmail.com]: | ||
- | # use tls | + | # use tls |
smtp_use_tls=yes | smtp_use_tls=yes | ||
Line 31: | Line 46: | ||
</ | </ | ||
- | 2. Add your own Gmail credentials to / | + | 4. Add your own Gmail credentials to / |
< | < | ||
[smtp.gmail.com]: | [smtp.gmail.com]: | ||
</ | </ | ||
- | 3. Run the following as root: \\ | + | 5. Run the following as root: \\ |
< | < | ||
# postmap / | # postmap / | ||
</ | </ | ||
- | 4. Make sure the / | + | 6. Make sure the / |
< | < | ||
# chown postfix sasl_passwd* | # chown postfix sasl_passwd* | ||
</ | </ | ||
- | 5. Tighten permissions: | + | 7. Tighten permissions: |
< | < | ||
# chmod 600 sasl_passwd sasl_passwd.db | # chmod 600 sasl_passwd sasl_passwd.db | ||
</ | </ | ||
- | 6. Restart postfix: \\ | + | 8. Restart postfix: \\ |
+ | < | ||
+ | # / | ||
+ | </ | ||
+ | or | ||
< | < | ||
# / | # / | ||
Line 60: | Line 79: | ||
</ | </ | ||
- | 7. Send a test message: \\ | + | 9. Edit ~/.muttrc for each user as appropriate: |
- | < | + | |
- | echo 'It works' | mailx -s 'Test message' | + | |
- | </ | + | |
- | + | ||
- | 8. Edit ~/.muttrc for each user as appropriate: | + | |
< | < | ||
Line 71: | Line 85: | ||
#set from = username@HOSTNAME_OR_ALIAS.domain | #set from = username@HOSTNAME_OR_ALIAS.domain | ||
#set realname=" | #set realname=" | ||
- | set realname=$USER@$HOSTNAME | + | set realname="$USER@$HOSTNAME" (works in CENTOS7, mutt-1.5.21-26.el7.x86_64) |
+ | |||
+ | </ | ||
+ | |||
+ | 10. Send a test message: \\ | ||
+ | < | ||
+ | mutt -s " | ||
+ | </ | ||
+ | or | ||
+ | < | ||
+ | echo 'It works' | mailx -s 'Test message' | ||
</ | </ | ||
gmail_as_a_relay_on_linux.txt · Last modified: 2024/01/01 12:40 by juckins