-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot send email via on site smtp server (ErrorException in StreamBuffer.php line 95:) #2570
Comments
It looks like the SSL certificate on your mail server is invalid. |
Except that it isn't. We have an open wildcard cert with RapidSSL that doesn't expire until 7/2019. As this is all purely internal, can we bypass SSL checking in any manner? I would be happy to provide our server information to you privately if you need to look at the cert to verify it's legitimacy. |
What's your mail server? mail.tonkin.com? |
Correct, and passes http://www.checktls.com/perl/TestReceiver.pl check. |
TLS is not the same thing as SSL though. Is this mail server blocked from outside connections?
Neither of those connect. |
Also, wildcard certs don't really matter if they're only installed on the web server and not on the mail server. |
Thanks for assistance, I am not our mail or network guy, so this is not my area of expertise. Not sure why you cannot telnet in, we test out fine internally, externally, and via mxtoolbox.com 220 smtp.tonkin.com mail.tonkin.com [656 ms] Is there any manner to disable TLS? In the mail.php i have encryption set to null, but it still attempts to TLS. This machine (snipeit) is whitelisted in our mail server, so we can safely trust it to blast a few emails. |
Can you show me your mail settings from your .env file, minus the password of course |
MAIL_DRIVER=smtp When I changed that encryption setting to null i got Swift_TransportException in AbstractSmtpTransport.php line 162: This is from generating a new user section. |
What happens if you try:
|
Swift_TransportException in StreamBuffer.php line 269: it looks like we don't listen on 587. We have an SSL port at 465, that also leaves us with: Swift_TransportException in AbstractSmtpTransport.php line 404: |
I'm not even seeing those ports open though...
|
Our firewall does some kind of packet inspection, I am not 100% sure as it is not my realm. I assure you that our email is working (you can email me at jallen@tonkin.com if you'd like), and internally we are much more open. Here is my nmap internally: Scanning mail.tonkin.com (172.16.18.239) [1000 ports] Discovered open port 8080/tcp on 172.16.18.239 Discovered open port 135/tcp on 172.16.18.239 Discovered open port 110/tcp on 172.16.18.239 Discovered open port 587/tcp on 172.16.18.239 Discovered open port 25/tcp on 172.16.18.239 Discovered open port 445/tcp on 172.16.18.239 Discovered open port 995/tcp on 172.16.18.239 Discovered open port 139/tcp on 172.16.18.239 Discovered open port 443/tcp on 172.16.18.239 Discovered open port 80/tcp on 172.16.18.239 Discovered open port 993/tcp on 172.16.18.239 Discovered open port 143/tcp on 172.16.18.239 Discovered open port 3389/tcp on 172.16.18.239 Discovered open port 8100/tcp on 172.16.18.239 Discovered open port 465/tcp on 172.16.18.239 Discovered open port 49155/tcp on 172.16.18.239 Discovered open port 49153/tcp on 172.16.18.239 Discovered open port 1433/tcp on 172.16.18.239 Discovered open port 49154/tcp on 172.16.18.239 Discovered open port 49159/tcp on 172.16.18.239 Discovered open port 8181/tcp on 172.16.18.239 Discovered open port 49152/tcp on 172.16.18.239 Discovered open port 8088/tcp on 172.16.18.239 |
This is also interesting: |
It looks like our server does not show all intermediate certs up the chain, which certain mail servers require to guarantee TLS. I have opened a ticket with our mail person to fix this, which may also fix this current issue. There is no way to send mail non-TLS internally? |
Based on what you're saying, your env config should look like:
Did you run that nmap from the machine that Snipe-IT is running on, or from your desktop machine? If you run Also try I was going to suggest intermediate certificate issues as well. Whether or not you can send non-TLS mail is up to your mail server. Some will force TLS. |
(I would bet that the intermediate cert fix will fix this issue.) |
I meant, can we elect to not use TLS via snipeIT. We can successfully send generic telnet emails from our whitelisted IPs internally (like snipeit) with 0 auth. [root@snipeit ~]# telnet mail.tonkin.com 587 [root@snipeit ~]# openssl s_client -connect mail.tonkin.com:465 It does look like TLS intermediate cert is the culprit for this scenario, and I'm hoping our mail admin can get it resolved. Changing to port 465 and 'ITAM' has another timeout. |
Well, you've already tried setting encryption to null, and it didn't seem happy about that. This shouldn't work, but try enclosing some settings in single quotes.
|
(Also, apologies for portscanning you. I was just trying to troubleshoot.) |
Thank you for so much help, we've at least definitely narrowed it down to the TLS chain. It may or may not be worth noting somewhere that TLS is required to send via an external mail host. At this point I think my best bet would be to get sendmail working on the snipeit side? Other than waiting on the mail admin who may or may not ever fix the TLS issue. |
It isn't required though, that's the thing. Lots of people use no encryption and it works fine. My guess is that your mail host is trying to force TLS. The error you get with port 25 almost makes it look like its parsing the env file wrong, which is why I suggested trying with the single quotes. It's as if it thinks that from name field isn't even set. |
Hrm, I wish I knew enough about all the areas to figure this out. We can successfully send an email via telnet from snipeit: [root@snipeit ~]# telnet mail.tonkin.com 25 If I set encryption type to null, in .env, i continue to get: Swift_TransportException in AbstractSmtpTransport.php line 162: So I am unsure how to send it unencrypted from snipeit functionally. |
Did you try it with the single quotes, as I mentioned above? |
Yes, I have tried all options you suggested, as well as all the varieties I could come up with. single quotes, 25, 587, 465, 'ITAM', 'jallen@tonkin.com' etc. |
I have to run out for a bit, but @uberbrady is going to try to help you. (He's badass with mail servers.) |
I have success!! Thank you @snipe, your 'it doesn't appear to be parsing your .env' comment inspired me to manually edit my mail.php with a MAIL_FROM_ADDR, and it is now working beautifully. Not sure why .env is not overriding the mail.php, or what the design is behind it, but that solved my problems 100%. Thank you again for your diligent work! |
Is there a way to not required a server at all, my company won't allow me to use any |
I had this same issue, all I had to do is to change the MAIL_USERNAME and MAIL_PASSWORD to null as shown below: --------------------------------------------REQUIRED: OUTGOING MAIL SERVER SETTINGS--------------------------------------------MAIL_DRIVER=smtp Our email server is an internal Exchange Server and we already bypassed SSL connections between the Snipe-IT and the mail server so TLS encryption is not needed. I hope this helps someone. |
Thank you @ayboye |
Expected Behavior (or desired behavior if a feature request)
Email generated and sent when user is created and 'email credentials' is checked.
Actual Behavior
"Whoops, something went wrong"
http://pastebin.com/cMheVhfs
Please confirm you have done the following before posting your bug report:
Please provide answers to these questions before posting your bug report:
Version of Snipe-IT you're running
v3.3.0-16-ge52a0f6
What OS and web server you're running Snipe-IT on
CentOS 7 with Apache
install.sh
http://pastebin.com/cMheVhfs
Creating new users, wish to email creds.
Failed to load resource: the server responded with a status of 500 (Internal Server Error)
Does work.
app/storage/logs
and your webserver's logs.Modified mail.php multiple times as I've seen on other tickets, no success.
No.
mail.php: Info redacted, but configured correctly. Internal mail server tested and working over Telnet to 25 with same user/pass as attempted in Conf
http://pastebin.com/BQ3LGX19
The text was updated successfully, but these errors were encountered: