Closed YoBii closed 1 month ago
đ Thanks for opening your first issue here! If you're reporting a đ bug, please make sure you include steps to reproduce it. We get a lot of issues on this repo, so please be patient and we will get back to you as soon as we can.
Are you running SELinux? https://snipe-it.readme.io/docs/linuxosx#notes-on-selinux
Snipe-IT DocumentationSetting up a web server can sound daunting for folks who don't normally do that kind of thing. This guide will help you walk through the configuration for Apache or Nginx on Linux and OSX.Using ApacheThe most common setup for Snipe-IT on a linux server is to use Apache, so if you're not sure what to...
As stated above I am not running SELinux. Debian doesn't come with it and it wasn't installed manually either. I double checked this now.
Can you provide a full stack trace of the mail error? The one above only includes the socialite issue.
Sorry but I can't. Nothing is written to laravel.log
when Send Test fails.
A while back I assumed this was a permission problem but I think I ruled that out. When I purposefully put a wrong APP_URL
that will produce errors in laravel.log
. So logging seems to work in general.
EDIT: The last entry in laravel.log
is from 2023-11-13. I have APP_DEBUG=true
in my .env
file.
We observed similar issue at Version v6.2.2 - build 11714 (master) on top of Ubuntu 22.04.3 LTS (Jammy Jellyfish) with all patches applied as of 2023-01-22. SMTP is set to smtp.gmail.com (Google Workspace Enterprise) with the email account fully tested.
Having the same issue where using the IIS server.
Can we provide any more info to help solve this issue?
Experiencing the same issue with Docker running on Ubuntu 22.04.4. (Office 365).
/edit: Strangely when using port 25 it works! (took me a few hours until I've came to the conclusion)
In my case I'm using office 365 with a setup relay.
@bibz0r hmm, I tried port 25 without success. Would you mind sharing you .env
/ mail configuration or check if mine is different from yours (you can see mine in the initial post)?
I have the similar error. Using the latest Docker-Image. In the docker-env I have my settings.
They are not working, even If I use MAIL_*
from here or MAIL_ENV_*
from here
Weird is that in the error-message it seems like none of my ENV-Vars is used as there is one dummy-entry (your_email_username
):
[2024-05-30 15:28:57] production.ERROR: Failed to authenticate on SMTP server with username "your_email_username" using 2 possible authenticators. Authenticator LOGIN returned Expected response code 235 but got code "535", with message "535 5.7.8 Authentication credentials invalid.
". Authenticator PLAIN returned Expected response code 235 but got code "535", with message "535 5.7.8 Authentication credentials invalid.
". {"userId":3,"exception":"[object] (Swift_TransportException(code: 0): Failed to authenticate on SMTP server with username \"your_email_username\" using 2 possible authenticators. Authenticator LOGIN returned Expected response code 235 but got code \"535\", with message \"535 5.7.8 Authentication credentials invalid.
\". Authenticator PLAIN returned Expected response code 235 but got code \"535\", with message \"535 5.7.8 Authentication credentials invalid.
\". at /var/www/html/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/Esmtp/AuthHandler.php:191)
Had same issue here with Docker install no logs in container or error.
For everyone still struggling with this:
When you're using Office 365 you can't just put any sender as MAIL_FROM_ADDR
like you may be used to.
The simplest option is to have from address and username identical i.e. MAIL_FROM_NAME
= MAIL_USERNAME
.
Alternatively if you want to use another address..
MAIL_USERNAME
+ MAIL_PASSWORD
) you're using for SMTP client submission has send as permission for that mailbox.However Microsoft will be turning off smtp client submission using app passwords entirely in 2025. We'll need a way to use modern authentication from Snipe-IT's side or migrate to using a connector and whitelist the IP of our Snipe-IT Instance.
Closing as the issue is resolved for me.
Debug mode
Describe the bug
Test mail returns
Mail could not be sent. No additional error message provided. Check your mail settings and your app log.
However application log (storage/logs/laravel.log) (or log tab in debug panel) doesn't show anything.
Reproduction steps
php artisan cache:clear
andphp artisan config:clear
)Expected behavior
I expect test mail and sending mail in general to work.
Screenshots
Snipe-IT Version
v6.2.3 build 11936 (gb47e734b3)
Operating System
Debian 11 (bullseye)
Web Server
apache2
PHP Version
7.4.33
Operating System
Windows
Browser
Firefox
Version
119
Device
No response
Operating System
No response
Browser
No response
Version
No response
Error messages
Additional context
Laravel: 8.83.27 DB: mysql SELinux: disabled Context: Application has been used in production for some time. Mail was always set to
log
as I didn't need it. Things have changed - now I want mail to work.Unfortunately I can't get a working setup of SMTP in snipe-it. Test mail returns
Mail could not be sent. No additional error message provided. Check your mail settings and your app log.
However nothing is printed to the application log (storage/logs/laravel.log) (or log tab in debug panel). I provided error messages from the log but I think those were unrelated and I was able to fix both of them. More details on this below. Point is, these were the only two types of errors in the log. Nothing else. Nothing about mail specifically.
.env These are my mail settings. I am trying to use an SMTP relay account on Office 365. This works for all other applications I am hosting. I double checked the credentials.
I also tried setting encryption to
tls
(btw it would be great if environment options like these were documented. I could only findnull
in https://snipe-it.readme.io/docs/configuration)Networking As I am behind a firewall I tried to connect to the mail server on the specified port using telnet from the host running snipe-it. It works just fine so it's not a networking issue (I am running other applications that are using SMTP in the same network as well..)
Upgrade Today I updated SnipeIT and could do so successfully after solving some permission problems with composer. It wasn't able to write to
/var/www/.cache
and apparently that was related to the socialite error in the log. After solving thisupgrade.php
printed that all permissions check out. I carefully checked the output of the script for any errors during upgrade. Seems fine. However the problem with mail persists.Previously Before all of this when I tried setting up mail the first time I noticed my
lavarel.log
was flooded withI solved this by prepending the APP URL with
https://
. Error never reoccurred since then but that didn't change anything about mail not working. Just thought I mention this.Summary Test mail is returning 500 internal server error and nothing is printed to
lavarel.log
.Please let me know when there's anything missing I can provide.
Thanks for reading and all your work.