hashview / hashview-old

A web front-end for password cracking and analytics
http://www.hashview.io
GNU General Public License v3.0
619 stars 134 forks source link

Internal Server Error when sending Emails #341

Closed GrepItAll closed 6 years ago

GrepItAll commented 6 years ago

When I attempt to send a test email from global settings, I get this error in the console:

14:06:24 web.1 | 2017-10-02 14:06:23 - NameError - undefined local variable or method `smtp_sender' for #<Sinatra::Application:0x007f2b3d7ffd90>: 14:06:24 web.1 | /home/user/Desktop/hashview/helpers/email.rb:13:in `sendEmail' 14:06:24 web.1 | /home/user/Desktop/hashview/routes/settings.rb:209:in `block in <top (required)>' I've just taken the first few lines as this appears to show the root of the problem.

I hope that helps somewhat, if there's any more info that you need from me then please ask.

i128 commented 6 years ago

Do you have your SMTP settings configured in the Global Setting section of the web app?

GrepItAll commented 6 years ago

Yes I do, configured to match this document: https://help.1and1.co.uk/mail-c65093/1and1-mail-basic-c40987/getting-started-c43521/set-up-e-mail-clients-using-imap-or-pop3-a619070.html

The same settings work with my normal email client. Deliberately putting in wrong settings provides the same error about an undefined variable.

i128 commented 6 years ago

Can you connect to your mysqldb mysql -u root -p <your pass>

Connect to the hashview db

use hashview; 

Check to see if the entries you typed in match whats listed in the table: select * from settngs;

Note the password is saved in clear text, so dont post it here, but validate that those settings look correct. It should look something like this: image

GrepItAll commented 6 years ago

Yep, the settings in the first row look correct to me (provided ClientMode is meant to be NULL). However I also have a second row (ID=2), where all the smtp stuff is set to NULL. Is this meant to happen? Should I try deleting the row and restarting hashview?

EDIT: I deleted the second row anyway. Didn't make a difference. Think it might have been from where I reinstalled Hashview but didn't clean up the DB.

i128 commented 6 years ago

Hm. Okay i'll have to look into this further, not sure whats causing it, but will try to replicate locally.

GrepItAll commented 6 years ago

Ok, thank you. I just checked it with a different SMTP server (different email), same thing.

i128 commented 6 years ago

So i think i've isolated the issue and implemented a fix, should be available in v0.7.2-beta

i128 commented 6 years ago

Closing, let me know if this comes back up.