I have a probleem in this part of code. It opens the connection and just freezes not proceeding to f.close, so the script is not running further.
if "opened" in line:
print "You just received some mail! Wow!"
data = json.dumps({"url":"awesome url", "data":"awesome data"})
req = urllib2.Request("http://1.2.3.4:8080/", data, {'Content-Type':'application/json'})
f = urllib2.urlopen(req)
response = f.read()
print (response)
f.close()