# Incoming email MX server

{% hint style="info" %}
Each Velocity MTA sending IP listens for incoming email replies on port 25 for authorized receiving domains
{% endhint %}

{% hint style="info" %}
**conf/receiving\_domains**\
In order to accept email for a domain as an incoming MX server, the receiving domain must be listed in velocity-install/conf/receiving\_domains, with one domain per line. Any domains not listed in this file will have their email rejected. &#x20;
{% endhint %}

{% code overflow="wrap" %}

```
mta.fivetacofeista.com
ehondasnephew.com
```

{% endcode %}

{% hint style="success" %}
Velocity MTA must be restarted for changes to take effect.
{% endhint %}

{% hint style="info" %}
**Adding MX records to your DNS**

In order for mailbox providers like Yahoo to know they can send email replies and complaint feedback loops to your Velocity MTA server, you must create an MX record pointing to your Velocity MTA IP address on your DNS hosting provider. &#x20;
{% endhint %}

{% hint style="warning" %}
**MX records are idiosyncratic**&#x20;

You must first create a DNS A record that points to your Velocity MTA IP address, then create an MX record that specifies that A record will be the MX record for your sending domain or subdomain.
{% endhint %}

Using Cloudflare as our example DNS hosting provider, our A record named "MX" will be the MX record for the sending subdomain sendmail.vitamindispatch.com.

<figure><img src="/files/KzT9VeorPah5y485Km4g" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
**MX record priority**

MX records require setting a priority, with the lowest number receiving the highest preference. Setting priority 0 will make an MX record the first to be attempted in a load balanced configuration with multiple servers handling a high volume of inbound mail.&#x20;
{% endhint %}

Using the terminal command **dig** we can verify our MX record is active and pointing to the right place.&#x20;

```
dig sendmail.vitamindispatch.com MX @1.1.1.1
```

```
;; ANSWER SECTION:
sendmail.vitamindispatch.com. 300 IN	MX	0 mx.vitamindispatch.com.

;; Query time: 85 msec
;; SERVER: 1.1.1.1#53(1.1.1.1)
;; WHEN: Fri Jun 09 04:56:16 PDT 2023
;; MSG SIZE  rcvd: 76

```

{% hint style="info" %}
Incoming messages are stored in plain text as individual files in the velocity-install/mail/new directory.&#x20;
{% endhint %}

```
ls -alctr velocity-install/mail/new
```

```
total 20
drwxr-xr-x 5 root root 4096 Apr  6 16:00 ..
-rw-r--r-- 1 root root 9231 Apr 17 06:46 c09d311382dcdb2b0784c02c225e34f0

```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.emaildelivery.com/docs/velocity-mta-continuing-education/incoming-email-mx-server.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
