From 97b87610331f53e756d032ad21db786037f921a1 Mon Sep 17 00:00:00 2001 From: fextracker Date: Wed, 29 Jul 2015 21:40:38 +0200 Subject: [PATCH] Original release 20150729 2015-07-29: install: fixed various bugs 2015-07-15: dop: symbolic links generate a HTTP 302 (temporarily redirection) 2015-07-15: instead of a HTTP 301 (permanently redirection) response 2015-06-16: fexsend: fixed bug hangs with https 2015-06-16: new fex.ph config variable @mailing_lists 2015-06-15: fup: always display fur link, if @local_domains is defined --- bin/backup | 4 +++ bin/fac | 6 ++-- bin/fbm | 2 +- bin/fexget | 2 +- bin/fexsend | 36 ++++++++++++++++------- bin/logwatch | 1 + bin/sexsend | 2 +- cgi-bin/fop | 2 +- cgi-bin/fup | 31 +++++++++++++++----- cgi-bin/fur | 9 +++++- doc/Changes | 6 ++++ doc/concept | 6 ++++ doc/version | 2 +- etc/xinetd_fex | 25 ++++++++-------- htdocs/FAQ/admin.faq | 12 ++++++-- htdocs/FAQ/user.faq | 14 +++++---- htdocs/download/fexget | 2 +- htdocs/download/fexsend | 36 ++++++++++++++++------- htdocs/download/sexsend | 2 +- htdocs/version | 2 +- install | 23 +++++++++++---- lib/dop | 6 ++-- lib/fex.ph | 5 +++- lib/fex.pp | 54 +++++++++++++++++++++++++++-------- locale/translate | 2 +- locale/translations | 63 +++++++++++++++++++++++++++++++++++------ 26 files changed, 264 insertions(+), 91 deletions(-) create mode 100755 bin/backup diff --git a/bin/backup b/bin/backup new file mode 100755 index 0000000..75cffc6 --- /dev/null +++ b/bin/backup @@ -0,0 +1,4 @@ +#!/bin/sh +mkdir -p $HOME/backup/spool 2>/dev/null +cd $HOME/spool +rsync -aRH --delete --exclude "*/*@*.*" --delete-excluded * $HOME/backup/spool/ diff --git a/bin/fac b/bin/fac index cec687a..b17d026 100755 --- a/bin/fac +++ b/bin/fac @@ -361,7 +361,7 @@ if ($opt_A) { open $fph,">$fph" or die "$0: cannot write to $fph - $!\n"; print {$fph} $_; close $fph; - system "cp $FEXLIB/fup.pl $vhd/lib/fup.pl"; + cpa("$FEXLIB/fup.pl","$vhd/lib"); foreach $i (qw'dop fex.pp fup.pl lf.pl reactivation.txt') { # symlink "$FEXLIB/$i","$vhd/lib/$i"; symlink "../../lib/$i","$vhd/lib/$i"; @@ -886,10 +886,10 @@ $0 -L [filter] # list pending files in detail $0 -M # list pending files with TO/FROM/FILE $0 -M TO/FROM/FILE # resend notification email $0 -m "reason" # enter maintenance mode (reason "exit" to leave) -$0 -A alias:hostname # add new virtual server -$0 -V virtualhost ... # operations on virtualhost (alias or hostname) $0 -E # show usage examples EOD +# $0 -A alias:hostname # add new virtual server +# $0 -V virtualhost ... # operations on virtualhost (alias or hostname) if (-x "$FEXHOME/cgi-bin/fac") { print "See also web admin interface $proto://$hostname$port/fac\n"; } diff --git a/bin/fbm b/bin/fbm index 1750641..d285a1e 100755 --- a/bin/fbm +++ b/bin/fbm @@ -20,7 +20,7 @@ use constant M => 2**20; our ($SH,$windoof,$sigpipe,$useragent); our ($FEXSERVER); -our $version = 20150615; +our $version = 20150729; # server defaults my $server = 'fex.rus.uni-stuttgart.de'; diff --git a/bin/fexget b/bin/fexget index 6c0126f..109c64d 100755 --- a/bin/fexget +++ b/bin/fexget @@ -30,7 +30,7 @@ our $SH; our ($fexhome,$idf,$tmpdir,$windoof,$useragent); our ($xv,%autoview); our $bs = 2**16; # blocksize for tcp-reading and writing file -our $version = 20150615; +our $version = 20150729; our $CTYPE = 'ISO-8859-1'; our $fexsend = $ENV{FEXSEND} || 'fexsend'; diff --git a/bin/fexsend b/bin/fexsend index a0eabe1..16235b7 100755 --- a/bin/fexsend +++ b/bin/fexsend @@ -37,7 +37,7 @@ our ($tpid,$frecipient); our ($FEXID,$FEXXX,$HOME); our (%alias); our $chunksize = 0; -our $version = 20150615; +our $version = 20150729; our $_0 = $0; our $DEBUG; @@ -81,7 +81,7 @@ my $atype = ''; # archive type my $fexcgi; # F*EX CGI URL my @files; # files to send my %AB = (); # server based address book -my ($server,$port,$sid); +my ($server,$port,$sid,$https); my $proxy = ''; my $proxy_prefix = ''; my $features = ''; @@ -108,7 +108,7 @@ usage: $0 [options] file(s) [@] recipient(s) or: $0 -x \# [-C -k -D -K -S] options: -v verbose mode -d delete file on fex server - -c compress file + -c compress file with gzip -g encrypt file with gpg -m limit limit throughput (kB/s) -i tag use ID data [tag] from ID file @@ -498,9 +498,10 @@ $port = 80; $port = 443 if $server =~ s{https://}{}; $port = $1 if $server =~ s/:(\d+)//; -if (0 and $port == 443) { - $opt_s and die "$0: cannot use -s with https due to stunnel bug\n"; - $opt_g and die "$0: cannot use -g with https due to stunnel bug\n"; +if ($port == 443) { + # $opt_s and die "$0: cannot use -s with https due to stunnel bug\n"; + # $opt_g and die "$0: cannot use -g with https due to stunnel bug\n"; + $https = $port; } $server =~ s{http://}{}; @@ -1474,6 +1475,17 @@ sub send_fex { } } } + unless ($opt_d or $location) { + if (scalar(@r) == 1) { + die "$0: server error: @r\n"; + } else { + if ($r[0] !~ /HTTP.1.. 2/ and $r[0] =~ /HTTP.[\s\d.]+(.+)/) { + die "$0: server error: $1\n"; + } else { + die "$0: server error:\n".join("\n",@r)."\n"; + } + } + } } } @@ -2052,7 +2064,11 @@ sub formdatapost { $SIG{ALRM} = sub { retry("timed out") }; while (my $b = read $file,$buf,$bs) { alarm($timeout*2); - syswrite $SH,$buf or &sigpipehandler; + if ($https) { + print {$SH} $buf or &sigpipehandler; + } else { + syswrite $SH,$buf or &sigpipehandler; + } alarm(0); $bytes += $b; if ($filesize > 0 and $bytes+$seek > $filesize) { @@ -2974,7 +2990,7 @@ sub serverconnect { if ($proxy) { tcpconnect(split(':',$proxy)); - if ($port == 443) { + if ($https) { printf "--> %s\n",$connect if $opt_v; nvtsend($connect,""); $_ = <$SH>; @@ -2989,7 +3005,7 @@ sub serverconnect { } else { tcpconnect($server,$port); } -# if ($port == 443 and $opt_v) { +# if ($https and $opt_v) { # printf "%s\n",$SH->get_cipher(); # } } @@ -3004,7 +3020,7 @@ sub tcpconnect { undef $SH; } - if ($port == 443) { + if ($https) { # eval "use IO::Socket::SSL qw(debug3)"; &enable_ssl; $SH = IO::Socket::SSL->new( diff --git a/bin/logwatch b/bin/logwatch index 1b75a21..733673c 100755 --- a/bin/logwatch +++ b/bin/logwatch @@ -87,6 +87,7 @@ $ignore = join('|',qw( x-Mobile X-Country X-ClickOnceSupport + X-Newrelic .*:\s*$ ); diff --git a/bin/sexsend b/bin/sexsend index 1fedac8..8a2a799 100755 --- a/bin/sexsend +++ b/bin/sexsend @@ -19,7 +19,7 @@ use constant M => 2**20; eval 'use Net::INET6Glue::INET_is_INET6'; -our $version = 20150615; +our $version = 20150729; my %SSL = (SSL_version => 'TLSv1'); my $sigpipe; diff --git a/cgi-bin/fop b/cgi-bin/fop index 949f084..a0eb824 100755 --- a/cgi-bin/fop +++ b/cgi-bin/fop @@ -542,10 +542,10 @@ if (-f $data) { # already downloaded? if ($limited_download and $limited_download !~ /^n/i and $from ne $to # fex to yourself is ok! - and $to !~ /$amdl/ # allowed multi download recipients and $from !~ /^_?fexmail/ # fexmail is ok! and $to !~ /^_?fexmail/ # fexmail is ok! and $to !~ /^anonymous/ # anonymous fex is ok! + and $to !~ /$amdl/ # allowed multi download recipients and $http_client !~ /$adlm/ # allowed download managers and $file !~ /\/STDFEX$/ # xx is ok! and (slurp("$file/comment")||'') !~ /^!\*!/ # multi download allow flag diff --git a/cgi-bin/fup b/cgi-bin/fup index b1e01e6..87cedaf 100755 --- a/cgi-bin/fup +++ b/cgi-bin/fup @@ -37,7 +37,7 @@ our (@registration_hosts,@demo,@file_link_dirs); our ($FEXHOME); our ($spooldir,$durl,$tmpdir,@logdir,$logdir,$docdir,$hostname,$admin,$fra); our ($keep_default,$recipient_quota,$sender_quota,$fex_yourself); -our ($sendmail,$mdomain,$fop_auth,$mail_auth,$faillog); +our ($sendmail,$mdomain,$fop_auth,$mail_auth,$faillog,$amdl); our ($dkeydir,$ukeydir,$akeydir,$skeydir,$gkeydir,$xkeydir); our ($MB,$DS); our $RB; # read POST bytes (total) @@ -945,7 +945,17 @@ unless ($file) { if (-x "$FEXHOME/cgi-bin/login") { print $info_login||$info_1; } - print "\n"; + pq(qq( + '


' + '' + 'Warning: the recipient must not be a mailing list, because after' + 'download the file will be no more available!' + '
' + 'Contact fexmaster' + 'if you want to fex to a mailing list,' + 'he can allow multiple downloads for specific addresses.' + '' + )); exit; } @@ -1201,10 +1211,9 @@ unless ($file) { '

' )); if (not $nomail and ( - @local_domains and @local_hosts and ipin($ra,@local_hosts) - or @local_rdomains and @local_rhosts and - (not @registration_hosts or ipin($ra,@registration_hosts)) - or @demo + @local_domains and @local_hosts or + @local_rdomains and @local_rhosts or + @demo )) { pq(qq( 'You can register yourself ' @@ -1725,6 +1734,7 @@ sub parse_request { $keep{$to} = $1 if $to =~ /:keep=(\d+)/i; $autodelete{$to} = $1 if $to =~ /:autodelete=(\w+)/i; } + $autodelete{$to} = 'NO' if $to =~ /$amdl/; # mailing lists, etc if (-e "$to/\@CAPTIVE") { my $v; $v = readlink "$to/\@AUTODELETE" and $autodelete{$to} = $v; @@ -2571,8 +2581,15 @@ sub setparam { 'Content-Length: 0', "" ); - &reexec; + } else { + nvt_print( + "HTTP/1.1 302 Found", + "Location: $ENV{PROTO}://$ENV{HTTP_HOST}/fup", + 'Content-Length: 0', + "" + ); } + &reexec; } elsif ($v eq 'LOCALE' and $vv =~ /^(\w+)$/) { $locale = $1; } elsif ($v eq 'REDIRECT' and $vv =~ /^([\w?=]+)$/) { diff --git a/cgi-bin/fur b/cgi-bin/fur index 94f6a1e..2a75445 100755 --- a/cgi-bin/fur +++ b/cgi-bin/fur @@ -39,13 +39,20 @@ my $user = my $id = my $verify = ''; &check_maint; -unless (@local_domains or @local_rdomains) { +unless (@local_domains and @local_rdomains) { html_error($error, "No domains for registrations are defined.", "Contact $ENV{SERVER_ADMIN} for details." ); } +unless (@local_hosts and ipin($ENV{REMOTE_ADDR}||0,@local_hosts)) { + html_error($error, + "Registrations from your host ($ENV{REMOTE_ADDR}) are not allowed.", + "Contact $ENV{SERVER_ADMIN} for details." + ); +} + # look for CGI parameters our %PARAM; &parse_parameters; diff --git a/doc/Changes b/doc/Changes index daf60e8..8993917 100644 --- a/doc/Changes +++ b/doc/Changes @@ -1,3 +1,9 @@ +2015-07-29 install: fixed various bugs +2015-07-15 dop: symbolic links generate a HTTP 302 (temporarily redirection) + instead of a HTTP 301 (permanently redirection) response +2015-06-16 fexsend: fixed bug hangs with https + new fex.ph config variable @mailing_lists +2015-06-15 fup: always display fur link, if @local_domains is defined 2015-06-10 fexsrv: fixed warning with https and SIGCHLD 2015-05-16 fexsrv/dop: added active and passive redirect support 2015-05-12 fuc: fixed bug undefined subroutine end_html diff --git a/doc/concept b/doc/concept index f64ba9a..26ad9da 100644 --- a/doc/concept +++ b/doc/concept @@ -690,6 +690,12 @@ Important for programmers: The perl variables of the F*EX CGI's (fup, fop, etc) have their UTF-8 flag turned off. This means, they contain UTF-8 data in binary representation. +F*EX has support for many languanges. For every language a translated +version will be installed in $HOME/locale/ +The switch is done at runtime via locale cookie (by fexsrv). +Some common functions from fex.pp must be present at any time for any +locale in any language, eg notification functions. Therfore there is +$HOME/lib/lf.pl (extracted functions from fex.pp). I have additional authentication modules for RADIUS, LDAP, mailman and POP. Please email me if you are interested. diff --git a/doc/version b/doc/version index db58082..c00183f 100644 --- a/doc/version +++ b/doc/version @@ -1 +1 @@ -fex-20150615 +fex-20150729 diff --git a/etc/xinetd_fex b/etc/xinetd_fex index c25a3db..8b42299 100644 --- a/etc/xinetd_fex +++ b/etc/xinetd_fex @@ -3,18 +3,19 @@ # service fex { - socket_type = stream - wait = no - type = unlisted - protocol = tcp - bind = ADDRESS - port = PORT - cps = 10 2 - user = fex - groups = yes - server = FEXHOME/bin/fexsrv - nice = 0 - disable = no + socket_type = stream + wait = no + type = unlisted + protocol = tcp + #flags = IPv6 + bind = ADDRESS + port = PORT + cps = 10 2 + user = fex + groups = yes + server = FEXHOME/bin/fexsrv + nice = 0 + disable = no } # configuration for https/SSL see /home/fex/doc/SSL # configuration for IPv6 see /home/fex/doc/IPv6 diff --git a/htdocs/FAQ/admin.faq b/htdocs/FAQ/admin.faq index 5a6a301..8ab089c 100644 --- a/htdocs/FAQ/admin.faq +++ b/htdocs/FAQ/admin.faq @@ -34,10 +34,12 @@ A: fac stands for F*EX Admin Control Q: F*EX is not working at all! I cannot connect to it with my web browser! A: Check your routing, ipfilters and firewall setup. Also check if xinetd is running. If it is linked with tcp-wrapper, configure it correctly (hosts.allow). + /etc/xinetd.d/fex should not contain a line "only_from" F*EX needs port 80/tcp for HTTP and optionally port 443/tcp for HTTPS. + Test the connection with: telnet YOURFEXSERVER 80 Q: What is the difference between all these user types (full, sub, group, external, ...)? -A: See http://fex.belwue.de/users.html +A: See http://fex.rus.uni-stuttgart.de/users.html Q: How can I integrate F*EX in the existing user management at my site? A: F*EX has several authentification modules: local, RADIUS, LDAP, mailman and POP. @@ -87,10 +89,10 @@ A: Let them register themselves with http://YOURFEXSERVER/fur Q: How can I change user settings like quota, restrictions or keep time? -A: Use /home/fex/bin/fac +A: Use /home/fex/bin/fac Q: How can I delete or temporarly disable a user? -A: Use /home/fex/bin/fac +A: Use /home/fex/bin/fac Q: I have BIG files already on the fexserver host. Can I upload just a link instead of the whole file? @@ -109,6 +111,10 @@ A: Set in fex.ph: Q: I want the Bcc mails to fex (admin user) to be sent to another address. A: Set variable $bcc in /home/fex/lib/fex.ph +Q: My users want to fex to mailing lists, but after first download the file is no more available!? +A: Add the mailing list address to @mailing_list in /home/fex/lib/fex.ph + This allows multiple downloads. + Q: I need more security! How can I enable (https) encryption? A: Read doc/SSL and also look for "fop_auth" in doc/concept (doc is a local directory in your installation or online http://fex.belwue.de/doc/) diff --git a/htdocs/FAQ/user.faq b/htdocs/FAQ/user.faq index 4c75028..b98c1d2 100644 --- a/htdocs/FAQ/user.faq +++ b/htdocs/FAQ/user.faq @@ -2,7 +2,7 @@ Q: What is the "auth-ID"? A: The auth-ID is an internal identification which authentificates the user. It will be first generated by the admin or the automatic registration process and can later be modified by you, the user. Think of some kind of a low security password. Q: What is the difference between all these user types (full, sub, group, external, ...)? -A: See http://fex.belwue.de/users.html +A: See http://fex.rus.uni-stuttgart.de/users.html Q: I have uploaded a HUGE file but misspelled my recipient's address. Now I have got an error bounce email. Must I re-upload the HUGE file? A: No, it is not necessary. You can redirect the file with "user config & operation control" @@ -63,11 +63,15 @@ Q: Can I use a download manager/accelerator? A: Generally, no, because they suck: they are not RFC compliant and produce a LOT of unnecessary server load. But there is one exception: axel http://axel.alioth.debian.org/ -Q: When I hit [ESC] in firefox the upload is canceled. Why? -A: This is a built-in feature of firefox: ESC terminates the current operation. - Simple solution: do not hit ESC in Firefox. - Complex solution: ask the Firefox developers to add keyboard configuration. +Q: Why is there an error "FILE has already been downloaded"? +A: Either you or someone else have already downloaded this file. Now it is gone. + Downloads are limited to a specific recipient. One cannot share it. + Perhaps the sender has fexed it to a mailing list (which is a bad idea!)? +Q: Can I fex to a mailing list? +A: Generally: no, because the first download makes the file no more available for others. + Contact $SERVER_ADMIN$, he can allow multiple downloads for specific addresses. + Q: Sending as a F*EX user is easy, but how to receive files from others, outside? A: Register them as your subusers, create a F*EX group or a one-time upload key with "user config & operation control" See also http://fex.belwue.de/usecases/foreign.html diff --git a/htdocs/download/fexget b/htdocs/download/fexget index 6c0126f..109c64d 100755 --- a/htdocs/download/fexget +++ b/htdocs/download/fexget @@ -30,7 +30,7 @@ our $SH; our ($fexhome,$idf,$tmpdir,$windoof,$useragent); our ($xv,%autoview); our $bs = 2**16; # blocksize for tcp-reading and writing file -our $version = 20150615; +our $version = 20150729; our $CTYPE = 'ISO-8859-1'; our $fexsend = $ENV{FEXSEND} || 'fexsend'; diff --git a/htdocs/download/fexsend b/htdocs/download/fexsend index a0eabe1..16235b7 100755 --- a/htdocs/download/fexsend +++ b/htdocs/download/fexsend @@ -37,7 +37,7 @@ our ($tpid,$frecipient); our ($FEXID,$FEXXX,$HOME); our (%alias); our $chunksize = 0; -our $version = 20150615; +our $version = 20150729; our $_0 = $0; our $DEBUG; @@ -81,7 +81,7 @@ my $atype = ''; # archive type my $fexcgi; # F*EX CGI URL my @files; # files to send my %AB = (); # server based address book -my ($server,$port,$sid); +my ($server,$port,$sid,$https); my $proxy = ''; my $proxy_prefix = ''; my $features = ''; @@ -108,7 +108,7 @@ usage: $0 [options] file(s) [@] recipient(s) or: $0 -x \# [-C -k -D -K -S] options: -v verbose mode -d delete file on fex server - -c compress file + -c compress file with gzip -g encrypt file with gpg -m limit limit throughput (kB/s) -i tag use ID data [tag] from ID file @@ -498,9 +498,10 @@ $port = 80; $port = 443 if $server =~ s{https://}{}; $port = $1 if $server =~ s/:(\d+)//; -if (0 and $port == 443) { - $opt_s and die "$0: cannot use -s with https due to stunnel bug\n"; - $opt_g and die "$0: cannot use -g with https due to stunnel bug\n"; +if ($port == 443) { + # $opt_s and die "$0: cannot use -s with https due to stunnel bug\n"; + # $opt_g and die "$0: cannot use -g with https due to stunnel bug\n"; + $https = $port; } $server =~ s{http://}{}; @@ -1474,6 +1475,17 @@ sub send_fex { } } } + unless ($opt_d or $location) { + if (scalar(@r) == 1) { + die "$0: server error: @r\n"; + } else { + if ($r[0] !~ /HTTP.1.. 2/ and $r[0] =~ /HTTP.[\s\d.]+(.+)/) { + die "$0: server error: $1\n"; + } else { + die "$0: server error:\n".join("\n",@r)."\n"; + } + } + } } } @@ -2052,7 +2064,11 @@ sub formdatapost { $SIG{ALRM} = sub { retry("timed out") }; while (my $b = read $file,$buf,$bs) { alarm($timeout*2); - syswrite $SH,$buf or &sigpipehandler; + if ($https) { + print {$SH} $buf or &sigpipehandler; + } else { + syswrite $SH,$buf or &sigpipehandler; + } alarm(0); $bytes += $b; if ($filesize > 0 and $bytes+$seek > $filesize) { @@ -2974,7 +2990,7 @@ sub serverconnect { if ($proxy) { tcpconnect(split(':',$proxy)); - if ($port == 443) { + if ($https) { printf "--> %s\n",$connect if $opt_v; nvtsend($connect,""); $_ = <$SH>; @@ -2989,7 +3005,7 @@ sub serverconnect { } else { tcpconnect($server,$port); } -# if ($port == 443 and $opt_v) { +# if ($https and $opt_v) { # printf "%s\n",$SH->get_cipher(); # } } @@ -3004,7 +3020,7 @@ sub tcpconnect { undef $SH; } - if ($port == 443) { + if ($https) { # eval "use IO::Socket::SSL qw(debug3)"; &enable_ssl; $SH = IO::Socket::SSL->new( diff --git a/htdocs/download/sexsend b/htdocs/download/sexsend index 1fedac8..8a2a799 100755 --- a/htdocs/download/sexsend +++ b/htdocs/download/sexsend @@ -19,7 +19,7 @@ use constant M => 2**20; eval 'use Net::INET6Glue::INET_is_INET6'; -our $version = 20150615; +our $version = 20150729; my %SSL = (SSL_version => 'TLSv1'); my $sigpipe; diff --git a/htdocs/version b/htdocs/version index db58082..c00183f 100644 --- a/htdocs/version +++ b/htdocs/version @@ -1 +1 @@ -fex-20150615 +fex-20150729 diff --git a/install b/install index 9c49c06..a34adf1 100755 --- a/install +++ b/install @@ -63,8 +63,10 @@ if (not $ip and open P,'host $(hostname)|') { } } close P; - print "Your IP [$guessed_ip] : "; - chomp($ip = ); + unless (-f $xinetd) { + print "Your IP [$guessed_ip] : "; + chomp($ip = ); + } $ip ||= $guessed_ip; } @@ -211,6 +213,14 @@ if (-d "$FEXHOME/spool") { } chownr('fex',"$FEXHOME/spool/."); +# fex-VM? +if (open my $setup,'/root/bin/setup') { + while (<$setup>) { + exit if /#.*X-VM/; + } + close $setup; +} + system(qw'perl -p -i -e', 's:href="/?FAQ.html":href="/FAQ/FAQ.html":', "$FEXHOME/lib/fup.pl" @@ -226,7 +236,8 @@ close $fph; eval $conf; -die "no \$spooldir in $fph\n" unless $spooldir; +# die "no \$spooldir in $fph\n" unless $spooldir; +$spooldir ||= '/home/fex/spool'; die "\$spooldir=$spooldir is not a directory, see $fph\n" unless -d $spooldir; symlink $spooldir,"$FEXHOME/spool" unless -e "$FEXHOME/spool"; @sds1 = stat "$spooldir/."; @@ -256,6 +267,7 @@ if ($newinstall or not -s $aa) { last if $admin =~ /.\@./; print "admin must be a valid email address!\n"; } + $aa = "$spooldir/$admin/@"; while (not $admin_pw) { print "F*EX admin password: "; $admin_pw = ; @@ -353,12 +365,13 @@ unless (-f $xinetd) { if ($crontab !~ /fex_cleanup/) { open $crontab,">fex.cron" or die "cannot create fex.cron - $!\n"; print {$crontab} $crontab,"\n"; + print {$crontab} " 3 2 * * * exec $FEXHOME/bin/backup\n"; print {$crontab} " 3 3 * * * exec $FEXHOME/bin/fex_cleanup\n"; close $crontab; - system qw(crontab -u fex fex.cron); + system qw'crontab -u fex fex.cron'; } - chownr('fex:root',"$FEXHOME $FEXHOME/spool/."); + chownr('fex:root',$FEXHOME,"$FEXHOME/spool/."); chmodr('go-r',"$FEXHOME/lib","$FEXHOME/cgi-bin","$FEXHOME/spool/."); print "\n"; diff --git a/lib/dop b/lib/dop index d816624..9c428a5 100755 --- a/lib/dop +++ b/lib/dop @@ -46,12 +46,10 @@ sub dop { $doc = "$path/$link"; $doc =~ s:/+:/:g; $doc =~ s:^/::; - $host = $ENV{HTTP_HOST} || $hostname; nvt_print( - "HTTP/1.1 301 Moved Permanently", - "Location: $ENV{PROTO}://$host/$doc", + "HTTP/1.1 302 Found", + "Location: /$doc", "Content-Length: 0", - "Connection: close", "" ); &reexec; diff --git a/lib/fex.ph b/lib/fex.ph index 50c4d09..585e291 100644 --- a/lib/fex.ph +++ b/lib/fex.ph @@ -128,8 +128,11 @@ $mail_authid = 'YES'; ## optional: allow anonymous upload without authentication for these IP ranges # @anonymous_upload = qw(127.0.0.1 ::1 10.10.100.0-10.10.200.255 129.69.1.129); +## optional: mailing list addresses (allows multiple downloads) +# @mailing_lists = qw(admin@my.domain *@listserv*); + ## optional: forbidden addresses -# @forbidden_recipients = qw(nobody@* *@listserv*); +# @forbidden_recipients = qw(nobody@* postmaster@else.where); ## optional: forbidden ip addresses for CGIs # @forbidden_hosts = qw(64.124.0.0-64.125.255.255); diff --git a/lib/fex.pp b/lib/fex.pp index 352b412..bd7ed98 100644 --- a/lib/fex.pp +++ b/lib/fex.pp @@ -75,9 +75,6 @@ if ($FHS) { # allowed download managers (HTTP User-Agent) $adlm = '^(Axel|fex)'; -# allowed multi download recipients -$amdl = '^(anonymous|_fexmail_)'; - # local config require "$FEXLIB/fex.ph" or die "$0: cannot load $FEXLIB/fex.ph - $!"; @@ -89,6 +86,13 @@ $debug = 0 if $debug =~ /no/i; @logdir = ($logdir) unless @logdir; $logdir = $logdir[0]; +# allowed multi download recipients: from any ip, any times +if (@mailing_lists) { + $amdl = '^('.join('|',map { quotewild($_) } @mailing_lists).')$'; +} else { + $amdl = '^-$'; +} + # check for name based virtual host $vhost = vhost($ENV{'HTTP_HOST'}); @@ -154,18 +158,20 @@ $default_locale ||= 'english'; # $durl is first default fop download URL # @durl is optional mandatory fop download URL list (from fex.ph) unless ($durl) { + my $host = ''; + my $port = 80; + my $xinetd = '/etc/xinetd.d/fex'; + if (@durl) { $durl = $durl[0]; } elsif ($ENV{HTTP_HOST} and $ENV{PROTO}) { - my $host = ''; - my $port = 0; ($host,$port) = split(':',$ENV{HTTP_HOST}||''); $host = $hostname; unless ($port) { $port = 80; - if (open my $xinetd,'<',"/etc/xinetd.d/fex") { + if (open $xinetd,$xinetd) { while (<$xinetd>) { if (/^\s*port\s*=\s*(\d+)/) { $port = $1; @@ -183,9 +189,23 @@ unless ($durl) { $durl = "$ENV{PROTO}://$host:$port/fop"; } } else { - $durl = "http://$hostname/fop"; + if (open $xinetd,$xinetd) { + while (<$xinetd>) { + if (/^\s*port\s*=\s*(\d+)/) { + $port = $1; + last; + } + } + close $xinetd; + } + if ($port == 80) { + $durl = "http://$hostname/fop"; + } else { + $durl = "http://$hostname:$port/fop"; + } } } +@durl = ($durl) unless @durl; sub reexec { @@ -699,8 +719,7 @@ sub checkforbidden { return $a if -d "$spooldir/$a"; # ok, if user already exists if (@forbidden_recipients) { foreach (@forbidden_recipients) { - $fr = quotemeta; - $fr =~ s/\\\*/.*/g; # allow wildcard * + $fr = quotewild($_); # skip public recipients if (@public_recipients) { foreach $pr (@public_recipients) { @@ -1290,6 +1309,14 @@ sub mtime { } +# wildcard * to perl regexp +sub quotewild { + local $_ = quotemeta shift; + s/\\\*/.*/g; # allow wildcard * + return $_; +} + + # extract locale functions into hash of subroutine references # e.g. \&german ==> $notify{german} sub locale_functions { @@ -1353,10 +1380,12 @@ sub notify_locale { ); } -### locale functions ### -# will be extracted by install process and saved in $FEXHOME/lib/lf.pl -# you cannot modify them here without re-installing! +########################### locale functions ########################### +# Will be extracted by install process and saved in $FEXHOME/lib/lf.pl # +# You cannot modify them here without re-installing! # +######################################################################## +# locale function! sub notify { # my ($status,$dkey,$filename,$keep,$warn,$comment,$autodelete) = @_; my %P = @_; @@ -1579,6 +1608,7 @@ sub notify { } +# locale function! sub reactivation { my ($expire,$user) = @_; my $fexsend = "$FEXHOME/bin/fexsend"; diff --git a/locale/translate b/locale/translate index 041f4b7..2fdd709 100755 --- a/locale/translate +++ b/locale/translate @@ -157,7 +157,7 @@ sub make_lf { print {$lf} "### auto-generated by install/translate - DO NOT EDIT! ###\n\n"; local $/; $_ = <$fexpp>; - s/.*\n(\#\#\# locale functions)/$1/s; + s/.*\n(\#\#\#* locale functions)/$1/s; s/\nsub (\w+)/\n\$$1\{$lang\} = sub/gs; s/\n\}\n/\n\};\n/gs; print {$lf} $_; diff --git a/locale/translations b/locale/translations index 1e31a14..0b1b6cf 100644 --- a/locale/translations +++ b/locale/translations @@ -1404,7 +1404,7 @@ et' add to recipients list zur Empfänger-Liste hinzufügen -uff d' Empfängerlischte setze +uff d' Empfängerlischte setza añada a la lista de destinatarios engadir á lista de destinatarios aggiungi alla lista di distribuzione @@ -1465,14 +1465,14 @@ fex te stesso zaslat sobě à votre adresse ->user config & operation control ->Benutzer Bedienungssteuerung ->Benutzr Bdienongssteierong ->configuración de usuario y control de operación ->configuración de usuario e control de operación ->configurazion utente & controllo operazioni ->nastavení uživatele a řízení provozu ->configuration utilisateur et gestion +user config & operation control +Benutzer Bedienungssteuerung +Benutzr Bdienongssteierong +configuración de usuario y control de operación +configuración de usuario e control de operación +configurazion utente & controllo operazioni +nastavení uživatele a řízení provozu +configuration utilisateur et gestion Alternate Java client (for files > 2 GB or sending of more than one file) Alternativer Java Client (für Dateien größer als 2 GB oder zum Senden von mehr als einer Datei) @@ -1483,6 +1483,51 @@ Client java alternativo (per file > 2 GB o per spedizioni di piu' di un file Alternativní Java klient (pro soubory větší než 2 GB či pro odesílání více než jednoho souboru) Client Java alternatif (pour les fichiers > 2 GB ou envoyer plusieurs fichiers d'un coup) +Warning: the recipient must not be a mailing list, because after +Warnung: die Empfängeradresse darf keine Mailingliste sein, weil nach dem +Obacht: die Empfängeradress darf koi Mailinglischt sei, weil nochm +Warning: the recipient must not be a mailing list, because after +Warning: the recipient must not be a mailing list, because after +Warning: the recipient must not be a mailing list, because after +Warning: the recipient must not be a mailing list, because after +Warning: the recipient must not be a mailing list, because after + +download the file will be no more available +Download wird die Datei nicht mehr verfügbar sein +Ronderlada isch die Datei nemme verfügbar +download the file will be no more available +download the file will be no more available +download the file will be no more available +download the file will be no more available +download the file will be no more available + +Contact fexmaster +Kontaktieren Sie den fexmaster +Frog dr fexmaster +Contact fexmaster +Contact fexmaster +Contact fexmaster +Contact fexmaster +Contact fexmaster + +if you want to fex to a mailing list +wenn Sie an eine Mailingliste fexen wollen +wenn Du an a Mailinglischt fexa wilsch +if you want to fex to a mailing list +if you want to fex to a mailing list +if you want to fex to a mailing list +if you want to fex to a mailing list +if you want to fex to a mailing list + +he can allow multiple downloads for specific addresses +er kann für bestimmte Adressen einen mehrfachen Download freischalten +der ko fir beschtemmte Adressa a mehrfaches Ronderlada erlauba +he can allow multiple downloads for specific addresses +he can allow multiple downloads for specific addresses +he can allow multiple downloads for specific addresses +he can allow multiple downloads for specific addresses +he can allow multiple downloads for specific addresses + You have to fill out this form completely to continue Sie müssen dieses Formular komplett ausfüllen um fortzufahren Du musch des Formular ganz ausffülla sonsch kosch ned weitrmacha -- 2.39.2