Defining a mail server connection in Lucee Admin

Linux debian 10
Apache
Lucee 5.3.9.133

I started a new server VPS at Gandi.
All going well. (linux, apache, lucee, web displayed well)
Now defining a “mail server” in Lucee Admin server context : mail.gandi.net

I press on “verify” button, then I get this good message : Verification of mail server [mail.gandi.net] was successful.

When I test “send a test mail” , with from/to , seems OK.
But no mail received.

And, when I use the CFmail in a web page, the mails never arrive.

How to ensure the mail server is correct and running, sending the correctly the mails ?

Thanks for help/suggestion.
(I need a mail server)

Did you try to turn logging for mails on?

This is how you can do it:

  1. Step: Log into your server administrator
  2. Step: Go to SettingsLogging
  3. Edit the setting for “mail” and set the level from from “error” to “debug” adn save it. You may need to restart Tomcat, I can’t remember well.
  4. Go to your application and create the mail with cfmail
  5. Check in the web context of that very same application for the logfile /web-inf/lucee/logs/mail.log

If the emails never arrive, it can be very different issues, e.g. spam-filters or depending on the SMTP server you are using, you may need to set for e.g. SPF, DKIM or similar.

I get this error :slight_smile: SMTPAddressFailedException: 554 5.7.1 <xvm-105-187.dc0.ghst.net[46.226.105.187]>: Client host rejected: Access denied

Then, It seems that the SMTP used decline my server IP.
Then, may be , I have to install a mail server on the web server ?
(or can I use some SMTP somewhere ?)
Thanks for suggestion.

Depends. Not necessarily. You need to know why exactly your IP is being denied. Looks like you are trying to use that smtp server without credentials, because the error code the smtp server is returning to you means that "relay is not allowed’ (that means without authentication). You need to have explicit authentication access and enter the credential to your mail settings in your application, just setting as you would do with any other mail cleint (like thunderbird, outlook, etc).

Can I use Postfix in Linux Debian 10
It should do the work ?
But I nerver used it (no experimentation with).
Thanks, Pierre.

Installing a mta mail server isn’t that trivial. There are many other things implicated. I’d check if your ISP that is hosting your domain doesn’t have already such a service available for you. My Domain Name Service provider for example has such a service on top for free. It’s good for most use cases, unless you want to make bulk mailings. But then, installing such an MTA might be more demanding than you are thinking. You’d need to whitelist it, keep on eye on the IP’s reputation and much more.

Well, I understand, I will check this at Gandi.
Thanks, Pierre.

Well , it did work when creating a mailbox at Gandi (admin@leol.fr) and use its parameters in the Lucee administration.

But , something strange,
when I use the Lucee admin to test the mail server, I receive that mail from Lucee admin with this from : admin@leol.fr to : pierre@pl-arts.com

And using a simple CFmail in a site page with same from/to it does not arrive, but no error, no undelivered.
And if I use another simple cfmail : from : pierre@pl-arts.com to : pierre@pl-arts.com
in the site page, it does arrive.
Seems to me misteries, If you have an idea ?
May be to wait arrivals.
Thanks, Pierre.

This sounds/smells like being some kind of spam filtering, but I can’t really say and take any conclusions and see the root of the cause. it can have tons of reasons. But it really doesn’t make sense. I’d say you must use the from emaiil of the smtp account allowed for its specific email. I’d also say, your cfmail is picking the wrong mailserver configuration, but you should be able to see the results in the logs.

Back to this thread, I need to use Postfix.
I used Gandi mail : mail.gandi.net and admin@leol.fr (a declared mail box in Gandi)
This does work well.

But Gandi do not allow large quantity of sent mail.
(I cannot send a large quantity of mail from all server sites)

So, they tell me, if I install a mail server, there is no limit, I work on my own.

Then, I see Postfix installation procedure on the net.
But, I am wondering, what I will have to declare in mail Lucee admnistration
instead of : mail.gandi.net

I take some precaution before starting Postfix installation.

Thanks for any advise.
Pierre.

Hi Pierre,
This forum is for Lucee help.
Installing and configuring postfix - is not really our thing…
if someone knows - I am sure they will help - but just don’t
“expect” postfix hjelp on a Lucee forum.

You might get more (detailed) help on a linux forum.

Also I would suggest that you reach out to Gandi - again.
Ask them if they have any documentation / suggestions for running your own mail server in their environment.

As far as what you declare in the Lucee settings…
That is all determined but how you configured your mail server.
If the mail server is configured for SSL/TLS - then you need match those settings in Lucee.
Etc…

Gavin.

1 Like

What is a “large” quantity to you? I’d say, your provider has a rate limit. Depending on the quantity of your mails, you could programmatically throttle your email sendings. Otherwise I’d suggest to use a mail service that would accomplish such bulk-maililings for you (e.g. mailgun, sendinblue, Amazon SES, etc).

The issue with installing your own MTA is, like I said before, that you need to watch and take care about a lot of additional things. It’s not just installing an MTA server and you are finished. You need to take care of the health of your SMTP server to have a good deliverability/reputation (SPF, DMARC, Rate-Limits, take care of sending policies of big email providers). Otherwise all your emails may not reach your recipients.

As @Gavin_Baumanis suggested, I’d look somewhere else to decide what to do.

OK, thanks,
large quantity may be : some thousands mail in a day (5000 example)
A site can publish some (5 to 10) advertisements in a day delivered to something like 500 members. (the mails are very short, 2 lines of text with a link to the site)
So Gandi do not allow this, then I am looking to another solution,
This is only to send all mails coming from Lucee. (never receiving mails)

Pierre.

If you are relaying email through another service, then you are subject to that service limits, ie throttling.

Otherwise, use a local email server, be it on the same network or on the same box. Have your lucee config create the email to the local server then forward accordingly.