Esempio n. 1
0
 def send_mail():
     data = json.loads(request.data)
     url = data["url"]
     if not get_mail_sent(url):
         ip = _get_user_ip(request)
         send(url, ip)
     return redirect(url_for("index"))
Esempio n. 2
0
 def send_mail():
     data = json.loads(request.data)
     url = data["url"]
     if not get_mail_sent(url):
         ip = _get_user_ip(request)
         send(url, ip)
     return redirect(url_for('index'))
Esempio n. 3
0
 def send(url, ip="", autosend=False):
     if not get_mail_sent(url):
         set_mail_sent(url)
         data = cached(url)
         if not autosend:
             subject = "URL Abuse report from " + ip
         else:
             subject = "URL Abuse report sent automatically"
         msg = Message(subject, sender="*****@*****.**", recipients=["*****@*****.**"])
         msg.body = digest(data)
         msg.body += "\n\n"
         msg.body += json.dumps(data, sort_keys=True, indent=4, separators=(",", ": "))
         mail.send(msg)
Esempio n. 4
0
 def send(url, ip='', autosend=False):
     if not get_mail_sent(url):
         set_mail_sent(url)
         data = cached(url)
         if not autosend:
             subject = 'URL Abuse report from ' + ip
         else:
             subject = 'URL Abuse report sent automatically'
         msg = Message(subject, sender='*****@*****.**', recipients=["*****@*****.**"])
         msg.body = digest(data)
         msg.body += '\n\n'
         msg.body += json.dumps(data, sort_keys=True, indent=4, separators=(',', ': '))
         mail.send(msg)
Esempio n. 5
0
 def send(url, ip='', autosend=False):
     if not get_mail_sent(url):
         set_mail_sent(url)
         data = cached(url)
         if not autosend:
             subject = 'URL Abuse report from ' + ip
         else:
             subject = 'URL Abuse report sent automatically'
         msg = Message(subject, sender='*****@*****.**', recipients=["*****@*****.**"])
         msg.body = digest(data)
         msg.body += '\n\n'
         msg.body += json.dumps(data, sort_keys=True, indent=4, separators=(',', ': '))
         mail.send(msg)