Article delegate-en/987 of [1-5169] on the server localhost:119
  upper oldest olders older1 this newer1 newers latest
search
[Top/Up] [oldest] - [Older+chunk] - [Newer+chunk] - [newest + Check]
[Reference:<_A986@delegate-en.ML_>]
Newsgroups: mail-lists.delegate-en

[DeleGate-En] Re: Changing user instead of server, again
22 Jan 2001 15:55:07 GMT ysato@etl.go.jp (Yutaka Sato)


Hi,

 |> A pair of MOUNT parameters:
 |> 
 |>   MOUNT="toto_*            pop://localhost/toto@titi.com"
 |>   MOUNT="//titi.com/toto_* pop://localhost/toto@titi.com"
 |> 
 |> will do.
 |
 |The problem here is that the 'toto' part can change too. In fact I would like the above rewrites to work for any 'toto' and any 'stuff'.

I think I've got a clearly specified requirement at last, but
it might be extended yet :)
Another mechanism for arbitrary rewriting in completely user
defined way, external filter, may be desirable. 

  SERVER=pop://localhost FTOSV=canonuser-filter

Basically canonuser-filter for requirements can be realized with
sed like this:
  sed -e '/^USER[^@]*$/s/^M*$/@titi.com&/' -e '/^USER/s/_.*@/@/'
(^M must be raw carriage-return to work)
But this will no work except we can disable its buffering for
standard output.  A possible solution is using sed line by line
as follows:

#!/bin/sh
while read LINE; do
 echo "$LINE" \
 | sed -e '/^USER[^@]*$/s/^M*$/@titi.com&/' -e '/^USER/s/_.*@/@/'
done

Cheers,
Yutaka
--
Yutaka Sato <ysato@delegate.org> http://www.delegate.org/~ysato/   @ @ 
Computer Science Division, Electrotechnical Laboratory            ( - )
1-1-4 Umezono, Tsukuba, Ibaraki, 305-8568 Japan                  _<   >_

  admin search upper oldest olders older1 this newer1 newers latest
[Top/Up] [oldest] - [Older+chunk] - [Newer+chunk] - [newest + Check]
@_@V