PowerMTA comes with a simple text-based configuration file which we can use to manipulate the behavior of it. This configuration guide will show you how to configure PowerMTA General Options including hostname, listening port, allowed email sources, general logs and bounce logs.
If you have been following our perfect bulk email server setup tutorial, you’ve already got PowerMTA v5 installed on your CentOS 7 VPS. It’s time to configure it. We’ll start by looking into the General Options section of the configuration file. But first, we must learn how to edit PowerMTA configuration file.
How to Edit PowerMTA Configuration File?
As I said earlier, PMTA comes with a simple text-based configuration file. All the important settings can be changed within this file. The file you need to edit is,
You can use a text editor like nano to edit this file. Following command will open PMTA configuration file for editing with nano text editor.
After making your changes to the file, you can close it by hitting Ctrl+X key combination on your keyboard. You’ll be editing PMTA configuration file multiple times during this tutorial series. So, you should get used to it.
Configure PowerMTA General Options
The smtpfix.com PowerMTA configuration file is split into a few sections in which General Options is the first section you’ll find within the file. Go ahead and open the PMTA configuration file in nano text editor like you learned in the previous step.
You’ll see BEGIN and END comments for PowerMTA general options at the beginning section of the file. We will be changing some of the values between these comments. Other values can be left unchanged.
The first value we’re going to change is the hostname. The default value looks like this within the configuration file,
It’s obvious that we need to change domain.com on the above line with our sending domain. Next, we see the following 3 lines,
postmaster firstname.lastname@example.org domain-key 2022,*,/etc/pmta/domain.com-dkim.key smtp-listener 0/0:2525
Configure PowerMTA Postmaster Email Address: You need to change the domain in postmaster email address. Some ISPs will send complaints and bounce reports to this email address. Make sure that the email address exists.
Configure PowerMTA DKIM: We’ll skip the line that starts with domain-key for now. It is there to configure DKIM for your domain and we’ve dedicated another tutorial for it. Which we’ll ask you to complete in a future step.
Configure PowerMTA Listening Port: The last line configures the listening port of PowerMTA, which we’ll leave unchanged. But if you would like to, you can change the port number (2525) for something else. PowerMTA will be listening on this port for incoming connections. This is the port you need to use when you’re adding PowerMTA SMTP credentials to an email marketing application (EMA) like MailWizz.
The final piece of configuration we’ll be manipulating inside PowerMTA General Options is sources configuration. It looks like below in the configuration file.
This block of code governs the incoming connections to your PowerMTA SMTP server. Settings are already hardened and ready to go. You just need to specify an IP address. So, replace X.X.X.X with your source IP address. That’s all you need to change on the above code.
The source IP address means IP address of the machine you’re connecting to PowerMTA SMTP from. This is also called a feeding source. Let’s say, you want to connect to PowerMTA from your local computer, then your local computer becomes the feeding source for PowerMTA. So, you would enter your local public IP address here.
Likewise, if you’re connecting to PowerMTA SMTP from a remotely hosted MailWizz, then you need to enter the public IP address of your MailWizz server here. Because MailWizz becomes the feeding source in this case. And if your EMA (ex: MailWizz) is hosted on the same server as your PowerMTA, you need to replace X.X.X.X with localhost or 127.0.0.1 to allow feeding from the server itself.
Connecting to PowerMTA from multiple sources
If you want to connect to PowerMTA from multiple feeding sources, you can duplicate the above block of code for each IP address you want to connect from. There is no limit to how many sources you can add.
That’s all we’re going to edit in this section. The rest of the codes in this section govern various options such as logs and storage directories which we don’t need to worry about right now. Leaving them with their default values will be perfectly fine.