Compare commits

...

7 commits

Author SHA1 Message Date
4ce8017756 Fix ChangeLog format.
Signed-off-by: Thomas Hochstein <thh@thh.name>
2026-01-31 23:37:03 +01:00
3680a37aaa Only connect to newsserver if there are approved posts.
Signed-off-by: Thomas Hochstein <thh@thh.name>
2026-01-31 23:37:03 +01:00
9e5f72b7ea Drop more headers.
Signed-off-by: Thomas Hochstein <thh@thh.name>
2026-01-31 23:37:03 +01:00
fc71f975af Add STARTTLS to poster.pl
Signed-off-by: Thomas Hochstein <thh@thh.name>
2026-01-31 23:37:03 +01:00
8db4fa83e0 Add wrapper script for read-mail.pl
Drop procmail, use Exim filter as .forward.

Signed-off-by: Thomas Hochstein <thh@thh.name>
2026-01-31 23:37:03 +01:00
6032e3984a Add shell to new huhu mod users.
Signed-off-by: Thomas Hochstein <thh@thh.name>
2026-01-31 23:37:02 +01:00
8259e05504 Update to current Debian version.
Signed-off-by: Thomas Hochstein <thh@thh.name>
2026-01-31 23:37:02 +01:00
8 changed files with 59 additions and 26 deletions

View file

@ -1,6 +1,11 @@
huhu 0.11.0 (unreleased)
* Re-order and add metadata files (TODO, ChangeLog, ...).
* Re-order and add metadata files (TODO, ChangeLog, ...).
* Update to current Debian version.
* Add shell to new huhu mod users.
* Add wrapper script for read-mail.pl
* Drop more headers.
* Only connect to newsserver if there are approved posts.
huhu 0.10 (unknown)
* huhu reports version 0.09 (from MOD/Displaylib.pm), but has code
to update databases from 0.09 to 0.10 (in samples/mysql).
* huhu reports version 0.09 (from MOD/Displaylib.pm), but has code
to update databases from 0.09 to 0.10 (in samples/mysql).

View file

@ -21,7 +21,7 @@ use DBI();
use MOD::Utils qw(read_private_config);
use News::Article();
use MOD::DBIUtilsPublic();
use Digest::SHA1();
use Digest::SHA();
push @MOD::DBIUtils::ISA,'MOD::DBIUtilsPublic';
@ -81,7 +81,7 @@ sub enter_table($$$$)
my $article_id = undef;
my $age = $self->{'config'}->{'check_duplicates_age'} || 7;
my $sha1 = Digest::SHA1::sha1_hex($body);
my $sha1 = Digest::SHA::sha1_hex($body);
my $stmt = $self->{'dbh'}->prepare(
"SELECT id\n" .
"\nFROM " . $table .

View file

@ -48,7 +48,7 @@ sub new($$)
my ($class,$configref) = @_;
my $self = {};
$self->{'config'} = $configref;
$self->{'dsn'} = "DBI:mysql:database=$self->{'config'}->{'mysql_db'};host=$self->{'config'}->{'mysql_host'};port=$self->{'config'}->{'mysql_port'}";
$self->{'dsn'} = "DBI:MariaDB:database=$self->{'config'}->{'mysql_db'};host=$self->{'config'}->{'mysql_host'};port=$self->{'config'}->{'mysql_port'}";
$self->{'dbh'} = DBI->connect($self->{'dsn'},$self->{'config'}->{'mysql_username'},$self->{'config'}->{'mysql_password'},
{ RaiseError => 1})
or die($DBI::errstr);

View file

@ -100,7 +100,7 @@ sub add_article($$;$)
}
if ($config->{'subjectcheck'} and
$db->check_subject($article->header('subject')))
$db->check_subject($article->header('subject')))
{
my $subjectscore = $config->{'subjectscore'};
$article->add_headers('X-Subject-Test', $subjectscore);

View file

@ -87,6 +87,8 @@ sub connect_nntp($)
# authinfo does not return a value
$nntp->authinfo($cfg_nntp_user, $cfg_nntp_pass);
$nntp->starttls if $nntp->can_ssl();
return $nntp;
}
@ -108,7 +110,6 @@ if ($sign_pgpmoose && DEBUG > 1)
print "News::Article::sign_pgpmoose enabled.\n";
}
my Net::NNTP $nntp = connect_nntp(\%config);
my $dbi = MOD::DBIUtils->new(\%config) ||
die "Can't connect to database";
@ -116,6 +117,9 @@ my $dbi = MOD::DBIUtils->new(\%config) ||
# i.e. all posts in the state 'moderated'.
my $dataref = $dbi->select_unposted();
# Only connect to newsserver if there are approved posts
my Net::NNTP $nntp = connect_nntp(\%config) if $dataref->rows;
#Schleife ueber alle selektierten Postings
#Einlesen des Postings, Header anpassen,anschliessend posten
#und das das posted-Bit in der Datenbank setzen.
@ -141,30 +145,36 @@ while (my $ref = $dataref->fetchrow_arrayref)
'Date',
'Delivery-date',
'Delivered-To',
'Errors-To', # Mailman
'Errors-To', # Mailman
'Envelope-to',
'Injection-Info', # defined by INN 2.6.x and Schnuerpel 2010
'Lines', # defined by INN 2.5.x or older
'NNTP-Posting-Date', # defined by INN 2.5.x or older
'NNTP-Posting-Host', # defined by INN 2.5.x or older
'Injection-Info', # defined by INN 2.6.x and Schnuerpel 2010
'Lines', # defined by INN 2.5.x or older
'Message-ID-Hash',
'X-Message-ID-Hash',
'NNTP-Posting-Date', # defined by INN 2.5.x or older
'NNTP-Posting-Host', # defined by INN 2.5.x or older
'Path',
'Precedence', # Mailman
'Precedence', # Mailman
'Received',
'Received-Spf',
'Status',
'Return-Path',
'To',
'X-Antivirus',
'X-Antivirus-Status',
'X-Attachment-Test',
'X-Beenthere', # Mailman
'X-Complaints-To', # defined by INN 2.5.x or older
'X-Beenthere', # Mailman
'X-Complaints-To', # defined by INN 2.5.x or older
'X-Lang-Test',
'X-Mailman-Version', # Mailman
'X-MSMail-Priority', # Outlook
'X-NNTP-Posting-Host', # set by Schnuerpel 2009 or older
'X-Mailfrom',
'X-Mailman-Version', # Mailman
'X-Mailman-Rule-Misses', ## Mailman 3
'X-MSMail-Priority', # Outlook
'X-NNTP-Posting-Host', # set by Schnuerpel 2009 or older
'X-NNTP-Posting-Date',
'X-Originating-IP',
'X-Priority', # Outlook
'X-Provags-ID', # GMX/1&1
'X-Priority', # Outlook
'X-Provags-ID', # GMX/1&1
'X-Spamassassin-Test',
'X-Spam-Checker-Version',
'X-Spam-Level',
@ -172,11 +182,11 @@ while (my $ref = $dataref->fetchrow_arrayref)
'X-Spam-Score',
'X-Spam-Status',
'X-Subject-Test',
'X-Trace', # defined by INN 2.5.x or older
'X-User-ID', # set by Schnuerpel 2009 or older
'X-Trace', # defined by INN 2.5.x or older
'X-User-ID', # set by Schnuerpel 2009 or older
'X-Virus-Scanned',
'X-Y-Gmx-Trusted', # GMX/1&1
'X-Zedat-Hint', # Uni Berlin/Individual?
'X-Y-Gmx-Trusted', # GMX/1&1
'X-Zedat-Hint', # FU Berlin (moderators.dana.de)
);
#albasani-workaround fuer @invalid

17
bin/read-mail-wrapper.sh Executable file
View file

@ -0,0 +1,17 @@
#!/bin/sh
#
# This script is a wrapper for read-mail.pl to set up the environment.
#
# Usage: ${HUHU_DIR}/bin/read-mail-wrapper.sh de.alt.test.moderated
export "LANG=C"
export "LC_CTYPE=C"
set -o nounset
set -o errexit
export HUHU_DIR="/home/huhu"
export PERL5LIB="${PERL5LIB:+$PERL5LIB:}${HUHU_DIR}"
USER_DIR=$( echo "$1" | sed 's#[-.]#/#g' )
CONFIG="/home/${USER_DIR}/etc/public.conf"
cat - | "${HUHU_DIR}/bin/read-mail.pl" "-config=${CONFIG}" -stdin

View file

@ -125,6 +125,7 @@ sub process_text($$$)
die 'Argument -config=file missing' unless($::config);
$::status = undef unless($::status); # to suppress warning
$::stdin = undef unless($::stdin); # to suppress warning
$::test = undef unless($::test); # to suppress warning
my %config = MOD::Utils::read_private_config($::config);
my $rm = MOD::ReadMail->new(\%config);

View file

@ -28,7 +28,7 @@ fi
user_home="${HUHU_HOME_BASE_DIR:-/home}/"$( echo "${user_name}" | sed 's#[-.]#/#g' )
user_home_parent="${user_home%/*}"
[ -d "${user_home_parent}" ] || mkdir -p "${user_home_parent}"
useradd --home "${user_home}" --create-home --skel "${skel_dir}" "${user_name}"
useradd --home "${user_home}" --shell /bin/bash --create-home --skel "${skel_dir}" "${user_name}"
user_home=$( awk -F: "/^${user_name}:/ { print \$6 }" /etc/passwd )