- 論壇徽章:
- 0
|
###########################################################
安裝 Courier-imap/imaps with Courierpassd 新的收發(fā)件協(xié)議
Courier 編譯的時候需要使用非rook權(quán)限
cd /downloads/qmailrocks/
tar jxvf courier-imap-4.0.2.tar.bz2
chown -R bsmith:wheel courier-imap-4.0.2
cd /downloads/qmailrocks/courier-imap-4.0.2
su bsmith
./configure --prefix=/usr/local --exec-prefix=/usr/local --with-authvchkpw --without-authldap --without-authmysql --disable-root-check --with-ssl --with-authchangepwdir=/usr/local/libexec/authlib --with-redhat
Note: the configure process will take a few minutes. Go grab a snack...
make && make check
Now we will exit out of our NON-ROOT USER and go back to being root...
exit
make install-strip && make install-configure
安裝Courier的ssl支持
/usr/local/sbin/mkimapdcert
(ssl的證書需要是從Verisign 或者 Thawte那里購買正是的證書,否則郵件客戶端會提示你正在連接非安全的 imap ssl server)
vi /usr/local/etc/imapd.cnf
change [email]postmaser@example.com[/email] an administrative email address
Save and exit
vi /usr/local/etc/imapd
Make sure that the following configuration exists: IMAPDSTART=YES
vi /usr/local/etc/imapd-ssl
Make sure that the following configuration exists: IMAPDSSLSTART=YES
Make sure that the following configuration exists: TLS_CERTFILE=/usr/local/share/imapd.pem
Save and exit the file.
MAXPERIP 參數(shù) 是指 每個IP的最大連接數(shù)量 在 /usr/local/etc/imapd 中,如果你的公司人員數(shù)量眾多,并且都是從一個IP地址NAT出來,那么需要加大這個參數(shù),默認(rèn)是4。
vi /usr/local/etc/authlib/authdaemonrc
Around like 27, you should see the "authmodulelist" setting. Make sure that "authvchkpw" is the only module listed. Like so:
authmodulelist="authvchkpw"
Save and exit the file.
創(chuàng)建啟動腳本:
cp /usr/local/libexec/imapd.rc /etc/rc.d/init.d/imap
cp /usr/local/libexec/imapd-ssl.rc /etc/rc.d/init.d/imaps
/usr/local/sbin/authdaemond stop
/usr/local/sbin/authdaemond start
/etc/rc.d/init.d/imap stop
/etc/rc.d/init.d/imaps stop
/etc/rc.d/init.d/imap start
/etc/rc.d/init.d/imaps start
測試登錄
telnet localhost 143
Trying 192.168.1.10...
Connected to 192.168.1.10.
Escape character is '^]'.
* OK [CAPABILITY IMAP4rev1 UIDPLUS CHILDREN NAMESPACE THREAD=ORDEREDSUBJECT THREAD=REFERENCES SORT QUOTA IDLE STARTTLS] Courier-IMAP ready. Copyright 1998-2003 Double Precision, Inc. See COPYING for distribution information.
a login [email]postmaster@mydomain.com[/email] my_password
a OK LOGIN Ok. (successful login!)
a logout (logs you out)
* BYE Courier-IMAP server shutting down
a OK LOGOUT completed
Connection closed by foreign host.
Hint: The "a" that you see before my login commands is required.
imap支持遠(yuǎn)程改密碼
Note: Courierpassd will require that port 106 be open to at least local traffic (traffic from 127.0.0.1)
cd /downloads/qmailrocks
tar zxvf courierpassd-1.1.0-RC1.tar.gz
cd courierpassd-1.1.0-RC1
./configure
make && make install
If your server uses Xinetd, here's how you integrate Courierpassd into it:
cd /etc/xinetd.d
Here we create the xinetd script for courierpassd...
vi courierpassd
service courierpassd
{
port = 106
socket_type = stream
protocol = tcp
user = root
server = /usr/local/sbin/courierpassd
server_args = -s imap
wait = no
only_from = 127.0.0.1
instances = 4
disable = no
}
Note: You may want to add additional IP's to the "only_from" setting above, depending on your needs.
Save and exit.
If your server uses Inetd, here's how integrate Courierpassd into it:
vi /etc/inetd.conf
Add the following line:
courierpassd stream tcp nowait root /usr/local/sbin/courierpassd -s imap
Save and exit.
vi /etc/services
Append to following line to the /etc/services file:
courierpassd 106/tcp #for /etc/xinetd.d/courierpassd
If your system uses Xinetd, them we now want to restart Xinetd:
/etc/rc.d/init.d/xinetd restart
If your system uses Inetd, then we now want to restart Inetd
/etc/rc.d/init.d/inetd restart
測試修改密碼:
root@redbox:/# telnet localhost 106
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
200 courierpassd v0.30 hello, who are you?
user [email]postmaster@qmailrocks.org[/email]
200 Your password please.
pass my_password (don't be a dumbass. Put your own password here)
200 Your new password please.
newpass my_new_password (don't be a dumbass. Put your new password here)
200 Password changed, thank-you.
quit
200 Bye.
Connection closed by foreign host.
root@redbox:/#
###########################################################
安裝web客戶端程序 Squirrelmail
1。php安裝的時候需要一下配置參數(shù)
--enable-track-vars
--enable-force-cgi-redirect
--with-gettext
--with-mysql
2。php.ini文件里面file_uploads = On
下載最新的Squirrelmail.tar.gz
[url]http://www.squirrelmail.org/download.php[/url]
cd /var/www/html
tar zxvf /path/to/squirrelmail-x.x.x.tar.gz (enter whatever version you downloaded)
mv squirrelmail-x.x.x webmail
mkdir /var/sqattachements
chown -R apache:apache /var/sqattachements (or whatever user apache runs as)
cd webmail
chown -R apache:apache data (or whatever user apache runs as)
cd config
./conf.pl
General
-------
1. Domain : 1.2.3.4 (Enter the IP of your server here. Don't be an idiot and actually use 1.2.3.4)
2. Invert Time : false
3. Sendmail or SMTP : SMTP
IMAP Settings
--------------
4. IMAP Server : localhost
5. IMAP Port : 143
6. Authentication type : login
7. Secure IMAP (TLS) : false
8. Server software : other
9. Delimiter : detect
SMTP Settings
-------------
4. SMTP Server : localhost
5. SMTP Port : 25
6. POP before SMTP : false
7. SMTP Authentication : login
8. Secure SMTP (TLS) : false
在apache里面配置虛擬主機(jī)
<VirtualHost 1.2.3.4:80>
ServerName mail.mydomain.com
ServerAlias mail.*
ServerAdmin [email]postmaster@mydomain.com[/email]
DocumentRoot /var/www/webmail
</VirtualHost>
生效以后,可以用
[url]http://www.yourdomain.com/webmail[/url]
登錄
Username: [email]postmaster@yourdomain.com[/email]
Password: your_password
安裝 修改密碼的插件
cd /path/to/squirrelmail_directory/plugins (example: cd /var/www/webmail/plugins)
wget [url]http://squirrelmail.org/countdl.php?fileurl=http%3A%2F%2Fwww.squirrelmail.org%2Fplugins%2Fchange_pass-2.7-1.4.x.tar.gz[/url]
Unpack the module...
tar zxvf change_pass-2.7-1.4.x.tar.gz
rm -rf change_pass-2.7-1.4.x.tar.gz
cd /path/to/squirrelmail_directory/config
./conf.pl
Choose the option for "plugins". On my version of Squirrelmail, this was option 8. Once you are in the modules menu you should see the "change_pass" module on the list of available, but inactive, modules. You can add the "change_pass" module by simply typing the number associated with the module and then hitting enter. Once the module appears on the active module list, go ahead and save the configuration changes and then exit out of the configuration tool.
###########################################################
殺毒及郵件過濾
perl的模塊支持
You will need these Perl Modules:
Digest::SHA1
Digest::HMAC
Net::DNS
Time::HiRes
HTML::Tagset
HTML::Parser
Pod::Usage
Parse::Syslog
Statistics::Distributions
You will also need these other packages:
perl-suidperl
unzip
How do I know if my server has these perl modules?
The following script will check your system for the above modules.
You MUST run this script as a NON-ROOT user!!
/downloads/qmailrocks/scripts/util/check_perlmods.script
If you see an output similar to this: /usr/lib/perl5/5.6.1/i386-linux/Time/HiRes.pm Your are good to go! However, if you get a "not found" type response for any of the above modules, you will need to install them.
Ok, so if I don't have the module(s), how do I down and install it(them)?
There are 3 main ways you can do this:
1. Redhat's "up2date" utility (reccomended): Redhat Network members can easily install every perl module and package that is required above with the exception of "Mail-Spamassassin", which is available in the "perlmods" directory of the Qmailrocks package. If you are a Redhat Network member and would like to see an example of how to install using the "up2date" utility, click here.
Important Note: The Parse::Syslog and Statistics::Distributions perl modules are currenly not available in RPM package format (at least I couldn't find any). These 3 modules will have to be installed via option 2 or 3
2. Qmailrocks included RPM packages: If you are not a member of Redhat Network, I've included RPM and source versions of all needed perl modules. These can be found in the "perlmods" directory of the Qmailrocks package. If you want to see an example of how to install these RPM's or source packages, click here. I try to keep these packages as current as possible, but you can always fine the latest versions at Redhat's download site.
3. Directly from CPAN: Go to [url]http://www.cpan.org[/url], get the module and install it. Alternatively, you can use the command line CPAN utility to connect to CPAN and install the module.
"unzip" and "perl-suidperl" 安裝后
安裝殺毒:
Installing Clam Anti Virus...
cd /downloads/qmailrocks/
rpm -Uvh clamav-x.x-x.x.rpm
rpm -Uvh clamav-devel-x.x-x.x.rpm
Now we'll do a few configuration settings to the /etc/clamd.conf file.
vi /etc/clamd.conf
"Example" - should already be commented out. However, if it is not, make sure that it is commented out (#)
"LogFile" - should be set to /var/log/clamav/clamd.log
"LogTime" - should be uncommmented.
"LogSyslog" - should be uncommented.
"User" - should be set to qscand
"ScanMail" - should be uncommented.
useradd -c "Qmail-Scanner Account" -s /bin/false qscand
Alright, now let's start Clamd...
/etc/init.d/clamd stop
/etc/init.d/clamd start
/usr/bin/freshclam -l /var/log/clamav/clam-update.log
[root@crescent clamav]# freshclam -l /var/log/clamav/clamav-update.log
ClamAV update process started at Sun Oct 24 23:36:22 2004
main.cvd is up to date (version: 27, sigs: 23982, f-level: 2, builder: tomek)
daily.cvd is up to date (version: 549, sigs: 1583, f-level: 3, builder: ccordes)
crontab -e (make sure you run this command as root)
25 1 * * * /usr/bin/freshclam --quiet -l /var/log/clamav/freshclam.log
Knowing Clam Anti Virus
1) Clam AV works pretty well right out of the box. However, there is a configuration file created at /etc/clamav.conf in case you want to customize it to your liking.
3) Clam logs to /var/log/clamav.log
4) When Clam detects an e-mail that contains a potential virus, the following will happen:
- a) Clam AV quarantines the e-mail in /var/spool/qmailscan/quarantine
- b) Clam AV will send a notification of the detection and quarantine to whoever you configure it to send notifications to. When we install Qmail-Scanner further down this page, we will tell it what people to notify when a virus is detected. If you configure Qmail-Scanner by my rules, it will send 1 notification to the system administrator. However, it can also send a notification to the sender and the recipient as well, if you configure it to do so.
安裝Spamassassin...防止垃圾郵件
If you don't have the Mail::Spamassassin Perl module installed on your system, let's install it now...
cd /downloads/qmailrocks/perlmods/rpms/
rpm -Uvh perl-Mail-SpamAssassin-3.0.2-1.i386.rpm
Now let's install the Spamassassin RPMs
cd /downloads/qmailrocks/
rpm -Uvh spamassassin-3.0.2-1.i386.rpm spamassassin-tools-3.0.2-1.i386.rpm
or
rpm -Uvh --nodeps spamassassin-3.0.2-1.i386.rpm spamassassin-tools-3.0.2-1.i386.rpm
groupadd spamd
useradd -g spamd -s /home/spamd spamd
vi /etc/sysconfig/spamassassin
If the above file exists, replace its contents with the following line. If the file does not exist, create it and add the following line:
SPAMDOPTIONS="-x -u spamd -H /home/spamd -d"
Save and exit from the file.
vi /etc/mail/spamassassin/local.cf
Add the following line...
required_hits 5
Save and exit from the file.
/etc/rc.d/init.d/spamassassin start
Now let's see if Spamassassin is running...
ps aux | grep spamd
spamd 3734 0.2 2.0 24992 20808 ? S 14:21 0:01 /usr/bin/spamd -x -u spamd -H /home/spamd -d
**!。 setup 設(shè)置自啟動
[[i] 本帖最后由 leera 于 2006-7-26 18:29 編輯 [/i]] |
|