If you like DNray Forum, you can support it by - BTC: bc1qppjcl3c2cyjazy6lepmrv3fh6ke9mxs7zpfky0 , TRC20 and more...

 

VDS mail setup

Started by CrazyNorth, Aug 14, 2022, 02:01 AM

Previous topic - Next topic

CrazyNorthTopic starter

Although I understand that the section I chose on the forum was not according to the rules, I cannot think of a better place for my question. In fact, I have already asked several communities, but so far, I have not received any answers. Perhaps the experts in this forum will be able to help me out.

The problem I am facing has to do with email notifications. When I host websites on some popular CMS platforms, such as Joomla, SMF, or WordPress, on a good hosting server, all email notifications are sent to users without any issues using the default settings. However, when I try on a VPS, I have never been successful in configuring mail settings so that it does not end up in spam and reliably reaches its addressees. Currently, I am stuck trying to get this to work with two websites.

My VPS is running Debian 8 with VestaCP installed, and exim4 comes along with it by default (I haven't changed any settings). My domain, mydomain.com, uses DNS servers from pdd.yandex.com. The following entries are configured there:

- mail A 1.2.3.4
- @ A 1.2.3.4
- @ TXT v=spf1 ip4:1.2.3.4 ~all
- @ MX mydomain.com. ten

Despite my research, I could not get the process of setting up mail for client sites clear. Most manuals available online only describe the process for setting up mail for a single domain on a VPS rather vaguely. Since hosting providers keep multiple client sites, the messages are usually sent from each. I would appreciate it if anyone could point me towards an understandable guide or at least give me some guidance on what search terms I should use.
  •  


Lechlak

If you are facing an issue where mail sent from a VPS ends up in spam, it might be a precaution taken by mail services, particularly if there has been spam sent from the VPS IP before. In order to resolve this issue, you could try setting up sending mail through SMTP mail services instead of exim4 on your VPS.

However, before doing that, it is advisable to configure various SFPs, DKIMs in the domain (on DNS), which should clearly reflect that the mail comes from such and such an IP.

Sending via SMTP to a VPS can be better than the usual mail () via PHP, although setting it up for each website can be quite tedious. Additionally, the IP of your VPS may have been blacklisted by some "spamhouse," resulting in your mail ending up in spam, depending on where you obtained the VPS.

To resolve this, you can write rDNS (PTR) for IP VDS (for example, mail.mydomain.com), set up a direct A-record for mail.mydomain.com with this IP, configure SMTP-MTA to issue the correct prompt with the correct hostname that matches the rDNS (mail.mydomain.com), write SPF for host mail.mydomain.com, and set up DKIM/DMARC.
  •  

spinneren

To ensure that your mail works seamlessly, you need to undertake several steps. Firstly, you must write an MX record for the domain pointing to your webserver. For example, if you want the example.com domain to point to your server, you can register the example.com domain itself as an MX record in the registrar's control panel or on your server's control panel if you use your own DNS server.

Next, you should add a mail domain in the control panel and create mailboxes in the control panel. Additionally, it is important to note that when registering the domain or IP address of the server as the pop3 and smtp server, careful attention must be paid.

Both receiving and sending mail require authorization, where the login will be the full address of the mailbox in the form login@domain.com, while the password will be specified when the mailbox was created.
  •  

Chittyfathy

Start by checking if your VPS provider allows you to set a custom rDNS record for your server's IP address. If so, configure a meaningful rDNS entry that matches your mail server's hostname. This can help improve your email deliverability by demonstrating that your server is correctly configured.

Next, make sure that your SPF record is properly set up in your DNS settings. Your current SPF record looks correct, but double-check that it includes all the necessary IP addresses or ranges that are authorized to send email on behalf of your domain.

Additionally, consider implementing DKIM and DMARC to further enhance the security and authenticity of your email messages. DKIM allows you to sign outgoing emails with a digital signature, while DMARC provides policies for handling emails that fail SPF and DKIM checks. Both of these measures can help improve your domain's reputation and reduce the likelihood of your emails being marked as spam.

Once the technical configurations are in place, it's important to monitor your domain's reputation and email deliverability using tools such as Sender Score and MXToolbox. These tools can provide insights into how your emails are being perceived by recipient mail servers and help identify any issues that may be affecting deliverability.

Here are some detailed steps and considerations to address your email deliverability issues on your VPS running Debian 8 with VestaCP installed:

1. Reverse DNS (rDNS): Start by checking if your VPS provider allows you to set custom rDNS for your server's IP address. A proper rDNS entry that matches your mail server's hostname can help establish the legitimacy of your email server and improve deliverability.

2. SPF Record: Ensure that your SPF record in the DNS settings includes all the necessary IP addresses or ranges that are authorized to send email on behalf of your domain. The SPF record you provided includes an IP address, but it's important to verify that it encompasses all valid sources of email for your domain.

3. DKIM and DMARC: Consider implementing DKIM to digitally sign outgoing emails and DMARC to specify policies for handling emails that fail SPF and DKIM checks. These authentication mechanisms can enhance the security and authenticity of your email messages, bolstering your domain's reputation and reducing the likelihood of emails being marked as spam.

4. Monitoring and Tools: Use email deliverability monitoring tools such as Sender Score and MXToolbox to track your domain's reputation and identify any issues that may be impacting your email deliverability. These tools can provide insights into how your emails are received by recipient mail servers, enabling you to take proactive measures to address any deliverability concerns.
  •  


If you like DNray forum, you can support it by - BTC: bc1qppjcl3c2cyjazy6lepmrv3fh6ke9mxs7zpfky0 , TRC20 and more...