XF 1.2 SMTP Mail Server Not Working Properly

RG70Hz

Active member
I have a domain & domain email all set up. I have some questions I need help with for trouble shooting.

Background info:
OS: Windows Server 2019
Web Server: IIS 10 (using php8)
Forum software: XenForo [1.2.9] (using php5.6.9)
Database: MySQL

I have a locally hosted website using my domain [my domain name]. It uses XenForo forum software and is routed through cloud flare. I have my email routing set up through iCloud [and configured in cloud flare]. Everything is set up, and working, so far.

My goal is to use SMTP to allow for my domain to send emails. Auto generated emails. For example, when a user signs up for my site, they are "Awaiting User Verification". They are supposed to receive and email from my domain (noreply@[mydomainname]) so they can "verify" and be redirected back to the site and become a fully registered user (allowing for total account access ex: change profile picture, post, etc.).
[Note: I temporarily disabled firewall for testing just in case]
I have my SMTP configured like this:

IIS 6.0 Manager >
General tab:
Ip address: (set to my static internal ip of [internal ip])
Access Tab:
Relay restrictions > "All except the list below"
Authentication > Anonymous Access
Delivery Tab:
Outbound Security > Anonymous Access, Enabled TLS Encryption
Outbound Connections > Port 587 (already forwarded on my router [internalip]:587 and in my firewall settings)
Advanced > Default settings

I used the service "https://www.emailsettings.email" to obtain my information for my iCloud email (primary email associated with my domain email) and got this information:
INCOMING SERVER IMAP POP3
Username: [myicloudemail] ...
Server Hostname: imap.mail.me.com ...
Server Port: 993 ...
SSL/TLS: SSL ...
Authentication: App Specific Password ...
OUTGOING SERVER SMTP
Username: [myicloudemail]
Server Hostname: smtp.mail.me.com
Server Port: 587
SSL/TLS: TLS
I input this same information into my XenForo admin panel in "Home > Options > Email Options". I used the "OUTGOING SERVER SMTP" configuration listed above and enabled TLS.

Telnet:
My telnet is also working. In CMD I type "telnet [internal ip] 587" and get the following response: "220 [server name] Microsoft ESMTP MAIL Service, Version: 10.0.17763.1697 ready at Fri, 24 Feb 2023 23:19:04 -0330" which tells me its also working. However, when I sign in and create an email, everything is fine until I try to send the email.

I have a few emails QUEUED but have no idea how to send them.

Also, for what it's worth, I have tried the "sendmail -q" [within cmd & telnet] command per ChatGPT but no luck. It returns a "Batch command not found"

These are the commands I used for telnet:
telnet [internal ip] 587
HELO [mydomainname]
MAIL FROM: [my iCloud email]
RCPT: [test email]
DATA
Subject: Test Email
This is a test email.
.
QUIT

When I use the QUIT command, it just closes the connection [says lost connection to host]. The options listed in telnet are:
"HELO EHLO STARTTLS RCPT DATA RSET MAIL QUIT HELP AUTH TURN ETRN BDAT VRFY".

It does not give me parameter options.

I do not know where to look for any logs for telnet. I also don't see anything in "events". Maybe I don't know what to look for.
Now onto my php settings. In both php.ini files (php5 & php8) I have the following configuration for SMTP:
[mail function]
SMTP = [internal ip]
; https://php.net/smtp-port
smtp_port = 587
; For Win32 only.
; https://php.net/sendmail-from
sendmail_from = [my iCloud email]

Inside "SMTP Emails" [in IIS Manager] I have the iCloud email configured.

All services are running [when I checked Services].

I sent an email from my domain email [hosted on iCloud] and it sent [through the mail app]

I think this is all the information needed to help troubleshoot. If more is needed, I will provide.

Onto my questions:
  1. Why are my emails not sending?
  2. How do I send the emails in the QUEUE (Any other option besides "QUIT"?)?
  3. Do I have any options besides the "LIST" option since it's not listed in my telnet?
  4. Is there any other way to test this?
It's important to note that I am novice but have the burning desire to learn, so any info provided must be clear and concise.
 
Last edited:
What do you mean?
It looks like it's trying to connect to an MTA at localhost on port 587. Do you have an SMTP instance running on localhost?
If you are using a Windows IIS server, I doubt you have an SMTP server active (if so, what are you using, and is it enabled for localhost access), so you will need to be connecting to a MTA out in the "real world".
Screenshot the email settings in your ACP and block out any username/passwords you are using.
 
It looks like it's trying to connect to an MTA at localhost on port 587. Do you have an SMTP instance running on localhost?
If you are using a Windows IIS server, I doubt you have an SMTP server active (if so, what are you using, and is it enabled for localhost access), so you will need to be connecting to a MTA out in the "real world".
Screenshot the email settings in your ACP and block out any username/passwords you are using.
I updated my question with more information.
 
I updated my question with more information.
If you are trying to use Apple email for a relay.. they may not allow that.
If you are using that apple email account to send with, you need to use the parameters for connecting to their SMTP server and authenticating directly in the ACP.
 
Last edited:
If you are trying to use Apple email for a relay.. they may not allow that.
If you are using that apple email account to send with, you need to use the parameters for connecting to their SMTP server and authenticating directly.
I did all of that already. I was literally on the phone with apple support who helped me configure the domain email of this purpose. They know everything I just explained in the question. The person was very insightful. However, this seems to be an issue with the server and not apple.
 
I did all of that already. I was literally on the phone with apple support who helped me configure the domain email of this purpose. They know everything I just explained in the question. The person was very insightful. However, this seems to be an issue with the server and not apple.
My point is... WHY are you trying to use a locally set up server to RELAY your outbound email to Apple when you can simply set up the Apple SMTP service directly in the ACP and have your email sent directly to Apple's SMTP service.
You still haven't shown what your ACP settings for sending email in your XF ACP is. THAT will help more than anything. Right now, it's hard to tell if you are trying to send directly from XF to Apple, send from XF to localhost SMTP service and then HOPE it relays to Apple or what exactly.
And be aware... SOME mailing setups like GMail and such will NOT allow a programatic connection to send email like XF uses... it works fine with an email client, but XF is not that.
 
My point is... WHY are you trying to use a locally set up server to RELAY your outbound email to Apple when you can simply set up the Apple SMTP service directly in the ACP and have your email sent directly to Apple's SMTP service.
You still haven't shown what your ACP settings for sending email in your XF ACP is. THAT will help more than anything. Right now, it's hard to tell if you are trying to send directly from XF to Apple, send from XF to localhost SMTP service and then HOPE it relays to Apple or what exactly.
And be aware... SOME mailing setups like GMail and such will NOT allow a programatic connection to send email like XF uses... it works fine with an email client, but XF is not that.
I stated in the bottom that I am a novice and have been using chat get for guidance. Do I only need one? I was of the understanding I need to route the emails through my local server AND a domain email. Is this incorrect? I just signed up for sendgrid and configured everything so my site should be using Sendgrid now. However, I did edit the php files and SMTP Email settings with the info provided. Do I change this? Are you saying it's not needed on both? Only one configuration is needed? I need clarification. Maybe I've been at the computer too long today and need to take a break. My head is spinning.

I appreciate your help nonetheless. If this is a simple fix [of just having one relay] then ill be ready to pull my hair out.
 
Forget everything about SMTP on the server, you just don't need it.

Just enter your external SMTP details in your XF control panel.
Well. Now that everything is all set up, how do I go about disabling everything on the system? Is it as simple as stopping the SMTP server on the local machine? I should also delete the domain email I used on iCloud correct? (if im using sendgrid that is). Do I need to uninstall the features from the roles and that will take care of everything? I can comment back out the lines in the php configs. Should I do that as well? Id assume if so, id also have to remove the forwarding rules I created since they're no longer needed?

Edit: I removed smtp from my local server and php configuration. I still have my Apple domain which is configured through cloudflare. Do you know if sendgrid has their own DNS I need to configure ? Should I keep iCloud in cloudflare? Or should I revert back to their defaults records?
 
Last edited:
I have a domain & domain email all set up. I have some questions I need help with for trouble shooting.

Background info:


I have a locally hosted website using my domain [my domain name]. It uses XenForo forum software and is routed through cloud flare. I have my email routing set up through iCloud [and configured in cloud flare]. Everything is set up, and working, so far.

My goal is to use SMTP to allow for my domain to send emails. Auto generated emails. For example, when a user signs up for my site, they are "Awaiting User Verification". They are supposed to receive and email from my domain (noreply@[mydomainname]) so they can "verify" and be redirected back to the site and become a fully registered user (allowing for total account access ex: change profile picture, post, etc.).
[Note: I temporarily disabled firewall for testing just in case]
I have my SMTP configured like this:

IIS 6.0 Manager >
General tab:

Access Tab:

Delivery Tab:



I used the service "https://www.emailsettings.email" to obtain my information for my iCloud email (primary email associated with my domain email) and got this information:

I input this same information into my XenForo admin panel in "Home > Options > Email Options". I used the "OUTGOING SERVER SMTP" configuration listed above and enabled TLS.

Telnet:
My telnet is also working. In CMD I type "telnet [internal ip] 587" and get the following response: "220 [server name] Microsoft ESMTP MAIL Service, Version: 10.0.17763.1697 ready at Fri, 24 Feb 2023 23:19:04 -0330" which tells me its also working. However, when I sign in and create an email, everything is fine until I try to send the email.

I have a few emails QUEUED but have no idea how to send them.

Also, for what it's worth, I have tried the "sendmail -q" [within cmd & telnet] command per ChatGPT but no luck. It returns a "Batch command not found"

These are the commands I used for telnet:


When I use the QUIT command, it just closes the connection [says lost connection to host]. The options listed in telnet are:


It does not give me parameter options.

I do not know where to look for any logs for telnet. I also don't see anything in "events". Maybe I don't know what to look for.
Now onto my php settings. In both php.ini files (php5 & php8) I have the following configuration for SMTP:
[mail function]


Inside "SMTP Emails" [in IIS Manager] I have the iCloud email configured.

All services are running [when I checked Services].

I sent an email from my domain email [hosted on iCloud] and it sent [through the mail app]

I think this is all the information needed to help troubleshoot. If more is needed, I will provide.

Onto my questions:
  1. Why are my emails not sending?
  2. How do I send the emails in the QUEUE (Any other option besides "QUIT"?)?
  3. Do I have any options besides the "LIST" option since it's not listed in my telnet?
  4. Is there any other way to test this?
It's important to note that I am novice but have the burning desire to learn, so any info provided must be clear and concise.
Sir what is your server system? plesk, centos, directadmin, .... ?
 
Well. Now that everything is all set up, how do I go about disabling everything on the system? Is it as simple as stopping the SMTP server on the local machine? I should also delete the domain email I used on iCloud correct? (if im using sendgrid that is). Do I need to uninstall the features from the roles and that will take care of everything? I can comment back out the lines in the php configs. Should I do that as well? Id assume if so, id also have to remove the forwarding rules I created since they're no longer needed?

Edit: I removed smtp from my local server and php configuration. I still have my Apple domain which is configured through cloudflare. Do you know if sendgrid has their own DNS I need to configure ? Should I keep iCloud in cloudflare? Or should I revert back to their defaults records?
You dont need anything in Cloudflare; you only need to enter the SMTP server details in your XF admin control panel.
 
I stated in the bottom that I am a novice and have been using chat get for guidance. Do I only need one? I was of the understanding I need to route the emails through my local server AND a domain email. Is this incorrect? I just signed up for sendgrid and configured everything so my site should be using Sendgrid now. However, I did edit the php files and SMTP Email settings with the info provided. Do I change this? Are you saying it's not needed on both? Only one configuration is needed? I need clarification. Maybe I've been at the computer too long today and need to take a break. My head is spinning.

I appreciate your help nonetheless. If this is a simple fix [of just having one relay] then ill be ready to pull my hair out.
You ONLY need to send your email outbound through an authorized SMTP server (which you configure to send to in your XF ACP). As I said, it appears you are trying to RELAY... and that is not something that a neophyte can easily set up, as you have to be sure that the recipient you are sending to is set to allow relaying from YOUR SERVER, along with a LOT of other steps. And I can almost guarantee you that Apple is NOT set up to do that from a home ISP server for a domain without more detailed work.

I personally use Amazone SES for my transactional email (which is what you are referring to) and have separate accounts with another provider set up for the bounce and unsubscribe email from another provider.

ALL you need to do is have a VALID SMTP receiver that you can connect to with a valid account and then send the outbound emails from it.
Another problem you will probably have is a LARGE amount of your emails will be shown as spam unless you use a reliable server (which SendGrid is).

Suggestion... dump your home setup and fork over a couple of bucks a month for an actual VPS out on the internet. If you are insistent, you CAN find WinBlows servers available... but there is a reason that they are the minority of serving websites.
 
You ONLY need to send your email outbound through an authorized SMTP server. As I said, it appears you are trying to RELAY... and that is not something that a neophyte can easily set up, as you have to be sure that the recipient you are sending to is set to allow relaying from YOUR SERVER, along with a LOT of other steps. And I can almost guarantee you that Apple is NOT set up to do that from a home ISP server for a domain without more detailed work.

I personally use Amazone SES for my transactional email (which is what you are referring to) and have separate accounts with another provider set up for the bounce and unsubscribe email from another provider.

ALL you need to do is have a VALID SMTP receiver that you can connect to with a valid account and then send the outbound emails from it.
Another problem you will probably have is a LARGE amount of your emails will be shown as spam unless you use a reliable server (which SendGrid is).
Thank you for the information. I’ll look into it more. I’ve since switched my dns records and everything over to send grid. Removed SMTP from IIS along with the configurations. Added send grid to my admin panel. It’s stilll not working currently but I’ll wait for send grid team to get back to me. Their test emails aren’t even sending. It’s strange.
 
Back
Top Bottom