Current time: 12-23-2024, 02:43 AM Hello There, Guest! (LoginRegister)


Post Reply 
About Postfix ...
Author Message
RatS Offline
Project Leader
******

Posts: 1,854
Joined: Oct 2006
Reputation: 17
Post: #21
RE: About Postfix ...
there is not much change. Best way is to upload it into bug tracker we will see, how we can implement.
04-23-2007 02:24 AM
Visit this user's website Find all posts by this user Quote this message in a reply
HappyAlex Offline
Junior Member
*

Posts: 11
Joined: Jan 2007
Reputation: 0
Post: #22
RE: About Postfix ...
ok i will today or tommorow
04-23-2007 02:46 PM
Find all posts by this user Quote this message in a reply
HappyAlex Offline
Junior Member
*

Posts: 11
Joined: Jan 2007
Reputation: 0
Post: #23
RE: About Postfix ...
ok let's start .. sorry for my EnglishSmile
--------------------------------------------------------------------------------------
1) install cyrus-sasl from sources with :
./configure --with-mysql=<path_where_is_mysql_libs and include>
2)rename old sasl2 or delete and make ln -s /usr/local/lib/sasl2 /usr/lib/sasl2
3) download postfix, gunzip and tar xvf
4) make this
make makefiles CCARGS="-DUSE_SASL_AUTH -DUSE_CYRUS_SASL -DHAS_MYSQL -I<path_where_is_mysql_include> -I/usr/local/include/sasl" AUXLIBS="-L/usr/local/lib/sasl2 -lsasl2 -L<path_where_is_mysql_libs> -lmysqlclient -lz -lm"

5) make
6)
adduser postfix
groupadd postdrop
6.a) make install
7) postfix start
8) tail /var/log/maillog
8.a) newaliases
--------------------------------------------------------------------------------
Mar 7 02:32:26 mail postfix/master[30277]: daemon started -- version 2.3.8, configuration /etc/postfix
--------------------------------------------------------------------------------
9) install Courier-imap
a) download courier-authlib
./configure --with-redhat --disable-root-check --with-mysql-libs=/usr/lib/mysql --with-mysql-includes=/usr/include/mysql --with-mailuser=courier --with-mailgroup=courier
then
make
make install
make install-configure
b) install courier-imap
export COURIERAUTHCONFIG="/usr/local/bin/courierauthconfig"
./configure --with-redhat --disable-root-check --with-mailuser=courier --with-mailgroup=courier --with-mysql
make install
9) install maildrop
./configure --enable-maildrop-uid=root --enable-maildrop-gid=mail --enable-syslog=1
----------------------- next-------------------------
First create mysql-user: for ex. mail_user
create database and give access mail_user for this DB
--------------------------------------------------------------------------------
CREATE TABLE alias(
address varchar( 128 ) NOT NULL default '',
goto varchar( 128 ) NOT NULL default '',
PRIMARY KEY ( address )
) TYPE = MYISAM ;# MySQL returned an empty result set (i.e. zero rows).

CREATE TABLE transport(
domain varchar( 128 ) NOT NULL default '',
transport varchar( 128 ) NOT NULL default '',
PRIMARY KEY ( domain )
) TYPE = MYISAM ;# MySQL returned an empty result set (i.e. zero rows).

CREATE TABLE users(
email varchar( 128 ) NOT NULL default '',
passwd varchar( 128 ) NOT NULL default '',
uid int( 11 ) unsigned NOT NULL default '1000',
gid int( 11 ) unsigned NOT NULL default '12',
maildir varchar( 255 ) NOT NULL default '/var/spool/mail',
enabled tinyint( 4 ) NOT NULL default '1',
quota int( 11 ) unsigned NOT NULL default '2048000',
PRIMARY KEY ( email )
) TYPE = MYISAM ;# MySQL returned an empty result set (i.e. zero rows).

------------------
File /etc/postfix/master.cf
String:
virtual unix - n y - - virtual
Change on:
virtual unix - n n - - virtual
---------------------------------------------------------------------------------
File /etc/postfix/main.cf
put:
mydestination = localhost, $myhostname, localhost.$mydomain,mysql:/etc/postfix/mysql-mydestination.cf
local_recipient_maps = unix:passwd.byname $alias_maps $virtual_mailbox_maps
Quote:virtual_mailbox_base = /
virtual_mailbox_maps = mysql:/etc/postfix/mysql-virtual-maps.cf
virtual_maps = mysql:/etc/postfix/mysql-virtual.cf
virtual_minimum_uid = 500
virtual_uid_maps = mysql:/etc/postfix/mysql-virtual-uid.cf
virtual_gid_maps = mysql:/etc/postfix/mysql-virtual-gid.cf
transport_maps = mysql:/etc/postfix/mysql-transport.cf



Create this files
Quote:# mysql-mydestination.cf
#
user = postfix
password = postfix
dbname = mail
table = transport
select_field = domain
where_field = domain
hosts = 127.0.0.1

# mysql-transport.cf
#
user = postfix
password = postfix
dbname = mail
table = transport
select_field = transport
where_field = domain
hosts = 127.0.0.1

# mysql-virtual-maps.cf
#
user = postfix
password = postfix
dbname = mail
table = users
select_field = maildir
where_field = email
additional_conditions = and enabled = 1
hosts = 127.0.0.1

# mysql-virtual-uid.cf
#
user = postfix
password = postfix
dbname = mail
table = users
select_field = uid
where_field = email
additional_conditions = and enabled = 1
hosts = 127.0.0.1

# mysql-virtual-gid.cf
#
user = postfix
password = postfix
dbname = mail
table = users
select_field = gid
where_field = email
additional_conditions = and enabled = 1
hosts = 127.0.0.1

#mysql-virtual.cf
#
user = postfix
password = postfix
dbname = mail
table = alias
select_field = goto
where_field = address
hosts = 127.0.0.1

put this config to authmysqlrc in /usr/local/etc/authlib/
MYSQL_SERVER localhost
MYSQL_USERNAME mail_user
MYSQL_PASSWORD <password>
#MYSQL_SOCKET /var/lib/mysql/mysql.sock
MYSQL_PORT 3306
MYSQL_DATABASE mail_system
MYSQL_USER_TABLE users
MYSQL_CLEAR_PWFIELD passwd
#DEFAULT_DOMAIN virtual1.domain
MYSQL_LOGIN_FIELD email
MYSQL_HOME_FIELD maildir
MYSQL_MAILDIR_FIELD maildir
MYSQL_WHERE_CLAUSE enabled=1

in /usr/local/lib/sasl2
create smtpd.conf
sasl_mech_list: login plain cram-md5 digest-md5
mech_list: login plain cram-md5 digest-md5
auxprop_plugin: sql
pwcheck_method: auxprop
sql_user: mail_user
sql_passwd: <password>
sql_hostnames: localhost
sql_database: mail_system
sql_select: select passwd from users where email = '%u@%r'
sql_verbose: yes


make changes into /etc/postfix/main.cnf

#mysql
smtpd_sasl_auth_enable = yes
smtpd_sasl_authenticated_header = yes
broken_sasl_auth_clients = yes
smtp_sasl_security_options = noanonymous

smtpd_recipient_restrictions =
permit_sasl_authenticated,
permit_mynetworks,
reject_unauth_destination

virtual_mailbox_base = /
virtual_mailbox_maps = mysql:/etc/postfix/mysql-virtual-maps.cf
virtual_maps = mysql:/etc/postfix/mysql-virtual.cf
virtual_minimum_uid = 500
virtual_uid_maps = mysql:/etc/postfix/mysql-virtual-uid.cf
virtual_gid_maps = mysql:/etc/postfix/mysql-virtual-gid.cf
transport_maps = mysql:/etc/postfix/mysql-transport.cf
message_size_limit = 30060000
virtual_mailbox_limit_inbox = yes
virtual_mailbox_limit_maps = mysql:/etc/postfix/mysql-virtual-quote.cf
virtual_maildir_extended = yes
virtual_create_maildirsize = yes
05-01-2007 12:17 AM
Find all posts by this user Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 3 Guest(s)