Article delegate-en/3029 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]

Newsgroups: mail-lists.delegate-en

[DeleGate-En] Re: A question about MOUNT
15 Jul 2005 11:08:52 GMT =?windows-1251?Q?=D1=E5=F0=E3=E5=E9=20=D1=FB=F0=E5=F1=EA=E8=ED?= <p3yeqbdyi-p5lznxi5ffxr.ml@ml.delegate.org>


Hello, Yutaka!

First of all thank you for the fast reply.
Will the patch you sent me last time be included in the official DeleGate releases?

 |I tried to solve this problem with rewriting destination server path
 |with MOUNT option looking something like this:
 |MOUNT="//*%S/%S imap://imap.*%(0):143/%(1)".

> I think this can be simply as this since ":143" is not necessary:
>    MOUNT="//* imap://imap.*"
This one makes absolutely same rHost to vHost rewrite as the next one (see below).

> Or it can be as this since %S is referred in the order.
>    MOUNT="//*%S/%S imap://imap.*%S:143/%S"

This one results in "ERROR MOUNT.rhost[1] imap. ? unknown" message in log file.
When trying to login to imap.mail.ru with account username@mail..ru I get the 
following log:

----------- LOGFILE START -----------
07/09 03:08:55.98 [25117] 0+0: --INITIALIZATION START: 8.9.5 on Linux/2.4.25-MCBC3.2.5--
07/09 03:08:55.99 [25117] 0+0: BINSHELL=/bin/sh
07/09 03:08:55.99 [25117] 0+0: DGROOT=/opt/delegate^M
07/09 03:08:55.99 [25117] 0+0: <DeleGate/8.9.5> [25117] -P192.168.2.250:8143 READY^M
07/09 03:08:55.99 [25117] 0+0: PORT= 192.168.2.250:8143/7 (0,192)
07/09 03:08:56.02 [25117] 0+0: OWNER=delegate/delegate => OWNER=delegate/delegate(delegate/delegate)
07/09 03:08:56.02 [25117] 0+0: REMITTABLE = imap,imaps
07/09 03:08:56.03 [25117] 0+0: PATH: gzip -> /bin/gzip
07/09 03:08:56.03 [25117] 0+0: #### gzip = [/bin/gzip]gzip
07/09 03:08:56.03 [25117] 0+0: #### gunzip = [/bin/gzip]gzip -d
07/09 03:08:56.03 [25117] 0+0: ADMIN=root@localhost protocol=imap(specialist)
07/09 03:08:56.04 [25117] 0+0: WORKDIR=/opt/delegate/work/192.168.2.250:8143
07/09 03:08:56.04 [25117] 0+0: #### %S/%S >> %S:143/%S ####
07/09 03:08:56.04 [25117] 0+0: #### %(0)/%(1) << %S:143/%S ####
07/09 03:08:56.04 [25117] 0+0: MOUNT[0]X[3] /-/builtin/icons/* = default
07/09 03:08:56.04 [25117] 0+0: MOUNT[1]X[4] /-/* = forbidden,from=!.RELIABLE,default
07/09 03:08:56.04 [25117] 0+0: MOUNT[2]X[0] /-* = default
07/09 03:08:56.04 [25117] 0+0: MOUNT[3]X[1] /=* = default
07/09 03:08:56.04 [25117] 0+0: MOUNT[4]X[2] //*%S/%S imap://imap.*%S:143/%S 
07/09 03:08:56.84 [25117] 0+0: gethostbyname(imap.) unknown[0.79s] 
07/09 03:08:56.84 [25117] 0+0: ERROR MOUNT.rhost[1] imap. ? unknown
07/09 03:08:56.85 [25117] 0+0: env[7] LIBPATH=.;/;/opt/delegate/lib;/opt/delegate/bin;/opt/delegate/etc
07/09 03:08:56.85 [25117] 0+0: ext[0] SERVER=imap
07/09 03:08:56.85 [25117] 0+0: ext[1] MOUNT=//*%S/%S imap://imap.*%S:143/%S
07/09 03:08:56.85 [25117] 0+0: ext[2] PERMIT=*:*:*,&,{!*,*}@*
07/09 03:08:56.85 [25117] 0+0: ext[3] AUTHORIZER=-any
07/09 03:08:56.85 [25117] 0+0: ext[4] PROTOLOG=192.168.2.250:8143.imap
07/09 03:08:56.85 [25117] 0+0: arg[1] DGROOT=/opt/delegate
07/09 03:08:56.85 [25117] 0+0: arg[2] TMPDIR=/opt/delegate/tmp
07/09 03:08:56.85 [25117] 0+0: arg[3] OWNER=delegate/delegate
07/09 03:08:56.85 [25117] 0+0: arg[4] ADMIN=root@localhost
07/09 03:08:56.85 [25117] 0+0: arg[5] RESOLV=cache,file,sys
07/09 03:08:56.85 [25117] 0+0: arg[6] TIMEOUT=restart:3h
07/09 03:08:56.85 [25117] 0+0: arg[7] TIMEOUT=shutout:24h
07/09 03:08:56.85 [25117] 0+0: arg[8] TIMEOUT=dns:2
07/09 03:08:56.85 [25117] 0+0: arg[9] TIMEOUT=dnsinv:2
07/09 03:08:56.85 [25117] 0+0: arg[10] MAXIMA=delegated:64
07/09 03:08:56.85 [25117] 0+0: arg[11] CACHE=no
07/09 03:08:56.91 [25117] 0+0: DELEGATE_Modified[0]: 42cf0401
07/09 03:08:56.91 [25117] 0+0: --INITIALIZATION DONE: 8.9.5 on Linux/2.4.25-MCBC3.2.5--
07/09 03:08:56.91 [25117] 0+0: RESTART at 09/Jul/2005:04:00:00 +0300
07/09 03:08:56.94 [25570] 1+0: -- Fork(OnetimeServer): 25117 -> 25570
07/09 03:08:56.98 [25570] 1+0: bind_insock(7,192.168.2.250,0) = 0, errno=0
07/09 03:08:56.99 [25570] 1+0: ## connect[7] TIMEOUT(1000)
07/09 03:08:56.99 [25570] 1+0: ### IDENT CONNECT(int.kin.org:113) TIMEOUT(1000ms) (110)
07/09 03:08:57.00 [25570] 1+0: (0) accepted [29] -@[192.168.2.2]int.kin.org:34393 (0.069s)(1)
07/09 03:08:57.01 [25570] 1+0: PATH: imap://-:143!kaa:8143!int.kin.org:34393!anonymous@int.kin.org;1120864137
07/09 03:08:57.04 [25570] 1+0: Free proxy -- imap://-/
07/09 03:08:57.04 [25570] 1+0: D: * OK 192.168.2.250 Proxy IMAP4 server DeleGate/8.9.5^M
07/09 03:08:57.05 [25570] 1+0: C: 0 CAPABILITY^M
07/09 03:08:57.05 [25570] 1+0: D: 0 OK CAPABILITY^M
07/09 03:08:57.06 [25570] 1+0: C: 1 LOGIN "username@mail..ru" ****
07/09 03:08:57.06 [25570] 1+0: gethostbyname(-) unknown[0.00s] 
07/09 03:08:57.06 [25570] 1+0: ## Auth/any = 0 <username:****>
07/09 03:08:57.06 [25570] 1+0: ##[doAUTH] set ClientAuth [username@-any]
07/09 03:08:57.06 [25570] 1+0: AUTHORIZER=-any host=[-any] user=[username] -> OK
07/09 03:08:57.07 [25570] 1+0: *** //mail.ru/username => imap://imap./mail.ru:143/username ***
07/09 03:08:57.07 [25570] 1+0: IMAP LOGIN  "mail.ru:143/username" @ imap.:143
07/09 03:08:57.07 [25570] 1+0: ConnectToServer unknown host 'imap.'
07/09 03:08:57.07 [25570] 1+0: ERROR: cannot connect to imap://imap.:143 - -1
07/09 03:08:57.07 [25570] 1+0: E-C: Can't connect: int.kin.org:34393 => imap://imap. (unknown)
07/09 03:08:57.07 [25570] 1+0: D: 1 BAD LOGIN user@host first.^M
07/09 03:08:57.07 [25570] 1+0: NO IMAP-LOGIN FROM username@kin..:34393 TO mail.ru:143/username@imap..
----------- LOGFILE END -----------

Please, pay attention to the "/" sign in server name in the following line:
*** //mail.ru/username => imap://imap./mail.ru:143/username ***


Now, what happens after switching to delegate9.0.3-pre29.tar.bz2 and applying the patch:

----------- LOGFILE START -----------
07/15 14:10:48.80 [29445] 2+0: -- Fork(OnetimeServer): 29377 -> 29445
07/15 14:10:48.82 [29445] 2+0: bind_insock(8,192.168.2.250,0) = 0, errno=0
07/15 14:10:48.84 [29445] 2+0: ## connect[8] TIMEOUT(1000)
07/15 14:10:48.84 [29445] 2+0: ### IDENT CONNECT(int.kin.org:113) TIMEOUT(1000ms) (110)
07/15 14:10:48.85 [29445] 2+0: (2) accepted [28] -@[192.168.2.2]int.kin.org:34396 (0.060s)(1)
07/15 14:10:48.85 [29445] 2+0: PATH: imap://-:143!kaa:8143!int.kin.org:34396!anonymous@int.kin.org;1121422248
07/15 14:10:48.87 [29445] 2+0: Free proxy -- imap://-/
07/15 14:10:48.87 [29445] 2+0: D: * OK 192.168.2.250 Proxy IMAP4 server DeleGate/9.0.3-pre29^M
07/15 14:10:48.90 [29445] 2+0: C: 0 CAPABILITY^M
07/15 14:10:48.90 [29445] 2+0: D: 0 OK CAPABILITY^M
07/15 14:10:48.91 [29445] 2+0: C: 1 LOGIN "username@mail..ru" ****
07/15 14:10:48.91 [29445] 2+0: *** //mail.ru/username => imap://imap.mail.ru:143/username ***
07/15 14:10:48.91 [29445] 2+0: IMAP LOGIN  "username" @ imap.mail.ru:143
07/15 14:10:49.97 [29445] 2+0: ConnectToServer connected [8] {194.67.23.220:143 <- 192.168.1.81:34041} [1.058s]
07/15 14:10:49.97 [29445] 2+0: willSTLS_SV: ServerFlags=10
07/15 14:10:51.12 [29445] 2+0: >>>> * OK Mail.Ru IMAP server ready.^M
07/15 14:10:51.12 [29445] 2+0: >>>> 1 LOGIN "username" ****
07/15 14:10:51.12 [29445] 2+0: willSTLS_SV: ServerFlags=10
07/15 14:10:51.12 [29445] 2+0: ## Auth/any = 0 <username:****>
07/15 14:10:51.12 [29445] 2+0: ##[doAUTH] set ClientAuth [username@-any]
07/15 14:10:51.12 [29445] 2+0: AUTHORIZER=-any host=[-any] user=[username] -> OK
07/15 14:10:52.38 [29445] 2+0: S: 1 NO Authentication failed.^M
07/15 14:10:52.38 [29445] 2+0: >>>> IMAP connection to the server closed.
07/15 14:10:52.38 [29445] 2+0: NO IMAP-LOGIN FROM -@kin..:34396 TO username@mail..ru
----------- LOGFILE END -----------

After analyzing the log file, I concluded, that rewriting hostname alone can't help me in my case, because the username passed to the server by DeleGate is "username", while server expects exactly "username@mail..ru", not just "username", nor "username@mail..ru". So, I decided to rewrite username as well and tried
MOUNT="//*%S/%S imap://imap.*%(0):143/%(1)@%(0)" and it worked at last!  

----------- LOGFILE START -----------
07/15 14:28:10.01 [29751] 5+0: -- Fork(OnetimeServer): 29716 -> 29751
07/15 14:28:10.03 [29751] 5+0: bind_insock(8,192.168.2.250,0) = 0, errno=0
07/15 14:28:10.04 [29751] 5+0: ## connect[8] TIMEOUT(1000)
07/15 14:28:10.04 [29751] 5+0: ### IDENT CONNECT(int.kin.org:113) TIMEOUT(1000ms) (110)
07/15 14:28:10.05 [29751] 5+0: (0) accepted [24] -@[192.168.2.2]int.kin.org:34406 (0.047s)(1)
07/15 14:28:10.05 [29751] 5+0: PATH: imap://-:143!kaa:8143!int.kin.org:34406!anonymous@int.kin.org;1121423290
07/15 14:28:10.07 [29751] 5+0: Free proxy -- imap://-/
07/15 14:28:10.07 [29751] 5+0: D: * OK 192.168.2.250 Proxy IMAP4 server DeleGate/9.0.3-pre29^M
07/15 14:28:10.08 [29751] 5+0: C: 0 CAPABILITY^M
07/15 14:28:10.08 [29751] 5+0: D: 0 OK CAPABILITY^M
07/15 14:28:10.12 [29751] 5+0: C: 1 LOGIN "username@mail..ru" ****
07/15 14:28:10.12 [29751] 5+0: *** //mail.ru/username => imap://imap.mail.ru:143/username@mail..ru ***
07/15 14:28:10.12 [29751] 5+0: IMAP LOGIN  "username@mail..ru" @ imap.mail.ru:143
07/15 14:28:10.25 [29751] 5+0: ConnectToServer connected [8] {194.67.23.220:143 <- 192.168.1.81:34059} [0.130s]
07/15 14:28:10.25 [29751] 5+0: willSTLS_SV: ServerFlags=10
07/15 14:28:10.39 [29751] 5+0: >>>> * OK Mail.Ru IMAP server ready.^M
07/15 14:28:10.39 [29751] 5+0: >>>> 1 LOGIN "username@mail..ru" ****
07/15 14:28:10.39 [29751] 5+0: willSTLS_SV: ServerFlags=10
07/15 14:28:10.39 [29751] 5+0: ## Auth/any = 0 <username@mail.ru:****>
07/15 14:28:10.39 [29751] 5+0: ##[doAUTH] set ClientAuth [username@mail.ru@-any]
07/15 14:28:10.39 [29751] 5+0: AUTHORIZER=-any host=[-any] user=[username@mail..ru] -> OK
07/15 14:28:14.41 [29751] 5+0: S: 1 OK Logged in.^M
07/15 14:28:14.41 [29751] 5+0: OK IMAP-LOGIN FROM -@kin..:34406 TO username@mail.ru@mail..ru
07/15 14:28:14.41 [29751] 5+0: C: 2 LIST "" "INBOX"^M
07/15 14:28:14.60 [29751] 5+0: S: 2 OK List completed.^M
----------- LOGFILE END -----------


Now another question arises. In case of a big network with lots of (say hundreds) of users that use different free mail servers in the Internet, and when some servers have all mail protocols on one host on different ports, and some servers have dedicated servers for each mail protocol and same user account (as in the case with user@mail..ru for imap., pop., and smtp.mail.ru), how will network administrator handle this situation? Consider that all mail should go through DeleGate for example for some kind of filtering or virus-checking.

May be we can write MOUNTs for each server that behaves like mail.ru. But what then should MOUNT look like to match specific server name? I mean how to make one MOUNT parameter rewrite rHost for only one server, say server1.com, another MOUNT parameter rewrite rHost for anothe server, say server2.com, etc.

But even if such MOUNTs are possible, network administrator will have a lot of work to do to make all mail servers with mail.ru-like behavior work. Maybe there is another way than using MOUNT? Can DeleGate somehow guess which server name (mail.ru or imap.mail.ru) to use? Can it guess whether to use account name "username", or "username@mail..ru", or "username@mail..ru"? 

I think guessing by trying all variants is not a good idea, but something should be done (if possible) to make DeleGate work with all types of server/user/account name combinations.


With best regards,
        Serge Sireskin


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