mirror of https://github.com/CIRCL/lookyloo
chg: Sanity check in email send
parent
a33c5eaabe
commit
fa57435433
|
@ -563,6 +563,7 @@ class Lookyloo():
|
||||||
s.quit()
|
s.quit()
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
self.logger.exception(e)
|
self.logger.exception(e)
|
||||||
|
self.logger.warning(msg.as_string())
|
||||||
|
|
||||||
def _ensure_meta(self, capture_dir: Path, tree: CrawledTree) -> None:
|
def _ensure_meta(self, capture_dir: Path, tree: CrawledTree) -> None:
|
||||||
metafile = capture_dir / 'meta'
|
metafile = capture_dir / 'meta'
|
||||||
|
|
|
@ -387,6 +387,9 @@ def cache_tree(tree_uuid: str):
|
||||||
@app.route('/tree/<string:tree_uuid>/send_mail', methods=['POST', 'GET'])
|
@app.route('/tree/<string:tree_uuid>/send_mail', methods=['POST', 'GET'])
|
||||||
def send_mail(tree_uuid: str):
|
def send_mail(tree_uuid: str):
|
||||||
email: str = request.form.get('email') if request.form.get('email') else '' # type: ignore
|
email: str = request.form.get('email') if request.form.get('email') else '' # type: ignore
|
||||||
|
if '@' not in email:
|
||||||
|
# skip clearly incorrect emails
|
||||||
|
email = ''
|
||||||
comment: str = request.form.get('comment') if request.form.get('comment') else '' # type: ignore
|
comment: str = request.form.get('comment') if request.form.get('comment') else '' # type: ignore
|
||||||
lookyloo.send_mail(tree_uuid, email, comment)
|
lookyloo.send_mail(tree_uuid, email, comment)
|
||||||
return redirect(url_for('tree', tree_uuid=tree_uuid))
|
return redirect(url_for('tree', tree_uuid=tree_uuid))
|
||||||
|
|
Loading…
Reference in New Issue