diff --git a/Rocksolid_Light/rocksolid/config.inc.php b/Rocksolid_Light/rocksolid/config.inc.php index 6873c7d..45b5767 100644 --- a/Rocksolid_Light/rocksolid/config.inc.php +++ b/Rocksolid_Light/rocksolid/config.inc.php @@ -29,9 +29,14 @@ $CONFIG = include ($config_file); $OVERRIDES = include ($config_dir . '/overrides.inc.php'); // Spool directory size and minimum in Gigabytes -$min_spool_disk_space = 2; -$free_spool_disk_space = disk_free_space($spooldir)*9.313E-10; -if($free_spool_disk_space < $min_spool_disk_space) { +if ($OVERRIDES['min_spool_disk_space'] > 0) { + $min_spool_disk_space = $OVERRIDES['min_spool_disk_space']; +} else { + $min_spool_disk_space = 2; +} + +$free_spool_disk_space = disk_free_space($spooldir) * 9.313E-10; +if ($free_spool_disk_space < $min_spool_disk_space) { $low_spool_disk_space = true; } else { $low_spool_disk_space = false; diff --git a/Rocksolid_Light/rocksolid/newsportal.php b/Rocksolid_Light/rocksolid/newsportal.php index 6724c8a..e9555ba 100644 --- a/Rocksolid_Light/rocksolid/newsportal.php +++ b/Rocksolid_Light/rocksolid/newsportal.php @@ -1896,41 +1896,43 @@ function get_next_article_number($group) return $local; } -function insert_article_from_array($this_article) +function insert_article_from_array($this_article, $check_duplicates = true) { global $CONFIG, $config_name, $spooldir, $logdir; $logfile = $logdir . '/spoolnews.log'; $group = $this_article['group']; $grouppath = $path . preg_replace('/\./', '/', $group); - // Create list of message-ids - $database = $spooldir . '/articles-overview.db3'; - $table = 'overview'; - $dbh = overview_db_open($database, $table); - $stmt = $dbh->prepare("SELECT msgid FROM $table WHERE newsgroup=:newsgroup"); - $stmt->bindParam(':newsgroup', $group); - $stmt->execute(); - while ($row = $stmt->fetch()) { - $msgids[$row['msgid']] = true; - } - $dbh = null; + if ($check_duplicates) { + // Create list of message-ids + $database = $spooldir . '/articles-overview.db3'; + $table = 'overview'; + $dbh = overview_db_open($database, $table); + $stmt = $dbh->prepare("SELECT msgid FROM $table WHERE newsgroup=:newsgroup"); + $stmt->bindParam(':newsgroup', $group); + $stmt->execute(); + while ($row = $stmt->fetch()) { + $msgids[$row['msgid']] = true; + } + $dbh = null; - // Check history database for deleted message-ids - $database = $spooldir . '/history.db3'; - $table = 'history'; - $dbh = history_db_open($database, $table); - $stmt = $dbh->prepare("SELECT msgid FROM $table WHERE newsgroup=:newsgroup"); - $stmt->bindParam(':newsgroup', $group); - $stmt->execute(); - while ($row = $stmt->fetch()) { - $msgids[$row['msgid']] = true; - } - $dbh = null; + // Check history database for deleted message-ids + $database = $spooldir . '/history.db3'; + $table = 'history'; + $dbh = history_db_open($database, $table); + $stmt = $dbh->prepare("SELECT msgid FROM $table WHERE newsgroup=:newsgroup"); + $stmt->bindParam(':newsgroup', $group); + $stmt->execute(); + while ($row = $stmt->fetch()) { + $msgids[$row['msgid']] = true; + } + $dbh = null; - if ($msgids[$this_article['mid']] == true) { - echo "\nDuplicate Message-ID for: " . $group . ":" . $this_article['local']; - file_put_contents($logfile, "\n" . format_log_date() . " " . $config_name . " Duplicate Message-ID for: " . $group . ":" . $this_article['local'], FILE_APPEND); - return "441 Insert failed (duplicate)\r\n"; + if ($msgids[$this_article['mid']] == true) { + echo "\nDuplicate Message-ID for: " . $group . ":" . $this_article['local']; + file_put_contents($logfile, "\n" . format_log_date() . " " . $config_name . " Duplicate Message-ID for: " . $group . ":" . $this_article['local'], FILE_APPEND); + return "441 Insert failed (duplicate)\r\n"; + } } // Open articles Database if ($CONFIG['article_database'] == '1') { diff --git a/Rocksolid_Light/rslight/scripts/spoolnews.php b/Rocksolid_Light/rslight/scripts/spoolnews.php index 1e84260..3edb35b 100644 --- a/Rocksolid_Light/rslight/scripts/spoolnews.php +++ b/Rocksolid_Light/rslight/scripts/spoolnews.php @@ -458,6 +458,10 @@ function get_articles($ns, $group) $current_article['snippet'] = $this_snippet; // Check Spam + if ($OVERRIDES['disable_spamassassin_spooling'] === true) { + $CONFIG['spamassassin'] = false; + $res = 0; + } if (isset($CONFIG['spamassassin']) && ($CONFIG['spamassassin'] == true)) { $spam_result_array = check_spam($subject[1], $from[1], $groupnames[1], $references, $body, $mid[1]); $res = $spam_result_array['res']; @@ -482,10 +486,10 @@ function get_articles($ns, $group) $current_article['group'] = $agroup; if ($group == $agroup) { $current_article['local'] = $local; - insert_article_from_array($current_article); + insert_article_from_array($current_article, false); } else { $current_article['local'] = get_next_article_number($agroup); - insert_article_from_array($current_article); + insert_article_from_array($current_article, false); } } } diff --git a/Rocksolid_Light/version.txt b/Rocksolid_Light/version.txt index 2003b63..b0bb878 100644 --- a/Rocksolid_Light/version.txt +++ b/Rocksolid_Light/version.txt @@ -1 +1 @@ -0.9.2 +0.9.5