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 revision | ||
| gmail_as_a_relay_on_linux [2019/05/01 11:23] – juckins | gmail_as_a_relay_on_linux [2025/03/20 19:55] (current) – juckins | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ===== Using Gmail as a Relay on CentOS | + | ==== Using Gmail as a Relay on RedHat |
| - | Required packages if CentOS6 6.7: \\ | + | RockyLinux 9 Notes: |
| - | * postfix | + | * (Nothing special noted) |
| - | * ca-certificates.noarch | + | |
| + | CentOS 8 Notes: | ||
| + | * (Nothing special noted) | ||
| Required packages if CentOS7 7.2.1511: \\ | Required packages if CentOS7 7.2.1511: \\ | ||
| Line 15: | Line 17: | ||
| * Best to use this version of mutt: mutt-1.6.2-1.fc22.x86_64.rpm | * Best to use this version of mutt: mutt-1.6.2-1.fc22.x86_64.rpm | ||
| * Otherwise, you may get errors like: Bad IDN in " | * Otherwise, you may get errors like: Bad IDN in " | ||
| + | * / | ||
| + | * As root, run ' | ||
| * If trouble sending after install, may need to consult [[http:// | * If trouble sending after install, may need to consult [[http:// | ||
| Directions [[http:// | Directions [[http:// | ||
| - | 1. If installed, make sure / | + | 1. If it exists, make sure / |
| 2. Make a backup copy of / | 2. Make a backup copy of / | ||
| Line 26: | Line 30: | ||
| < | < | ||
| - | # sets gmail as relay | + | # Sets gmail as relay |
| relayhost = [smtp.gmail.com]: | relayhost = [smtp.gmail.com]: | ||
| - | # use tls | + | # Use tls |
| smtp_use_tls=yes | smtp_use_tls=yes | ||
| - | # use sasl when authenticating to foreign SMTP servers | + | # Use sasl when authenticating to foreign SMTP servers |
| smtp_sasl_auth_enable = yes | smtp_sasl_auth_enable = yes | ||
| - | # path to password map file | + | # Path to password map file |
| smtp_sasl_password_maps = hash:/ | smtp_sasl_password_maps = hash:/ | ||
| + | # NOTE: This section *should* be configured properly in CentOS8 and RockyLinux9 by default | ||
| # list of CAs to trust when verifying server certificate | # list of CAs to trust when verifying server certificate | ||
| # | # | ||
| Line 43: | Line 48: | ||
| smtp_tls_CAfile = / | smtp_tls_CAfile = / | ||
| - | # eliminates | + | # Eliminates |
| smtp_sasl_security_options = | smtp_sasl_security_options = | ||
| - | # add debugging | + | # Modify |
| debug_peer_list=smtp.gmail.com | debug_peer_list=smtp.gmail.com | ||
| debug_peer_level=3 | debug_peer_level=3 | ||
| </ | </ | ||
| - | 4. Add your own Gmail credentials to / | + | 4. Add your own Gmail credentials to / |
| < | < | ||
| - | [smtp.gmail.com]: | + | [smtp.gmail.com]: |
| </ | </ | ||
| Line 84: | Line 89: | ||
| </ | </ | ||
| - | 9. Edit ~/.muttrc for each user as appropriate: \\ | + | 9. Add these lines to the global |
| < | < | ||
| - | #set from = $USER@$HOSTNAME | + | set from = "`whoami`@`hostname`" |
| - | #set from = username@HOSTNAME_OR_ALIAS.domain | + | set realname = "`whoami`@`hostname`" |
| - | #set realname="juckins@lightning" | + | |
| - | set realname=" | + | |
| </ | </ | ||
| Line 98: | Line 100: | ||
| mutt -s " | mutt -s " | ||
| </ | </ | ||
| - | or to send a message without using a separate file: | + | or to send a message without using a separate file but note mailx is probably not looking at .muttrc: |
| < | < | ||
| echo 'It works' | mailx -s 'Test message' | echo 'It works' | mailx -s 'Test message' | ||
| + | </ | ||
| + | or | ||
| + | < | ||
| + | mailx -a test.txt -s "test subject" | ||
| </ | </ | ||
gmail_as_a_relay_on_linux.1556724183.txt.gz · Last modified: by juckins
