No Such User Here VPN/WHM with Mail Routed through Separate Server - email

Ok, I am using a VPN on GoDaddy for webhosting. But on one of the websites that I am hosting, the email is handled on a separate VPN.
So I have an A record for domain.com set to the GoDaddy VPN and an A record for mail.domain.com set to the IP of the other domain and several CNAMES pointed to that A record. It's all working beautifully except for one thing....
Email from other domains on the GoDaddy VPN cannot send to this domain. So myemail#mydomain.com cannot send to email#separateemailvpn.com
I get error "No Such User Here" from my server.
I understand that the GoDaddy VPN is checking for that user locally and not finding it, but I don't know how to make it NOT check for this domain.
I am using WHM/cPanel with Exim and SpamAsassin. Thanks!

Not sure what the deal is with the downvotes, but here was my solution (probably obvious).
From Linux Terminal:
sudo su (for admin rights)
nano /etc/localdomains (erase domain from local domains)
nano /etc/remotedomains (add domain to remote domains)
Now it doesn't check that domain for users locally before it sends it out to the remote server.

Changing the mail exchanger on the server is relatively easy from WHM too. In WHM left menu, navigate to "DNS Functions >> Edit MX Entry". From there, simply select the domain name you wish to edit, and then select the desired mail exchanger to change the mail routing settings for the domain.
The options are Auto, Local Mail Exchanger, Backup Mail Exchanger, or Remote Mail Exchanger. Set to "Remote Mail Exchanger" and click Save to have WHM update the /etc/localdomains and /etc/remotedomains for you.

Related

The IP you're using to send mail is not authorized 550-5.7.1 to send email directly to our servers

I am new to DO and I have tried to look for solution online but I didn't find any answer. I am using Ubuntu OS 20.04(LTS)X64 version.
My question is that I have 2 droplets, MailServer droplet where I have installed docker composer and mailcow to run mail mails, and another droplet named WebServer hosting my domains. I have also set up all required DS records under my domain added on WebServer droplet and pointed A record mail.mydomail.com to the IP of mail server droplet. However, whenever I try sending emails they all bounce back unless the ones sending between mydomain users(user1#mydomain.com & user2#mydomain.com). It just says that "The IP you're using to send mail is not authorized.....".
Any support to help me solve this issue will be highly appreciated. An I am wondering if that approach is possible or if there is any documentation on how someone can set up dns records on one server and configure mailserver on another server using digitalocean.
Here is how I set my DNS on mydomain.com to point to MailServer IP

Send Email From Application Hosted On Local Server

I have orangescrum installed on both local server and cloud server. When I try to send E-mail to other user from local server the mail is not getting delivered. I have checked the SMTP configurations, all seems fine. I checked email track delivery on cpanel but no email is shown.
I want mail server hosted on cloud to accept those emails originated from my local server and send it to the destination email address. It seems like something is blocking the request. Should I have to configure(DKIM,SPF etc) anything on cpanel so that it accept my mails? Any help is much appreciated.
Looks like you want to use your cpanel server as "smarthost" for your local server.
In cPanel you can do it in this way:
You can add the IP address/hostname of the local server (public IP) to the
following options in "WHM Home » Service Configuration » Exim
Configuration Manager":
"Trusted SMTP IP addresses"
"Backup MX hosts"
In some cases you may need to add the IP address to the
/etc/alwaysrelay file and enable Antirelayd.

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

Plesk, Email with localy established domain where the mail server is external

i have a big problem with the setup for an Domain.
The Webservices are established on our Server but the Mail functions are on a Server of an other Company when we now want send an Email over our Server he tried to send it localy insted of sending it to an other server so he give back an no account here error.
Thanks for helping me out and friendly greetings.
Edit: OS Debian 6
Imap: Courier
Send: Postfix
CP: Plesk
Further to this, we are using Plesk 11.5.3 on a setup where a single mail service is activated for all domains.
So each domain cannot have the mail service turned on or off individually.
We had the same problem as Franco, and we fixed this by running the following command for each domain that had external email:
# /usr/local/psa/bin/mail --off domain.com
Works perfectly, and removes any previously created local email addresses from Postfix.
"The problem is because the server will attempt to deliver emails for the domain name locally by default. To resolve that problem you would need to set it to use the domain name's MX record."
The simple answer is to disable mail services for the subscription.
Untick the box for "Activate mail service on domain".

sendmail and MX records when mail server is not on web host

This is a problem I'm sure is easy to fix, but I've been banging my head on it all day.
I'm developing a new web site for a client. The web site resides at (this is an example) website.com. I have a PHP form script to email visitors' requests to requests#website.com.
When I coded this on a staging server on a different domain, all worked fine. When I moved it to website.com, the mail messages never arrived. The web server is on a virtual host with a major ISP.
Here's what I've learned since then: My client's mail server is Microsoft Exchange on a box physically in their office. Whenever someone on the outside world emails requests#website.com, the mail arrives. But if the web server sends to the same email address, it fails every time. This is not a PHP problem. I secure shell in to the web server and have tested this both with sendmail and the UNIX mail application. I've also tested it by emailing various email accounts from the shell. I can email myself, for example, just nobody at the website.com domain.
In short, when I'm logged in to website.com, mail to requests#website.com, user#website.com, another_user#website.com all fail. All other addresses work fine. What I've discovered is those dropped emails are routed to the web server's "catchall" account where they sit in its inbox.
I've done an MX lookup on website.com. The MX record points to mailsec.website.com. I can telnet to mailsec.website.com port 25 and see the SMTP server.
It appears to me that website.com isn't doing an MX lookup when it's sending mail to requests#website.com. My theory is that it recognizes the domain as local, sees that there's no "requests" user account to deliver it to, and drops the mail into the catchall account. What I want is to force sendmail to do the MX lookup and send the message on to the Exchange server. I'm at wit's end here. I can't figure out how to do this.
For that matter, I may be way off base here and have misdiagnosed this entirely. Internet mail and MX has always seemed a black art to me, and my ignorance is certainly showing in this question.
I think the problem is that sendmail (your process) is talking to the local sendmail daemon. The local sendmail daemon thinks that because it is website.com, it should know how to deliver the email. Unfortunately, the actual address in the to field does not exist on the web server and thus it dumps it in the "catchall" mail box. You should talk to your ISP and have them update their sendmail configuration so that mail addressed to ...#website.com gets forward to the mail exchanger instead of being handled locally.
Sendmail by default guesses list of local email domains.
It can be turned off using the following line in your sendmail.mc file:
define(`confDONT_PROBE_INTERFACES',`True')
As root list local email domains before and after the change using:
echo '$=w' | sendmail -Am -bt
You will see which domains should be added "manually" to (usually) /etc/mail/local-host-names file after disabling auto-guessing.
After changing sendmail.mc:
Generate/compile new sendmail.cf file
Restart sendmail daemon (or send HUP signal)
tvanfosson basically has it, but as a temporary workaround, you should be able to change your script so that it mails 'user#mailsec.website.com', and then the mail will get delivered to the actual mail server.
Edit the tsm.cf file (in /etc/mail/ or similar) to include
FEATURE(relay_entire_domain)
between the DOMAIN() and MAILER() lines. Since you're editing the file, you may want to also improve security with
define(`confPRIVACY_FLAGS',``noexpn,novrfy'')
After changing the tsm.cf file (or any sendmail config file), restart or SIGHUP the sendmail process.
This change is necessary because the WWW and MX servers for the domain do not exist in the same process space; this FEATURE triggers sendmail to process messages for the domain using it's external delivery mechanism.
The edited portion of the tsm.cf file should look similar to this:
DOMAIN(website.com)dnl
FEATURE(relay_entire_domain)dnl
define(`confPRIVACY_FLAGS',``noexpn,novrfy'')dnl
MAILER(smtp)dnl
MAILER(procmail)dnl
What worked for me was to add an MX record on the webserver hosting the website, that points to the host assigned on the original domain name server. In the case presented here would be an mx record pointing to: mailsec.website.com
I'm new here. Wanted to extend RB_CWI answer, but I am not allowed to comment.
His solution worked great.
You are not required to define the DOMAIN().
However, on my system I was required to install the sendmail-cf package.
The instructions below were done on CentOS 6.5
First, install sendmail-cf
sudo yum install sendmail-cf
Then, edit the senmail.mc
sudo vi /etc/mail/sendmail.mc
At the bottom of the file add FEATURE(relay_entire_domain)dnl, so it looks like:
...
FEATURE(relay_entire_domain)dnl
MAILER(smtp)dnl # right above this line
MAILER(procmail)dnl
dnl MAILER(cyrusv2)dnl
Save the file, and restart sendmail.
sudo service sendmail restart
Got stuck on the same problem. MX points to an external Exchange server but php/sendmail did not lookup this record. Instead mails posted by WordPress on this webserver dropped in the catchall-mailbox.
Solution was to delete ALL mailboxes on the webserver. Now sendmail was interested in the MX and all mails went to the Exchange.
However, the Exchange uses the webspace's mail server as SmartHost for outgoing mails. As solution for this, we were able to use the FTP credentials for accessing the mail server. I assume this solution does not work on every provider on this planet, but in our case (all-inkl.com) it worked out.