Configure postfix & dovecot to send mail on webmin/virtualmin

This article will show how to configure postfix & dovecot from webmin control panel to send mail.

Logging to your webmin/virtualmin control panel by below url:


switch to webmin part.

Edit Postfix config files:

Go to Servers > Postfix Mail Server and click over the “Edit Config Files” icon.
Select from the “Edit config file” dropdown box.
Click the “Edit” button.
Scroll down to the end of the configuration file, and add the following settings:

smtpd_sasl_type = dovecot
smtpd_sasl_path = private/auth
Also make sure you have exactly this line into your file :

smtpd_recipient_restrictions = permit_sasl_authenticated, permit_mynetworks, reject_unauth_destination permit_sasl_authenticated

postfix config

Finally also at the same file (at the middle of the file this time) uncomment the line :

home_mailbox = Maildir/
Click the “Save” button.

postfix config

Notice that for the last setting we could have done it by navigating at Server > Postfix Mail Server, and by clicking at “Local delivery” icon and by setting Maildir/ at the voice “Home-relative pathname of user mailbox file”.

postfix local delivery

Edit Dovecot config files

Navigate to Servers > Dovecot IMAP/POP3 Server and click over the “Edit Config Files” icon.
Select /etc/dovecot/conf.d/10-master.conf from the “Edit config file” dropdown.
Click the “Edit” button.
Find the configuration section for the auth service, and uncomment lines related to the socket. Specify the username and group name of your Postfix user.
In our case is user=postfix, group = postfix.
The section should look something like the following code when finished:

service auth
 # Postfix smtp-auth
 unix_listener /var/spool/postfix/private/auth
 mode = 0660
 user = postfix
 group = postfix

Click “Save”

dovecot config

Now go to file : /etc/dovecot/conf.d/10-auth.conf and hit the “Edit” button.
Find and change auth_mechanisms to :

auth_mechanisms = plain login
Click “Save”.

dovecot config2

Click the “Stop Dovecot Server” button and then the “Start Dovecot Server” button to restart the dovecot daemon.

Set Postfix to listen at Port 587

We need to instruct Postfix to listen for SMTP connections on port 587.
Navigate to Servers > Postfix Mail Server and click at the “Server Processes” icon.
Click the “Add a new server process” link.
In the “Create Server Process” form fill like this :

Set “Transport type” to Internet.
Set Server name/port” to 587.
Set “Process command” to smtpd.
Set “Enabled?” to Yes.
Set “Listen on host address” to Any address.
Set “Private to mail system?” to No.

postfix create process

Click the “Create” button.

At the “Server Processes” list you should have a new process with name 587 like the picture below.

postfix server processes list

Navigate to Servers > Postfix Mail Server.
Click “Stop Postfix” and then “Start Postfix” to restart the service.

Now you can send or receive & can read mail from your virtualmin server.

Thank you for reading this article.

Was this helpful?

0 / 0

Leave a Reply 0

Your email address will not be published. Required fields are marked *