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

Updated anti-spam measures and From: field formats.

parent aa77cf34
No related branches found
No related tags found
No related merge requests found
...@@ -5,11 +5,11 @@ ...@@ -5,11 +5,11 @@
// Configuration file (in ctrl/newslink.cfg) format: // Configuration file (in ctrl/newslink.cfg) format:
// ;this line is a comment // ;this line is a comment
// server // server servername
// username // port TCP port number (defaults to 119)
// password // user username (optional)
// subboard newsgroup // pass password (optional)
// subboard newsgroup // area subboard (internal code) newsgroup
// ... // ...
const VERSION="1.00 Alpha" const VERSION="1.00 Alpha"
...@@ -17,7 +17,10 @@ const VERSION="1.00 Alpha" ...@@ -17,7 +17,10 @@ const VERSION="1.00 Alpha"
printf("Synchronet NewsLink session started (v%s)", VERSION); printf("Synchronet NewsLink session started (v%s)", VERSION);
var tearline = format("--- Synchronet NewsLink v%s\r\n",VERSION); var tearline = format("--- Synchronet NewsLink v%s\r\n",VERSION);
var tagline = format(" * %s telnet://%s\r\n",system.name,system.inetaddr); var tagline = format(" * %s, %s telnet://%s\r\n"
,system.name,system.location,system.inetaddr);
var antispam = format("remove-%s-this."
,random(50000).toString(36));
var cfg_fname = system.ctrl_dir + "newslink.cfg"; var cfg_fname = system.ctrl_dir + "newslink.cfg";
...@@ -30,14 +33,16 @@ var email_addresses = true; // Include e-mail addresses in headers ...@@ -30,14 +33,16 @@ var email_addresses = true; // Include e-mail addresses in headers
// Parse arguments // Parse arguments
for(i=0;i<argc;i++) { for(i=0;i<argc;i++) {
if(argv[i].toLowerCase()=="-d") if(argv[i].toLowerCase()=="-d") // debug
debug = true; debug = true;
else if(argv[i].toLowerCase()=="-r") else if(argv[i].toLowerCase()=="-r") // reset export pointers (export all)
reset_ptrs = true; reset_ptrs = true;
else if(argv[i].toLowerCase()=="-u") else if(argv[i].toLowerCase()=="-u") // update export pointers (export none)
update_ptrs = true; update_ptrs = true;
else if(argv[i].toLowerCase()=="-ne") else if(argv[i].toLowerCase()=="-ne") // no e-mail addresses
email_addresses = false; email_addresses = false;
else if(argv[i].toLowerCase()=="-nm") // no mangling of e-mail addresses
antispam = "";
else else
cfg_fname = argv[i]; cfg_fname = argv[i];
} }
...@@ -232,7 +237,7 @@ for(i in area) { ...@@ -232,7 +237,7 @@ for(i in area) {
body += tagline; body += tagline;
} }
if(1) if(0)
writeln(format("IHAVE %s",hdr.id)); writeln(format("IHAVE %s",hdr.id));
else else
writeln("POST"); writeln("POST");
...@@ -246,21 +251,28 @@ for(i in area) { ...@@ -246,21 +251,28 @@ for(i in area) {
if(!email_addresses) if(!email_addresses)
writeln(format("From: %s@%s",hdr.from,newsgroup)); writeln(format("From: %s@%s",hdr.from,newsgroup));
else if(hdr.from.indexOf('@')!=-1) else if(hdr.from.indexOf('@')!=-1)
writeln(format("From: %s",hdr.from)); writeln(format("From: %s%s",antispam,hdr.from));
else if(hdr.from_net_type && hdr.from_net_addr!=null) { else if(hdr.from_net_type && hdr.from_net_addr!=null) {
if(hdr.from_net_addr.indexOf('@')!=-1) if(hdr.from_net_addr.indexOf('@')!=-1)
writeln(format("From: \"%s\" <%s>" writeln(format("From: \"%s\" <%s%s>"
,hdr.from,hdr.from_net_addr)); ,hdr.from
,antispam,hdr.from_net_addr));
else else
writeln(format("From: \"%s\" <%s@%s>" writeln(format("From: \"%s\" <%s%s@%s%s>"
,hdr.from,hdr.from,hdr.from_net_addr)); ,hdr.from
,antispam,hdr.from
,antispam,hdr.from_net_addr));
} }
else if(hdr.from.indexOf(' ')>0) else if(hdr.from.indexOf(' ')>0)
writeln(format("From: \"%s\"@%s" writeln(format("From: \"%s\" <\"%s%s\"@%s%s>"
,hdr.from,system.inetaddr)); ,hdr.from
,antispam,hdr.from
,antispam,system.inetaddr));
else else
writeln(format("From: %s@%s" writeln(format("From: \"%s\" <%s%s@%s%s>"
,hdr.from,system.inetaddr)); ,hdr.from
,antispam,hdr.from
,antispam,system.inetaddr));
writeln("Subject: " + hdr.subject); writeln("Subject: " + hdr.subject);
writeln("Message-ID: " + hdr.id); writeln("Message-ID: " + hdr.id);
writeln("Date: " + hdr.date); writeln("Date: " + hdr.date);
......
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