i have installed postfix on ubuntu server 14.04.4. i am able to telnet to the server as send emails from my smtp server. but since there is no authentication needed for this everybody is having access to the server. so,
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
You have an article about it on DO : https://www.digitalocean.com/community/tutorials/how-to-configure-a-mail-server-using-postfix-dovecot-mysql-and-spamassassin
Uses dovecot and mysql for TLS authentication.
Append these lines in /etc/postfix/main.cf and restart postfix service.
smtp_tls_auth_only = yes smtp_tls_security_level = encrypt
The email messages i’ll be encrypted as TLS and verified by your hostname.
Enabling authentication on Postfix involves configuring Postfix to use SASL (Simple Authentication and Security Layer) for authentication, and typically Dovecot is used as the SASL provider. Below are the steps to enable authentication on Postfix using Dovecot on a Debian-based system such as Kali Linux. This guide assumes you have both Postfix and Dovecot installed.
Ensure that both Postfix and Dovecot are installed:
sudo apt update
sudo apt install postfix dovecot-core dovecot-imapd dovecot-pop3d
Edit the Dovecot configuration to enable SASL:
sudo nano /etc/dovecot/conf.d/10-auth.conf
Uncomment and modify the following lines:
disable_plaintext_auth = no
auth_mechanisms = plain login
Edit the Dovecot configuration to set up the auth socket:
sudo nano /etc/dovecot/conf.d/10-master.conf
Uncomment and modify the unix_listener section:
service auth {
unix_listener /var/spool/postfix/private/auth {
mode = 0660
user = postfix
group = postfix
}
}
Restart Dovecot to apply the changes:
sudo systemctl restart dovecot
Edit the Postfix main configuration file:
sudo nano /etc/postfix/main.cf
Add or modify the following lines to enable SASL and configure it to use Dovecot:
smtpd_sasl_type = dovecot
smtpd_sasl_path = private/auth
smtpd_sasl_auth_enable = yes
smtpd_sasl_security_options = noanonymous
smtpd_sasl_local_domain = $myhostname
smtpd_recipient_restrictions = permit_sasl_authenticated,permit_mynetworks,reject_unauth_destination
# TLS settings (optional but recommended)
smtpd_tls_cert_file = /etc/ssl/certs/your_cert.pem
smtpd_tls_key_file = /etc/ssl/private/your_key.pem
smtpd_use_tls = yes
Restart Postfix to apply the changes
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.