On Thursday 13 March 2003 13:12, Ajai Khattri wrote:
> We are currently setting up qmailadmin. I was wondering if anyone had
> written any patches to qmailadmin so that the "Domain Name" field on the
> login page displays a pulldown of domain-names instead of just a text
> field? Maybe pulling the domains from vpopmail at runtime? ;-)
>
> (No customers will ever see qmailadmin so this is OK for us).

Hi Ajai.

I have written a patch for Sqwebmail that does exactly what you want and
much MUCH more. I will soon port this patch to qmailadmin.

I plan to begin the porting process late next week. It shouldn't take
more than an hour or two, so if you can wait until then, you'll have what
you need. (and hopefully it will be included in the next release.)

Attached is documentation for the 'logindomainlist' file that my patch
reads before generating it's drop down menu, or hidden field.

Take a look, and let me know if it's what you're looking for.

-- 
Jesse Guardiani, Systems Administrator
WingNET Internet Services,
P.O. Box 2605 // Cleveland, TN 37320-2605
423-559-LINK (v)  423-559-5145 (f)
http://www.wingnet.net

We are actively looking for companies that do a lot of long
distance faxing and want to cut their long distance bill by
up to 50%.  Contact [EMAIL PROTECTED] for more info.

   /usr/local/share/sqwebmail/logindomainlist - this file can be used in
   a vast number of ways to fine tune the user login experience.

   In sqwebmail version prior to 3.5.0.20030304, logindomainlist had much
   more limited functionality. You could only specify a list of domains,
   one per line. The user would then see a drop down list to the right of
   the user id field on login.html. This drop down list was of limited
   usefulness because it always defaulted to an empty (non-existant)
   domain. The user would then have to search through the drop down to
   find the domain he wanted to log in under. In addition, the drop down
   had no access controls, and it showed EACH user ALL of the domains
   listed in the logindomainlist file.

   However, now the logindomainlist file is MUCH more useful. Among the
   new logindomainlist functionality is the ability to specify a group
   field for each drop down menu record, and the ability to specify
   default domains so that the user doesn't have to go searching for his
   domain in the drop down list. Also, you can do away with the drop down
   menu all together if you wish. You can now specify records that
   generate hidden fields in login.html, allowing you to show only one
   domain to the user per URL or IP address. This can greatly reduce
   confusion for first time web mail users.

   And finally, the new logindomainlist functionality allows you to use
   wildcards to rewrite the domain portion of the calling URL to the mail
   domain equivalent. For example, the following record can rewrite the
   URL "mail.*.com" to the mail domain "*.com"

   *.com:mail.*.com:*

   This powerful wildcard functionality can often automate most of your
   server's default domains with just one or two logindomainlist records.

   Let's take a look at the NEW logindomainlist file format:

   firstfield:secondfield:thirdfield

   Above, we can see that the new logindomainlist records are made up of
   three fields delimited by colons. But what does each field do?

   First Field - the first field contains the MAIL login domain. This is
   the part of an email address after the @ symbol. For example, in the
   email address "[EMAIL PROTECTED]", "domain.com" is the mail login
   domain.

   Second Field - the second field contains the URL or IP address that is
   used to figure out which mail domain to use by default. For example,
   in the following logindomainlist record:

   domain1.com:domain2.com

   "domain2.com" is the "default domain" and "domain1.com" is the "mail
   domain". If the user logs into the following URL:

   http://domain2.com/cgi-bin/sqwebmail

   His default domain will be "domain1.com".

   Third Field - the third field may contain a "modifier". The modifier
   may be either a single character modifier, or a group string. The
   individual modifiers and their functions are listed below:

   * - the asterisk modifier tells sqwebmail that the first and second
   fields _MAY_ contain wildcards. It also explicitly turns off the drop
   down list, since wildcards are technically incompatible with drop
   downs. And finally, IPs are not allowed in the second field with this
   modifier since wildcarding would have to be implemented differently
   for IP addresses.

   When using wildcarding, whatever the asterisk (*) represents in the
   second field will be substituted for the asterisk (if it exists) in
   the first field. For example, given the following logindomainlist
   record:

   *.com:mail.*.com:*

   And the user logs into sqwebmail with the following URL:

   http://mail.mydomain.com/cgi-bin/sqwebmail

   The asterisk in the second field will represents the string
   "mydomain". This string will then be substituted in place of the
   asterisk in the first field to give the following default mail login
   domain: mydomain.com

   Similarly, if the following record exists in the logindomainlist file:

   *:*:*

   Then ANY URL the user uses to access sqwebmail will be directly used
   as the default domain.

   But the first field doesn't _HAVE_ to contain an asterisk. The
   following will work just fine:

   mydomain.com:mydomain.*:*

   The above example will allow the user to access the "mydomain.com"
   mail domain from any of the following URLs: "mydomain.org",
   "mydomain.net", "mydomain.us", etc...

   And finally, the first field doesn't have to contain anything at all!
   If the first field is empty, that record will serve as an explicit
   non-default. No default will be specified if the second field matches
   the user's login URL. This is useful because the logindomainlist is
   searched from the top down. Any wildcard records at the bottom of the
   list will be overridden by records closer to the top. An "explicit
   non-default" record can be used to specify certain domains as "system
   account" domains so that no domain is specified.

   @ - the AT modifier tells sqwebmail to turn off the drop down. It
   functions similar to the asterisk (*) modifier, except without
   wildcarding. However, since wildcarding is disabled with the @
   modifier, IP addresses can be entered in the second field.

   group string - If the modifier field (third field) contains a group
   string, all domains with the same group string will be displayed
   together in the user's drop down. For example, if your logindomainlist
   contains the following records:
     domain1.com:domain2.com:firstgroup
     domain3.com:domain4.com:firstgroup
     domain5.com:domain6.com:firstgroup
     domain7.com:domain8.com:secondgroup
     domain9.com:domain10.com:secondgroup

   And the user logs into sqwebmail with the following URL:

   http://domain4.com/cgi-bin/sqwebmail

   He will see a drop down containing ONLY the following:
     domain1.com
     domain3.com
     domain5.com

   "domain3.com" will be automatically selected, or defaulted. Only the
   records in the firstgroup will be visible to the user. This is great
   for companies with many mail domains.

Reply via email to