Compare commits
7 commits
4511720b3b
...
4ce8017756
| Author | SHA1 | Date | |
|---|---|---|---|
| 4ce8017756 | |||
| 3680a37aaa | |||
| 9e5f72b7ea | |||
| fc71f975af | |||
| 8db4fa83e0 | |||
| 6032e3984a | |||
| 8259e05504 |
8 changed files with 59 additions and 26 deletions
|
|
@ -1,5 +1,10 @@
|
|||
huhu 0.11.0 (unreleased)
|
||||
* 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
|
||||
|
|
|
|||
|
|
@ -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 .
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
|
@ -145,11 +149,14 @@ while (my $ref = $dataref->fetchrow_arrayref)
|
|||
'Envelope-to',
|
||||
'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
|
||||
'Received',
|
||||
'Received-Spf',
|
||||
'Status',
|
||||
'Return-Path',
|
||||
'To',
|
||||
|
|
@ -159,9 +166,12 @@ while (my $ref = $dataref->fetchrow_arrayref)
|
|||
'X-Beenthere', # Mailman
|
||||
'X-Complaints-To', # defined by INN 2.5.x or older
|
||||
'X-Lang-Test',
|
||||
'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
|
||||
|
|
@ -176,7 +186,7 @@ while (my $ref = $dataref->fetchrow_arrayref)
|
|||
'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-Zedat-Hint', # FU Berlin (moderators.dana.de)
|
||||
);
|
||||
|
||||
#albasani-workaround fuer @invalid
|
||||
|
|
|
|||
17
bin/read-mail-wrapper.sh
Executable file
17
bin/read-mail-wrapper.sh
Executable 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
|
||||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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 )
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue