Mail Server DNS configuration of MX Records for Forwarding - email

I have an account with an internet provider, the majority of my company is based on the mail server they provide which is a bog standard UX style server from what I can tell. They offer the ability to edit the DNS records in the admin login, and you can edit the MX records.
What I want to do is introduce a subset of email accounts that are managed by a second mail server, this being an MS Exchange server. So what I want, I think, is to configure the Authoritative server as the 1and1 server, and configure the Exchange server as a non-Authoritative server and have the Authoritative server forward all non local addresses, or specified addresses, on to the Exchange server. Thus all addresses would look the same old_mx#ab.com and exchange#ab.com, but they would be resolved by different mail servers, working in tandem. My assumption had been you could specify a destination for unresolved e-mail addresses before they are declared void and bounced.
I spoke to a support engineer at 1and1 who said it was possible but they needed the exchange server address. Seemed reasonable, MS seem to think it's possible and provided an address. I just phoned the ISP back with the Exchange server details as provided by MS... and the next engineer says it isn't possible.
Can we confirm this is possible firstly, and how would I go about configuring it?

Not much help has been forthcoming on this question, but I do have some leads on answers myself. It would seem that there is no DNS record solution to the problem, not one commonly supported anyway. The DNS can only really be used for primary and secondary MX definition.
The only way to set this form of triaged MX server seems to rely on the MS Exchange server being defined as the first link in a chain of mail servers. i.e. The DNS referenced server. Once this is done the MS Exchange server can be configured as a non-Authoritative reference, within the server. Once that is done the MS Exchange is then provided with the subsequent servers to reference. On receipt of an e-mail that the MSE server doesn't recognise it will then forward the mail to another server that might be another non-authoritative MSE or an authoritative server of any description. The end server would then be responsible for returning any error messages back to the sender.
If anyone finds a better solution that doesn't involve redefining the master mail MX records I would be very interested, as I don't really want the MSE setup as the primary MX record.

Related

How to connect my Mac Mail to my domain which his DNS are handled through DigitalOcean?

I bought a domain.
I pointed his name servers to:
ns1.digitalocean.com
ns2.digitalocean.com
I have added a CNAME record point to #
I want to send and receive emails using my Mac mail program.
I know that I should probably build a full mail server which is an awful thing to do.
Therefore, I have another server (not digitalocean) running on cPanel. In this cPanel I have a very powerful cPanel's mail server.
How can I point my digitalocean CNAME to the remote server where the cPanel is?
I hope it's clear enough.
In order to make your domain points to the digital ocean server, you will have to create A record that points to the IP of that server, same goes to any subdomain.
Regarding your mail server, you need to make mail.mydomain.com points to the IP of your cPanel server using A record not CName and also modifying other records like SPF/DKIM records.
For your local mail client you can get the configuration by logging into the cPanel user account and view the mail settings

How to configure a sendmail to relay email from and to a mail server

I've a full server with mail and web behind a dynamic IP access.
This is all configured to update the ip in case it changes and works well with everything except mail.
Although I've implemented SPF DKIM and DMARK, since the address are listed in PBL, many servers refuse the connection.
I'm trying to solve this issue setting up a relay machine for my domains in a small VPS with Fixed IP and Reverse DNS to avoid PBL's.
I've found a link from a guy that implemented a similar solution, but he changes the sendmail.cf file, that is not supposed to be touched.
This link:
https://www.akadia.com/services/sendmail_relay.html
How can I do this in the sendmail.mc file for compilation with m4?
My idea is to set the mx records pointing to this vps acting as relay, and also configure my postfix mailserver to forward mail to the relay, which I think I've found were to do this in webmin.
Hope someone can shed some light in my head.
Thanks in advance.
You can specify default relay for outgoing email in sendmail.mc file using SMART_HOST.
define(`SMART_HOST', `name.of.smart.host')dnl
Useful tip: You may put smart host name in square brackets to avoid lookup for DNS MX records.
define(`SMART_HOST', `[name.of.smart.host]')dnl
WARNING
sendmail uses *.cf files as configuration. *.mc fIle must be "compiled" into *.cf file.

Reverse IP configuration in a VPS with several registered domains to avoid spam mails

Hello everyone in the community.
I have a headache that you can't imagine with this topic and I need your help.
I have a VPS server contracted at OVH, where I have access to the WHM and the Cpanel.
I currently have two hosted domains, I have created for each one their account in Cpanel, so each domain has its own configurations: Ftp, Mail etc...
The problem is that the mail that comes out of any of these domains are going directly into SPAM. I've read a lot on the internet, there's talk about configuring the PTR, configuring a reverse IP and so on.
The thing is that I am confused because I have two different domains, with all their different characteristics and the OVH server is one with one IP and already has its reverse IP.
So when I check the CPANEL of each account in the Email Deliverability option it tells me that there is a problem with the PTR.
The truth is that I have no idea how to change this for each domain, each domain appears in the DNS zone of the WHM and I can edit or add what I need but I see that everything is fine.
I don't know what to change or how to change it. I hope you can guide me. Thank you
Your cPanel/WHM server ip address has to have a valid PTR record which should matche your server's hostname. If the PTR doesn't match the hostname then that's a reason your emails go to SPAM. You should also check your server ip address to see if it's listed in any blacklist. You can check that on mxtoolbox.com for example. You also need to have valid DKIM, SPF and DMARC dns records for your domains.

Ubuntu exim4 - Config setup and spam filters

I've recently setup my Ubuntu web server with exim4 so my PHP website applications can send email such as "thank you" and "confirmation" notices.
I've got it setup and working such that I can send email to gmail, Yahoo! and my work address. However, my work email gets caught up in our spam filter. I'm new to setting up mail servers so I'm not sure what I might need to look for in making this mail server more trusted, while keeping is secure.
Here are some details:
Server is NATed behind a firewall.
Firewall has port 25 open for outgoing SMTP traffic (from server to anywhere).
Server is virtual hosting a couple different of our websites
The server is running the following exim4 config:
dc_eximconfig_configtype='internet'
dc_other_hostnames='web-serv.example1.com;example2.com'
dc_local_interfacees='127.0.0.1'
dc_readhost=''
dc_relay_domains=''
dc_minimaldns='false'
dc_relay_nets='' dc_smarthost=''
CFILEMODE='644'
dc_use_split_config='false'
Questions:
Do I need to open port 25 to incoming SMTP mail (anywhere to server)? I wonder if other mail servers need to talk to my mail server to verify itself, in a sort of handshake attempt.
I have not created any MX records primarily because the server has different websites on it the mail server should send mail for all the websites. Do I need to pick/create a domain address and create MX records for it?
One thing of note is that the mail headers look like this:
Return-Path: <www-data#example2.com>
Received: from web-serv.example1.com ([Firewall public IP Address])
Received-SPF: neutral (google.com: [Firewall public IP Address] is neither permitted nor denied by best guess record for domain of www-data#example2.com)
"web-serv" is the host name of the server, such that you get this if you type it into the command line:
$ hostname
web-serv
and "www-data" is the account name for the Apache2 server that Ubuntu gave it as default.
Any other general advice would be appreciated. It's all new to me.
Cheers!
One item of note, since I posted this question time time ago (almost 10 months) is that I found out the biggest issue I had was with setting up the DNS for reverse DNS on our hosting providers side of things.
In other words, our hosting provider (the people who give us our IP address and manage our hardware) had to enter a record to match my server(s) hostname to whatever IP address it used.
There's a specific name for this. I believe it's a "PTR" record but the name escapes me at the moment, but you basically tell them "my server hostname is ..." and they do a quick update to the DNS for reverse DNS purposes.
When I asked this question, we had a different hosting provider who didn't really help explain this to me, and after switching providers, I got to talk to someone who was happy to help me understand that side of the equation.
And as I understand it, this is setup by the people who assign you the IP addresses. But there's probably more to it than that.
Once I got that setup properly, email had no problem getting through the spam filters and Gmail/Yahoo showed SPF as "passed". It was showing neutral before.
Our company email was set to drop any email that would not resolve reverse DNS, which is why I could not even receive the email or find it in the spam filter. Of course, that situation would be dependent on the company and what email policy and software they're using to manage spam. Some might just drop all email that does not reverse DNS and some might dump it in to spam filters instead.
Hope that might help some people with similar issues.
Cheers!

Accept All Incoming Email Messages on Server

I want to write some email scanning software and don't understand how to setup my server. I have a hosted web server running Windows 2003 Server. It is running the Default SMTP Virtual Server with a fully-qualified domain name of abcdef.com (example). DNS is pointing abcdef.com to my server. If I spoof an email from my desktop pc so that it appears to come from info#abcdef.com, and I send the email to a 'non-existant' email address then the bounceback does arrive on my web server and is stored in C:\inetpub\mailroot\Queue on the server - great! (I can scan it and handle the bounceback). However, if I simply send an email straight to info#abcdef.com then it does not seem to get placed anywhere on the server. I don't understand why bouncebacks get stored but other incoming email doesn't. I'm keen to avoid having to install any 'email server software' on the server, as I want to keep things as clean as possible. All I really want is some way of telling the server to accept all incoming messages to abcdef.com so that I can process them myself, and to place the .eml files in a known directory that I can scan. I'll then write an eml file parser to process the files.
Thanks very much.
A possible reason for the lack of delivery is that your domain has a DNS A record, but no DNS MX record. MX records are used for delivery of mail. Historically, if no MX record was present for a domain, mail servers were supposed to fall back to looking for a domain's A record.
In your case, I'd guess that your local mail-sending software is looking for an MX record and then stopping if it doesn't find one, whereas the remote system sending you the bounce is looking for the MX record and then looking for an A record when it can't find one.
The Wikipedia article on MX records has more details.
SMTP is a message transfer agent (MTA), responsible only for handling the transfer of mail from one point (the client, perhaps) to another (the mailbox server, such as a POP or IMAP server). SMTP servers aren't the right tool for ultimately handling mail coming INTO a domain -- they only handle transferring the mail coming into a domain to another app, such as the aforementioned POP or IMAP server, which then know how to sort and store that mail.
In short, the Default SMTP Virtual Server isn't the tool you're looking for for your project.
From this other StackOverflow question, it looks like there are a few SMTP servers which are intended for development use but which might serve the purpose you seek -- they accept incoming messages and then write them to files (in some manner, and with some tweaking).
Ok, working now. Issues were as follows:
There was no MX record, so external email wasn't being directed to the server. The .EML file that existed on the server was indeed placed there by an outbound email process.
The firewall was blocking port 25 - now opened.
It is necessary to have some sort of inbound email service running on the server. Windows Server has a lightweight POP3 service which you can configure to place all incoming email into a single 'catch-all' mailbox. This fills with .EML files, which can then be scanned by our custom service.
Many thanks to delfuego & Jon.