By fkohrt on
I have configured SMTP Authentication Support on my new Drupal 8.9.x site and do receive notification emails from my mail server about new releases that are available. However, they look exactly as follows:
There is a security update available for your version of Drupal. To ensure
the security of your server, you should update immediately!
See the available updates page for more information:
http://default/admin/reports/updates
Your site is currently configured to send these emails when any updates are
available. To get notified only for security updates,
http://default/admin/reports/updates/settings.The base URL (including the protocol that should be https) are not correctly set up. How can I do that? I am using composer to manage my site.
Comments
=-=
That email is built out in the core update.module. Why it's not providing a proper link is odd. Are you indicating that the emails for updates were fine before SMTP Authentication module was introduced to your install?
No
No, I thought it might be of relevance that I'm using that module, but probably it isn't. (Installing the module was one of the first things I did, so no emails were sent before installing it.)
=-=
Do you have your trusted hosts properly set in settings.php?
also clear cache and run cron.
Yes, I already had my trusted
Yes, I already had my trusted hosts set, and neither re-indexing the site nor clearing the cache (with subsequently running cron) solves the issue.
=-=
A google search on my side only locates one relevant issue : https://www.drupal.org/project/drupal/issues/2883031 for D7. D8 no longer has a base_url setting in settings.php. The issue has no formal resolution. I can't reproduce this issue.
Alright, thanks for looking
Alright, thanks for looking into it though! This is also hard to debug for me because this email is only sent daily and I had to make the update now.
Do you know of a way I can manually trigger emails that contain the base URL so I can further look into it?
=-=
I do not. devel.module may have a method to do so. may want to look at the update.module to see if there is something in the code that will allow an auto trigger. I don't suppose there would be unless there is a module that is outdated. I suppose you could without issue. set one of your existing module versions to be an older version in it's info file then run cron.
Excellent idea, thank you!
Excellent idea, thank you! So I did change the version entry in some module's info file (
web/modules/contrib/smtp/smtp.info.yml) and then ran_update_cron_notify()using drush (source):The usual email without correct base URL arrives. Reading through “Removed base_url option from settings.php” I try out the following
and it finally works! So I figure I forgot setting the
--urifor my cron job as well (see further here).Regards!
What helped me
Hi, I ran into this page because my Drupal 8 site was sending out emails where all the links pointed to http://default or https://default and I was having a hard time understanding how to change that.
After attempting the changes on this page, I finally discovered that, while it's not recommended, sometimes you need to set the drush.yml file's options > uri setting.
The recommended location for the drush.yml file is /web/sites/default/drush.yml but that one seemed to get ignored on my site and I had to set the one here: /vendor/drush/drush/drush.yml
you can check the location of what yml files drush is looking at by running drush status. In the printout from that, it'll list Site URI and Drush configs which will be relevant to what you're changing here.
After I updated the yml file, I cleared cache, retested the emails and things started linking properly pointing to my site instead of default.
I think in the old days, this could all be solved by setting the $base_url, but now it's done using a method similar to the one I explained above. Hope this helps someone down the road.