Skip to content
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

Configure Gmail with Webzash #158

Open
jessicana opened this issue Oct 20, 2021 · 30 comments
Open

Configure Gmail with Webzash #158

jessicana opened this issue Oct 20, 2021 · 30 comments

Comments

@jessicana
Copy link

Hey,

Are the below settings correct to configure gmail with webzash?

image

@prashants
Copy link
Owner

prashants commented Oct 20, 2021 via email

@jessicana
Copy link
Author

jessicana commented Oct 20, 2021

Thanks! I used 587 and now I can confirm that the email is not working as I want on webzash. This is due to a problem at my end that I try to know what is it. How can I debug this issue on webzash? To be clear, I have the same issue on my mail server that it also does not send emails with webzash although it was just fine previously. See below the error message. I understand that I can go to my gmail account security and allow less secure apps to "ON", I did that but it did not solve my problem. Do you think Fail2ban has anything to do with this?

The challenge I have is that if I click forget password using webzash forget password link, I cannot sign in until I get an email to reset my password, since I have a problem getting emails, I got blocked. I noticed that when I click on forget password link and try to sign in after that using my correct credentials, webzash does not accept my sign-in attempt and starts counting 5, 4, 3,2,1 and blocks me.
MTEISMU

@prashants
Copy link
Owner

prashants commented Oct 21, 2021 via email

@jessicana
Copy link
Author

I tried with and without TLS. It did not work.

@prashants
Copy link
Owner

prashants commented Oct 22, 2021 via email

@prashants
Copy link
Owner

prashants commented Oct 22, 2021 via email

@jessicana
Copy link
Author

jessicana commented Oct 25, 2021

Your configuration is correct but it did not work. I am unable to get webzash to work again with gmail or any other email. The email problem started when I set a password on webzash URL so that I only access the URL and never went away even after I canceled out the password protection. I am not sure what problem has this protection caused. Although I canceled out the below lines:

#      auth_basic "Login";
#      auth_basic_user_file /etc/nginx/.htpasswd;

The problem never went away. Below is the whole block:

  ## Nginx Configuration for Webzash
  location ^~ /webzash
  {
    root /var/www/example.com/html/root
    index index.php;
    try_files $uri $uri/ /webzash/index.php;

    location ~ \.php$
    {
      try_files $uri =404;
      include fastcgi_params;
      fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
      fastcgi_pass unix:/run/php/php8.0-fpm.sock;
  ### Protect webzash using a username and password
      auth_basic "Login";
      auth_basic_user_file /etc/nginx/.htpasswd;
    }
  }

@prashants
Copy link
Owner

prashants commented Oct 25, 2021 via email

@jessicana
Copy link
Author

I did check Nginx error logs - no problem!

@prashants
Copy link
Owner

Can you try the mail option which will use your local mail server if you are hosting the app online.

Maybe firewall is blocking the smtp connections.

@jessicana
Copy link
Author

I suspect that the firewall is blocking it. I am not sure how to go around it - to be honest ..

@prashants
Copy link
Owner

#151 (comment)

You can try inserting this code in the same place as above and see what error message you are getting

public $gmail = array(
  'host' => 'ssl://smtp.gmail.com',
  'port' => 465,
  'username' => 'youremailid@gmail.com',
  'password' => 'yourpassword',
  'transport' => 'Smtp',
  'timeout' => 30
);

$email = new CakeEmail('gmail');
$email->from('youremailid@gmail.com')
->to('some@gmail.com')
->subject('Hello !')
->send("Sample message");

More settings option are given below...

https://book.cakephp.org/2/en/core-utility-libraries/email.html

@jessicana
Copy link
Author

Thanks! This is the way I want to debug this error. I used the above code and inserted that under:

/**
 * login method
 */
	public function login() {

in the WzusersController.php and I go this syntax error:

Errors
syntax error, unexpected token "public"
Error: An Internal Error Has Occurred.

Stack Trace
[internal function] → App::load()
CORE/Cake/Routing/Dispatcher.php line 266 → class_exists()
CORE/Cake/Routing/Dispatcher.php line 235 → Dispatcher->_loadController()
CORE/Cake/Routing/Dispatcher.php line 158 → Dispatcher->_getController()
APP/webroot/index.php line 117 → Dispatcher->dispatch()
ROOT/index.php line 41 → require(string)

This would be very helpful if it works!

@jessicana
Copy link
Author

This is what I get when I try to email an entry to an email:

image

This remains there until I refresh the page!

@prashants
Copy link
Owner

prashants commented Nov 12, 2021 via email

@jessicana
Copy link
Author

jessicana commented Nov 13, 2021

It is working. I was thinking to uninstall webzash and install it again and see if the email would work after that..

@prashants
Copy link
Owner

prashants commented Nov 13, 2021 via email

@jessicana
Copy link
Author

The mail server (i.e., sending and receiving emails) is working with other apps but not with webzash

@prashants
Copy link
Owner

prashants commented Nov 13, 2021 via email

@Ain45
Copy link

Ain45 commented Nov 18, 2021

I have the same problem on a new computer, webzash is not sending email. I use XAMPP on my computers. Yesterday I started trying on an old computer and everything is working. Now I also tried a child's laptop and everything works in it. What's blocking email on my new computer? I set tls 587 on all computers. The new computer also has Avast antivirus, others do not have antivirus protection. What else can hinder this program?
Thank you!

@jessicana
Copy link
Author

jessicana commented Nov 20, 2021

Well, thank you @Ain45
I think it is not working on these settings:
Protocol: SMTP
Port: 587
Use TLS: Enabled
Username: mail.example.org
Password: XXX
From: my email

I use mailcow and the SRV domain settings is properly configured:
_submission._tcp IN SRV 0 1 587 mail.example.org. (your ${MAILCOW_HOSTNAME})

@prashants If there is any further information I can provide, please let me know.

If you can embed PHPMailer in the software is would resolve this problem. I noticed it stopped working all of a sudden as @Ain45 said.

My email works perfectly on across all platforms except on webzash.

@prashants
Copy link
Owner

prashants commented Nov 20, 2021 via email

@jessicana
Copy link
Author

Any update on this is highly appreciated :)

@jessicana
Copy link
Author

jessicana commented Jun 26, 2022

Hey, I tried to configure sending emails with my existing webzash installation using different mailserver and it worked. I also tried a fresh install of webzash but my existing mailserver could not send emails. I contacted the support team of my mailserver about the warning I get on the backend when I try to send emails from webzash as I get this warning:
warning: TLS library problem: error:14094415:SSL routines:ssl3_read_bytes:sslv3 alert certificate expired:../ssl/record/rec_layer_s3.c:1543:SSL alert number 45:

Their support team said this: The warning with the expired certificate came from webzash, right? I would say that this Software has not been up to date regarding the trusted certificate chains. In 2019 (i think) the root CA Certificate from Let's Encrypt has gone invalide, and if your Software isnt updated, they probably dont know about the new valide chain and thinks it is invalid.

I also followed troubleshooting steps on my end such as:

  1. Re-enabling TLS 1.0 and TLS 1.1
  2. Forcing renewal. I got —> Certificate signed! —> command completed successfully
    but none solved this issue

Is there any update batch that webzash could release to resolve this issue?

@prashants
Copy link
Owner

prashants commented Jun 27, 2022 via email

@prashants
Copy link
Owner

prashants commented Jun 29, 2022 via email

@prashants
Copy link
Owner

prashants commented Jul 8, 2022 via email

@jessicana
Copy link
Author

I tried that on a fresh install and it did not work with Mailcow. It works with other mailserver but not with mailcow. I tested a fresh install of webzash and mailcow. Not a firewall issue. It is a TLS issue.

@prashants
Copy link
Owner

prashants commented Jul 14, 2022 via email

@prashants
Copy link
Owner

prashants commented Jul 23, 2022 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants