[freeside] courier-mta table name?

Vlad Sedov vlad at humbleguys.net
Wed Jul 17 21:30:39 PDT 2002


this would work, but we have a bunch of users already on the courier
server.. they're in the following format:

CREATE TABLE passwd (
  id varchar(128) NOT NULL default '',
  crypt varchar(128) NOT NULL default '',
  name varchar(128) NOT NULL default '',
  uid int(10) unsigned NOT NULL default '570',
  gid int(10) unsigned NOT NULL default '570',
  home varchar(255) NOT NULL default '',
  maildir varchar(255) NOT NULL default '',
  quota varchar(255) NOT NULL default '',
  PRIMARY KEY  (id),
  KEY id (id)
) TYPE=MyISAM;


and here's what the fields look like:

id = login in the user at domain.com format
crypt = unix-crypted _password.. this one's easy
name = gecos, basically
uid = same for all users, so can be fed from default
gid = same as uid
home = /mail/<domain name>
maildir = "./<username>"

I haven't quite figured out how to extract the user's domain inside of
the export module.. not that i'm too lazy to RTFM... just kinda new to
perl :-)


also... is it possible to set the GECOS field automatically from the
account's first+last name?...


thanks

Vlad



On Wed, 2002-07-17 at 21:59, Kristian Hoffmann wrote:
> The easiest way would be just change the courier config file to use user
> instead of passwd.  Otherwise, edit sqlmail.pm and change...
> 
> %fs_mail_table = ( svc_acct => 'user',
>                    svc_domain => 'domain' );
> 
> to
> 
> %fs_mail_table = ( svc_acct => 'passwd',
>                    svc_domain => 'domain' );
> 
> 
> Here is the schema we are using for sqlmail:
> 
> CREATE TABLE domain (
>   domain char(128) NOT NULL default '',
>   svcnum int(11) NOT NULL default '0',
>   catchall int(11) default NULL,
>   PRIMARY KEY  (svcnum)
> ) TYPE=MyISAM;
> 
> --
> -- Table structure for table 'user'
> --
> 
> CREATE TABLE user (
>   username char(128) NOT NULL default '',
>   _password char(128) NOT NULL default '',
>   finger char(128) NOT NULL default '',
>   domsvc int(11) NOT NULL default '0',
>   svcnum int(11) NOT NULL default '0',
>   PRIMARY KEY  (svcnum)
> ) TYPE=MyISAM;
> 
> 
> And the MYSQL_SELECT_CLAUSE we're using for courier:
> 
> MYSQL_SELECT_CLAUSE     \
> SELECT username, '', _password, [mtauid], [mtagid], CONCAT('/var/spool/courier/', \
> '$(domain)', '/'), '$(local_part)', '', finger \
> FROM user LEFT JOIN domain ON user.domsvc = domain.svcnum \
> WHERE username = '$(local_part)' and domain = '$(domain)'
> 
> 
> I have an example exim configuration if you want.
> 
> It was done like this so that we could use virtual domain hosting support
> in courier.  It keeps a seperate spool directory for each domain.  The
> export was intended for use with an MTA as well.  That is why the domain
> table is there.  svc_forward support will be added eventually.
> 
> -Kristian
> 
> 
> On 17 Jul 2002, Vlad Sedov wrote:
> 
> > Hello -
> >
> > How would I change the sqlmail table name from the default 'user' to
> > something else? Our courier server stores the usernames in a table
> > called 'passwd', and sqlmail.pm wants to update a table called 'user'...
> >
> >
> > Thanks,
> >
> > Vlad
> >
> >
> >
> >
> 





More information about the freeside-users mailing list