Linux -Blue forest free software | Return to home page | Site Map | Search WWW | Contact Us |
Your current position : Homepage > Free Software > Technological exchanges >Network Communication


    

Blue Forest http://www.lslnet.com at 12:08 on July 28, 2006


Freebsd completely ports installed postfix with SASL2 mysql courier-imap

Freebsd completely ports installed postfix with SASL2 mysql courier-imap
Author : KE Gui which QQ:93606088 E-mail:chaohu@tom.com

All rights reserved Huake world : (www.chinake.com). For this article, please indicate the source, the paper was formed in April 30, 2005.
In this paper, the hardware environment : 10/100 pro+ADSL CII800+256M+intel815E+40G+intel online.
Windows xp software environment : 4.10 sp2+Vmware 5.0+secureCRT4.1+leapftp+freebsd
May 6, 2005, in freebsd 5.3 of the system under test.
The greatest advantage of the system is simple, but support encryption and authentication and security links. Some use certified courier certification process with a higher efficiency. Configuration File less.
————————————————————————————————————————
1, the basic system ready
1.1 cyber environment that enables virtual machine has access to the Internet
First download 4.10-RELEASE-i386-disc1.iso installed before installing Vmware5.0, installed after the network will link the two, we ban it (irrelevant), ADSL link up Youji sharing -- -- -- Attribute Sharing -- to determine local link. Youji --internet agreement on the local link (layers) -- DNS service for the use of the following addresses, DNS addresses will be obtained by dialing ADSL (eg : 202.102.192.68) -- to determine their preference.
1.2 virtual machine creation freebsd
--typical-- Vmware--new virtual machine-- next start next -- next --other--freebsd-- (virtual machine amendment to preserve the trails Space requirements shall not be less than 4G) next (use bridged networking) -- the next step disk size (the largest allocation of space) 10G-- completed.
Shoot, 1976 virtual machine memory to Windows virtual machine regulation setting, adjusting CD-ROM--USE ISO image, after the visit of our downloaded 4.10-RELEASE-i386-disc1.iso OK. Windows xp attention to the virtual machine and switched to Ctrl+Alt bond.
130 systems installed freebsd
Launched into the virtual machine interface to install freebsd.
Skip Kernel 1.3.1 and continue with installation and configuration
1.3.2 standard into hard disk management, according to a direct, q.
1.3.3 standard to guide the election process into districts, according to a direct, q.
1.3.4 choose to install, I choose Minimal, you can also advance, make use of key-box choice, a choice about the key is OK and cancel, and then the transport, about five minutes.
Note : No direct the transport set. If the machine is actually installed, to determine a good network environment.
As ports installation procedure for downloading thread, too slow, therefore, will be ready to win the necessary software downloaded using Google to find back through ftp upload to freebsd, freebsd use sshd management, the need for a user group 车 account.
1.3.5 User confirmation requested
Would you like to configure any Ethernet network or slip/ppp devices? (yes)
10-2 choice lance/pcnet (isolan/novell ne2100/ne32-vl) Ethernet.
Do you want to try ipv6 configuration of the interface? (No.)
Do you want to try interface? dhcp configuration of the (No.)
1.3.6 server and network configuration, can be crucial in the Internet
Host mail :
Domain:chinake.com
Ipv4 gateway:192.168.0.1
Name server:202.102.192.68
Ipv4 address:192.168.0.66
Netmask:255.255.255.0.
Would you like to bring up the interface right now? Lnc0 (yes)
Do you want this machine to function as a network gateway? (no)
Opening Server 1.3.7, after posting of documents easier, faster, if your network, may open.
Do you want to configure inetd and the network services that it provides? (yes)
No. # ftp to be deleted before, and then knock Morales once Enter twice.
Do you want to have anonymous ftp access to this machine? (no)
Do you want to configure this machine as an NFS server? (no)
Do you want to configure this machine as an NFS client? (no)
Do you want to select a default security profile for this host? (no)
Would you like to customize your system console setting? (no)
Would you like to set this machine ''s time zone now? (No)
Would you like to enable Linux binary compatibility? (yes)
Does this system have a attaches to it? Non-usb mouse (yes)
Option 2 enable test and run the mouse encryption, and then exit
1.3.8 additional software, only increases the need to update ports tree procedures
The freebsd package collection is a collection of thousands of ready-to-run applications. from text editors to games to Web servers and more. would you browse the collection now? (yes). If after the distribution, operation /stand/sysinstall.
All-- box button to select the option to use cvsup-16.1h and portupgrade-20040325_1, ok--install.
1.3.9 users increased, and it has authority 车 group.
Would you like to add any initial user accounts to the system? (yes)
User add a new user to the system
Login id:chaohu
Uid:1001
Group : 火
Password:chaohu
Ok--exit
1.3.10 root user password changes
Now you must set the system manager 's password
This is the password you 'll use to log in as "root."
Two key input, the input is invisible attention.
No--exit install--yes choose to restart the computer. FREEBSD basic system installed successfully.
————————————————————————————————————————
2, the Web server software installation
Link to create 2.1 sshd
SecureCRT installation, after the new link.
Name : mail.chinake.com
Hostname:192.168.0.66
Username:chaohu
Password:chaohu
$su
Password :
Mail#
Note : # said the root identity, said $ ordinary user.
Following the absence of special note that all orders are to root user operation.
2.2 update ports tree.
Cd /usr/share/examples/cvsup; cvsup g L 2-h ftp.freebsdchina.org ports-supfile
About 10 minutes, depending on the speed of the network.
Mkdir /usr/ports/distfiles
Chmod 777 /usr/ports/distfiles
All users can write to change the list, using leapftp software ftp://192.168.0.66, chaohu : user names and passwords, login and switched to the catalog, craft required software, is a relatively large software packages, such as mysql.
2.3 installed openssl
Make install clean cd /usr/ports/security/openssl;
2.4 installed mysql database, the proposed installation of version 4.0 or 3.23.
Cd /usr/ports/databases/mysql323-server/;
Make install clean BUILD_OPTIMIZED=yes WITH_OPENSSL=yes
Ee /etc/rc.conf; mysql_enable= adding : "yes"
Installation x 250
Cd install clean /usr/ports/www/apache13-modssl;make
Support https link webservice path : /usr/local/www/data/. Can also choose apache2.
Ee /etc/rc.conf; apache_enable= adding : "yes"
2.6 installed php4
Cd install clean /usr/ports/lang/php4;make
Cp /usr/local/etc/php.ini.dist /usr/local/etc/php.ini
Ee /usr/local/etc/apache/httpd.conf
In the final accession :
AddType application/x-httpd-php. PHP
AddType application/x-httpd-php-source. Phps

2.7 install phpmyadmin
As for the path to install phpmyadmin acquiescence : /usr/local/www/phpMyAdmin
Our path is : /usr/local/www/data/ webservice
Therefore, we have to change their acquiescence to install.
Cd /usr/ports/databases/phpmyadmin;
Ee Makefile
Www/data/ www/ will all be changed.
Make install clean
Ee /usr/local/www/data/phpMyAdmin/config.inc.php;
Will be the first to configure, re - http
$cfg[ 'PmaAbsoluteUri'] = 'http://192.168.0.66/phpMyAdmin/';
$cfg[ 'Servers' ][$i][' auth_type '] =' http '; 4003rd Authentication method (configure, http or cookie based)?
2.8 installed perl5.8
Cd install clean /usr/ports/lang/perl5.8/;make
According to suggest after the completion of the implementation :
/usr/local/bin/use.perl Port
2.9 Installation expect
Cd /usr/ports/lang/expect
Make install clean
2.10 installed postfixadmin
With phpmyadmin, its tacit approval for the installation of Contents : /usr/local/www/postfixadmin/.
So I want to install it /usr/local/www/data/postfixadmin/, amending makefile, all www/, www/data/ changed, a lot of attention Department.
Cd install clean /usr/ports/mail/postfixadmin;ee Makefile;make
Import :
Cd /usr/local/www/data/postfixadmin/
Mysql-u root "DATABASE_MYSQL.TXT
Laws config.ini.php document ee config.ini.php
$CONF[ 'Default_language'] = 'cn';
$CONF[ 'Domain_path'] = 'yes';
$CONF[ 'Domain_in_mailbox'] = 'NO';
The user menu items such as : /usr/local/virtual/chinake.com/chaohu
Contents : mail storage building
Mkdir /usr/local/virtual;
Chown www:www /usr/local/virtual;
Chmod 771 /usr/local/virtual

3, Mail System
3.1 installed courier-imap
Cd /usr/ports/mail/courier-imap
Make install clean
Choose Add : [auth_mysql], if not, can make configure, re-selection.
Editor : ee /etc/rc.conf; increase courier_authdaemond_enable= then "yes" from the start and started :
/usr/local/etc/rc.d/courier_authdaemond.sh Start. At this point in /var/run/authdaemond/ under socket.
Chmod o+x /var/run/authdaemond; to sasl enforceable authority.
3.2 installed SASL2
Cd /usr/ports/security/cyrus-sasl2;make install WITH_AUTHDAEMON=yes clean;
-DWITH_AUTHDAEMOND Install or use : make clean
Ee /usr/local/lib/sasl2/smtpd.conf;
Pwcheck_method : authdaemond
Log_level : 3
Mech_list : PLAIN LOGIN
Authdaemond_path:/var/run/authdaemond/socket
Thus, some of the basic certification completed.
3.3 installed postfix
3.3.1 cd /usr/ports/mail/postfix
[sasl2]+[tls]+[db42]+[mysql]+[vda]+[test] Installed at selected.
Make install clean
Will be installed at the end of the issue suggested that the two were joined user groups and revise mailer.conf. Y all answer.
Echo 'postfix : root' ";>; /etc/aliases
/usr/local/bin/newaliases
Chown postfix:postfix /etc/opiekeys
3.3.2 replacement and stop handbook
Ee /etc/rc.conf; revised sendmail_enable= 'NONE'
Started to establish links :
Cd /usr/local/etc/rc.d/;ln s /usr/local/sbin/postfix postfix.sh
Creating /etc/periodic.conf
Ee /etc/periodic.conf
Daily_clean_hoststat_enable= "NO"
Daily_status_mail_rejects_enable= "NO"
Daily_status_include_submit_mailq= "NO"
Daily_submit_queuerun= "NO"
3.3.3 distribution postfix
Because I want to use the same user to read and x-mail list, because users at 64A, id:80, /usr/local/etc/postfix/main.cf attention to the user id.
Ee /usr/local/etc/postfix/main.cf
In the final phrase :
#======= BASE ==============
Myhostname = mail.chinake.com
Mydomain = chinake.com
Home_mailbox = Maildir/
Mydestination = $myhostname
Local_recipient_maps =
#======= MYSQL Based =============
Virtual_gid_maps = static:80
Virtual_mailbox_base = /usr/local/virtual
Virtual_uid_maps = static:80
Virtual_minimum_uid = 80
Virtual_alias_maps = mysql:/usr/local/etc/postfix/mysql_virtual_alias_maps.cf
Virtual_mailbox_domains = mysql:/usr/local/etc/postfix/mysql_virtual_domains_maps.cf
Virtual_mailbox_maps = mysql:/usr/local/etc/postfix/mysql_virtual_mailbox_maps.cf
#======= Quota ============
Message_size_limit = 5242880
Virtual_mailbox_limit_inbox = no
Virtual_mailbox_limit_override = yes
Virtual_maildir_extended = yes
Virtual_create_maildirsize = yes
Virtual_mailbox_limit_maps = mysql:/usr/local/etc/postfix/mysql_virtual_mailbox_limit_maps.cf
Virtual_mailbox_limit = 52428800
#======== SASL ================
Smtpd_sasl_auth_enable = yes
Smtpd_sasl_security_options = noanonymous
Broken_sasl_auth_clients = yes
Permit_auth_destination reject smtpd_recipient_restrictions = permit_sasl_authenticated
#smtpd_sasl_local_domain = $mydomain
Smtpd_client_restrictions = permit_sasl_authenticated

Several configuration file :
Cd /usr/local/etc/postfix/;
1, ee mysql_virtual_alias_maps.cf
User = postfix
Password = postfix
Hosts = localhost
Dbname = postfix
Table = alias
Select_field = goto
Where_field = address

2, ee mysql_virtual_domains_maps.cf
User = postfix
Password = postfix
Hosts = localhost
Dbname = postfix
Table = domain
Select_field = description
Where_field = domain
#additional_conditions And backupmx = = '0' and active = 'one'
3, ee mysql_virtual_mailbox_maps.cf
User = postfix
Password = postfix
Hosts = localhost
Dbname = postfix
Table = mailbox
Select_field = maildir
Where_field = username
= = #additional_conditions And active 'one'
4, ee mysql_virtual_mailbox_limit_maps.cf
User = postfix
Password = postfix
Hosts = localhost
Dbname = postfix
Table = mailbox
Select_field = quota
Where_field = username
= = #additional_conditions And active 'one'

Here, I use 80 users that the World Wide Web (HTTP) and modifications :

3.4, configuration courier-imap certification
Ee /usr/local/etc/authlib/authmysqlrc
DEFAULT_DOMAIN chinake.com
MYSQL_CRYPT_PWFIELD password
MYSQL_DATABASE postfix
MYSQL_GID_FIELD '80'
MYSQL_HOME_FIELD '/usr/local/virtual'
MYSQL_LOGIN_FIELD username
MYSQL_MAILDIR_FIELD maildir
MYSQL_NAME_FIELD name
MYSQL_OPT 0
MYSQL_PASSWORD postfix
#MYSQL_PORT 0
#MYSQL_QUOTA_FIELD Quota
MYSQL_SERVER localhost
MYSQL_UID_FIELD '80'
MYSQL_USERNAME postfix
MYSQL_USER_TABLE mailbox

Here are revised to 80 users pay attention to the middle instead of the ballots, TAB键 in Unix systems, many of which involved the use TAB键. Please pay special attention to the quotation marks.
Ee /usr/local/etc/authlib/authdaemonrc
Authmodulelist= "authmysql authpam authuserdb"
Authmodulelistorig= "authmysql authpam authuserdb"
Version= "authdaemond.mysql"
4, the installation of webmail
In addition to the allocation of acquiescence [AUTH_MYSQL]
Cd install clean /usr/ports/mail/sqwebmail/;make
Ee /etc/rc.conf; sqwebmaild_enable= added : "yes"
Ee /etc/crontab
#minute Hour mday month wday who command
0 * * * * bin /usr/local/share/sqwebmail/ cleancache.pl
Well, building a mail server.
5, virtual domain, managers and user management.
Http://192.168.0.66/postfixadmin/admin/
Fenwick attention ahead after caretakers, and then add users, and then under /usr/local/virtual look at the list of users is not established, and if not, please check the maillog /var/log/ and messages. A careful inspection configuration files.
6, send and receive mail
Use Outlook or http://192.168.0.66/cgi-bin/sqwebmail/sqwebmail
Attention virtual domain, the use of log-mail addresses.



 Privacy Policy  Copyright © 1999-2000 LSLNET.COM. All rights reserved. Blue Forest website owners. E-mail : Webmaster@lslnet.com