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

added support for s flag - no subject filtering

parent cd067e45
No related branches found
No related tags found
No related merge requests found
......@@ -22,6 +22,7 @@
// r remove "Newsgroups:" header field from imported messages
// u uudecode attachments
// i import all (not just new articles)
// s no subject filtering
const REVISION = "$Revision$".split(' ')[1];
......@@ -449,7 +450,7 @@ for(i in area) {
var hdr={ from: "", to: newsgroup, subject: "", id: "" };
var line_counter=0;
var recv_lines=0;
var file;
var file=undefined;
var md5;
while(socket.is_connected) {
......@@ -483,7 +484,7 @@ for(i in area) {
if(flags.indexOf('u')>=0) { // uudecode attachments
if(line.substr(0,6)=="begin ") {
// Parse uuencode header
arg=line.split(' ');
arg=line.split(/\s+/);
arg.splice(0,2); // strip "begin 666 "
fname=file_getname(arg.join(" "));
if(file_exists(attachment_dir + fname)) { // generate unique name, if necessary
......@@ -546,7 +547,9 @@ for(i in area) {
}
md5_list.push(md5);
if(partial)
file_rename(file.name,hdr.subject.replace(/\//g,'.'));
file_rename(file.name
,attachment_dir
+ hdr.subject.replace(/\//g,'.').replace(/ /g,'_') + ".part");
}
if(truncsp(body).length==0) {
......@@ -567,7 +570,7 @@ for(i in area) {
&& hdr.gateway.indexOf(system.inetaddr)!=-1)
continue;
if(system.trashcan("subject",hdr.subject)) {
if(flags.indexOf('s')==-1 && system.trashcan("subject",hdr.subject)) {
printf("!BLOCKED subject: %s\r\n",hdr.subject);
var reason = format("Blocked subject (%s)",hdr.subject);
system.spamlog("NNTP","NOT IMPORTED",reason,hdr.from,server,hdr.to);
......
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