Config 3rd (Godaddy) SMTP server as the relay of your smtp server
Godaddy:
MX records:
0 | smtp.secureserver.net |
10 | mailstore1.secureserver.net |
Host Names (CNAME)
POP | pop.secureserver.net |
IMAP | imap.secureserver.net |
SMTP | smtpout.secureserver.net |
Port:
- Without SSL
- Incoming Port
- IMAP – 143
POP – 110
- IMAP – 143
- Outgoing (SMTP) port
- One of the following: 25, 80, 3535
- Incoming Port
- With SSL
- Incoming Port
- IMAP – 993
POP – 995
- IMAP – 993
- Outgoing (SMTP) port
- 465
- Incoming Port
Install Postfix
sudo apt-get install mailutils
sudo apt-get install postfix
Config Postfix
sudo nano /etc/postfix/main.cf
Test Postfix SMTP Server Can Send Email
echo "This is the body of the email" |
mail -s "This is the subject line" xxx@gmail.com
Forward System Mail via the Postfix SMTP Server
cat /etc/aliases
# /etc/aliases
mailer-daemon: postmaster
postmaster: root
nobody: root
hostmaster: root
usenet: root
news: root
webmaster: root
www: root
ftp: root
abuse: root
noc: root
security: root
root: account@yourdomain
Send Mail via external (Godaddy) smtp server
Configuring Usernames and Passwords
sudo nano /etc/postfix/sasl/passwd [smtpout.secureserver.net]:80 account@yourdomain:passwd
sudo postmap /etc/postfix/sasl/passwd
Configuring Relay
sudo nano /etc/postfix/main.cf
# specify SMTP relay host
relayhost = [smtpout.secureserver.net]:80
At the end of the file, add the following parameters to enable authentication:
cat /etc/postfix/main.cf
smtp_sasl_auth_enable = yes smtp_sasl_security_options = noanonymous smtp_sasl_password_maps = hash:/etc/postfix/sasl/passwd
Test Postfix SMTP Relay
echo "email via godaddy smtp" |
mail -s "smtp relay" "From: account@yourdomain" xxx@dest
Config email alias From header in Postfix
Add the line into /etc/postfix/main.cf
smtp_generic_maps = hash:/etc/postfix/generic
cat /etc/postfix/generic
other-email account@yourdomain
sudo postmap /etc/postfix/generic