Skip to content
Snippets Groups Projects
Commit 430c0b8e authored by rswindell's avatar rswindell
Browse files

Added an "unmangle" option to newslink.cfg (or "-um" on the command-line)

to automatically remove the NewsLink anti-spam measure from the e-mail address
(if present) in imported messages.
parent 9821e627
No related branches found
No related tags found
No related merge requests found
......@@ -53,6 +53,7 @@ var import_amount = 0; // Import a fixed number of messages per group
var lines_per_yield = 5; // Release time-slices ever x number of lines
var yield_length = 1; // Length of yield (in milliseconds)
var max_newsgroups_per_article = 5; // Used for spam-detection
var unmangle = false;
// Parse arguments
for(i=0;i<argc;i++) {
......@@ -70,6 +71,8 @@ for(i=0;i<argc;i++) {
email_addresses = false;
else if(argv[i].toLowerCase()=="-nm") // no mangling of e-mail addresses
antispam = "";
else if(argv[i].toLowerCase()=="-um") // un-mangle e-mail addresses when importing
unmangle = true;
else if(argv[i].toLowerCase()=="-ix") // import a fixed number of messages
{
import_amount = parseInt(argv[i+1]);
......@@ -126,6 +129,12 @@ function unique_fname(dir,fname)
return(dir + new_fname);
}
// Remove NewsLink anti-spam meature from e-mail address
function unmangle_addr(addr)
{
return addr.replace(/\.remove-\S+-this/,"");
}
var host;
var port=119;
var username;
......@@ -182,6 +191,9 @@ while(!cfg_file.eof) {
case "debug":
debug=true;
break;
case "unmangle":
unmangle=true;
break;
case "slave":
slave=true;
break;
......@@ -775,6 +787,9 @@ for(i in area) {
if(flags.indexOf('r')>=0) // remove "Newsgroups:" header field
delete hdr.newsgroups;
if(unmangle)
hdr.from_net_addr = unmangle_addr(hdr.from_net_addr);
hdr.from_net_type=NET_INTERNET;
// hdr.from_net_addr=hdr.from;
if(flags.indexOf('t')==-1)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment