How to Configure Postfix to Work with Alternate Port SMTP in VM server
The guide has been created to help you with fitting suffix victimization No-IP’s Alternate Port SMTP service. This guide can re-examine everything that ought to be done to confirm that your Alternate Port SMTP service functions properly. merely follow the guide to confirm that your settings square measure correct.
Note: we'll be operating with Sudo commands. you may like administrator permissions to finish this method.
Please remember that this guide won't cowl the way to install suffix.
Once you've got put in suffix you may be got to begin configuring the service. the subsequent steps should be taken so as to send outgoing mail victimization No-IP’s Alternate Port SMTP service with suffix.
Once you've got completed putting in suffix you may be got to modify the “main.cf” file. merely enter the subsequent command into Terminal and press ‘enter’.
sudo nano /etc/postfix/main.cf
Using arrow keys on your keyboard, press ‘down’ until you see a line “myhostname =”. Need to replace the information after “=” with the FQDN used in your Postfix setup wizard doing first configuring.
This time we will also need to configure “relayhost =” line just below the “hostname =” line. Input following after “=”
You need to add the following function to the bottom of the “main.cf” file. By adding the following function information are allowing authentication and showing Postfix wherever to locate Alternate Port of SMTP username and password data you can copy.
smtp_sasl_auth_enable = yes
smtp_sasl_security_options = noanonymous
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_use_tls = yes
Now save your work and continue the next step to follow. Located at the bottom of your terminal window you will see the following information,
If you are using a standard keyboard simply hold down “Ctrl+X”, then press “Y”, finish by pressing “Enter”.
You are now finished configuring the “main.cf” file.
Configuring your OUTBOUND SMTP Usernames and Passwords
Next, need to create a database file that will host your Alternate Port SMTP Username and Password. Follow the steps below to create the database file needed for you.
In Terminal enter the following commands. By running this commands you can able to creating new text documents that you can edit within your Terminal window.
sudo nano /etc/postfix/sasl_passwd
Next, within your Terminal window, you will need to type in the following information. Replace “username” and “password” with your Alternate Port SMTP credentials that can be located within your No-IP account under your “mail” tab.
As shown above, save this information like you did during configuration.
If you are using a standard keyboard simply hold down “Ctrl+X”, then press “Y”, and finish by pressing “Enter”.
Now, enter the following command into your Terminal window.
sudo postmap /etc/postfix/sasl_passwd
If everything went well you will be able to locate your /etc/postfix file and see a file named “sasl_passwd.db”.
Securing your “sasl_passwd” and “sasl_passwd.db” files.
When creating the files above you also created files that showcase the information in plain text. For security purposes, it is highly recommended that you change their permissions so that only the root user can read or write to the files. To do so Copy and Paste the following commands into your Terminal window.
sudo chown root:root /etc/postfix/sasl_passwd /etc/postfix/sasl_passwd.db
sudo chmod 0600 /etc/postfix/sasl_passwd /etc/postfix/sasl_passwd.db
Testing your OUTBOUND service.
It is now time to test your settings and make sure you can send outbound mail to yourself. It is recommended to send to an email address that you know is setup correctly.
Using a Terminal window enter the following commands, making sure to press ‘enter’ after each line.
Subject: Test mail
This is a test email