[Mew-dist 03458] Re: [im] imget by IMAP

Yuuichi Teranishi 寺西裕一 teranisi at example.com
1998年 1月 20日 (火) 15:27:33 JST


寺西です。

teranisi> IMAP で imget する機能をほんのすこし向上させるパッチを作って
teranisi> みました。

すみません、ImapAccount の書式を勘違いしていて、
ImapAccount=user/AUTH at example.com 
の形式を受け付けなくなってしまっていました。
これを直すパッチをお送りします。im-83 に対するパッチです。

;; これまで文句が全然出てないということは im で IMAP を使っているひとは
;; あまりいないのでしょうか?

--
Yuuichi Teranishi (寺西裕一) <teranisi at example.com>
NTT Information and Communication Systems Laboratories
The movement you need is on your shoulder...
-------------- next part --------------
--- Imap.pm.in~	Mon Jan 19 18:47:31 1998
+++ Imap.pm.in	Tue Jan 20 15:05:37 1998
@@ -623,19 +623,24 @@
 # IMAP folder (--src=imap[%folder][:user][/auth][@server[/port]])
 sub imap_spec ($) {
     my $spec = shift;
-    my ($folder, $auth, $host, $user) = ('INBOX', 'auth', '', '');
-    my $s = imapaccount();
 
-    if ($s =~ /(.+)\@(.+)/) {
-        $user = $1;
-        $host = $2;
-    } elsif ($s =~ /\@(.+)/){
-        $user = $ENV{'USER'} || $ENV{'LOGNAME'} || im_getlogin();
-	$host = $1;
-    } else {
-      $user = $s;
-      $host = 'localhost';
-    } 
+    my ($folder, $auth, $host) = ('INBOX', 'auth', 'localhost');
+    my $user = $ENV{'USER'} || $ENV{'LOGNAME'} || im_getlogin();
+    my $account = imapaccount();
+
+    while ($account ne '') {
+        if ($account =~ /^([^\/\@]+)(.*)/) {
+	    $user = $1;
+	} elsif ($account =~ /^\/([^\/\@]+)(.*)/) {
+	    $auth = $1;
+	} elsif ($account =~ /^\@([^\@]+)(.*)/) {
+	    $host = $1;
+	} else {
+	    im_warn("invalid ImapAccount: $account\n");
+	    return ('', '', '', '');
+	}
+	$account = $2;
+    }
     while ($spec ne '') {
 	if ($spec =~ /^%([^%:\@]+)(.*)/) {	# XXX
 	    $folder = $1;


Mew-dist メーリングリストの案内