[Mew-dist 17097] Re: Sender の設定
Tatsuya Kinoshita
tats at example.com
2001年 4月 11日 (水) 23:39:39 JST
In message "[Mew-dist 17093] Re: Sender の設定"
Tatsuya Kinoshita <tats at example.com> wrote:
> imsetupで「User=」を設定しておくべきだったのだろうな。
今さらながら、パッチを作ってみました。
なお、[Mew-dist 15884]で報告された64bit環境への対応も含んでいます。
(動作は未確認)
--
木下達也
-------------- next part --------------
This patch is written by Tatsuya Kinoshita. Copyright is disclaimed.
diff -ur im-141/IM/MD5.pm im-141-tats20010411/IM/MD5.pm
--- im-141/IM/MD5.pm Fri Apr 14 16:47:25 2000
+++ im-141-tats20010411/IM/MD5.pm Mon Mar 19 23:57:37 2001
@@ -106,10 +106,10 @@
# F, G, H and I are basic MD5 functions.
-sub MD5_F {my($x, $y, $z) = @_; ((($x) & ($y)) | ((~$x) & ($z))); }
-sub MD5_G {my($x, $y, $z) = @_; ((($x) & ($z)) | (($y) & (~$z))); }
+sub MD5_F {my($x, $y, $z) = @_; ((($x) & ($y)) | (&MD5_trunc(~$x) & ($z))); }
+sub MD5_G {my($x, $y, $z) = @_; ((($x) & ($z)) | (($y) & &MD5_trunc(~$z))); }
sub MD5_H {my($x, $y, $z) = @_; (($x) ^ ($y) ^ ($z)); }
-sub MD5_I {my($x, $y, $z) = @_; (($y) ^ (($x) | (~$z))); }
+sub MD5_I {my($x, $y, $z) = @_; (($y) ^ (($x) | &MD5_trunc(~$z))); }
# ROTATE_LEFT rotates x left n bits.
@@ -155,8 +155,13 @@
sub MD5_trunc {
my($x) = @_;
- while ($x >= 4294967296) {
- $x -= 4294967296;
+
+ if (($x | 0) == $x) {
+ $x &= 0xffffffff;
+ } else {
+ while ($x >= 4294967296) {
+ $x -= 4294967296;
+ }
}
return $x;
}
diff -ur im-141/imsetup.in im-141-tats20010411/imsetup.in
--- im-141/imsetup.in Fri Apr 14 16:47:24 2000
+++ im-141-tats20010411/imsetup.in Wed Apr 11 23:20:37 2001
@@ -41,6 +41,7 @@
my $home = $ENV{'HOME'};
my $address;
+my $username;
my $mail = "Mail";
my $news = "News";
my $usecl = "@im_usecl@";
@@ -132,6 +133,7 @@
} while (! ($src =~ /^local$|^pop$|^imap$/i));
if ($src =~ /^pop|^imap/i) {
+ my $a = extract_addr($address);
if ($src =~ /^pop/i) {
$auth = "POP";
do {
@@ -143,7 +145,7 @@
$auth = &input_config("What kind of IMAP authentication mechanism? (AUTH/LOGIN)", $auth);
} while (! ($auth =~ /^auth$|^login$/i));
}
- ($user, $host) = split(/\@/, $address);
+ ($user, $host) = split(/\@/, $a);
$host = "mail." . $host;
$user = &input_config("What is your $src account name?", $user);
$host = &input_config("What is your $src server name or IP address?", $host);
@@ -287,9 +289,7 @@
print "Setup $im_config.\n";
if (!$opt_noharm) {
my $a = extract_addr($address);
- if ($a =~ /\@(.*)/) {
- $domain = $1;
- }
+ ($username, $domain) = split(/\@/, $a);
$nntpservers = $ENV{'NNTPSERVER'} || "localhost";
open(CONFIG, ">$im_config");
print CONFIG <<"---";
@@ -324,11 +324,11 @@
Address=$address
FromDomain=$domain
ToDomain=$domain
+User=$username
#Name=Full Name # commentary name for my mail address
# should not contain 8bit characters
#AddrRegex=
#Org=The Mew Organization # for news posting
-#User=user_name
##
## Default global parameters
Mew-dist メーリングリストの案内