snipe / snipe-it

A free open source IT asset/license management system
https://snipeitapp.com
GNU Affero General Public License v3.0
10.79k stars 3.12k forks source link

Mail notification not working with smtp 25 and without username/password #15118

Closed olvegg closed 1 month ago

olvegg commented 1 month ago

Debug mode

Describe the bug

I have recently setup Snipe-IT on my dreamhost VPS. I have also setup a Microsoft 365 SMTP relay which allows for my VPS IP address to send email without authentication for my external services such as my wordpress site or snipe-it.

My Wordpress uses the SMTP relay on port 25 without user authentication without any issue, I also tested directly from the VPS console via telnet to my SMTP relay on port 25. Snipe-IT on the other end throws the following error:

When using the General Settings "Test Mail" function.

Mail could not be sent. No additional error message provided. Check your mail settings and the app log.

Reproduction steps

  1. Setup Microsoft 365 SMTP connector setup to authenticate email using the VPS IP
  2. Test Microsoft 365 SMTP connector with other application (FluentSMTP on Wordpress or Sending a message using telnet on the VPS itself) which works well
  3. Setup Snipe-IT on dreamhost VPS using the Installation documentation
  4. Configure Snipe-IT using smtp, mail, mailsend all of which fail in the same way, everything else works as expected
  5. Review common errors and similar github issues before posting
  6. (Profit?) ...

Expected behavior

Expecting that mail notifications test work instead of throwing errors

Screenshots

No response

Snipe-IT Version

v7.0.3 build 13980

Operating System

Ubuntu Server 20.04.1 LTS

Web Server

Apache

PHP Version

8.2.15

Operating System

Windows 11

Browser

Firefox

Version

128.0 (64-bit)

Device

No response

Operating System

No response

Browser

No response

Version

No response

Error messages

[Snipe-IT Debug] I do not see any Snipe-IT error with debug mode turned on besides the error message.

[Browser's console]

XHRPOST
https://am.myredacteddomain.com/api/v1/settings/mailtest
[HTTP/3 500  21354ms]

XHRPOST
https://am.myredacteddomain.com/api/v1/settings/mailtest
[HTTP/3 500  21354ms]

POST
    https://am.myredacteddomain.com/api/v1/settings/mailtest
Status
500
VersionHTTP/3
Transferred2.09 kB (857 B size)
Referrer Policysame-origin
Request PriorityHighest
DNS ResolutionSystem

    alt-svc
        h3=":443"; ma=86400
    cache-control
        max-age=0, must-revalidate, no-cache, no-store, private
    cf-cache-status
        DYNAMIC
    cf-ray
        8a55a404287f6ac0-SEA
    content-type
        application/json
    date
        Thu, 18 Jul 2024 21:42:38 GMT
    expires
        Sun, 02 Jan 1990 00:00:00 GMT
    feature-policy
        accelerometer 'none';autoplay 'none';camera 'none';display-capture 'none';document-domain 'none';encrypted-media 'none';fullscreen 'none';geolocation 'none';sync-xhr 'none';usb 'none';xr-spatial-tracking 'none'
    nel
        {"success_fraction":0,"report_to":"cf-nel","max_age":604800}
    pragma
        no-cache
    priority
        u=0,i=?0
    referrer-policy
        same-origin
    report-to
        {"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v4?s=a70ZWaw6OZAOukr7Kh6STYOGYZVgdjPZuVLZslv%2BANMgfmlAZkbe%2FazgRipGIU2gsroOiXhpUIvQiYE%2BESgOq4WI1nd8hMsL6DHZdr5GbI4nDfaBZOEyMO2WDy1d4gzJNmWK"}],"group":"cf-nel","max_age":604800}
    server
        cloudflare
    set-cookie
        snipeit_session=Y57IeXU5ZUyoe1KtqLQaKOcpoYp8zVUKCNtvlzGu; expires=Sat, 27 Jul 2024 05:42:38 GMT; Max-Age=720000; path=/; httponly
    vary
        Origin,User-Agent
    x-content-type-options
        nosniff
    x-frame-options
        DENY
    x-ratelimit-limit
        120
    x-ratelimit-remaining
        119
    x-xss-protection
        1; mode=block

    Accept
        application/json, text/javascript, */*; q=0.01
    Accept-Encoding
        gzip, deflate, br, zstd
    Accept-Language
        en-US,en;q=0.5
    Alt-Used
        am.myredacteddomain.com
    Connection
        keep-alive
    Content-Length
        0
    Cookie
        componentsTable.bs.table.cardView=false; companiesTable.bs.table.cardView=false; usersTable.bs.table.cardView=false; locationTable.bs.table.cardView=false; consumablesTable.bs.table.cardView=false; categoryTable.bs.table.cardView=false; manufacturersTable.bs.table.cardView=false; departmentsTable.bs.table.cardView=false; assetsListingTable.bs.table.cardView=false; licensesTable.bs.table.cardView=false; accessoriesTable.bs.table.cardView=false; depreciationsTable.bs.table.cardView=false; assetsListingTable.b…SekgrcFZ3dStYb2REMnhqL1h3Q1VTa0kxQmUvUHF2WXVXMmlCbC9LSFlRV3c3K2JqVWo0Y2IvUkxGTGRrckVCUVRqTVg1dUgrR1V3bGtmdjZFcjgyVTFRcTNUSjEyT2lmZTFZc0tyUTBST1liWEUrQ1dWZ0U2VXRTVmJpZS9yYWxhWGp2QVB3VVhiS0Z4amxPNE1mRVcyZHB0a3l1TzF1VDZLU21vN0lzUTdNUFNBQzExVzZBNWZPL1FNZGtsWFl0YTVwMkRVcFpNRGovRGRJc2Q0a3R2OFZzd2JDN1ZoeVg5am9JdzVxTjFhTXdwdlhpZVd3emNXbmxWOEpZenV3TTlsOFI4eVBvSlBtNDlhaUVqUDJCTGdmaXAxckpyUW0zdDlIbDg0M0ciLCJtYWMiOiIwNTRkN2FmOThjNWM4ZTE0M2RmMWM3ZTkwNWM4ZWI5ZWVjMWU0Mzg5ZTBjOTJkYzY1ODA5ZWNlNjhiZmIyOGQyIiwidGFnIjoiIn0%3D
    DNT
        1
    Host
        am.myredacteddomain.com
    Origin
        https://am.myredacteddomain.com
    Priority
        u=0
    Referer
        https://am.myredacteddomain.com/admin/settings
    Sec-Fetch-Dest
        empty
    Sec-Fetch-Mode
        cors
    Sec-Fetch-Site
        same-origin
    Sec-GPC
        1
    TE
        trailers
    User-Agent
        Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:128.0) Gecko/20100101 Firefox/128.0
    X-CSRF-TOKEN
        Vzk1HqpXmBsYxKgkS68CDLZaQvqTN4OqEwtZBK42
    X-Requested-With
        XMLHttpRequest

XHRPOST
https://am.myredacteddomain.com/api/v1/settings/mailtest
[HTTP/3 500  21354ms]

    snipeit_session 
    expires "2024-07-27T05:42:38.000Z"
    httpOnly    true
    path    "/"
    value   "Y57IeXU5ZUyoe1KtqLQaKOcpoYp8zVUKCNtvlzGu"

    accessoriesTable.bs.table.cardView  "false"
    assetsListingTable.bs.table.cardView    "false"
    assetsListingTable.bs.table.hiddenColumns   '["id","model_number","employee_number","rtd_location","manufacturer","supplier","purchase_date","age","order_number","eol","asset_eol_date","warranty_months","warranty_expires","requestable","notes","checkout_counter","checkin_counter","requests_counter","created_at","updated_at","last_checkout","last_checkin","expected_checkin","last_audit_date","next_audit_date","byod"]'
    asssetModelsTable.bs.table.cardView "false"
    categoryTable.bs.table.cardView "false"
    companiesTable.bs.table.cardView    "false"
    componentsTable.bs.table.cardView   "false"
    consumablesTable.bs.table.cardView  "false"
    dashActivityReport.bs.table.cardView    "false"
    dashCategorySummary.bs.table.cardView   "false"
    dashCompanySummary.bs.table.cardView    "false"
    departmentsTable.bs.table.cardView  "false"
    depreciationsTable.bs.table.cardView    "false"
    laravel_token   "eyJpdiI6InZmbEZRKzI2Si9mQlU5MXgvQ1ZPeUE9PSIsInZhbHVlIjoiaU1DdTJvR3NkK25hL2hUY2V1NFNWKzhSekgrcFZ3dStYb2REMnhqL1h3Q1VTa0kxQmUvUHF2WXVXMmlCbC9LSFlRV3c3K2JqVWo0Y2IvUkxGTGRrckVCUVRqTVg1dUgrR1V3bGtmdjZFcjgyVTFRcTNUSjEyT2lmZTFZc0tyUTBST1liWEUrQ1dWZ0U2VXRTVmJpZS9yYWxhWGp2QVB3VVhiS0Z4amxPNE1mRVcyZHB0a3l1TzF1VDZLU21vN0lzUTdNUFNBQzExVzZBNWZPL1FNZGtsWFl0YTVwMkRVcFpNRGovRGRJc2Q0a3R2OFZzd2JDN1ZoeVg5am9JdzVxTjFhTXdwdlhpZVd3emNXbmxWOEpZenV3TTlsOFI4eVBvSlBtNDlhaUVqUDJCTGdmaXAxckpyUW0zdDlIbDg0M0ciLCJtYWMiOiIwNTRkN2FmOThjNWM4ZTE0M2RmMWM3ZTkwNWM4ZWI5ZWVjMWU0Mzg5ZTBjOTJkYzY1ODA5ZWNlNjhiZmIyOGQyIiwidGFnIjoiIn0="
    licensesTable.bs.table.cardView "false"
    locationTable.bs.table.cardView "false"
    manufacturersTable.bs.table.cardView    "false"
    remember_web_59ba36addc2b2f9401580f014c7f58ea4e30989d   "eyJpdiI6InB3Qll2U2NDTmlyQVJpcHd3NHV4M1E9PSIsInZhbHVlIjoiTjFaYWI1WlFXTWNGNERRSXF1aVVKQTE2c0V2WlpZM1pWVEFPWW5xKzZTNjhnUTl2T1NMZnBJZ2Z1NUtNTnNTMXIxWXBJR2pady9TbUpPMmg5Ny9WcXJURmMrcHBVV0d0U0dDbFhNcy9hOVBuLy9JN25pMWl3VktWdTRsejVwLzd2TWRhRDI2NFhKbnkya0N6elp5NCtVcnFuSHdtWHd1bk9KVk1sS3hWa2pxN0s5emtpMnhDOGc2NmROMjk5bmNVVjFFbGU2MkhMUm9VWGVQUkxVV01uZ1E2UW9OaTBlZEZNMEtGSnZrcXREcz0iLCJtYWMiOiI0YThlYTQxNjRmMDA2OTY3YWU5YjI4YWJkMGI2ZDhjNmJiNWRmYzA3ZGI4YjQ0YTI1YWUxZjVkNjdiMTBhY2UyIiwidGFnIjoiIn0="
    snipeit_session "Y57IeXU5ZUyoe1KtqLQaKOcpoYp8zVUKCNtvlzGu"
    usersTable.bs.table.cardView    "false"
    XSRF-TOKEN  "eyJpdiI6IjFqclo4TmZ2S09Db0pGWDJkc1loM3c9PSIsInZhbHVlIjoid1FtdGhmRGd1TmIzanhmV1U0bDlNa1dtSkdzSUQveGZ2d2w5UDY3b1BSWG1sSjVTK2VkRitPNXNqTWVwMlc2NEdaS1liRWEwU2dlQXF0TGRvYSsyeStZUTFoWEpHV1JZTnhManpNbnR6UzJHQkQ2SU9hbGZ5dHpuSXhvV1I4Y28iLCJtYWMiOiI5ZTc4YTg5YzFhM2Q3MzgzOGJiMzRkZjBlMTAxNmRhMDUxYjk1NGIxZmFkOWIyODA4ZDY1NDVmNDA0NmYyOTNkIiwidGFnIjoiIn0="

XHRPOST
https://am.myredacteddomain.com/api/v1/settings/mailtest
[HTTP/3 500  21354ms]

message 'Failed to authenticate on SMTP server with username "username@myredacteddomain.com" using the following authenticators: "LOGIN", "XOAUTH2". Authenticator "LOGIN" returned "Expected response code "235" but got code "535", with message "535 5.7.139 Authentication unsuccessful, SmtpClientAuthentication is disabled for the Tenant. Visit https://aka.ms/smtp_auth_disabled for more information. [MN2PR06CA0021.namprd06.prod.outlook.com 2024-07-18T21:42:22.582Z 08DCA68B4EBD97CF]".". Authenticator "XOAUTH2" returned "Expected response code "235" but got code "535", with message "535 5.7.139 Authentication unsuccessful, SmtpClientAuthentication is disabled for the Tenant. Visit https://aka.ms/smtp_auth_disabled for more information. [MN2PR06CA0021.namprd06.prod.outlook.com 2024-07-18T21:42:33.269Z 08DCA68B4EBD97CF]".".'

XHRPOST
https://am.myredacteddomain.com/api/v1/settings/mailtest
[HTTP/3 500  21354ms]

send
https://am.myredacteddomain.com/js/dist/all.js:1:82733
ajax
https://am.myredacteddomain.com/js/dist/all.js:1:78332
<anonymous>
https://am.myredacteddomain.com/admin/settings line 1 > injectedScript:20:15
dispatch
https://am.myredacteddomain.com/js/dist/all.js:1:43085
add/m.handle
https://am.myredacteddomain.com/js/dist/all.js:1:41080
c
https://am.myredacteddomain.com/cdn-cgi/scripts/7d0fa10a/cloudflare-static/rocket-loader.min.js:1:9405
(Async: EventListener.handleEvent) t.prototype.patchEventTargetMethods/t.addEventListener
https://am.myredacteddomain.com/cdn-cgi/scripts/7d0fa10a/cloudflare-static/rocket-loader.min.js:1:9497
add
https://am.myredacteddomain.com/js/dist/all.js:1:41542
St/<
https://am.myredacteddomain.com/js/dist/all.js:1:40150
each
https://am.myredacteddomain.com/js/dist/all.js:1:2978
each
https://am.myredacteddomain.com/js/dist/all.js:1:1457
St
https://am.myredacteddomain.com/js/dist/all.js:1:40125
on
https://am.myredacteddomain.com/js/dist/all.js:1:46738
x.fn[e]
https://am.myredacteddomain.com/js/dist/all.js:1:88686
<anonymous>
https://am.myredacteddomain.com/admin/settings line 1 > injectedScript:13:24
t.prototype.activateScript
https://am.myredacteddomain.com/cdn-cgi/scripts/7d0fa10a/cloudflare-static/rocket-loader.min.js:1:11855
t.prototype.run/n<
https://am.myredacteddomain.com/cdn-cgi/scripts/7d0fa10a/cloudflare-static/rocket-loader.min.js:1:11052
t.prototype.run
https://am.myredacteddomain.com/cdn-cgi/scripts/7d0fa10a/cloudflare-static/rocket-loader.min.js:1:11259
t.prototype.run/n<
https://am.myredacteddomain.com/cdn-cgi/scripts/7d0fa10a/cloudflare-static/rocket-loader.min.js:1:11156
s/<
https://am.myredacteddomain.com/cdn-cgi/scripts/7d0fa10a/cloudflare-static/rocket-loader.min.js:1:670
(Async: EventHandlerNonNull) u
https://am.myredacteddomain.com/cdn-cgi/scripts/7d0fa10a/cloudflare-static/rocket-loader.min.js:1:724
t.prototype.run/n<
https://am.myredacteddomain.com/cdn-cgi/scripts/7d0fa10a/cloudflare-static/rocket-loader.min.js:1:11115
t.prototype.run
https://am.myredacteddomain.com/cdn-cgi/scripts/7d0fa10a/cloudflare-static/rocket-loader.min.js:1:11259
t.prototype.run/n<
https://am.myredacteddomain.com/cdn-cgi/scripts/7d0fa10a/cloudflare-static/rocket-loader.min.js:1:11156
s/<
https://am.myredacteddomain.com/cdn-cgi/scripts/7d0fa10a/cloudflare-static/rocket-loader.min.js:1:670
(Async: EventHandlerNonNull) u
https://am.myredacteddomain.com/cdn-cgi/scripts/7d0fa10a/cloudflare-static/rocket-loader.min.js:1:724
t.prototype.run/n<
https://am.myredacteddomain.com/cdn-cgi/scripts/7d0fa10a/cloudflare-static/rocket-loader.min.js:1:11115
t.prototype.run
https://am.myredacteddomain.com/cdn-cgi/scripts/7d0fa10a/cloudflare-static/rocket-loader.min.js:1:11259
t.prototype.run/n<
https://am.myredacteddomain.com/cdn-cgi/scripts/7d0fa10a/cloudflare-static/rocket-loader.min.js:1:11156
s/<
https://am.myredacteddomain.com/cdn-cgi/scripts/7d0fa10a/cloudflare-static/rocket-loader.min.js:1:670
(Async: EventHandlerNonNull) u
https://am.myredacteddomain.com/cdn-cgi/scripts/7d0fa10a/cloudflare-static/rocket-loader.min.js:1:724
t.prototype.run/n<
https://am.myredacteddomain.com/cdn-cgi/scripts/7d0fa10a/cloudflare-static/rocket-loader.min.js:1:11115
t.prototype.run
https://am.myredacteddomain.com/cdn-cgi/scripts/7d0fa10a/cloudflare-static/rocket-loader.min.js:1:11259
t.prototype.run/n<
https://am.myredacteddomain.com/cdn-cgi/scripts/7d0fa10a/cloudflare-static/rocket-loader.min.js:1:11156
s/<
https://am.myredacteddomain.com/cdn-cgi/scripts/7d0fa10a/cloudflare-static/rocket-loader.min.js:1:670
(Async: EventHandlerNonNull) u
https://am.myredacteddomain.com/cdn-cgi/scripts/7d0fa10a/cloudflare-static/rocket-loader.min.js:1:724
t.prototype.run/n<
https://am.myredacteddomain.com/cdn-cgi/scripts/7d0fa10a/cloudflare-static/rocket-loader.min.js:1:11115
t.prototype.run
https://am.myredacteddomain.com/cdn-cgi/scripts/7d0fa10a/cloudflare-static/rocket-loader.min.js:1:11259
x/<
https://am.myredacteddomain.com/cdn-cgi/scripts/7d0fa10a/cloudflare-static/rocket-loader.min.js:1:2907
t.prototype.runOnLoad/<
https://am.myredacteddomain.com/cdn-cgi/scripts/7d0fa10a/cloudflare-static/rocket-loader.min.js:1:8117
(Async: EventListener.handleEvent) t.prototype.runOnLoad
https://am.myredacteddomain.com/cdn-cgi/scripts/7d0fa10a/cloudflare-static/rocket-loader.min.js:1:8051
x
https://am.myredacteddomain.com/cdn-cgi/scripts/7d0fa10a/cloudflare-static/rocket-loader.min.js:1:2884
<anonymous>
https://am.myredacteddomain.com/cdn-cgi/scripts/7d0fa10a/cloudflare-static/rocket-loader.min.js:1:12169
<anonymous>
https://am.myredacteddomain.com/cdn-cgi/scripts/7d0fa10a/cloudflare-static/rocket-loader.min.js:1:12326
<anonymous>
https://am.myredacteddomain.com/cdn-cgi/scripts/7d0fa10a/cloudflare-static/rocket-loader.min.js:1:12329

XHRPOST
https://am.myredacteddomain.com/api/v1/settings/mailtest
[HTTP/3 500  21354ms]

Connection: 
Protocol version:   "TLSv1.3"
Cipher suite:   "TLS_AES_128_GCM_SHA256"
Key Exchange Group: "x25519"
Signature Scheme:   "ECDSA-P256-SHA256"
Host am.myredacteddomain.com:   
HTTP Strict Transport Security: "Disabled"
Public Key Pinning: "Disabled"
Certificate:    
Issued To   
Common Name (CN):   "myredacteddomain.com"
Organization (O):   "<Not Available>"
Organizational Unit (OU):   "<Not Available>"
Issued By   
Common Name (CN):   "WE1"
Organization (O):   "Google Trust Services"
Organizational Unit (OU):   "<Not Available>"
Period of Validity  
Begins On:  "Wed, 10 Jul 2024 23:09:01 GMT"
Expires On: "Tue, 08 Oct 2024 23:09:00 GMT"
Fingerprints    
SHA-256 Fingerprint:    "78:23:7F:71:C8:C6:C1:DA:E3:89…D:7F:24:55:B6:93:93:D6:5C:62"
SHA1 Fingerprint:   "1F:08:6A:5C:73:92:D3:6D:B0:CC:F5:22:92:BF:57:E2:0D:7A:3C:8C"
Transparency:   "<Not Available>"

[Storage/logs] The laravel.log file is empty which is surprising given that I enabled debug mode?

[Demo Reproduction] Not applicable: This cannot be reproduced in demo as the .env smtp configuration and the demo server ip authentication on MS365 is required to reproduce the issue.

[PHP Modules]

bcmath
bz2
calendar
Core
ctype
curl
date
dom
exif
fileinfo
filter
ftp
gd
gettext
hash
iconv
imagick
imap
intl
json
libxml
mbstring
mysqli
mysqlnd
openssl
pcntl
pcre
PDO
pdo_mysql
pdo_sqlite
Phar
posix
pspell
random
Reflection
session
SimpleXML
soap
sockets
sodium
SPL
sqlite3
standard
tokenizer
xml
xmlreader
xmlwriter
xsl
zip
zlib

[ENV file content]

# --------------------------------------------
# REQUIRED: BASIC APP SETTINGS
# --------------------------------------------
APP_ENV=production
APP_DEBUG=true
APP_KEY=base64:redacted
APP_URL=https://am.myredacteddomain.com
APP_TIMEZONE='America/Los_Angeles'
APP_LOCALE='en-US'
MAX_RESULTS=500

# --------------------------------------------
# REQUIRED: UPLOADED FILE STORAGE SETTINGS
# --------------------------------------------
PRIVATE_FILESYSTEM_DISK=local
PUBLIC_FILESYSTEM_DISK=local_public

#PRIVATE_FILESYSTEM_DISK=s3_private
#PUBLIC_FILESYSTEM_DISK=s3_public

# --------------------------------------------
# REQUIRED: DATABASE SETTINGS
# --------------------------------------------
DB_CONNECTION=mysql
DB_HOST=db.myredacteddomain.com
DB_PORT=3306
DB_DATABASE=prd_redacted_02
DB_USERNAME=redacted
DB_PASSWORD=redacted
DB_PREFIX=null
DB_DUMP_PATH='/usr/bin'
DB_CHARSET=utf8mb4
DB_COLLATION=utf8mb4_unicode_ci

# --------------------------------------------
# OPTIONAL: SSL DATABASE SETTINGS
# --------------------------------------------
DB_SSL=false
DB_SSL_IS_PAAS=false
DB_SSL_KEY_PATH=null
DB_SSL_CERT_PATH=null
DB_SSL_CA_PATH=null
DB_SSL_CIPHER=null
DB_SSL_VERIFY_SERVER=null

# --------------------------------------------
# REQUIRED: OUTGOING MAIL SERVER SETTINGS
# --------------------------------------------
MAIL_MAILER=smtp
MAIL_HOST=myredacteddomain-com.mail.protection.outlook.com
MAIL_PORT=25
MAIL_USERNAME=
MAIL_PASSWORD=
MAIL_FROM_ADDR=noreply@myredacteddomain.com
MAIL_FROM_NAME='Snipe-IT'
MAIL_REPLYTO_ADDR=noreply@myredacteddomain.com
MAIL_REPLYTO_NAME='Snipe-IT'
MAIL_AUTO_EMBED_METHOD='attachment'
MAIL_TLS_VERIFY_PEER=false

# MAIL_ENCRYPTION is no longer supported. SymfonyMailer will use tls if it's
# advertised, and won't if it's not. If you want to use your mail server's IP but it's failing
# because of certificate errors, set MAIL_TLS_VERIFY_PEER-true

# --------------------------------------------
# REQUIRED: IMAGE LIBRARY
# This should be gd or imagick
# --------------------------------------------
IMAGE_LIB=gd

# --------------------------------------------
# OPTIONAL: BACKUP SETTINGS
# --------------------------------------------
MAIL_BACKUP_NOTIFICATION_DRIVER=null
MAIL_BACKUP_NOTIFICATION_ADDRESS=null
BACKUP_ENV=true
ALLOW_BACKUP_DELETE=false
ALLOW_DATA_PURGE=false

# --------------------------------------------
# OPTIONAL: SESSION SETTINGS
# --------------------------------------------
SESSION_DRIVER=file
SESSION_LIFETIME=12000
EXPIRE_ON_CLOSE=false
ENCRYPT=false
COOKIE_NAME=snipeit_session
COOKIE_DOMAIN=null
SECURE_COOKIES=false
API_TOKEN_EXPIRATION_YEARS=15
BS_TABLE_STORAGE=cookieStorage
BS_TABLE_DEEPLINK=true

# --------------------------------------------
# OPTIONAL: SECURITY HEADER SETTINGS
# --------------------------------------------
APP_TRUSTED_PROXIES=192.168.1.1,10.0.0.1
ALLOW_IFRAMING=false
REFERRER_POLICY=same-origin
ENABLE_CSP=false
ADDITIONAL_CSP_URLS=null
CORS_ALLOWED_ORIGINS=null
ENABLE_HSTS=false

# --------------------------------------------
# OPTIONAL: CACHE SETTINGS
# --------------------------------------------
CACHE_DRIVER=file
QUEUE_DRIVER=sync
CACHE_PREFIX=snipeit

# --------------------------------------------
# OPTIONAL: REDIS SETTINGS
# --------------------------------------------
REDIS_HOST=null
REDIS_PASSWORD=null
REDIS_PORT=null

# --------------------------------------------
# OPTIONAL: MEMCACHED SETTINGS
# --------------------------------------------
MEMCACHED_HOST=null
MEMCACHED_PORT=null

# --------------------------------------------
# OPTIONAL: PUBLIC S3 Settings
# --------------------------------------------
PUBLIC_AWS_SECRET_ACCESS_KEY=null
PUBLIC_AWS_ACCESS_KEY_ID=null
PUBLIC_AWS_DEFAULT_REGION=null
PUBLIC_AWS_BUCKET=null
PUBLIC_AWS_URL=null
PUBLIC_AWS_BUCKET_ROOT=null

# --------------------------------------------
# OPTIONAL: PRIVATE S3 Settings
# --------------------------------------------
PRIVATE_AWS_ACCESS_KEY_ID=null
PRIVATE_AWS_SECRET_ACCESS_KEY=null
PRIVATE_AWS_DEFAULT_REGION=null
PRIVATE_AWS_BUCKET=null
PRIVATE_AWS_URL=null
PRIVATE_AWS_BUCKET_ROOT=null

# --------------------------------------------
# OPTIONAL: AWS Settings
# --------------------------------------------
AWS_ACCESS_KEY_ID=null
AWS_SECRET_ACCESS_KEY=null
AWS_DEFAULT_REGION=null

# --------------------------------------------
# OPTIONAL: LOGIN THROTTLING
# --------------------------------------------
LOGIN_MAX_ATTEMPTS=3
LOGIN_LOCKOUT_DURATION=60
LOGIN_AUTOCOMPLETE=false

# --------------------------------------------
# OPTIONAL: FORGOTTEN PASSWORD SETTINGS
# --------------------------------------------
RESET_PASSWORD_LINK_EXPIRES=15
PASSWORD_CONFIRM_TIMEOUT=10800
PASSWORD_RESET_MAX_ATTEMPTS_PER_MIN=50

# --------------------------------------------
# OPTIONAL: MISC
# --------------------------------------------
LOG_CHANNEL=single
LOG_MAX_DAYS=10
APP_LOCKED=false
APP_CIPHER=AES-256-CBC
APP_FORCE_TLS=true
APP_ALLOW_INSECURE_HOSTS=false
GOOGLE_MAPS_API=
LDAP_MEM_LIM=500M
LDAP_TIME_LIM=600
IMPORT_TIME_LIMIT=600
IMPORT_MEMORY_LIMIT=500M
REPORT_TIME_LIMIT=12000
REQUIRE_SAML=false
API_THROTTLE_PER_MINUTE=120
CSV_ESCAPE_FORMULAS=true

# --------------------------------------------
# OPTIONAL: HASHING
# --------------------------------------------
HASHING_DRIVER='bcrypt'
BCRYPT_ROUNDS=10
ARGON_MEMORY=1024
ARGON_THREADS=2
ARGON_TIME=2

# --------------------------------------------
# OPTIONAL: SCIM
# --------------------------------------------
SCIM_TRACE=false
SCIM_STANDARDS_COMPLIANCE=false

# --------------------------------------------
# OPTIONAL: AWS Settings
# --------------------------------------------
AWS_ACCESS_KEY_ID=null
AWS_SECRET_ACCESS_KEY=null
AWS_DEFAULT_REGION=null

# --------------------------------------------
# OPTIONAL: LOGIN THROTTLING
# --------------------------------------------
LOGIN_MAX_ATTEMPTS=3
LOGIN_LOCKOUT_DURATION=60
LOGIN_AUTOCOMPLETE=false

# --------------------------------------------
# OPTIONAL: FORGOTTEN PASSWORD SETTINGS
# --------------------------------------------
RESET_PASSWORD_LINK_EXPIRES=15
PASSWORD_CONFIRM_TIMEOUT=10800
PASSWORD_RESET_MAX_ATTEMPTS_PER_MIN=50

# --------------------------------------------
# OPTIONAL: MISC
# --------------------------------------------
LOG_CHANNEL=single
LOG_MAX_DAYS=10
APP_LOCKED=false
APP_CIPHER=AES-256-CBC
APP_FORCE_TLS=true
APP_ALLOW_INSECURE_HOSTS=false
GOOGLE_MAPS_API=
LDAP_MEM_LIM=500M
LDAP_TIME_LIM=600
IMPORT_TIME_LIMIT=600
IMPORT_MEMORY_LIMIT=500M
REPORT_TIME_LIMIT=12000
REQUIRE_SAML=false
API_THROTTLE_PER_MINUTE=120
CSV_ESCAPE_FORMULAS=true

# --------------------------------------------
# OPTIONAL: HASHING
# --------------------------------------------
HASHING_DRIVER='bcrypt'
BCRYPT_ROUNDS=10
ARGON_MEMORY=1024
ARGON_THREADS=2
ARGON_TIME=2

# --------------------------------------------
# OPTIONAL: SCIM
# --------------------------------------------
SCIM_TRACE=false
SCIM_STANDARDS_COMPLIANCE=false

Additional context

This is a fresh install

I manually configured Snipe-IT

I have attempted to use smtp, mail or sendmail without any success

I have tested the SMTP relay to make sure it's not the issue by:

  1. Using another application on the VPS (Wordpress with Fluent SMTP) which works.
  2. Sent a simple email from the VPS console via telnet and using the server address, port 25, noreply email as a sender and my email as recipient which works

The browser console response is confusing as the .env isn't configured to authenticate with the email mentionned there:

''Failed to authenticate on SMTP server with username "username@myredacteddomain.com" using the following authenticators: "LOGIN", "XOAUTH2". Authenticator "LOGIN" returned "Expected response code "235" but got code "535", with message "535 5.7.139 Authentication unsuccessful, SmtpClientAuthentication is disabled for the Tenant."

Why would it try to authenticate with this email? This is the email of the user I use to go and test in the admin settings, but it is NOT the email configured in the .env for sending emails.

Thank you for your help on this issue.

welcome[bot] commented 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.

snipe commented 1 month ago

The storage/logs/laravel.log being empty is a bit worrisome. Can you check the permissions and make sure that directory is writable? That 500 could be because it's unable to write to the log file.

olvegg commented 1 month ago

Thanks for checking in, the issue was resolved today. I can confirm laravel.log is still empty and the permissions is 664 while the storage folder is 775. As you raised the issue with laravel, I thought to search what could be done to troubleshoot it and found a resource including the following commands:

    php artisan config:cache
    php artisan config:clear
    php artisan cache:clear

Interestingly, what happened now is that laravel.log is still empty BUT Snipe-IT debug bar has finally appeared which wasn't on before .. AND the mail test worked!

I have no idea what prevented the debug bar to show up before, or the email to work but it seems that the laravel commands have resolved something..??

In any case, I appreciate you responding so quickly and providing the impetus to check what was going on with laravel. I don't know if the file should still be empty, but at least now the system works as intended.

snipe commented 1 month ago

Great, glad you're sorted :) We usually recommend running those commands first just to rule out any caching issues. https://snipe-it.readme.io/docs/common-issues#quick-tip-handy-commands

Snipe-IT Documentation
Common Issues
🚧 Problem Installing/Upgrading?: We've moved the the most common installation/upgrade issues to their own page. If you're having an issue installing or upgrading Snipe-IT, please check the Installation/Upgrading Issues page before opening a ticket on Github . Quick Tip: Handy Commands 👍 Many issue...