Form with local SMTP but external mail server

hiredgeek

Member
Jul 9, 2014
15
1
53
cPanel Access Level
Root Administrator
I have websites with contact forms that use SMTP to send notification emails. The forms authenticate to a dedicated [email protected] account on each domain. The local [email protected] account doesn't need to receive email, it's only meant for SMTP outgoing. It works great when I'm using the Local Mail Exchanger setting in cPanel. But I run into problems when a site uses the Remote Mail Exchanger.

For instance, example.com has DNS and email on Bluehost, with the A record pointed at my cPanel server. A form on example.com authenticates via SMTP to the local [email protected] account. Form notifications are emailed to [email protected], which is on another server. Therefore I use "Remote Mail Exchanger", but then I get this error:

DN="/CN=*.bluehost.com": SMTP error from remote mail server after RCPT TO:<[email protected]>: 550-Verification failed for <[email protected]>\n550-No Such User Here\n550 Sender verify failed

So when I select Remote Mail Exchanger, that also effects the outgoing mail and it's trying to connect to bluehost instead of my local account.
Is there a way for the form to connect to it's local SMTP, but still have incoming mail to the same domain go to the remote server?
 
Last edited by a moderator:

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
7,519
1,028
313
cPanel Access Level
Root Administrator
Hey there! The behavior you're seeing sounds correct to me from my understanding of the issue. Could you not authenticate to [email protected] at the remote address, moving that email completely off the local machine? I believe that is where the confusion is, as having both a local address and a remote address is going to cause odd behavior.
 

hiredgeek

Member
Jul 9, 2014
15
1
53
cPanel Access Level
Root Administrator
To clarify, the forms' SMTP credentials use my local server hostname (not the domain) as the host.

Since my SMTP account doesn't need to have incoming mail (and isn't connected to any DNS as far as I can tell), I was hoping to just use it for outgoing mail only. Ideally, that would mean the local server sends the email, but it still routes it externally after it's been sent.

I understand why "Remote Mail Exchanger" effects the outgoing mail of the domain, but perhaps I'm not understanding why the rule is still enforced when the SMTP logs in directly to the local server hostname.

As for authenticating on the remote servers, sometimes I don't have access to do that.
Thanks for your help!
 
Last edited:

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
7,519
1,028
313
cPanel Access Level
Root Administrator
I've thought about this a bit and I think there's a few things happening here:

-authentication to the local machine
-delivery of the form itself
-delivery of the form notification

Is that correct?

I would not expect the remote/local mail exchanger setting to change the authentication on the system in any way since you're using the local hostname. The issue you're running into, if I'm understanding things correctly, is when you send from your form to Bluehost. When this happens while you are set to the remote exchanger option, the mail gets delivered to BlueHost and then you get the error because the verification callouts they use do not detect the "mail" account on the BlueHost side since it only exists in cPanel. That seems like standard behavior to me.

Does that make sense?

Now, when the local exchanger option is set, there's no issue because it just delivers everything locally.

You mentioned you don't have access to remote authentication, but this would just be an email address and password like what you have already setup for the "mail" account in cPanel. Is there no way to get that created on the BlueHost side? I think that would resolve all the issues and confusion you're seeing.
 

hiredgeek

Member
Jul 9, 2014
15
1
53
cPanel Access Level
Root Administrator
Ok so it sounds like the 550 error is from Bluehost's sender verification.
My misunderstanding was I thought the error was from SMTP authentication.
After looking at the logs further, it looks like the local SMTP authorization is successful at first, but then Bluehost responds with it's sender verify error. Not all servers give that response, so perhaps Bluehost has their sender verification On, and others have it Off.

I understand that I can create a mail account on the remote mail server, but I was really hoping I could do it all on my end.
So am I correct in my understanding that what I was trying to do is actually possible, but it's just something that some mail servers like Bluehost don't like?
 

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
7,519
1,028
313
cPanel Access Level
Root Administrator
That's how I'm interpreting things, yes.

This error isn't specific to BlueHost - this error would happen with any server that uses sender verification. We see this frequently on cPanel machines as well. The specific issue here is that the email address doesn't exist where the DNS is trying to deliver email.
 
  • Like
Reactions: hiredgeek