SMTP Error: 535 5.7.8 Authentication credentials invalid - cakephp

I am using jango smtp setting in my project.
Below is my code:
funcation sendmail()
{
$this->Email->smtpOptions = array(
'timeout' => '30',
'port' => '25',
'host' => 'relay.jangosmtp.net',
'username' => 'xxxx',
'password' => '1234567'
);
}
sendmail function gives the following error:
SMTP Error: 535 5.7.8 Authentication credentials invalid
What may be the reason?

This is basically because credentials is not correct !!
May be this will help you !!
535 Authentication failed. Restarting authentication process.
If a SMTP client authenticates but the username or password is incorrect, or the account is disabled, hMailServer sends this error message to the client.
http://support.qualityunit.com/156325-Email-is-not-sent-because-of-failed-authentication
SMTP error 535 authentication failed in roundcube
SMTP Error (435): Authentication failed
If you face SMTP error 535 Authentication Failed while sending an email from round cube, then you can check the following things.
[root#server1 ~]# vi /usr/local/cpanel/base/3rdparty/roundcube/config/main.inc.php
and changed
$rcmail_config['smtp_user'] = ‘%u’;
to
$rcmail_config['smtp_user'] = ”;

Related

Codeigniter Centos 9 cannot connect to remote SQL Server

Back when I was still developing the application (CodeIgniter3) in my local computer using Xampp (windows 10) I can connect to the remote SQL Server database through my local computer without any issue. But, when I deploy my application in Centos 9 Apache web server can't seem to connect to the remote SQL Server database.
The message I got when I tried to query it through my ci models by using $this->db->error() command is:
array(2) { ["code"]=> string(11) "08001/10054" ["message"]=> string(73) "[Microsoft][ODBC Driver 17 for SQL Server]TCP Provider: Error code 0x2746" }.
I can ping the SQL Server IP without no issue from my web server, also checked that the required port for SQL Server already opened (1433) in the remote SQL Server by using Telnet. Things I've already tried based on a lot of googling but still won't resolve the issue:
enabling some the httpd_can_network_connect & httpd_can_network_connect_db in selinux
disabling selinux (changed to permissive mode)
changing the config/database.php settings. My current settings is :
$db['default'] = array( 'dsn' => '', 'hostname' => 'xxx.xx.xxx.xx',
'port' => '', 'username' => 'xxx', 'password' =>
'xxx', 'database' => 'xxx', 'dbdriver' => 'sqlsrv',
'dbprefix' => '', 'pconnect' => FALSE, 'db_debug' => FALSE,
'cache_on' => FALSE, 'cachedir' => '', 'char_set' => 'utf8',
'dbcollat' => 'utf8_general_ci', 'swap_pre' => '', 'encrypt' =>
FALSE, 'compress' => FALSE, 'stricton' => FALSE, 'failover' =>
array(), 'save_queries' => TRUE );
Modify /etc/ssl/openssl.cnf config file as follows sed -i -E 's/(CipherString\s*=\s*DEFAULT#SECLEVEL=)2/\11/' /etc/ssl/openssl.cnf since some reference said that it might be a problem with openssl vs. sql-server protocol/version (FYI, my web server openssl version is 3.0.1)
opening port 1433 in my web server through firewalld
Please help me, what exactly is the issue and how do I resolve this?
UPDATE 1
Already checked that i can telnet from my web server to the sql server machine on port 1433.
Regarding the probable cause of openssl tls version not supported, I also check tls version supported on the sql server using command openssl s_client -host ip -port 1433 -tls1 and it said that it is connected. But when i check tls version supported on my Centos Apache web server using the same command (different ip), it gives me error.
Hence, i tried to change the openssl.conf as instructed in https://askubuntu.com/questions/1233186/ubuntu-20-04-how-to-set-lower-ssl-security-level still didnt solve the issue

React & AWS IoT MQTT over WSS - "connection lost - will attempt reconnection in x seconds"

I am unable to successfully connect to an AWS IoT device via MQTT using websockets with authenticated cognito users.
I am using aws-iot-device-sdk in a react application.
Upon trying to connect, the following debug logs get printed to the web browser console:
canonical request: GET
/mqtt
X-Amz-Algorithm=<removed>
SignedHeaders=host
host:<removed>.iot.us-east-1.amazonaws.com
host
<removed>
index.js:102 hashed canonical request: <removed>
index.js:111 string to sign: <removed>
<removed>
20210618/us-east-1/<removed>
index.js:117 signing key: <removed>
index.js:125 signature: <removed>
index.js:137 url: wss://<removed>.iot.us-east-1.amazonaws.com/mqtt?X-Amz-Algorithm=<removed>
index.js:630 using websockets, will connect to 'wss://<removed>.iot.us-east-1.amazonaws.com/mqtt?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=....
index.js:781 connection lost - will attempt reconnection in 128 seconds...
JS Code To Create the Device and Connect:
var device = awsIot.device({
clientId : <unique client id>,
region : 'us-east-1',
debug : true,
host : '<removed>.iot.us-east-1.amazonaws.com',
protocol : 'wss',
accessKeyId : accessKeyId,
secretKey : secretAccessKey,
sessionToken : sessionToken
});
device.on('connect', function(err, data) {
if (err) {
console.log(`Connection Error: ${err}`);
return;
}
console.log('connected');
})
Authenticated IoT AWS Roles:
"Action": [
"iot:Connect",
"iot:Subscribe",
"iot:Publish",
"iot:Receive"
],
"Resource": [
"arn:aws:iot:us-east-1:<removed>:client/cognito_user_*",
"arn:aws:iot:us-east-1:<removed>:topic*/resource/*"
]
I am able to connect to the MQTT broker using certs with MQTT.fx but the application I am working on requires authenticated cognito users to be able connect to the broker. Any insight would be appreciated.
Solved this problem.
The problem I was having was the Cognito User did not have a necessary certificate associated with it in order to access the resource.

cakephp 3 SMTP on DigitalOcean

I can´t send email on digitalOcean droplet with ubuntu, php7 and cakephp3
In my localhost it works but in production I get timeout error.
I've done everything and many ways and no works.
see my app.config
'EmailTransport' => [
'default' => [
'className' => 'Smtp',
'host' => 'smtp.gmail.com',
'port' => 587,
'timeout' => 30,
'username' =>'MYuser',
'password' => 'MYpwd',
'client' => null,
'tls' => true,
'url' => env('EMAIL_TRANSPORT_DEFAULT_URL', null),
],
],
Can someone help me?
thanks
I found the answer.
DigitalOcean blocks for 60 days new Droplets to send email for "security reasons".
If you need a server for host a site whos send email, don't choice DigitalOcean.
Apparently, Digital Ocean blocks outgoing SMTP ports by default. You'll have to ask them to unblock them, and they may wait a while before doing so.
https://www.digitalocean.com/community/questions/not-able-to-connect-to-gmail-smtp
Look like you have to enable port 25. According to their support, they mentioned like this;
sudo ufw allow 25
sudo ufw reload
Or you may not have enough money for support SLA.

Error sending test email gitbucket

The email settings was setup using a gmail account and when testing it the error below is returned.
[Error] org.apache.commons.mail.EmailException: Sending the email to
the following server failed : smtp.gmail.com:587
The settings are host: smtp.gmail.com, port:587 and STARTTLS/SSL Enabled.
Try a combination of enabling STARTTLS and disabling SSL.

Solr HTTP error: Unauthorized (401)

I have an application and I've used Solarium for Solr. I have the configuration file:
public function getConfig()
{
return array(
'adapteroptions' => array(
'host' => '127.0.0.1',
'port' => 8983,
'path' => '/solr/',
));
}
and it worked just fine. The problem I have now is that I've moved the application into another server and it seem that the port is changed. This are the dates I receive:
tomcat7 installed and solr 4.7.2.
You cand check at www.mysite:8080/solr
user: mysiteuser password:mysitepass
So in my config file I've changed the port in 8080, but I get the following error:
Solr HTTP error: Unauthorized (401)
Can someone help me to write the correct settings? How can I set the user and password?
Thank you
You should define it via the specific endpoint:
$client = new Solarium\Client($config);
$client->getEndpoint()->setAuthentication(SOLR_SERVER_USERNAME, SOLR_SERVER_PASSWORD);

Resources