Mandrill SMTP with Swiftmail in Laravel - works local, breaks on hosting - laravel

When users are registered Laravel fires of a welcome email using Swiftmail configured to use SMTP with Mandrill. With the existing config, this works perfectly on my local installation.
When moving to the production server (Unmanaged, CentOS with WHM/Cpanel), the first HELO fails, giving this error:
Swift_TransportException in AuthHandler.php line 181:
Failed to authenticate on SMTP server with username "info#mydomain.com" using 2 possible
authenticators
in AuthHandler.php line 181
at Swift_Transport_Esmtp_AuthHandler->afterEhlo(object(Swift_SmtpTransport)) in
EsmtpTransport.php line 307
All other questions I can find with this error are about Gmail needing to have it's authentication weakened to allow the connection. This is directly with Mandrill so such things can't be the issue.
I've already checked the correct port (578) is open - nmap says it is.
That the credentials in mail.php are valid - API key is correct, so is user information.
And that the server can access the remote server - I can telnet smtp.mandrillapp.com without issue.
I'm running out of things to test for to fix.
Any suggestions welcome, and thank you in advance!

Related

I am getting below error while sending mail through amazon SES

I am getting below error message
A PHP Error was encountered
Severity: Warning
Message: fsockopen(): Peer certificate CN=`15-206-188-47.cprapid.com' did not match expected CN=`email-smtp.ap-south-1.amazonaws.com'
Filename: libraries/Email.php
Line Number: 2070
Backtrace:
Double-check that you are using the correct SMTP endpoint for the Amazon SES region where your account is located. If you are not sure, you can find the correct endpoint in the Amazon SES documentation.
it's correct
Ensure that the server you are connecting to is actually an Amazon SES server. It's possible that you are accidentally connecting to a different server that is presenting a mismatched certificate.
it's actually correcting to amazone ses server
Check that your local DNS is resolving the correct IP address for the Amazon SES SMTP endpoint. You can try using the nslookup or dig command to check the IP address.
how can i check this ?
If none of the above steps work, it's possible that there is an issue with the SSL certificate on the server side. In this case, you may need to contact Amazon SES support to report the issue and get further assistance. They can help you determine if the certificate presented by the server is valid and properly configured.
what should i do here ?
I found above solution for issue and can any one help me to resolved this.

'503 Failed authentication on backend server: Unauthorized' when logging on to OWA

When logging on to OWA using a browser, receive a 503 error. In the Fiddler trace will see a more detailed response status code:
503 Failed authentication on backend server: Unauthorized
On the Exchange Server, see the following System event log (intermittently):
Event 4 Security-Kerberos
The Kerberos client received a KRB_APP_ERR_MODIFIED error from the server exchangeserver$.
The target name used was HTTP/exchangeserver.ad.root.
This indicates that the target server failed to decrypt the ticket provided by the client.
I hope someone only receives this in a lab environment!
Here is a link to enable Kerberos logging, which could be helpful as well: https://learn.microsoft.com/en-us/troubleshoot/windows-server/identity/enable-kerberos-event-logging
After enabling Kerberos logging, would see the KRB_APP_ERR_MODIFIED error more frequently, whereas before would not be logged each time a logon attempt occurred.
The issue here (in the lab) was that a duplicate SPN for the Exchange Server in question was added erroneously to another server, causing a duplicate. This was due to trying to enable Kerberos delegation for a separate web application.
Although there could be a quicker way to do this, you can list the SPNs on each server to look for your erroneous exchangeserver record by running
setspn -l otherservername (this is a lower-case L)
And if you find that SPNs like http/exchangeserver or http/exchangeserver.ad.root are listed on another server (say 'otherservername'), you can carefully remove them by running
setspn -D http/exchangeserver otherservername
setspn -D http/exchangeserver.ad.root otherservername
I was able to logon to OWA immediately after the duplicate SPN was removed, without restarting any servers or services.
Check, if the bindings for Exchange Backend website in IIS is correctly configured. You can check this by visiting IIS console in the server and open bindings for Backend website for 443 port. See, if the certificate is assigned well
Also, check, if the Default website's binding is correct. It should have thirdparty SSL certificate assigned or the self signed certificate
If any of the bindings are incorrect, fix it and restart IIS (iisrest from cmd prompt). Check again

Laravel cannot not connect to Stripe

I have trouble connecting to Stripe with my Laravel / React application. Locally it works and the same code on a Digital Ocean droplet doesn't. I get this message:
Could not connect to Stripe (https://api.stripe.com/v1/invoices/upcoming?customer=cus_XXXXXXXXXX). Please check your internet connection and try again. If this problem persists, you should check Stripe's service status at https://twitter.com/stripestatus, or let us know at support#stripe.com. (Network error [errno 7]: )
That is the error message from Laravel. The important part is (Network error [errno 7]: ). It has to do with CURL that encounters this error: CURLE_COULDNT_CONNECT (error code 7).
Also I would expect something like this (Network error [errno 7]: Failed connect to api.stripe.com:443; Operation now in progress). Not a blank space after the colon.
I have tried this:
The server uses SSL (https://xxxxx.xxx)
Reboot the server
Redeploy the application
Clear caches for config, route, view etc.
php artisan optimize:clear
Re-run composer
Checked my Stripe API keys
Tried manually to connect fromt the shell with curl and it works.
Tried https://github.com/stripe/stripe-reachability#stripe-reachability
For reference, you can see the error on https://curl.haxx.se/libcurl/c/libcurl-errors.html and means :
CURLE_COULDNT_CONNECT (7) - Failed to connect() to host or proxy.
This is not an issue in the code, you may need to check your server hosting provider.
BTW, you may need to look at This answer. It's the same.
It is solved with him by changing the server and when communicating with the host provider, he found that the port is blocked because of high traffic.

What is the default email server for Teamcity 7.1?

Without any changes, email notifications stopped being sent from our continuous integration server which is a Teamcity 7.1 server. Up to now I've just used the default teamcity email configuration, which was this:
SMTP host: mail
SMTP port: 25
Send email messages from: Teamcity
SMTP login: <blank>
SMTP password: <blank>
Secure connection: none
Worked fine for last year or so. Now I'm trying to diagnose what is wrong, but I don't really know what the above configuration is doing... Is it pointing to a built-in mail server that is bundled with Teamcity? Is it pointing to the company's exchange server? Something else?
Teamcity does not have any bundled mail servers. This configuration point to your company's SMTP server. By occasion, SMTP server's name is 'mail'. So TC tries to connect to mail:25 and send messages 'from' 'Teamcity'
Please check if SMTP server's authentication settings were modified (e.g., anonymous access is now forbidden). Also please check 'teamcity-server.log' for error messages related to sending notifications.

Server running Microsoft CRM cannot connect, but every other machine on network can

I have an annoying problem.
On every machine on the network, browsing to our internal MS CRM URL works fine. However, if I log into the actual server itself and try to connect the same credentials just do not work. I get this error:
HTTP Error 401.1 - Unauthorized
You do not have permission to view this directory or page using the credentials that you supplied.
I can't figure it out. They're on the same domain, everything should be fine. It's a big problem because there is an application running on the server that needs to connect to the CRM webservice - and fails.
Even with Basic Auth, I enter the username and password and it fails.
Any ideas?
You might be hitting the loopback security check. Read this KB article to see if you are, and how to disable it so things will work: http://support.microsoft.com/default.aspx?scid=kb;en-us;896861

Resources