Ubuntu 15.04 Vivid Enabling SMTP Sendmail Authentication
Hi! The Tutorial shows you Step-by-Step How to Install Packages for Required SMTP Sendmail Authentication on a Ubuntu 15.04 Vivid Vervet Postfix Secure Mail Server.
With this SMTP Setup we are Stopping Unauthorized Mails Relaying and so the Users will Need to Authenticate for sending mails.
-
Open a Shell Session
Ctrl+Alt+t on Desktop
(Press “Enter” to Execute Commands)In case first see: Terminal QuickStart Guide.
-
Installing SMTP Cyrus SSL Auth Packages.
sudo apt-get install libsasl2-2 libsasl2-modules libsasl2-modules-sql
If Got “User is Not in Sudoers file” then see: How to Enable sudo
-
Configuring SMTP Authentication
sudo nano /etc/postfix/main.cf
Append:
smtpd_recipient_restrictions = reject_unauth_pipelining, permit_mynetworks, permit_sasl_authenticated, reject_non_fqdn_recipient, reject_unknown_recipient_domain reject_unauth_destination, check_policy_service inet:127.0.0.1:10023, permit # modify the existing smtpd_sender_restrictions smtpd_sender_restrictions = permit_sasl_authenticated, permit_mynetworks, reject_non_fqdn_sender, reject_unknown_sender_domain, reject_unauth_pipelining, permit # then add these smtpd_sasl_auth_enable = yes broken_sasl_auth_clients = yes smtpd_sasl_security_options = noanonymous smtpd_sasl_local_domain =
Ctrl+x to Save & Exit from nano :)
Then Edit the Postfix SSL Config File:sudo nano /etc/postfix/sasl/smtpd.conf
Add:
pwcheck_method: auxprop/nauxprop_plugin: sql mech_list: plain login cram-md5 digest-md5 sql_engine: mysql sql_hostnames: 127.0.0.1 sql_user: postfixamdin sql_passwd: [postfixadminMySqlPass] sql_database: postfixadmin sql_select: select password from mailbox where username='%u@%r' and active = 1
Change the ‘postfixadminMySqlPass’!
Save & Exit
Then Test Setup Restarting the Postfix MTAsudo service postfix restart
-
How to Setup a Multi Virtual Domain/Alias Ubuntu Mail Server.