Readme.mysql
3.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
Author: Jim Hull (8-24-2001)
imaginos@imaginos.net
Mysql support for mailutils ....
This addition to mailutils allows you to have complete email support
without actually having the users on the systems. This would allow you to
have complete web based account management for users while still
maintaining system security as the users can not access the box directly.
The setup is designed to work with the same table definitions as ProFtpd
thus granting you the ability to grant complete web/ftp/email based system
all authenticated by a database running in mysql. A current running system
for this exists at http://www.linuxrocket.net/freeweb.cgi.
Setup:
Mysql:
create database mail;
grant all privileges on mail.* to user@localhost identified by
'foobar';
create table users (username VARCHAR(20) UNIQUE NOT NULL,
uid INT(5) NOT NULL DEFAULT 99,
gid INT(5) NOT NULL DEFAULT 99,
password VARCHAR(15) NOT NULL,
homedir VARCHAR(128) NOT NULL,
shell VARCHAR(64) NOT NULL,
comment TEXT);
When you are done, it should look like ....
+----------+--------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+----------+--------------+------+-----+---------+-------+
| username | varchar(20) | | PRI | | |
| uid | int(5) | | | 99 | |
| gid | int(5) | | | 99 | |
| password | varchar(15) | | | | |
| homedir | varchar(128) | | | | |
| shell | varchar(64) | | | | |
| comment | text | YES | | NULL | |
+----------+--------------+------+-----+---------+-------+
System Setup:
After modifying MySql/MySql.h with your appropriate defines, compile and
install.
Add a user with no possibility of a pass, with its own gid, shell should
be /bin/false and dir should be /dev/null. Something like ...
monly:x:3002:805:Mail Only:/dev/null:/bin/false
monly:x:805:
When you enter new users into your table, you want to be sure they all
have the same uid/gid in the table as that one user on the system. If you
use the mailer thats in examples/mail.MysqlMailer.c then you will be all
ready to go. It explains in the source for its setup and installation.
an example entry would be ...
+----------+------+------+---------------+-------------------------+------------+----------+
| username | uid | gid | password | homedir | shell | comment |
+----------+------+------+---------------+-------------------------+------------+----------+
| foobar | 3002 | 805 | JahUAjwjhAJha | /home/foobar | /bin/false | F. Bar |
+----------+------+------+---------------+-------------------------+------------+----------+
1) make sure /var/spool/foobar is uid '3002', gid 'mail' and 0660
2) make sure /home/foobar is uid '3002', gid '805' so when you set up
proftpd it works in unison