SMTP outgoing mail configuration FAILS TEST

SMTP outgoing mail configuration FAILS TEST

by Beto Boton -
Number of replies: 23

Hello

NEW 3.11.2 installation on little oak.net via installatron

I'm really lost with this issue.

Attempting to complete the:  Home / Site administration / Server / Email / Outgoing mail configuration

Host Name mail.guardedhost.com

Port 587

Username beto.  online  @  betoboton  .com (real email but Extra spaces added HERE ONLY)

Password it is correct since I can login from my mac , and also via webmail

SMTP security set to TLS

Authentication via LOGIN

USING THE TESTMAIL I GET:

Your site couldn't communicate with your mail server. Please check your outgoing mail configuration.

IF I REMOVE the Host Name and leave it BLANK it tells me the message was sent successfully, BUT regardless the email address I send it TO, the message is NEVER received.

HOW DO I CONFIGURE MOODLE TO SEND EMAIL FROM MY EMAIL HOST AND ADDRESS? 


ALSO IF i add a user using 
  • Email-based self-registration with admin confirmation plugin
I do not get an email to confirm the user access as I used to receive

ANY HELP would be much appreciated, since no email = no moodle...

Kind Regards
Beto Boton

Average of ratings: -
In reply to Beto Boton

Re: SMTP outgoing mail configuration FAILS TEST

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
To be double sure, you could configure a real mail client like Thunderbird to send e-mails with your account. Then compare its settings with those you have given Moodle.

If the tally 100% and still no success, check the firewall rules of your server. They should allow outgoing connections to the port in the SMTP hosts field.
Average of ratings: Useful (1)
In reply to Visvanath Ratnaweera

Re: SMTP outgoing mail configuration FAILS TEST

by Beto Boton -

Hi

Thanks for your reply 

I can log to the smtp and send email from all mail clients and from webmai.

The Only place it doesn’t work is from moodle 3.11.2

here are the instruction to the smtp

https://www.omnis.com/knowledge/24.html

It seem I'm doing 100% correct

Regards

Beto Boton

In reply to Visvanath Ratnaweera

Re: SMTP outgoing mail configuration FAILS TEST

by Beto Boton -
YES, I can configure and send mail from an email client, Thunderbird, Mac Mail etc

Here are the instruction on my hosting services email area:

Port 587
Port 587 is the industry standard email 'submission' port.
SMTP port 25 is blocked by most ISPs and is discouraged from being used.
For information on how to enable this feature please consult the email client software's documentation.
Host Name mail.guardedhost.com
Encryption is available for Outbound mail (SMTP) via TLS
Transport Layer Security (TLS) is an alternative to SSL for encrypting a stream of packets end-to-end.
Simply enable TLS (or STARTTLS) in your email application. Consult the documentation for the email application for assistance with these settings.


THANK YOU

Beto Boton
In reply to Beto Boton

Re: SMTP outgoing mail configuration FAILS TEST

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
There is nothing wrong with the port 587. The question is whether your server can reach that port of your smtp provider.

Here's a quick test from my laptop (which gives a positive result):
Attachment smtp-guardedhost.png
Average of ratings: Useful (1)
In reply to Visvanath Ratnaweera

Re: SMTP outgoing mail configuration FAILS TEST

by Beto Boton -
Once again , thank you for your help.
I have 10 email addresses on this server which is my hosting.
Thunderbird works, Mac Mail works, My website form works, My Paypal ordering system works fine. They all use the same SMTP on my HOSTING services with my domain betoboton.com.
Why Moodle 3.11.1 and 3.11.2 don't?
I had a previous installation of Moodle up to 3.10 which worked without any issues with this SMTP fr years and several upgrades, until last month when an automatic version upgrade did not complete properly .
I REMOVED the older Moodle install (deleted completely) and reinstalled from scratch using Installatron, in a different folder on my hosting services, just to make sure no issues could arise.

Well It seems there is no answer to this issue and it is very frustrating to see years of work going to the rubbish bin .

Thank you for trying hard to help, I do appreciate it.

Kind Regards
Beto Boton
In reply to Beto Boton

Re: SMTP outgoing mail configuration FAILS TEST

by Ken Task -
Picture of Particularly helpful Moodlers

Has there been any changes to DNS? not made by you but provider?  Any change the servers that are to relay?

mail.guardedhost.com
mail.guardedhost.com.    86400    IN    A    216.239.133.245

A postfix Customer Mail Relay ONLY?  Relays to where?

dig betoboton.com -t MX
betoboton.com.        86400    IN    MX    10 postoffice.guardedhost.com
postoffice.guardedhost.com. 86400 IN    A    216.239.133.243

Aren't all the clients you tested with using IMAP?

Are there maillogs on your server?   What do they show?

What if you logged onto server via ssh and installed 'alpine' ... a text based mail application.   And use it to send to yourself.

'SoS', Ken


In reply to Ken Task

Re: SMTP outgoing mail configuration FAILS TEST

by Beto Boton -
Thank you Ken

Let me try:
1- No DNS
2- No clients using IMAP
3- No mail logs but I send and receive quite a few emails a day from this server
4- I don't have a clue how to use SSH to log on to the server and check for something.
TRUST ME there is nothing wrong on the server, otherwise I would not be able to send any email from any of my 10 emailsl addresses using smtp.guardedhost.com on port 587.
CHECKED with my hosting services and it is all Rechecked and working.

Thank you
Beto Boton
In reply to Beto Boton

Re: SMTP outgoing mail configuration FAILS TEST

by Ken Task -
Picture of Particularly helpful Moodlers

In this response ... I see smtp.guardedhost.com yet in your other postings mail.guardedhost.com - so which/what is it?

smtp.guardedhost.com doesn't exist in DNS!

One doesn't actually 'login' using SMTP.

No logs!!!!  Really!!!!  How about web service error logs?

Do you have an old email message from your moodle server?

If so, can you look at the full header of that message and look from the Subject line upwards ....shows the paths that took.

I'll send you a PM in this system ... try what it says in that PM!

'SoS', Ken


In reply to Beto Boton

Re: SMTP outgoing mail configuration FAILS TEST

by Ken Task -
Picture of Particularly helpful Moodlers

set smtp session limit to default 1
set email subject prefix text to default ... blank remove EDU:

The only reason I pm'd my real email address was to get a look at a full header.   Please don't think that I'm taking on personal/just in time support for free.

Yes, the stars are not aligned right for you ... and we don't know why. sad

I use SendGrid (SMTP via API key) for my sites ... have a 3.10.highest and a 3.11.highest and no issues sending via SendGrid.   I also don't use Installertron.

Like all things web and email ... further one strays from the masses the stranger web and email things can get ... IMHO!

'SoS', Ken

In reply to Ken Task

Re: SMTP outgoing mail configuration FAILS TEST

by Ken Task -
Picture of Particularly helpful Moodlers

You need to get your hosting provider support involved with this.

Tiz midnight here ... need zzzzzz's.

Good luck!

'SoS', Ken


In reply to Beto Boton

Re: SMTP outgoing mail configuration FAILS TEST

by Ken Task -
Picture of Particularly helpful Moodlers

A follow up ...

"I had a previous installation of Moodle up to 3.10 which worked without any issues with this SMTP fr years and several upgrades, until last month when an automatic version upgrade did not complete properly"

Moodle doesn't have an 'auto version upgrade'.  Why did the installatron auto version upgrade fail ... or not complete properly?

And ... 'using Installatron'.   Moodle doesn't have official docs on 'Installatron'.

Just thinkin' out loud! smile

'SoS', Ken

In reply to Ken Task

Re: SMTP outgoing mail configuration FAILS TEST

by Beto Boton -

Hello Ken

Attached is a pdf showing the automatic update on installatron FYI.

Update did not complete stating there were "multiple versions of Moodle" installed, but that is in the past .



In reply to Beto Boton

Re: SMTP outgoing mail configuration FAILS TEST

by Ken Task -
Picture of Particularly helpful Moodlers

I don't work for Moodle HQ nor do I program, but I have used Moodle a very long time and installed/updated/upgraded many sites ... never with Installatron.

Installatron is not programmed nor provided by moodle.org.

now to others ...

In reply to Beto Boton

Re: SMTP outgoing mail configuration FAILS TEST

by Ken Task -
Picture of Particularly helpful Moodlers

Maybe someone else knows but thought I'd ask you cause this is what your server appears to be running ...

server: openresty/1.15.8.2

Anyone in these forums run an openresty or have experience with one?

From what I read based on nginx?

Wonder what else is 'different' about it?

'SoS', Ken

In reply to Beto Boton

Re: SMTP outgoing mail configuration FAILS TEST

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
Hi

No problem. Surprisingly, something as simple as an e-mail can get very complicated and generate heat.
wink

You wrote:
> I have 10 email addresses on this server which is my hosting.

You mean, 10 e-mail addresses from guardedhost.com.

> Thunderbird works, Mac Mail works, My website form works, My Paypal ordering system works fine.

Know nothing about Mac Mail and Paypal odering. But Thunderbird and the contact form of your website sending mail are useful clues. Means the SMTP service is running, the parameters you enter are correct and no firewall blocks outgoing SMTP(Auth) connections from your Moodle server.

> Why Moodle 3.11.1 and 3.11.2 don't?
> I had a previous installation of Moodle up to 3.10 which worked without any issues with this SMTP fr years and several upgrades,

You didn't say that earlier.

> until last month when an automatic version upgrade did not complete properly .

So a botched upgrade is a strong suspect. I saw in your server contract that the provider makes a snap-shot of the server before an upgrade. So fall back to the snap-shot. I note that they offer Moodle packaged their own way. You haven't installed it yourself downloading the source from moodle.org. If you can reproduce that 3.11.1 works and 3.11.2 doesn't, it is the job of the hosting provider to solve look in to the problem. Without Unix command line access (CLI), you are not even in a position to provide them with clues or evidence.

Well, theoretically it is possible that 3.11.2 introduced a bug. But outgoing e-mail is such a critical function, others would have reported it. My "latest" productive Moodle sites run 3.9.current, so no idea what's happening on the bleeding edge.

> Well It seems there is no answer to this issue

The cause has not yet been identified. You are jumping to conclusions.

> and it is very frustrating to see years of work going to the rubbish bin.

I am at a loss to understand how a blockade in outgoing e-mail destroys your site's content.

> Thank you for trying hard to help, I do appreciate it.

Solving computer problems is the easiest thing in the world. They are rational.
smile
In reply to Visvanath Ratnaweera

Re: SMTP outgoing mail configuration FAILS TEST

by Beto Boton -
THANK YOU VERY MUCH for your encouragement.
I found a solution and will be posting it soon so other users don't go trough the same ordeal .
Kind Regards
Beto Boton
In reply to Beto Boton

Re: SMTP outgoing mail configuration FAILS TEST

by Beto Boton -

Solution to Outgoing mail configuration


During the last 65 years of my life and being involved in computer sciences since 1974, I learned (the hard way) that the solution is sitting in front of you all the time, you just need to look deeply.

I have 2 other Moodle installations sitting on Synology NAS for development purposes and I used them to test my solution before going to the live installation on littleoak.net server.
They all worked fine

Here is the solution to this issue:

DO NOT COMPLETE THE Site administration / Server / Email / Outgoing mail configuration

I'm posting a pdf showing leaving every field but 1 empty it will work ( at least it did for me)

THE ONLY FIELD I HAVE FILLED is No Reply address and everythiing else is blank.
(see Success Boton Astrology/ Administration/ Server/ Email/ Outgoing mail configuration.pdf attached)

Testing the configuration I got a successful message see attached Success result outgoing config.pdf

and I received a confirmation email
This is a test message to confirm that you have successfully configured
your site's outgoing mail.



I HAVE NO IDEA WHY IT WORKED but as someone pointed out "the stars were not aligned to me", and I knew that was a wrong conclusion, I'm used to a life of overcoming obstacles. I believe it is because I'm on the same server domain (not sure)

To the enlightend ones,the email has the following header:

"Carlos Alberto (Beto) Boton"
Boton Astrology: test message
To: "Carlos Alberto (Beto) Boton"
Reply-To: "Carlos Alberto (Beto) Boton"
Content-Type: ⁨text/plain; charset=UTF-8⁩
Mime-Version: ⁨1.0⁩
X-Mailer: ⁨PHPMailer 6.2.0 (https://github.com/PHPMailer/PHPMailer)⁩
Return-Path: ⁨⁩
X-Antiabuse: ⁨This header was added to track abuse, please include it with any abuse report⁩
X-Virus-Status: ⁨Clean⁩
Received: ⁨from tev-mbp3.omnis.com ([216.239.133.141]) by tev-mailbox8.omnis.com with LMTP id xQlyD1xHFGEYCgAA2pUiBA (envelope-from ) for ; Wed, 11 Aug 2021 21:55:40 +0000⁩
Received: ⁨from postoffice.omnis.com ([216.239.133.141]) by tev-mbp3.omnis.com with LMTP id 4HRHDlxHFGFgZgAACXjPUA (envelope-from ) for ; Wed, 11 Aug 2021 21:55:40 +0000⁩
Received: ⁨from outbound-relay7.guardedhost.com (outbound-relay7.guardedhost.com [216.239.133.207]) by postoffice.guardedhost.com (Postfix) with ESMTPS id 4GlNt333hBz2xZc for ; Wed, 11 Aug 2021 21:55:39 +0000 (GMT)⁩
Received: ⁨from mail.guardedhost.com (tev-mx6.omnis.com [216.239.133.155]) by outbound-relay5.guardedhost.com (Postfix) with ESMTP id 4GlNt30sCvzD3B for ; Wed, 11 Aug 2021 21:55:39 +0000 (GMT)⁩
Received: ⁨from tev-cl06.omnis.com (tev-cl06.omnis.com [216.239.136.60]) by mail.guardedhost.com (Postfix) with ESMTP id 4GlNt22m4Fz2xZ9 for ; Wed, 11 Aug 2021 21:55:38 +0000 (GMT)⁩
Received: ⁨by tev-cl06.omnis.com (Postfix, from userid 248948) id 1A58A30CC131; Wed, 11 Aug 2021 21:55:38 +0000 (GMT)⁩
⁨⁩
Delivered-To: ⁨beto@betoboton.com⁩
X-Antiabuse-Id: ⁨DD7D1752-FAEE-11EB-BAC1-A46DBF64A2FA⁩
Received-Spf: ⁨pass⁩
Authentication-Results: ⁨mail.guardedhost.com;auth=none⁩
Authentication-Results: ⁨postoffice.guardedhost.com; iprev=pass; spf=pass smtp.mailfrom=betoboton.com⁩


=================
THANK YOU VERY MUCH FOR ALL THE PRECIOUS HELP YOU ALL GAVE
==================

Kind Regards
Beto Boton
Average of ratings: Useful (1)
In reply to Beto Boton

Re: SMTP outgoing mail configuration FAILS TEST

by Ken Task -
Picture of Particularly helpful Moodlers

Congrats!   The 'Stars Aligned!' smile

For others reading this solution to an 'outer limits' setup ... the reason for failure, noreply address is checked and one of ... note that's one of ... the other mail servers involved in relaying mail from this moodle had a rule to trap messages IF the message did have a what checkers considered a server mis-match in noreply address ie, @tld not the mail server for the @tld

Other mail servers involved in relay and checking:

Received: ⁨from postoffice.omnis.com ([216.239.133.141])
Received: ⁨from outbound-relay7.guardedhost.com (outbound-relay7.guardedhost.com [216.239.133.207])
Received: ⁨from mail.guardedhost.com (tev-mx6.omnis.com [216.239.133.155])

Server is *now* using the built in PHPMailer which is default for Moodles when not using SMTP relay.

X-Mailer: ⁨PHPMailer 6.2.0 (https://github.com/PHPMailer/PHPMailer)⁩

Trick to that form ... use a local to server account and the FQDN of the moodle server itself ... server really won't be getting that mail from outside ... but it could be used to do so from localhost ... and that seems to satisfy those other relay mail servers checks on spam.

All is well that ends well!    And the 'Stars did align' ... finally ... didn't  they. smile

'SoS', Ken

In reply to Beto Boton

Re: SMTP outgoing mail configuration FAILS TEST

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
Glad to hear the good news. Now the "stars had second thoughts" time to analyze what happened.

Your solution is something new, a change of cause. Instead of relaying the mails through an external (SMTPAuth) service you relay them from "localhost", the same machine where Moodle runs. You were lucky. Unknown to you, there was a "Sendmail" running in addition to the web server.

Side note, an old (historical) problem Moodle has: When there is nothing in the SMTP hosts field, Moodle fills it with 'localhost' behind our backs. Less parameters to fill for some Moodle administrators, untold pain for others.

So, your original problem, as also pointed out by Ken, must have been that your external provider refuses sending mail with your account on behalf of other accounts. We couldn't debug that since you don't have access to the logs of their mail service. The full headers you've would have evidence unless the HTML editor of this forum haven't purged all mail addresses (bracketed in <>). You might want to attach it as a text file.

For the peace of mind, you could go back to the setup with the trouble, use the e-mail address of the mail account you are authenticating with as the no-reply address and retry.

But, you also have made statements confusing us. For example,
> Why Moodle 3.11.1 and 3.11.2 don't?
> I had a previous installation of Moodle up to 3.10 which worked without any issues with this SMTP fr years and several upgrades, until last month when an automatic version upgrade did not complete properly.

There were other differences than just the (scripted) update, right?
In reply to Visvanath Ratnaweera

Re: SMTP outgoing mail configuration FAILS TEST

by Beto Boton -
First of all, THANK YOU, your explanations really clarified a lot of questions I had.
Perhaps I didn't write it properly:
First installation was in 2017
Updates followed normal until ver 3.9
When updated to 3.10 it failed
RESTORED 3.9 from backup
Problem started
Updated 3.10 again problem continued
Gave up and deleted the whole thing
NEW from scratch installation 3.11 on a new folder on the server, no emails where sent whatsoever (not configured, and that is why I started configuring)

Asked support from my hosting services (little oak.net) who does not offer support at all for Moodle installations on their services, beside it offers installatron services to install Moodle !
Since I have lost access to my previous installation, I used as an example the setup from my NAS installations of Moodle (which works fine)

Then came the idea of returning to no parameters and starting adding one parameter at the time.

That is how I found out, no parameter and adding just the return address worked.

I'm Glad and hopefully, if it happens to someone else this tread can be of assistance

Once again Thank you for your help

Kind Regards
Beto Boton
Average of ratings: Useful (1)
In reply to Beto Boton

Re: SMTP outgoing mail configuration FAILS TEST

by Ken Task -
Picture of Particularly helpful Moodlers

Welcome!  Think hosting providers that offer things like Installertron for Moodle and then turn around and say they don't support is a mixed message.    Seems like they all do it. :\

Yes, your trials and tribulations with this could possibly help others.   Thanks for 'sharing' back what worked for you.

'SoS', Ken

In reply to Ken Task

Re: SMTP outgoing mail configuration FAILS TEST

by James Peter -
Hi Ken
Glad to see you here with helping hands smile
which email sending option is fast and safe and best?

SMTP ?
or internal sendmail ?

Is there any way to configure Microsoft exchange server ?


Thanks
In reply to James Peter

Re: SMTP outgoing mail configuration FAILS TEST

by Ken Task -
Picture of Particularly helpful Moodlers

@jasim ... you really should start your own thread rather then piggy-backing ... even if your question is related.   Your question/issues deserve individual attention, do they not?

To answer briefly ... 'best' ... is debatable, and I am perhaps the last person to ask about any Microsoft product.  'fast' ... what's expectations there?   I'll trade 'fast' for 'secure' and reliable any day.

Can tell you that any service (like sendmail) configured to not only send but receive mail adds to the 'attack surface' of the server where moodle resides.    Many years ago I ran Sendmail ... bought an O'Reily book on Sendmail ... it was 2.5 inches thick and discussed and provided all possible rules to Sendmail at that time.  I did not/could not read it cover to cover but used as a reference when/if needed.   Running one really required a 'degree' or 'shingle' I was not really willing to pursue - didn't have the time for one (same probably applies to Exchange).

Moodle really only needs to be able to send mail.   And an SMTP relay is 'best' for the rest.

My preference is locally installed PostFix as sending only - configured to use SendGrid's API Key SMTP relay - in both the local Postfix as well as Moodle config.

'SoS', Ken