1
0
mirror of https://github.com/MailHops/mailhops-plugin.git synced 2025-05-21 08:30:23 -07:00

Bump v1.0.7

This commit is contained in:
Andrew Van Tassel 2015-11-13 11:11:59 -07:00
parent 96ed6ca0a1
commit 1fc862191f
3 changed files with 19 additions and 17 deletions

View File

@ -1,5 +1,11 @@
# Change Log # Change Log
## [1.0.7] - 2015-11-13
### Fixed
- Check that IP address starts with digit less than 240 (IANA-RESERVED)
## [1.0.6] - 2015-11-12 ## [1.0.6] - 2015-11-12
### Fixed ### Fixed

View File

@ -8,7 +8,7 @@ var mailHops =
{ {
msgURI: null msgURI: null
, isLoaded: false , isLoaded: false
, options: {'version':'MailHops Plugin 1.0.6','lan':'en','unit':'mi','api_url':'http://api.mailhops.com','debug':false} , options: {'version':'MailHops Plugin 1.0.7','lan':'en','unit':'mi','api_url':'http://api.mailhops.com','debug':false}
, message: { secure:[] } , message: { secure:[] }
, client_location: null , client_location: null
}; };
@ -222,7 +222,7 @@ mailHops.getRoute = function(){
}; };
//another ip check, dates will throw off the regex //another ip check, dates will throw off the regex
mailHops.testIP = function(ip,header){ mailHops.testIP = function(ip,header){
var retval = true; var validIP = true;
try { try {
var firstchar = header.substring(header.indexOf(ip)-1); var firstchar = header.substring(header.indexOf(ip)-1);
@ -231,17 +231,14 @@ mailHops.testIP = function(ip,header){
lastchar = lastchar.substring(0,1); lastchar = lastchar.substring(0,1);
if(firstchar.match(/\.|\d|\-/) if(firstchar.match(/\.|\d|\-/)
|| lastchar.match(/\.|\d|\-/) || lastchar.match(/\.|\d|\-/)
|| ( firstchar == '?' && lastchar == '?' ) || ( firstchar == '?' && lastchar == '?' )
|| lastchar == ';'){ || lastchar == ';'
return null; || parseInt(ip.substring(0,ip.indexOf('.'))) >= 240 //IANA-RESERVED
} ){
else if(header.indexOf('['+ip+']') !== -1 || header.indexOf('('+ip+')') !== -1){ validIP = false;
retval = true; } else {
} //check if this IP was part of a secure transmission
//check if this IP was part of a secure transmission
if(retval){
if(header.indexOf('using SSL') != -1){ if(header.indexOf('using SSL') != -1){
if(header.substring(header.indexOf('using SSL')+11,header.indexOf('using SSL')+12) == '.') if(header.substring(header.indexOf('using SSL')+11,header.indexOf('using SSL')+12) == '.')
mailHops.message.secure.push(ip+':'+header.substring(header.indexOf('using SSL'),header.indexOf('using TLS')+14)); mailHops.message.secure.push(ip+':'+header.substring(header.indexOf('using SSL'),header.indexOf('using TLS')+14));
@ -258,10 +255,9 @@ mailHops.testIP = function(ip,header){
mailHops.message.secure.push(ip+':'+'using TLSv1/SSLv3'); mailHops.message.secure.push(ip+':'+'using TLSv1/SSLv3');
} }
} catch(e) { } catch(e) {
retval = true; mailHops.LOG('testIP Error: '+JSON.stringify(e));
mailHops.LOG('testIP Error: '+JSON.stringify(e));
} }
return retval; return validIP;
}; };
mailHops.setupEventListener = function(){ mailHops.setupEventListener = function(){

View File

@ -5,7 +5,7 @@
<Description about="urn:mozilla:install-manifest"> <Description about="urn:mozilla:install-manifest">
<em:type>2</em:type> <em:type>2</em:type>
<em:id>thunderbird@mailhops.com</em:id> <em:id>thunderbird@mailhops.com</em:id>
<em:version>1.0.6</em:version> <em:version>1.0.7</em:version>
<em:name>MailHops</em:name> <em:name>MailHops</em:name>
<em:description>MailHops maps the route an email traveled to get to you. Using GeoIP it also displays distance traveled along with the location (city, state and country) of the sender.</em:description> <em:description>MailHops maps the route an email traveled to get to you. Using GeoIP it also displays distance traveled along with the location (city, state and country) of the sender.</em:description>