# / usr / local / psa / admin / sbin / autoinstaller -select-release-current -install-component postfixBoth Postfix and qmail use the same root directory to store incomingmail. This directory is defined by the variable $PLESKMAILNAMESDin the /etc/psa/psa.conf configuration file. By default, it is/var/qmail/mailnames. Soundsoap pro torrent mac torrent 2016. Storing incoming mail in the same directoryallows the messages remain available after switching between mailagents.Unlike incoming mail, the mail queue is lost while switching between themail agents.
Therefore, before switching, we recommend you stop the SMTPservice to prevent the acceptance of email and the delivery of allqueued mail. To stop the SMTP service, run the following command.
IntroductionPostfix is a mail transfer agent (MTA), an application used to send and receive email. In this tutorial, you will install and configure Postfix so that it can be used to send emails by local applications only — that is, those installed on the same server as Postfix.Why would you want to do that?If you’re already using a third-party email provider for sending and receiving emails, you do not need to run your own mail server. However, if you manage a cloud server on which you have installed applications that need to send email notifications, running a local, send-only SMTP server is a good alternative to using a third-party email service provider or running a full-blown SMTP server.In this tutorial, you’ll install and configure Postfix as a send-only SMTP server on Debian 9. PrerequisitesTo follow this tutorial, you will need:.One Debian 9 server, set up with the, and a sudo non-root user.A valid domain name, like example.com, pointing to your server. You can set that up by following these.Note that your server’s hostname should match your domain or subdomain. You can verify the server’s hostname by typing hostname at the command prompt.
The output should match the name you gave the server when it was being created. Step 1 — Installing PostfixIn this step, you’ll learn how to install Postfix.
You will need two packages: mailutils, which includes programs necessary for Postfix to function, and postfix itself.First, update the package database:. sudo apt updateNext, install mailtuils:. sudo apt install mailutilsFinally, install postfix:. sudo apt install postfixNear the end of the installation process, you will be presented with a window that looks like the one in the image below. The default option is Internet Site.
That’s the recommended option for this tutorial, so press TAB, then ENTER.After that, you’ll get another window just like the one in the next image. The System mail name should be the same as the name you assigned to the server when you were creating it. If it shows a subdomain like subdomain.example.com, change it to just example.com. When you’ve finished, press TAB, then ENTER.You now have Postfix installed and are ready to modify its configuration settings. Step 2 — Configuring PostfixIn this step, you’ll configure Postfix to process requests to send emails only from the server on which it is running, i.e.
From localhost.For that to happen, Postfix needs to be configured to listen only on the loopback interface, the virtual network interface that the server uses to communicate internally. To make the change, open the main Postfix configuration file using nano or:. sudo nano /etc/postfix/main.cfWith the file open, scroll down until you see the following section. /etc/postfix/main.cf.mydestination = $myhostname, localhost.$yourdomain, $yourdomain.Save and close the file.Note: If you’re hosting multiple domains on a single server, the other domains can also be passed to Postfix using the mydestination directive. /etc/aliases mailer-daemon: postmasterpostmaster: rootroot: youremailaddress.Replace youremailaddress with your personal email address. When finished, save and close the file. For the change to take effect, run the following command:.
sudo newaliasesYou can test that it works by sending an email to the root account using:. echo 'This is the body of the email' mail -s 'This is the subject line' rootYou should receive the email at your email address.
If not, check your Spam folder. ConclusionThat’s all it takes to set up a send-only email server using Postfix. You may want to take some additional steps to protect your domain from spammers, however.If you want to receive notifications from your server at a single address, then having emails marked as Spam is less of an issue because you can create a whitelist workaround.
However, if you want to send emails to potential site users (such as confirmation emails for a message board sign-up), you should definitely set up SPF records and DKIM so your server’s emails are more likely to be seen as legitimate.If configured correctly, these steps make it difficult to send Spam with an address that appears to originate from your domain. Taking these additional configuration steps will also make it more likely for common mail providers to see emails from your server as legitimate.