[Mew-dist 10389] Re: imap環境でimmvできない

SAKAI Kiyotaka ksakai at example.com
1999年 8月 24日 (火) 15:45:23 JST


>> In article <19990820222036Y.shirai at example.com>, Hideyuki SHIRAI (白井秀行) <shirai at example.com> writes:

> [shirai at example.com:~/]% immv --verbose=on --src=+tmp --dst=%#mh/inbox 1
> immv: unknown authentication protocol: inbox
> immv: unknown authentication protocol: inbox
> immv: invalid imap spec: %/:
> Password (imap/:@): 
> immv: opening IMAP session
> immv: WARNING: imap connection was not established.
> immv: ERROR: invalid password (imap/:@).

motonari さんが提案しているように、AUTH の区切は // を使うようにパッチ
を作ってみました。

ただし、ImapAccount に記述するときと Pop で使うときは、

> ~/.im/Config には、
> ImapAccount=shirai at example.com
> と書いてありますが、

> ImapAccount=/AUTH:shirai at example.com
> ImapAccount=/LOGIN:shirai at example.com

のように、従来通り / で動くようにしてあるつもりです。
-- 
酒井 清隆 (E-mail: ksakai at example.com)
-------------- next part --------------
Index: IM/Imap.pm
===================================================================
RCS file: /home/ksakai/cvsroot/im-125/IM/Imap.pm,v
retrieving revision 1.1.1.1
diff -u -c -r1.1.1.1 Imap.pm
*** Imap.pm	1999/08/24 02:16:47	1.1.1.1
--- Imap.pm	1999/08/24 06:11:01
***************
*** 598,608 ****
      }
  }
  
! # IMAP folder (--src=imap[%folder][/auth][:user][@server[/port]])
  sub imap_spec ($) {
      my $spec = shift;
  
!     if ($spec eq '' || $spec =~ /^%([^%:\@\/]+)$/) {
  	my $s = imapaccount();
  	if ($s !~ /^[\/\@:]/) {
  	    if ($s =~ /\@/) {
--- 598,608 ----
      }
  }
  
! # IMAP folder (--src=imap[%folder][//auth][:user][@server[/port]])
  sub imap_spec ($) {
      my $spec = shift;
  
!     if ($spec eq '' || $spec !~ /[:\@]|\/\//) {
  	my $s = imapaccount();
  	if ($s !~ /^[\/\@:]/) {
  	    if ($s =~ /\@/) {
***************
*** 611,626 ****
  		$s = "\@$s";
  	    }
  	}
  	$spec .= $s if ($s ne '');
      }
  
      my ($folder, $auth, $host) = ('INBOX', 'auth', 'localhost');
      my $user = $ENV{'USER'} || $ENV{'LOGNAME'} || im_getlogin();
  
!     if ($spec =~ /^%([^%:\@\/]+)(.*)/) {	# XXX
  	$folder = $1;
  	$spec = $2;
!     }
      if ($spec =~ /^\/(\w+)(.*)/) {
  	$auth = $1;
  	$spec = $2;
--- 611,632 ----
  		$s = "\@$s";
  	    }
  	}
+ 	if ($spec ne '' && $s =~ /^\/[^\/]/) {
+ 	    $s = "/$s";
+ 	}
  	$spec .= $s if ($s ne '');
      }
  
      my ($folder, $auth, $host) = ('INBOX', 'auth', 'localhost');
      my $user = $ENV{'USER'} || $ENV{'LOGNAME'} || im_getlogin();
  
!     if ($spec =~ /^%(.*)\/(\/.*)/) {
  	$folder = $1;
  	$spec = $2;
!     } elsif ($spec =~ /^%([^%:\@]+)(.*)/) {
! 	$folder = $1;
! 	$spec = $2;
!     }	
      if ($spec =~ /^\/(\w+)(.*)/) {
  	$auth = $1;
  	$spec = $2;
***************
*** 720,726 ****
      ($folder, $auth, $user, $host) = imap_spec($folder);
      $folder =~ s/^/%/;
  
!     return "$folder/$auth:$user\@$host"; # may be appended '/port'
  }
  
  sub imap_folder_name ($) {
--- 726,732 ----
      ($folder, $auth, $user, $host) = imap_spec($folder);
      $folder =~ s/^/%/;
  
!     return "$folder//$auth:$user\@$host"; # may be appended '/port'
  }
  
  sub imap_folder_name ($) {
Index: IM/Pop.pm
===================================================================
RCS file: /home/ksakai/cvsroot/im-125/IM/Pop.pm,v
retrieving revision 1.1.1.1
diff -u -c -r1.1.1.1 Pop.pm
*** Pop.pm	1999/08/24 02:16:47	1.1.1.1
--- Pop.pm	1999/08/24 06:18:41
***************
*** 558,568 ****
      return $msgs;
  }
  
! # POP folder (--src=pop[/auth][:user][@server[/port]])
  sub pop_spec ($) {
      my $spec = shift;
  
!     if ($spec eq '') {
  	my $s = popaccount();
  	if ($s !~ /^[\/\@:]/) {
  	    if ($s =~ /\@/) {
--- 558,568 ----
      return $msgs;
  }
  
! # POP folder (--src=pop[//auth][:user][@server[/port]])
  sub pop_spec ($) {
      my $spec = shift;
  
!     if ($spec eq '' || $spec !~ /[:\@]|\/\//) {
  	my $s = popaccount();
  	if ($s !~ /^[\/\@:]/) {
  	    if ($s =~ /\@/) {
***************
*** 571,588 ****
  		$s = "\@$s";
  	    }
  	}
! 	$spec = $s if ($s ne '');
      }
      my ($auth, $host) = ('apop', 'localhost');
      my $user = $ENV{'USER'} || $ENV{'LOGNAME'} || im_getlogin();
  
      if ($spec =~ /(.*)\@(.*)/) {
  	$host = $2;
  	$spec = $1;
-     }
-     if ($spec =~ /^\/(\w+)(.*)/) {
- 	$auth = $1;
- 	$spec = $2;
      }
      if ($spec =~ /^:(.*)/) {
  	$user = $1;
--- 571,588 ----
  		$s = "\@$s";
  	    }
  	}
! 	$spec .= $s if ($s ne '');
      }
      my ($auth, $host) = ('apop', 'localhost');
      my $user = $ENV{'USER'} || $ENV{'LOGNAME'} || im_getlogin();
  
+     if ($spec =~ /^\/\/?(\w+)(.*)/) {
+ 	$auth = $1;
+ 	$spec = $2;
+     }
      if ($spec =~ /(.*)\@(.*)/) {
  	$host = $2;
  	$spec = $1;
      }
      if ($spec =~ /^:(.*)/) {
  	$user = $1;


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