Sorry, that one failed for me.
It did not find the domain of a user with this mailbox location...
dir:       /var/qmail/vpopmail/domains/westpa.net/1/3/crapper

The only thing that seems to be stable is this...
 Match = re.search(".*/domains?/([^\./]+\.[^/]+)/", Dict["Home"]) 

Sam
 


-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
On Behalf Of Jim Ramsay
Sent: Friday, March 19, 2004 3:13 PM
To: [EMAIL PROTECTED]
Subject: Re: TMDA-cgi 0.13 "Aluminim" Re-Release + Another Problem


Jim Ramsay wrote:

> Okay... so we want to find the left-most directory name
> which contains a dot... will that do it?

This RE will do it:

"^/(?:[^\./]+/)+([^\./]+\.[^/]+)/(?:[^/]+/)+/?$"

Translation:

   ^/
- To match, a $HOME directory must start with a /

   (?:[^\./]+/)+
- Then there must be at least one directory level without a dot in it

   ([^\./]+\.[^/]+)/
- After one or more of those, there must be a directory level with a dot
   in it.  This is what will be returned as the Domain.

   (?:[^/]+/)+
- Then there must be at least one directory level after that, which may
   or may not contain a dot.

   /?$
- Finally, the string may or may not end with /

That's my final answer.  If that won't do, I may make it a 
./configure-time option for all virtual user admins to set, with the 
above as default.

This will break any system with non-virtual users where a normal user's 
home directory path has a '.' in it somewhere.  I don't know if that 
happens anywhere.

-- 
Jim Ramsay
"Me fail English?  That's unpossible!"

_____________________________________________
tmda-users mailing list ([EMAIL PROTECTED])
http://tmda.net/lists/listinfo/tmda-users

_____________________________________________
tmda-users mailing list ([EMAIL PROTECTED])
http://tmda.net/lists/listinfo/tmda-users

Reply via email to