Compare commits
7 commits
4ce8017756
...
4511720b3b
| Author | SHA1 | Date | |
|---|---|---|---|
| 4511720b3b | |||
| 7ac13a8f49 | |||
| 41f79c4287 | |||
| ea63da2aaa | |||
| eabcb590c4 | |||
| 2082293b05 | |||
| 464f145382 |
7 changed files with 57 additions and 24 deletions
11
ChangeLog
11
ChangeLog
|
|
@ -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).
|
||||
|
|
@ -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';
|
||||
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
|
@ -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
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