Compare commits
2 commits
| Author | SHA1 | Date | |
|---|---|---|---|
| a60ea76fe8 | |||
| 162c5aefda |
21 changed files with 44 additions and 20 deletions
|
|
@ -3,9 +3,12 @@
|
||||||
|
|
||||||
package UVreadmail;
|
package UVreadmail;
|
||||||
|
|
||||||
|
use utf8;
|
||||||
|
use open qw(:std :encoding(UTF-8));
|
||||||
use strict;
|
use strict;
|
||||||
use UVconfig;
|
use UVconfig;
|
||||||
use UVmessage;
|
use UVmessage;
|
||||||
|
use Encode qw(decode :fallbacks);
|
||||||
use MIME::QuotedPrint;
|
use MIME::QuotedPrint;
|
||||||
use MIME::Base64;
|
use MIME::Base64;
|
||||||
use MIME::Parser;
|
use MIME::Parser;
|
||||||
|
|
@ -200,6 +203,7 @@ sub process {
|
||||||
|
|
||||||
# extract address and name
|
# extract address and name
|
||||||
my $from = $head->get('From') || '';
|
my $from = $head->get('From') || '';
|
||||||
|
utf8::decode($from); # fix double encoding
|
||||||
|
|
||||||
if ($from =~ /\s*([^<]\S+\@\S+[^>]) \((.+)\)/) {
|
if ($from =~ /\s*([^<]\S+\@\S+[^>]) \((.+)\)/) {
|
||||||
($voter_addr, $voter_name) = ($1, $2);
|
($voter_addr, $voter_name) = ($1, $2);
|
||||||
|
|
@ -240,6 +244,13 @@ sub process {
|
||||||
$body = $entity->stringify_body;
|
$body = $entity->stringify_body;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# body: charset conversion to Perl internal representation
|
||||||
|
my $ct = $head->get('Content-Type') || '';
|
||||||
|
if ($ct =~ /^text\/plain;.*charset=\"?([-a-zA-Z0-9]+)\"?/i) {
|
||||||
|
my $charset = $1;
|
||||||
|
$body = decode($charset, $body, FB_CROAK);
|
||||||
|
}
|
||||||
|
|
||||||
my $h_date = $head->get('Date') || '';
|
my $h_date = $head->get('Date') || '';
|
||||||
chomp $h_date;
|
chomp $h_date;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,8 @@
|
||||||
|
|
||||||
package UVsendmail;
|
package UVsendmail;
|
||||||
|
|
||||||
|
use utf8;
|
||||||
|
use open qw(:std :utf8);
|
||||||
use strict;
|
use strict;
|
||||||
use UVconfig;
|
use UVconfig;
|
||||||
use UVtemplate;
|
use UVtemplate;
|
||||||
|
|
@ -239,7 +241,7 @@ sub mimeencode {
|
||||||
$word =~ s/\n//g;
|
$word =~ s/\n//g;
|
||||||
my $encword;
|
my $encword;
|
||||||
if ($word =~ /[\x7F-\xFF]/) {
|
if ($word =~ /[\x7F-\xFF]/) {
|
||||||
$encword = MIME::Words::encode_mimeword($word, 'Q', 'ISO-8859-1');
|
$encword = MIME::Words::encode_mimeword($word, 'Q', 'UTF-8');
|
||||||
} elsif (length($word) > 75) {
|
} elsif (length($word) > 75) {
|
||||||
$encword = MIME::Words::encode_mimeword($word, 'Q', 'us-ascii');
|
$encword = MIME::Words::encode_mimeword($word, 'Q', 'us-ascii');
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
|
|
@ -44,6 +44,8 @@ einer Liste immer 60 Zeichen lang ist um ansehnliche Tabellen auszugeben.
|
||||||
|
|
||||||
#----------------------------------------------------------------------
|
#----------------------------------------------------------------------
|
||||||
|
|
||||||
|
use utf8;
|
||||||
|
use open qw(:std :utf8);
|
||||||
use strict;
|
use strict;
|
||||||
use vars qw( $VERSION $functions @dirs);
|
use vars qw( $VERSION $functions @dirs);
|
||||||
use UVconfig;
|
use UVconfig;
|
||||||
|
|
@ -370,10 +372,10 @@ sub _parse_rules{
|
||||||
sub _strip_chars{
|
sub _strip_chars{
|
||||||
my $line = $_[0] || return;
|
my $line = $_[0] || return;
|
||||||
|
|
||||||
# führenden whitespace entfernen
|
# führenden whitespace entfernen
|
||||||
$$line =~ s/^\s+//;
|
$$line =~ s/^\s+//;
|
||||||
|
|
||||||
# kommentare bis zum nächsten Zeilenumbruch entfernen
|
# kommentare bis zum nächsten Zeilenumbruch entfernen
|
||||||
$$line =~ s/^#.*$//m;
|
$$line =~ s/^#.*$//m;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -618,8 +620,8 @@ sub _parse_comment{
|
||||||
my $count = 1;
|
my $count = 1;
|
||||||
|
|
||||||
while($string && $count) {
|
while($string && $count) {
|
||||||
$string =~ s/^[^\[\]\\]+//s; # alles außer Klammern und Backslash wegwerfen
|
$string =~ s/^[^\[\]\\]+//s; # alles außer Klammern und Backslash wegwerfen
|
||||||
$string =~ s/^\\.//; # alles gesperrte löschen
|
$string =~ s/^\\.//; # alles gesperrte löschen
|
||||||
|
|
||||||
$count++ if $string =~ s/^\[//;
|
$count++ if $string =~ s/^\[//;
|
||||||
$count-- if $string =~ s/^\]//;
|
$count-- if $string =~ s/^\]//;
|
||||||
|
|
@ -775,7 +777,7 @@ Sonderzeichen oder Leerzeichen uebergeben werden muessen diese gequotet
|
||||||
werden. Dazu kann ' also auch " verwendet werden.
|
werden. Dazu kann ' also auch " verwendet werden.
|
||||||
|
|
||||||
Die Funktionen geben im Allgemeinen einen String zurueck. Im Rahmen
|
Die Funktionen geben im Allgemeinen einen String zurueck. Im Rahmen
|
||||||
von Listen können auch Arrays uebergeben werden.
|
von Listen können auch Arrays uebergeben werden.
|
||||||
|
|
||||||
Die erste Funktion duerfte ueblicherweise 'value' sein. Sie gibt den
|
Die erste Funktion duerfte ueblicherweise 'value' sein. Sie gibt den
|
||||||
des angegeben Schluessel zurueck, der dann von den folgenden Funktionen
|
des angegeben Schluessel zurueck, der dann von den folgenden Funktionen
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
votetaker := value mailfrom | fill-left 65
|
votetaker := value mailfrom
|
||||||
head := value head | quote "> "
|
head := value head | quote "> "
|
||||||
body := value body | quote "> "
|
body := value body | quote "> "
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ bdsginfo := value bdsginfo | create-lines 72
|
||||||
bdsgtext-first := value bdsgtext | first-words 50
|
bdsgtext-first := value bdsgtext | first-words 50
|
||||||
bdsgtext-more := value bdsgtext | drop-words 50 | create-lines 50
|
bdsgtext-more := value bdsgtext | drop-words 50 | create-lines 50
|
||||||
|
|
||||||
votetaker := value mailfrom | fill-left 65
|
votetaker := value mailfrom
|
||||||
|
|
||||||
== TEMPLATE =================================================================
|
== TEMPLATE =================================================================
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
votetaker := value mailfrom | fill-left 65
|
votetaker := value mailfrom
|
||||||
|
|
||||||
== TEMPLATE =================================================================
|
== TEMPLATE =================================================================
|
||||||
Zur Wertung deiner Stimme ist die Zustimmung zur Speicherung,
|
Zur Wertung deiner Stimme ist die Zustimmung zur Speicherung,
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
votetaker := value mailfrom | fill-left 65
|
votetaker := value mailfrom
|
||||||
|
|
||||||
== TEMPLATE =================================================================
|
== TEMPLATE =================================================================
|
||||||
Diese automatische Nachricht wurde dir nach Erhalt Deiner ANNULLIERUNG
|
Diese automatische Nachricht wurde dir nach Erhalt Deiner ANNULLIERUNG
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
votetaker := value mailfrom | fill-left 65
|
votetaker := value mailfrom
|
||||||
head := value head | quote "> "
|
head := value head | quote "> "
|
||||||
body := value body | quote "> "
|
body := value body | quote "> "
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
votetaker := value mailfrom | fill-left 65
|
votetaker := value mailfrom
|
||||||
head := value head | quote "> "
|
head := value head | quote "> "
|
||||||
body := value body | quote "> "
|
body := value body | quote "> "
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -12,5 +12,5 @@ Message-ID: [$msgid]
|
||||||
Date: [$date]
|
Date: [$date]
|
||||||
X-Automated-Message: generated by [$usevote-version]
|
X-Automated-Message: generated by [$usevote-version]
|
||||||
MIME-Version: 1.0
|
MIME-Version: 1.0
|
||||||
Content-Type: text/plain; charset\=iso-8859-1
|
Content-Type: text/plain; charset\=UTF-8
|
||||||
Content-Transfer-Encoding: 8bit
|
Content-Transfer-Encoding: 8bit
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
votetaker := value mailfrom | fill-left 65
|
votetaker := value mailfrom
|
||||||
body := value body | quote "> "
|
body := value body | quote "> "
|
||||||
|
|
||||||
== TEMPLATE =================================================================
|
== TEMPLATE =================================================================
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
votetaker := value mailfrom | fill-left 65
|
votetaker := value mailfrom
|
||||||
body := value body | quote "> "
|
body := value body | quote "> "
|
||||||
|
|
||||||
== TEMPLATE =================================================================
|
== TEMPLATE =================================================================
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
votetaker := value mailfrom | fill-left 65
|
votetaker := value mailfrom
|
||||||
head := value head | quote "> "
|
head := value head | quote "> "
|
||||||
body := value body | quote "> "
|
body := value body | quote "> "
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
votetaker := value mailfrom | fill-left 65
|
votetaker := value mailfrom
|
||||||
body := value body | quote "> "
|
body := value body | quote "> "
|
||||||
|
|
||||||
== TEMPLATE =================================================================
|
== TEMPLATE =================================================================
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
votetaker := value mailfrom | fill-left 65
|
votetaker := value mailfrom
|
||||||
body := value body | quote "> "
|
body := value body | quote "> "
|
||||||
|
|
||||||
== TEMPLATE =================================================================
|
== TEMPLATE =================================================================
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
votetaker := value mailfrom | fill-left 65
|
votetaker := value mailfrom
|
||||||
head := value head | quote "> "
|
head := value head | quote "> "
|
||||||
body := value body | quote "> "
|
body := value body | quote "> "
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
votetaker := value mailfrom | fill-left 65
|
votetaker := value mailfrom
|
||||||
body := value body | quote "> "
|
body := value body | quote "> "
|
||||||
|
|
||||||
== TEMPLATE =================================================================
|
== TEMPLATE =================================================================
|
||||||
|
|
|
||||||
|
|
@ -21,6 +21,8 @@
|
||||||
# written in C). Not all functions of Usevote/UseVoteGer 3.x are implemented!
|
# written in C). Not all functions of Usevote/UseVoteGer 3.x are implemented!
|
||||||
###############################################################################
|
###############################################################################
|
||||||
|
|
||||||
|
use utf8;
|
||||||
|
use open qw(:std :utf8);
|
||||||
use strict;
|
use strict;
|
||||||
use Getopt::Long;
|
use Getopt::Long;
|
||||||
use FindBin qw($Bin);
|
use FindBin qw($Bin);
|
||||||
|
|
|
||||||
2
uvcfv.pl
2
uvcfv.pl
|
|
@ -20,6 +20,8 @@
|
||||||
# written in C). Not all functions of Usevote/UseVoteGer 3.x are implemented!
|
# written in C). Not all functions of Usevote/UseVoteGer 3.x are implemented!
|
||||||
###############################################################################
|
###############################################################################
|
||||||
|
|
||||||
|
use utf8;
|
||||||
|
use open qw(:std :utf8);
|
||||||
use strict;
|
use strict;
|
||||||
use Getopt::Long;
|
use Getopt::Long;
|
||||||
use Digest::MD5 qw(md5_hex);
|
use Digest::MD5 qw(md5_hex);
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,8 @@
|
||||||
# written in C). Not all functions of Usevote/UseVoteGer 3.x are implemented!
|
# written in C). Not all functions of Usevote/UseVoteGer 3.x are implemented!
|
||||||
###############################################################################
|
###############################################################################
|
||||||
|
|
||||||
|
use utf8;
|
||||||
|
use open qw(:std :encoding(UTF-8));
|
||||||
use strict;
|
use strict;
|
||||||
use Getopt::Long;
|
use Getopt::Long;
|
||||||
use Digest::MD5 qw(md5_hex);
|
use Digest::MD5 qw(md5_hex);
|
||||||
|
|
|
||||||
|
|
@ -21,6 +21,8 @@
|
||||||
# written in C). Not all functions of Usevote/UseVoteGer 3.x are implemented!
|
# written in C). Not all functions of Usevote/UseVoteGer 3.x are implemented!
|
||||||
###############################################################################
|
###############################################################################
|
||||||
|
|
||||||
|
use utf8;
|
||||||
|
use open qw(:std :utf8);
|
||||||
use strict;
|
use strict;
|
||||||
use Getopt::Long;
|
use Getopt::Long;
|
||||||
use Text::Wrap qw(wrap $columns);
|
use Text::Wrap qw(wrap $columns);
|
||||||
|
|
@ -330,6 +332,7 @@ sub process_vote {
|
||||||
$voter_name = $3;
|
$voter_name = $3;
|
||||||
$voter_name =~ s/^\s+//; # strip leading spaces
|
$voter_name =~ s/^\s+//; # strip leading spaces
|
||||||
$voter_name =~ s/\s+$//; # strip trailing spaces
|
$voter_name =~ s/\s+$//; # strip trailing spaces
|
||||||
|
utf8::decode($voter_name); # fix double encoding
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($voter_name) {
|
if ($voter_name) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue