swaks – command line SMTP testing tool

swaks is a command line SMTP testing tool available at http://www.jetmore.org/john/code/swaks/ On Debian/Ubuntu, you can install it with

if you just type swaks, it will ask your email, then sent a mail using MX Record to specified email address. To send email using specific mail sevrer

Deliver a standard test email, requiring CRAM-MD5 […]

Read More…

Create DKIM in PowerMTA


To generate DKIM, go to https://www.sparkpost.com/resources/tools/dkim-wizard/ On first text box, enter the domain name that you will be sending email from. For example, if i need to sent email from [email protected], i need to enter serverok.in in this text box. In DomainKey Selector text box, enter name for your DKIM key. This can be any […]

Read More…

Change SMTP port in PowerMTA

To change SMTP port in PowerMTA, edit file

Find line starting with

This line specify port used by PowerMTA server. You can change the power on this line. If you need PowerMTA listen to multiple ports, duplicate the line and change port, this will make PowerMTA work using both ports.

This will […]

Read More…

Create SMTP user in PowerMTA

Once you have PowerMTA installed, you need to create SMTP user. To create an SMTP user, edit file


Add below

In above code, replace SMTP_USERNAME_HERE and SMTP_PASSWORD_HERE with SMTP username and password you need. in vmta-1, domain-key line that is commented out is used to Enable DKIM signing of out going […]

Read More…

How to stop SPAM with Postfix RBL

To stop spam using RBL in postfix, edit main.cf


Restart postfix

See postfix […]

Read More…

Postfix enable Maildir

To enable postfix, run

You can do it by editing /etc/postfix/main.cf


if home_mailbox entry already in main.cf file, then modify instead of adding a new entry. Virtual Mailbox If you are using virtual mailbox, make sure you spedify folder in your virtual_mailbox_maps. Here is what i have in main.cf

in […]

Read More…

fatal: open /etc/postfix/main.cf: Permission denied

On a CentOS server, when sending mail from PHP scripts, mail failed to work. On checking postfix log file (/var/log/maillog), i see following error.

To fix this, disable selinux

To permanantly disable SELinux, run


Read More…

Postfix email forward

postfix mail server

On an Ubuntu Server, i done following to setup email forwarding. Install postfix

Edit /etc/postfix/main.cf, add following


Create Virtual mailbox


Create alias file, used for mail forwarding


Wth above configuration, mail coming to [email protected]_HERE.com will get forwarded to [email protected] Email coming to [email protected]_HERE.com get delivered […]

Read More…