This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
networking:linux:postfix_smarthost [2016/10/08 12:26] gcooper |
networking:linux:postfix_smarthost [2021/11/30 08:01] (current) gcooper |
||
---|---|---|---|
Line 18: | Line 18: | ||
* Blacklisted IP address | * Blacklisted IP address | ||
* Etc. | * Etc. | ||
+ | |||
+ | You need a package installed (CentOS, Ubuntu): | ||
+ | |||
+ | < | ||
+ | yum install cyrus-sasl-plain | ||
+ | </ | ||
+ | |||
+ | < | ||
+ | apt install libsasl2-modules | ||
+ | </ | ||
You can copy and paste the following into an editor, then adjust the $SMTPHOST and $USERPASS variables for your needs. Then, as root, paste it to the command line: | You can copy and paste the following into an editor, then adjust the $SMTPHOST and $USERPASS variables for your needs. Then, as root, paste it to the command line: | ||
Line 43: | Line 53: | ||
postconf -e ' | postconf -e ' | ||
- | / | + | systemctl restart |
</ | </ | ||
Line 61: | Line 71: | ||
< | < | ||
- | yum install cyrus-sasl-plain | + | yum install cyrus-sasl-plain |
</ | </ | ||
Line 73: | Line 83: | ||
< | < | ||
- | SMTPHOST=your.mailserver.domain:587 | + | #smtp.isp.com |
+ | < | ||
</ | </ | ||
Line 84: | Line 95: | ||
< | < | ||
postconf -e ' | postconf -e ' | ||
- | / | + | postfix reload |
</ | </ | ||
Line 91: | Line 102: | ||
**Envelope-From**: | **Envelope-From**: | ||
- | Some servers require the '' | + | <note warning>Some mail servers require the '' |
< | < | ||
Line 102: | Line 113: | ||
< | < | ||
- | # Use the empty regexp | + | # Use the empty regex '//' |
- | // pbx@yourdomain.tld | + | // validsender@yourdomain.tld |
</ | </ | ||
Line 113: | Line 124: | ||
</ | </ | ||
- | ===== Script for FreePBX Distro ===== | + | ===== FreePBX Distro ===== |
+ | |||
+ | :!: Includes **SMTP authentication**, | ||
- **Copy** to a text editor | - **Copy** to a text editor | ||
- **Edit** for your needs | - **Edit** for your needs | ||
- **Paste** into FreePBX Distro CLI as '' | - **Paste** into FreePBX Distro CLI as '' | ||
+ | |||
+ | :!: This package must be installed on older FreePBX Distro installations: | ||
+ | |||
+ | < | ||
+ | yum install cyrus-sasl-plain | ||
+ | </ | ||
+ | |||
+ | Copy, edit, then paste in the CLI: | ||
< | < | ||
FILE=/ | FILE=/ | ||
- | SMTPHOST=yourhost.yourdomain.com:587 | + | # Your valid mail server - colon and port number optional |
+ | SMTPHOST=yoursmtphost.yourdomain.tld:587 | ||
+ | # SMTP auth credentials - username may have @ | ||
USERPASS=yoursmtpusername: | USERPASS=yoursmtpusername: | ||
CANONICAL=/ | CANONICAL=/ | ||
- | SENDER=pbx@yourdomain.com | + | # Must be a valid authorized sender e-mail address in your domain |
+ | SENDER=validsender@yourdomain.tld | ||
+ | # Trusted CAs aren't configured by default?! | ||
CAFILE=/ | CAFILE=/ | ||
- | |||
- | yum install cyrus-sasl-plain | ||
- | #apt-get install libsasl2-modules | ||
# This will overwrite any existing contents | # This will overwrite any existing contents | ||
Line 159: | Line 181: | ||
postconf -e " | postconf -e " | ||
- | / | + | postfix reload |
</ | </ |