qmail管理

使用以下命令查看qmail队列:

# /var/qmail/bin/qmail-qstat

以下命令检查队列详情:

# /var/qmail/bin/qmail-qread

根据message ID查看占有的文件:

# find /var/qmail/queue -iname xxxxx

查看文件可以看到邮件细节

# vi /var/qmail/queue/mess/1/xxxxx

若要删除队列,可依次执行以下命令:

# /etc/init.d/qmail stop

find /var/qmail/queue/mess -type f -exec rm {} \;

find /var/qmail/queue/info -type f -exec rm {} \;

find /var/qmail/queue/local -type f -exec rm {} \;

find /var/qmail/queue/intd -type f -exec rm {} \;

find /var/qmail/queue/todo -type f -exec rm {} \;

find /var/qmail/queue/remote -type f -exec rm {} \;

# /etc/init.d/qmail start

qmailshow.sh

#!/bin/sh
#show qmail queue

MESS=`find /var/qmail/queue/mess -type f | wc | awk '{print $1}'`
INFO=`find /var/qmail/queue/info -type f | wc | awk '{print $1}'`
LOCAL=`find /var/qmail/queue/local -type f | wc | awk '{print $1}'`
REMOTE=`find /var/qmail/queue/remote -type f | wc | awk '{print $1}'`
BOUNCE=`find /var/qmail/queue/bounce -type f | wc | awk '{print $1}'`

echo ""
echo "Current Qmail Queue:"
echo "--------------------"
echo "mess:             "$MESS
echo "info:             "$INFO
echo "local:            "$LOCAL
echo "remote:           "$REMOTE
echo "bounce:           "$BOUNCE
echo "--------------------"
date
echo ""

Bill’s Linux Qmail Toaster v. 0.9.4

说明:很早之前就借鉴bill的文章搭建qmail,基本按照他的操作一步步即可完成,很好的文章,一直在关注。
转载:http://billslinuxqmail.sourceforge.net/toaster/?page=toc
What’s a POP toaster?

I use Dan Bernstein’s definition described at http://cr.yp.to/qmail/toaster.html

What this toaster does and does not do

This “howto” will walk you through building a LinuxQmail”Toaster”. While these instructions are intended to work with popular Linux distributions, they will probably work on other flavors of Unix without too much modification. When complete you will have the following features available:

QmailSMTP Mail Server with SMTP-AUTH (Plain, Login, CRAM-MD5), TLS (SSL) support, and optional Virus/Spam Scanner.
POP3 Server with CRAM-MD5, APOP, and SSL support
IMAP Server with TLS (SSL) support
WebMail Server
Quota Support (usage viewable by webmail)
Autoresponder
Mailing Lists
Web-Based Email Administration

You can also chose to install the following options:

Graphical usage tracking
Anti-Spam and Anti-Virus
Challenge Responce new user verification

What this toaster does NOT do is act as a thorough guide toqmailor any of the other packages it installs. Such information is already available in the documentation, Life WithQmail, or other howtos/toasters. I only put this together to document all the commands/urls/procedures that I find myself repeating often. It’s intended to have a bit of a “copy and paste” feel to it aimed at the impatient (me). If it’s not sufficient for you, take the time to read the documentation of each package that’s to be installed. There’s no substitute for that.

Copy/paste ability of the toaster has been improved. If you are running on a known distribution you should be able to copy/paste all the text in white background boxes. Pink background boxes require you to follow the instructions they give.

The configure page isn’t as bad as it looks since much of it is set by the distribution. If your distribution is not already supported by the toaster, you should configure the toaster to make it work and send a copy of the settings to the toaster mailing list so it can be added to future versions.

Assumptions/Support

This document assumes that you are familiar with Unix system administration, mail/web protocols, etc. You don’t have to be a guru to make this work, but you will be patching and compiling source code, as well as editing configuration files. If you want a “point and click” install experience, this is not for you.

These instructions come with no warranty or guarantee. If you blow up your server, and lose business in the process, that’s your problem.

Support is not provided. There are mailing lists for all these packages, as well as one specific to this toaster. See links in the appendix for more information.

Commercial support is available. See http://merchbox.com/qmail.php for more information. There are also other sources of commercial support for the individual packages. See the respective documentation for each package for further information.

Toaster License

This document is covered by the same license as Life WithQmail, and the license is detailed here:

http://www.opencontent.org/opl.shtml Continue reading “Bill’s Linux Qmail Toaster v. 0.9.4”

Indimail

1、为避免依赖问题,建议采用yum的方式安装;
2、hostname设置为你要使用的域名,如:mail.mygod.com;
3、本安装不涉及web mail客户界面;
4、使用管理iwebadmin,需要有qmail,qmailadmin,vpopmail的相关命令行基础,以及配置信息等。

[root@server opt]# wget http://download.opensuse.org/repositories/home:/indimail/CentOS_5/home:indimail.repo
–2011-01-27 19:05:30– http://download.opensuse.org/repositories/home:/indimail/CentOS_5/home:indimail.repo
正在解析主机 download.opensuse.org… 195.135.221.134
Connecting to download.opensuse.org|195.135.221.134|:80… 已连接。
已发出 HTTP 请求,正在等待回应… 200 OK
长度:273
Saving to: `home:indimail.repo’

100%[=============================================================================================================================>] 273 –.-K/s in 0s

2011-01-27 19:05:32 (11.8 MB/s) – `home:indimail.repo’ saved [273/273]

[root@server opt]# ls
home:indimail.repo
[root@server opt]# mv home\:indimail.repo indimail.repo

[root@server opt]# mv indimail.repo /etc/yum.repos.d/
1、安装indimail,会自动匹配数据库,并安装;
yum install indimail
yum install indimail-devel
yum install indimail-shared
yum install iwebadmin
yum install procmail

2、根据提示操作,开启随机启动

/var/indimail/sbin/initsvc -on
/sbin/init q
/var/indimail/sbin/svctool –postmaster=postmaster@mygod.com –config=cert
cat /etc/inittab
查看进程和端口
ps -ef
netstat -nlpt

查看默认邮箱域名
cat /var/indimail/control/defaultdomain

3、检查indimail安装;
service mysqld start
[root@mail control]# pwd
/var/indimail/control
[root@mail control]# cat host.mysql
localhost:indimail:ssh-1.5-:/tmp/mysql.sock
上面是indimail连接数据库的默认账户和密码,需要在数据库中手动添加

[root@mail control]# rpm -V indimail

4、为了使用web界面的qmail管理
yum install httpd
service httpd start
cd /var/indimail/bin
./vadddomain mygod.com
./vdominfo mygod.com

5、浏览器登录http://ip/cgi-bin/iwebadmin 添加账户,测试;
查看日志信息
tail -f /var/log/indimail/pop3d.110/current
tail -f /var/log/indimail/smtpd.25/current

[root@mail etc]# /etc/init.d/indimail stop
Stopping /service/clamd: [ OK ]
Stopping /service/fetchmail: [ OK ]
Stopping /service/freshclam: [ OK ]
Stopping /service/greylist.1999: [ OK ]
Stopping /service/indisrvr.4000: [ OK ]
Stopping /service/inlookup.infifo: [ OK ]
Stopping /service/mysql.3306: [ OK ]
Stopping /service/proxy-imapd.4143: [ OK ]
Stopping /service/proxy-imapd-ssl.9143: [ OK ]
Stopping /service/proxy-pop3d.4110: [ OK ]
Stopping /service/proxy-pop3d-ssl.9110: [ OK ]
Stopping /service/pwdlookup: [ OK ]
Stopping /service/qmail-imapd.143: [ OK ]
Stopping /service/qmail-imapd-ssl.993: [ OK ]
Stopping /service/qmail-pop3d.110: [ OK ]
Stopping /service/qmail-pop3d-ssl.995: [ OK ]
Stopping /service/qmail-poppass.106: [ OK ]
Stopping /service/qmail-qmqpd.628: [ OK ]
Stopping /service/qmail-qmtpd.209: [ OK ]
Stopping /service/qmail-send.25: [ OK ]
Stopping /service/qmail-smtpd.25: [ OK ]
Stopping /service/qmail-smtpd.366: [ OK ]
Stopping /service/qmail-smtpd.465: [ OK ]
Stopping /service/qmail-smtpd.587: [ OK ]
Stopping /service/qmail-spamlog: [ OK ]
Stopping /service/qscanq: [ OK ]
Stopping svscan: [ OK ]
[root@mail etc]# /etc/init.d/indimail start
Starting svscan: [ OK ]