NOQUEUE: reject: RCPT from unknown[61.166.15.181]: 450 4.7.1 : Recipient address rejected: Policy Rejection- Please try later.; from= to= proto=SMTP helo=
NOQUEUE: reject: RCPT from unknown[113.108.240.140]: 450 4.7.1 : Recipient address rejected: Policy Rejection- Please try later.; from= to= proto=ESMTP helo=
9D07076E27E: to=<260923016@qq.com>, relay=mx3.qq.com[112.95.240.192]:25, delay=6.2, delays=0.01/0.01/1.3/4.8, dsn=5.0.0, status=bounced (host mx3.qq.com[112.95.240.192] said: 550 Sender frequency limited. http://service.mail.qq.com/cgi-bin/help?subtype=1&&id=20022&&no=1000723 (in reply to end of DATA command))
9D07076E27E: sender non-delivery notification: C872376E27D
NOQUEUE: reject: RCPT from unknown[123.54.188.15]: 450 4.1.8 : Sender address rejected: Domain not found; from= to= proto=ESMTP helo=
NOQUEUE: reject: RCPT from unknown[123.54.188.214]: 450 4.1.8 : Sender address rejected: Domain not found; from= to= proto=ESMTP helo=
NOQUEUE: reject: RCPT from unknown[123.54.170.189]: 450 4.1.8 : Sender address rejected: Domain not found; from= to= proto=ESMTP helo=
NOQUEUE: reject: RCPT from unknown[123.54.171.96]: 450 4.7.1 : Recipient address rejected: Policy Rejection- Please try later.; from= to= proto=ESMTP helo=

NOQUEUE: reject: RCPT from unknown[118.145.23.140]: 450 4.7.1 : Recipient address rejected: Policy Rejection- Please try later.; from= to= proto=ESMTP helo=
C3C2276E27E: to= (260923016@qq.com) , relay=mx3.qq.com[112.90.137.245]:25, delay=5.5, delays=0.01/0.01/2.1/3.4, dsn=5.0.0, status=bounced (host mx3.qq.com[112.90.137.245] said: 550 Mail content denied. http://service.mail.qq.com/cgi-bin/help?subtype=1&&id=20022&&no=1000726 (in reply to end of DATA command))
C3C2276E27E: sender non-delivery notification: 5263D76E27D

张工帮我看下这日志是什么意思,基本上每天都会有很多这样的日志

Logwatch 发来邮件报告中有以下错误

--------------------- amavis Begin ------------------------
2 messages checked and passed.
1 spam messages were found.

**Unmatched Entries**
NOTICE: reconnecting in response to: err=2006, HY000, DBD::mysql::st execute failed: MySQL server has gone away at (eval 102) line 166, line 490.: 1 Time(s)
NOTICE: reconnecting in response to: err=2006, HY000, DBD::mysql::st execute failed: MySQL server has gone away at (eval 102) line 166, line 138.: 1 Time(s)
NOTICE: reconnecting in response to: err=2006, HY000, DBD::mysql::st execute failed: MySQL server has gone away at (eval 102) line 166, line 154.: 1 Time(s)
---------------------- amavis End -------------------------

我不知道在哪里去修正这个错误

求解张工

忘了一个common.conf的nginx配置文件
# vi /opt/lamps/etc/common.conf
----------------------------------------------------

root $root;

location / {
  if (-d $request_filename) {
    rewrite ^/(.*)([^/])$ http://$host/$1$2/ permanent;
  }
  #if (!-e $request_filename) {
  #  rewrite ^(.+)$ /index.php last;
  #}
  # nginx文件类型错误解析导致远程命令执行漏洞 Begin, nginx < 1.0
 if ( $fastcgi_script_name ~ \..*\/.*php ) {
   return 403;
 }
 # nginx 文件类型错误解析导致远程命令执行漏洞 End
}

location ~ .*\.php$  {
  fastcgi_pass   unix:/opt/lamps/run/php-fpm.sock;
  fastcgi_param  SCRIPT_FILENAME    $root$fastcgi_script_name;
  fastcgi_param  QUERY_STRING       $query_string;
  fastcgi_param  REQUEST_METHOD     $request_method;
  fastcgi_param  CONTENT_TYPE       $content_type;
  fastcgi_param  CONTENT_LENGTH     $content_length;

  fastcgi_param  SCRIPT_NAME        $fastcgi_script_name;
  fastcgi_param  REQUEST_URI        $request_uri;
  fastcgi_param  DOCUMENT_URI       $document_uri;
  fastcgi_param  DOCUMENT_ROOT      $document_root;
  fastcgi_param  SERVER_PROTOCOL    $server_protocol;

  fastcgi_param  GATEWAY_INTERFACE  CGI/1.1;
  fastcgi_param  SERVER_SOFTWARE    nginx/$nginx_version;

  fastcgi_param  REMOTE_ADDR        $remote_addr;
  fastcgi_param  REMOTE_PORT        $remote_port;
  fastcgi_param  SERVER_ADDR        $server_addr;
  fastcgi_param  SERVER_PORT        $server_port;
  fastcgi_param  SERVER_NAME        $host;
  fastcgi_param  REDIRECT_STATUS    200;
 
  fastcgi_index index.php;
}

location ~ robots\.txt$ {
  access_log /dev/null;
  error_log /dev/null;
}

location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$ {
  access_log /dev/null;
  error_log /dev/null;
  expires 1h;
}

location ~ .*\.(js|css)?$ {
  access_log /dev/null;
  error_log /dev/null;
  expires 1h;
}

关于Roundcube, phpMyAdmin, phpLDAPadmin, phpPgAdmin迁移到nginx其实非常简单
这里把我的iredmail安装方法分享给大家

首先,假设有一个干净的系统环境,
我们直接下载iredmail.0.7.4进行安装,安装完成后是运行在apahce2下的,我们先停止apahce2服务,开始把iredmail 造移到nginx


我们需要一个 nginx + php + mysql 的 web 环境( for centos 5.8 x86_64)
如果你的系统是 centos 6.*,建议先下载安装 epel (http://rpmfind.net/linux/rpm2html/searc … el-release)
-----------------------------------------------------------------------------------------------------------------
1. 安装必要的包,主要用用编译

yum -y install \
"autoconf" \
"automake" \
"bison.x86_64" \
"bzip2-devel.x86_64" \
"cpp.x86_64" \
"cyrus-sasl.x86_64" \
"cyrus-sasl-plain.x86_64" \
"expect.x86_64" \
"flex" \
"fam-devel" \
"freetype-devel.x86_64" \
"gd.x86_64" \
"gcc.x86_64" \
"gcc-c++.x86_64" \
"gcc-g77" \
"gdbm-devel.x86_64" \
"glibc-devel" \
"glibc-headers" \
"glibc-kernheaders" \
"libtool.x86_64" \
"libxml2.x86_64" \
"libf2c" \
"libjpeg-devel.x86_64" \
"libpng-devel.x86_64" \
"libtiff-devel.x86_64" \
"libc-client-devel.x86_64" \
"libstdc++-devel.x86_64" \
"libmcrypt.x86_64" \
"libmcrypt-devel.x86_64" \
"libtool-ltdl.x86_64" \
"mhash.x86_64" \
"mhash-devel.x86_64" \
"libxslt-devel.x86_64" \
"libtidy-devel.x86_64" \
"libtidy.x86_64" \
"zlib-devel.x86_64" \
"expat.x86_64" \
"expat-devel.x86_64" \
"mysql.x86_64" \
"mysql-devel.x86_64" \
"mysql-server.x86_64" \
"neon.x86_64" \
"neon-devel.x86_64" \
"pcre.x86_64" \
"pcre-devel.x86_64" \
"libXp.x86_64" \
"yum-fastestmirror"

2. 下载安装 nginx-1.2.0最新稳定版(http://www.nginx.org/download/nginx-1.2.0.tar.gz)
# tar zxvf nginx-1.2.0.tar.gz
# cd nginx-1.2.0

 ./configure --prefix=/opt/lamps/nginx \
--user=nobody \
--group=nobody \
--conf-path=/opt/lamps/etc/nginx.conf \
--with-http_ssl_module \
--with-http_stub_status_module \
--http-fastcgi-temp-path=/opt/lamps/tmp/http_fastcgi_temp \
--http-proxy-temp-path=/opt/lamps/tmp/http_proxy_temp \
--http-client-body-temp-path=/opt/lamps/tmp/http_client_body_temp \
--http-log-path=/opt/lamps/logs/nginx_access_log \
--pid-path=/opt/lamps/run/nginx.pid \
--lock-path=/opt/lamps/run/nginx.lock \
--error-log-path=/opt/lamps/logs/nginx_error.log

# make && make install
# mkdir -p /opt/lamps/tmp/ (手动创建这个目录,因为nginx安装时不会自动创建,会造成启动失败)
# mkdir -p /opt/lamps/run/

3. 将 nginx 添加到系统服务
# vi /etc/init.d/nginx
---------------------------------------------------------------------------------------

#!/bin/bash
#
# chkconfig: 235 85 15
# description: Nginx is a high-performance web and proxy server.
#              It has a lot of features, but it's not for everyone.
# processname: nginx
# pidfile: /opt/lamps/run/nginx.pid
# config: /opt/lamps/etc/nginx.conf

nginxd=/opt/lamps/nginx/sbin/nginx
nginx_config=/opt/lamps/etc/nginx.conf
nginx_pid=/opt/lamps/run/nginx.pid
nginx_lock=/opt/lamps/run/nginx.lock

RETVAL=0
prog="nginx"

# Source function library.
. /etc/rc.d/init.d/functions

# Source networking configuration.
. /etc/sysconfig/network

# Check that networking is up.
[ ${NETWORKING} = "no" ] && exit 0

[ -x $nginxd ] || exit 0


# Start nginx daemons functions.
start() {
if [ -e $nginx_pid ];then
   echo "nginx already running...."
   exit 1
fi

   echo -n $"Starting $prog: "
   daemon $nginxd -c ${nginx_config}
   RETVAL=$?
   echo
   [ $RETVAL = 0 ] && touch $nginx_lock
   return $RETVAL

}

# Stop nginx daemons functions.
stop() {
        echo -n $"Stopping $prog: "
        killproc $nginxd
        RETVAL=$?
        echo
        [ $RETVAL = 0 ] && rm -f $nginx_lock $nginx_pid
}

# reload nginx service functions.
reload() {
    echo -n $"Reloading $prog: "
    #kill -HUP `cat ${nginx_pid}`
    killproc $nginxd -HUP
    RETVAL=$?
    echo
}

# See how we were called.
case "$1" in
start)
        start
        ;;

stop)
        stop
        ;;

reload)
        reload
        ;;

restart)
        stop
        start
        ;;

status)
        status $prog
        RETVAL=$?
        ;;
*)
        echo $"Usage: $prog {start|stop|restart|reload|status|help}"
        exit 1
esac

exit $RETVAL

-----------------------------------------------------------------------
# chmod +x /etc/init.d/nginx
# chkconfig nginx on

4. 下载安装 php-5.3.11 (http://www.php.net/downloads.php)
# tar jxvf php-5.3.11.tar.br2
# cd php-5.3.11

./configure \
--prefix=/opt/lamps/php \
--with-libdir=lib64 \
--with-config-file-path=/opt/lamps/etc \
--with-zlib-dir \
--with-libxml-dir \
--with-bz2 \
--with-mcrypt \
--with-mhash \
--with-curl \
--with-curlwrappers \
--with-gd \
--with-jpeg-dir \
--with-png-dir \
--with-freetype-dir \
--with-iconv-dir \
--with-pear \
--with-openssl \
--with-tidy \
--with-mysql=mysqlnd \
--with-mysqli=mysqlnd \
--with-pdo-mysql=mysqlnd \
# --with-oci8=share,instantclient,/opt/instantclient/ \
--enable-sqlite-utf8 \
--enable-bcmath \
--enable-xml \
--enable-exif \
--enable-imap \
--enable-zip \
--enable-ftp \
--enable-soap \
--enable-zend-multibyte \
--enable-mbstring \
--enable-sockets \
--enable-gd-native-ttf \
--enable-inline-optimization \
--enable-mbregex \
--enable-fpm \
--disable-debug

# make && make install

5. nginx 是以 fastcgi 方式运行 php的,所以我们配置
# cp /opt/lamps/php/etc/php-fpm.conf.default /opt/lamps/etc/php-fpm.conf
# vi /opt/lamps/etc/php-fpm.conf
--------------------------------------------------------------------------

;include=/opt/lamps/php/etc/fpm.d/*.conf
[global]
pid = /opt/lamps/run/php-fpm.pid
error_log = /opt/lamps/logs/php.log
log_level = error
emergency_restart_threshold = 10
emergency_restart_interval = 1m
process_control_timeout = 5s
daemonize = yes

[www]
listen = /opt/lamps/run/php-fpm.sock
listen.backlog          = -1
listen.allowed_clients  = 127.0.0.1
listen.owner            = nobody
listen.group            = nobody
listen.mode             = 0666

user                        = nobody
group                       = nobody
pm                          = dynamic
pm.max_children             = 5120
pm.start_servers            = 50
pm.min_spare_servers        = 50
pm.max_spare_servers        = 100
pm.max_requests             = 5120
;pm.status_path             = /status
;ping.path                  = /ping
;ping.response              = pong
request_terminate_timeout   = 0
request_slowlog_timeout     = 2s
slowlog                     = /opt/lamps/logs/php_slow.log
rlimit_files                = 65536
rlimit_core                 = 0

;chroot = 
;chdir = /var/www

catch_workers_output = yes

env[HOSTNAME] = $HOSTNAME
env[PATH] = /usr/local/bin:/usr/bin:/bin
env[TMP] = /tmp
env[TMPDIR] = /tmp
env[TEMP] = /tmp

php_admin_value[sendmail_path] = /usr/sbin/sendmail -t -i
php_flag[display_errors] = on
php_admin_value[error_log] = /opt/lamps/logs/php_error.log
php_admin_flag[log_errors] = on
php_admin_value[memory_limit] = 128M

--------------------------------------------------------------------------
6. 配置 php-fpm 系统服务
# vi /etc/init.d/php-fpm
--------------------------------------------------------------------------

#!/bin/bash
#
# chkconfig: 2345 80 20
# description: starts the PHP FastCGI Process Manager daemon
# processname: php-fpm
# pidfile: /opt/lamps/run/php-fpm.pid
# config: /opt/lamps/etc/php-fpm.conf

prefix=/opt/lamps/php
exec_prefix=${prefix}

php_fpm_BIN=${exec_prefix}/sbin/php-fpm
php_fpm_CONF=/opt/lamps/etc/php-fpm.conf
php_fpm_PID=/opt/lamps/run/php-fpm.pid


php_opts="--fpm-config $php_fpm_CONF"


wait_for_pid () {
        try=0

        while test $try -lt 35 ; do

                case "$1" in
                        'created')
                        if [ -f "$2" ] ; then
                                try=''
                                break
                        fi
                        ;;

                        'removed')
                        if [ ! -f "$2" ] ; then
                                try=''
                                break
                        fi
                        ;;
                esac

                echo -n .
                try=`expr $try + 1`
                sleep 1

        done

}

case "$1" in
        start)
                echo -n "Starting php-fpm "

                $php_fpm_BIN $php_opts

                if [ "$?" != 0 ] ; then
                        echo " failed"
                        exit 1
                fi

                wait_for_pid created $php_fpm_PID

                if [ -n "$try" ] ; then
                        echo " failed"
                        exit 1
                else
                        echo " done"
                fi
        ;;

        stop)
                echo -n "Gracefully shutting down php-fpm "

                if [ ! -r $php_fpm_PID ] ; then
                        echo "warning, no pid file found - php-fpm is not running ?"
                        exit 1
                fi

                kill -QUIT `cat $php_fpm_PID`

                wait_for_pid removed $php_fpm_PID

                if [ -n "$try" ] ; then
                        echo " failed. Use force-exit"
                        exit 1
                else
                        echo " done"
                fi
        ;;

        force-quit)
                echo -n "Terminating php-fpm "

                if [ ! -r $php_fpm_PID ] ; then
                        echo "warning, no pid file found - php-fpm is not running ?"
                        exit 1
                fi

                kill -TERM `cat $php_fpm_PID`

                wait_for_pid removed $php_fpm_PID

                if [ -n "$try" ] ; then
                        echo " failed"
                        exit 1
                else
                        echo " done"
                fi
        ;;

        restart)
                $0 stop
                $0 start
        ;;

        reload)

                echo -n "Reload service php-fpm "

                if [ ! -r $php_fpm_PID ] ; then
                        echo "warning, no pid file found - php-fpm is not running ?"
                        exit 1
                fi

                kill -USR2 `cat $php_fpm_PID`

                echo " done"
        ;;

        *)
                echo "Usage: $0 {start|stop|force-quit|restart|reload}"
                exit 1
        ;;

esac

-------------------------------------------------------------------------------------
# chmod +x /etc/init.d/php-fpm
# chkconfig php-fpm on
-------------------------------------------------------------------------------------
7. 配置 iredmail 相关站点
# vi /opt/lamps/etc/nginx.conf
-------------------------------------------------------------------------------------

user  nobody nobody;
worker_processes 8;
error_log  /opt/lamps/logs/nginx_error.log;
#error_log /dev/null;
pid        /opt/lamps/run/nginx.pid;

worker_rlimit_nofile 65536;

events{
  use epoll;
  worker_connections 65536;
}

http{
  include       mime.types;
  default_type  application/octet-stream;

  charset  utf-8;

  server_names_hash_bucket_size 128;
  client_header_buffer_size     32k;
  large_client_header_buffers   4 32k;
  client_max_body_size          8m;

  sendfile          on;
  tcp_nopush        on;
  tcp_nodelay       on;
  keepalive_timeout 60;
  
  server_name_in_redirect off;
  #optimize_server_names off;

  fastcgi_connect_timeout       300;
  fastcgi_send_timeout          300;
  fastcgi_read_timeout          300;
  fastcgi_buffer_size           64k;
  fastcgi_buffers               4 64k;
  fastcgi_busy_buffers_size     128k;
  fastcgi_temp_file_write_size  128k;

  gzip              on;
  gzip_min_length   1k;
  gzip_buffers      4 16k;
  gzip_http_version 1.0;
  gzip_comp_level   6;
  gzip_types        text/plain application/json application/x-javascript text/css application/xml;
  gzip_vary         on;

  log_format access '$remote_addr - $remote_user [$time_local] "$request" '
                      '$status $body_bytes_sent "$http_referer" '
                      '"$http_user_agent" $http_x_forwarded_for';
  index index.html index.htm index.php;

  server{
    listen  80;
    server_name status.domain.com;
    location / {
      stub_status on;
      access_log /dev/null;
      error_log /dev/null;
    }
  }

  # 以站点方式配置
  # [url=http://www.domain.com]www.domain.com[/url] -> /web/www.domain.com        你的主站
  # pma.domain.com -> /web/pma.domain.com        phpmyadmin
  # mail.domain.com -> /web/mail.domain.com      Roundcube
  # ldap.domain.com -> /web/ldap.domain.com      phpLDAPadmin
  # pg.domain.com -> /web/pg.domain.com          phpPgAdmin
  server{
    listen  80;
    server_name  *.com; 
    set $root /web/$host;
    include common.conf; 
    access_log /opt/lamps/logs/all_site.access.log access;    
  }

  # 因为 iredadmin 是python 程序,所以要单独配置
  server{
    listen  80;
    server_name mailadmin.domain.com;
    location / {
      include uwsgi_params;  
      uwsgi_pass unix:/opt/lamps/run/uwsgi.sock;  
      uwsgi_param UWSGI_PYHOME /web/mailadmin.domain.com/iredadmin.py/;  
      uwsgi_param UWSGI_SCRIPT iredadmin;  
      uwsgi_param UWSGI_CHDIR /web/mailadmin.domain.com/;
    }
    location /static {
      alias /web/mailadmin.domain.com/static;
    }
    access_log /dev/null; # 我这里禁用日志 uwsgi 已经有日志了
  }
}

-------------------------------------------------------------------------------------

OK,安装完成
启动相关服务
# service php-fpm start
# service nginx stsrt

最后用yum 删除 iredmail 安装的apache2 和php
# yum remove php-* httpd

==== 提供基本信息便于分析问题并得到快速回复 ====
- iRedMail 版本:
- 使用的 Linux/BSD 发行版名称及版本号:
- 与您的问题相关的日志信息:
====

我的环境使用最新的 nginx-1.2.0,关于编译安装这里不再复述,请查阅相关文档。
关于iredmail的安装,这里也不再复述。
1. 安装 uwsgi
首先去官方下载 uwsgi (http://projects.unbit.it/downloads/uwsgi-1.2.tar.gz)

# tar zxvf uwsgi-1.2.tar.gz
# cd uwsgi-1.2
# make ( 直接 make,不需要 make install )
# cp uwsgi /usr/bin/ (复制过去就安装好uwsgi了)

2. 配置 uwsgi 系统服务,可以用 service uwsgi start|stop|restart 操作
# vi /etc/init.d/uwsgi

#!/bin/bash
#
# chkconfig: 235 83 18
# description: starts the uWSGI Process Manager daemon
# processname: uwsgi
#

PROG='uWSGI'
BINPATH='/usr/bin/uwsgi'
PIDFILE='/var/run/uwsgi.pid'
SOCKFILE='/var/run/uwsgi.sock'
LOGFILE='/var/log/uwsgi.log'

check_status() {
    # Usage: check_status pid_number
    PID="${1}"
    l=$(ps -p ${PID} | wc -l | awk '{print $1}')
    if [ X"$l" == X"2" ]; then
        echo "running"
    else
        echo "stopped"
    fi
}

start() {
    if [ -f ${PIDFILE} ]; then
        PID="$(cat ${PIDFILE})"
        s="$(check_status ${PID})"

        if [ X"$s" == X"running" ]; then
            echo "${PROG} is already running."
        else
            rm -f ${PIDFILE} >/dev/null 2>&1
            echo "Starting ${PROG} ..."
            ${BINPATH} -s ${SOCKFILE} --vhost --pidfile ${PIDFILE} --daemonize ${LOGFILE}
        fi
    else
        echo "Starting ${PROG} ..."
        ${BINPATH} -s ${SOCKFILE} --vhost --pidfile ${PIDFILE} --daemonize ${LOGFILE}
    fi
    unset s
}

stop() {
    if [ -f ${PIDFILE} ]; then
        PID="$(cat ${PIDFILE})"
        s="$(check_status ${PID})"

        if [ X"$s" == X"running" ]; then
            echo "Stopping ${PROG} ..."
            kill -9 ${PID}
            if [ X"$?" == X"0" ]; then
                rm -f ${PIDFILE} >/dev/null 2>&1
                rm -f ${SOCKFILE} >/dev/null 2>&1
            else
                echo -e "\t\t[ FAILED ]"
            fi
        else
            echo "${PROG} is already stopped."
            rm -f ${PIDFILE} >/dev/null 2>&1
            rm -f ${SOCKFILE} >/dev/null 2>&1
        fi
    else
        echo "${PROG} is already stopped."
    fi
    unset s
}

status() {
    if [ -f ${PIDFILE} ]; then
        PID="$(cat ${PIDFILE})"
        s="$(check_status ${PID})"

        if [ X"$s" == X"running" ]; then
            echo "${PROG} is running."
        else
            echo "${PROG} is stopped."
        fi
    else
        echo "${PROG} is stopped."
    fi
    unset s
}

case "$1" in
    start) start ;;
    stop) stop ;;
    status) status ;;
    restart) stop && start ;;
    *)
        echo $"Usage: $0 {start|stop|restart|status}"
        RETVAL=1
        ;;
esac

# chmod +x /etc/init.d/uwsgi
# chkconfig uwsgi on
# service uwsgi start

3. 配置 nginx
(nginx 本身就支持 uwsgi 来运行 python 程序,所以我们配置nginx 的 uwsgi )
# vi /path/to/nginx.conf 添加一个站点

server{
    listen  80;
    server_name mailadmin.yourdomain.com;
    location / {
      include uwsgi_params;  
      uwsgi_pass unix:/var/run/uwsgi.sock;  
      uwsgi_param UWSGI_PYHOME /path/to/iRedAdmin-0.1.6/iredadmin.py/;  
      uwsgi_param UWSGI_SCRIPT iredadmin;  
      uwsgi_param UWSGI_CHDIR /path/to/iRedAdmin-0.1.6/;
    }
    location /static {
      alias /path/to/iRedAdmin-0.1.6/static;
    }
    access_log /dev/null;
  }

# service nginx restart

到些nginx + uwsgi + iredadmin 安装配置完成
访问 mailadmin.yourdomain.com 即可开工了

这个功能不会出现。
虽然有考虑加入 Nginx 支持,但是目前优先级不高,所以不会那么快支持。

我的意思并不是说nginx,是说能在dialog配置时,至少可以选择是否安装web环境,然后由用户自己手动配置web就可以了

iRedMail 默认的 Postfix 参数 smtpd_sender_restrictions 和 smtpd_recipient_restrictions 应该能挡掉这种类型的垃圾邮件的,麻烦您贴一下命令 'postconf -n' 的输出。另外,邮件标题里已经有 '***SPAM***' 标记,表示 Amavisd + SpamAssassin 已经识别到了这是垃圾邮件。

张工,我已经帖出postconf -n 信息了,你还没帮我看呢

张工,谢谢你的解答
======================= Postconf  Begin=========================
# postconf -n
alias_database = hash:/etc/postfix/aliases
alias_maps = hash:/etc/postfix/aliases
allow_min_user = no
biff = no
bounce_queue_lifetime = 1d
broken_sasl_auth_clients = yes
command_directory = /usr/sbin
config_directory = /etc/postfix
content_filter = smtp-amavis:[127.0.0.1]:10024
daemon_directory = /usr/libexec/postfix
data_directory = /var/lib/postfix
debug_peer_level = 2
delay_warning_time = 0h
disable_vrfy_command = yes
enable_original_recipient = no
home_mailbox = Maildir/
html_directory = no
inet_interfaces = all
inet_protocols = ipv4
mail_owner = postfix
mailbox_command = /usr/libexec/dovecot/deliver
mailq_path = /usr/bin/mailq.postfix
manpage_directory = /usr/share/man
maximal_backoff_time = 4000s
maximal_queue_lifetime = 1d
message_size_limit = 15728640
minimal_backoff_time = 300s
mydestination = $myhostname, localhost, localhost.localdomain, localhost.$myhostname
mydomain = *mydomain*.com
myhostname = mail.*mydomain*.com
mynetworks = 127.0.0.0/8
mynetworks_style = subnet
myorigin = mail.*mydomain*.com
newaliases_path = /usr/bin/newaliases.postfix
proxy_read_maps = $canonical_maps $lmtp_generic_maps $local_recipient_maps $mydestination $mynetworks $recipient_bcc_maps $recipient_canonical_maps $relay_domains $relay_recipient_maps $relocated_maps $sender_bcc_maps $sender_canonical_maps $smtp_generic_maps $smtpd_sender_login_maps $transport_maps $virtual_alias_domains $virtual_alias_maps $virtual_mailbox_domains $virtual_mailbox_maps $smtpd_sender_restrictions
queue_directory = /var/spool/postfix
queue_run_delay = 300s
readme_directory = /usr/share/doc/postfix-2.5.9/README_FILES
recipient_bcc_maps = proxy:mysql:/etc/postfix/mysql/recipient_bcc_maps_domain.cf, proxy:mysql:/etc/postfix/mysql/recipient_bcc_maps_user.cf
recipient_delimiter = +
relay_domains = $mydestination, proxy:mysql:/etc/postfix/mysql/relay_domains.cf
sample_directory = /usr/share/doc/postfix-2.5.9/samples
sender_bcc_maps = proxy:mysql:/etc/postfix/mysql/sender_bcc_maps_domain.cf, proxy:mysql:/etc/postfix/mysql/sender_bcc_maps_user.cf
sendmail_path = /usr/sbin/sendmail.postfix
setgid_group = postdrop
smtp_data_init_timeout = 240s
smtp_data_xfer_timeout = 600s
smtpd_data_restrictions = reject_unauth_pipelining
smtpd_enforce_tls = no
smtpd_helo_required = yes
smtpd_helo_restrictions = permit_mynetworks,permit_sasl_authenticated, check_helo_access pcre:/etc/postfix/helo_access.pcre
smtpd_recipient_restrictions = reject_unknown_sender_domain, reject_unknown_recipient_domain, reject_non_fqdn_sender, reject_non_fqdn_recipient, reject_unlisted_recipient, permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination, reject_non_fqdn_helo_hostname, reject_invalid_helo_hostname, check_policy_service inet:127.0.0.1:10031
smtpd_reject_unlisted_recipient = yes
smtpd_reject_unlisted_sender = yes
smtpd_sasl_auth_enable = yes
smtpd_sasl_authenticated_header = no
smtpd_sasl_local_domain =
smtpd_sasl_path = ./dovecot-auth
smtpd_sasl_security_options = noanonymous
smtpd_sasl_type = dovecot
smtpd_sender_login_maps = proxy:mysql:/etc/postfix/mysql/sender_login_maps.cf
smtpd_sender_restrictions = permit_mynetworks, reject_sender_login_mismatch, permit_sasl_authenticated
smtpd_tls_CAfile = /etc/pki/tls/certs/iRedMail_CA.pem
smtpd_tls_cert_file = /etc/pki/tls/certs/iRedMail_CA.pem
smtpd_tls_key_file = /etc/pki/tls/private/iRedMail.key
smtpd_tls_loglevel = 0
smtpd_tls_security_level = may
tls_random_source = dev:/dev/urandom
transport_maps = proxy:mysql:/etc/postfix/mysql/transport_maps_user.cf, proxy:mysql:/etc/postfix/mysql/transport_maps_domain.cf
unknown_local_recipient_reject_code = 550
virtual_alias_domains =
virtual_alias_maps = proxy:mysql:/etc/postfix/mysql/virtual_alias_maps.cf, proxy:mysql:/etc/postfix/mysql/domain_alias_maps.cf, proxy:mysql:/etc/postfix/mysql/catchall_maps.cf, proxy:mysql:/etc/postfix/mysql/domain_alias_catchall_maps.cf
virtual_gid_maps = static:502
virtual_mailbox_base = /web/vmail
virtual_mailbox_domains = proxy:mysql:/etc/postfix/mysql/virtual_mailbox_domains.cf
virtual_mailbox_maps = proxy:mysql:/etc/postfix/mysql/virtual_mailbox_maps.cf
virtual_minimum_uid = 501
virtual_transport = dovecot
virtual_uid_maps = static:501
=================================== Postconf End====================================
晕,被墙了,张工还是想点办法解决这个问题吧,不然我们访问网站很不方便
开发webmail其实也不太难的,只是我对邮件相关的技术细节不太了解,如果有时间希望我们可以一起合作开发.
当然我希望是用PHP开发,你的python还是不太普及。
另外有个我认为很重要的问题就是我的安装环境是nginx+php+mysql,iredmail安装起来就很不方便,自己改安装脚本又怕出错
要是安装程序可以在dialog中设定nginx,php相关环境变量就好了
期待下一个版本中加入自定义web环境功能

张工,最近我的邮件服务器老是收到垃圾邮件
=======================================================
主   题:***SPAM*** odiovts 企 业 白 领 核 心 办 公 技 能(PPT+Excel)高级应用2012
发件人:柯喁閰 <cqh@steelhome.cn>
收件人: <zhxxzi@yahoo.com.cn>
=======================================================

但收件人并不是我的邮件域,请问我要怎样防止垃圾邮件

别外
1. 怎样升级 policy 到 2.07
2. 我自己用php_imap 开发了个 webmail,我还想开发 mailadmin for php, policyadmin for php ,但不我清楚需要操作哪些数据库及表字段的含义,希望得到你的帮助
3. 为什么 www.iredmail.org打不开呢,很多 iredmail的 连接都打不开
4. 你这个论坛好象不能上传图片,不能展示我的webmail啦,吼吼

果然是这样,我删除邮箱账号和相应的mailbox目录,重建账号后就又可以收到邮件了,张工帮我查下是什么原因呢

晕,
发件人是:337805@testdomain.com 这是第三方邮箱
收件人是:service@mydomain.com, service@mydomin2.com, service@mydomain2.co.uk这三个是我的iredmail邮箱,都收不到邮件.
以前也发生过这种事,后来我删除了相应账号的Mailbox文件夹和账号,重建后又可以了


出于安全考虑我把相关域改了名字

服务器端和邮件客户端都没有什么提示

张工麻烦你帮我看下,如果需要我可以提供ssh给你
我的qq:337805

======================

==== 提供基本信息便于分析问题并得到快速回复 ====
- iRedMail 版本:
- 使用的 Linux/BSD 发行版名称及版本号:centos 5.3
- 与您的问题相关的日志信息:
====
# cat maillog
========================================================================================
Apr  4 10:33:58 centos postfix/smtpd[7427]: connect from unknown[183.60.2.43]
Apr  4 02:33:59 centos policyd: connection from: 127.0.0.1 port: 41653 slots: 0 of 2044 used
Apr  4 02:33:59 centos policyd: rcpt=49, greylist=new, host=183.60.2.43 (unknown), from=337805@testdomain.com, to=service@mydomain.com, size=0
Apr  4 10:33:59 centos postfix/smtpd[7427]: NOQUEUE: reject: RCPT from unknown[183.60.2.43]: 450 4.7.1 <service@mydomain.com>: Recipient address rejected: Policy Rejection- Please try later.; from=<337805@testdomain.com> to=<service@mydomain.com> proto=SMTP helo=<smtpbg127.testdomain.com>
Apr  4 10:33:59 centos postfix/smtpd[7427]: disconnect from unknown[183.60.2.43]
Apr  4 10:34:00 centos postfix/smtpd[7427]: connect from unknown[64.71.138.43]
Apr  4 02:34:00 centos policyd: rcpt=50, greylist=update, host=64.71.138.43 (unknown), from=337805@testdomain.com, to=service@mydomain2.co.uk, size=0
Apr  4 10:34:00 centos postfix/smtpd[7427]: B6EB05BD380: client=unknown[64.71.138.43]
Apr  4 10:34:01 centos postfix/cleanup[7432]: B6EB05BD380: message-id=<tencent_64D8B318567FD91E7E89A932@testdomain.com>
Apr  4 10:34:01 centos postfix/qmgr[3774]: B6EB05BD380: from=<337805@testdomain.com>, size=1844, nrcpt=1 (queue active)
Apr  4 10:34:01 centos postfix/smtpd[7427]: disconnect from unknown[64.71.138.43]
Apr  4 10:34:01 centos postfix/smtpd[7427]: connect from unknown[64.71.138.43]
Apr  4 02:34:02 centos policyd: rcpt=51, greylist=update, host=64.71.138.43 (unknown), from=337805@testdomain.com, to=service@mydomain2.com, size=0
Apr  4 10:34:02 centos postfix/smtpd[7427]: 727845BD382: client=unknown[64.71.138.43]
Apr  4 10:34:02 centos postfix/cleanup[7432]: 727845BD382: message-id=<tencent_64D8B318567FD91E7E89A932@testdomain.com>
Apr  4 10:34:02 centos postfix/qmgr[3774]: 727845BD382: from=<337805@testdomain.com>, size=1842, nrcpt=1 (queue active)
Apr  4 10:34:03 centos postfix/smtpd[7427]: disconnect from unknown[64.71.138.43]
Apr  4 10:34:47 centos postfix/smtpd[7472]: connect from localhost.localdomain[127.0.0.1]
Apr  4 10:34:47 centos postfix/smtpd[7472]: AE4F55BD387: client=localhost.localdomain[127.0.0.1]
Apr  4 10:34:47 centos postfix/cleanup[7432]: AE4F55BD387: message-id=<tencent_64D8B318567FD91E7E89A932@testdomain.com>
Apr  4 10:34:47 centos postfix/qmgr[3774]: AE4F55BD387: from=<337805@testdomain.com>, size=2290, nrcpt=1 (queue active)
Apr  4 10:34:47 centos postfix/smtpd[7472]: disconnect from localhost.localdomain[127.0.0.1]
Apr  4 10:34:47 centos postfix/smtpd[7472]: connect from localhost.localdomain[127.0.0.1]
Apr  4 10:34:47 centos postfix/smtpd[7472]: AF70A5BD388: client=localhost.localdomain[127.0.0.1]
Apr  4 10:34:47 centos postfix/cleanup[7432]: AF70A5BD388: message-id=<tencent_64D8B318567FD91E7E89A932@testdomain.com>
Apr  4 10:34:47 centos postfix/qmgr[3774]: AF70A5BD388: from=<337805@testdomain.com>, size=2284, nrcpt=1 (queue active)
Apr  4 10:34:47 centos postfix/smtpd[7472]: disconnect from localhost.localdomain[127.0.0.1]
Apr  4 10:34:47 centos amavis[8294]: (08294-11) Passed CLEAN, LOCAL [64.71.138.43] [64.71.138.43] <337805@testdomain.com> -> <service@mydomain2.co.uk>, Message-ID: <tencent_64D8B318567FD91E7E89A932@testdomain.com>, mail_id: gry1VfwABYDl, Hits: -7.118, size: 1843, queued_as: AE4F55BD387, 46492 ms
Apr  4 10:34:47 centos amavis[8295]: (08295-10) Passed CLEAN, LOCAL [64.71.138.43] [64.71.138.43] <337805@testdomain.com> -> <service@mydomain2.com>, Message-ID: <tencent_64D8B318567FD91E7E89A932@testdomain.com>, mail_id: uCEalnEL+vUj, Hits: -7.118, size: 1841, queued_as: AF70A5BD388, 44783 ms
Apr  4 10:34:47 centos postfix/smtp[7437]: B6EB05BD380: to=<service@mydomain2.co.uk>, relay=127.0.0.1[127.0.0.1]:10024, delay=47, delays=0.64/0/0/46, dsn=2.0.0, status=sent (250 2.0.0 from MTA([127.0.0.1]:10025): 250 2.0.0 Ok: queued as AE4F55BD387)
Apr  4 10:34:47 centos postfix/qmgr[3774]: B6EB05BD380: removed
Apr  4 10:34:47 centos postfix/smtp[7440]: 727845BD382: to=<service@mydomain2.com>, relay=127.0.0.1[127.0.0.1]:10024, delay=45, delays=0.63/0/0/45, dsn=2.0.0, status=sent (250 2.0.0 from MTA([127.0.0.1]:10025): 250 2.0.0 Ok: queued as AF70A5BD388)
Apr  4 10:34:47 centos postfix/qmgr[3774]: 727845BD382: removed
Apr  4 10:34:47 centos postfix/pipe[7475]: AE4F55BD387: to=<service@mydomain2.co.uk>, relay=dovecot, delay=0.05, delays=0/0/0/0.04, dsn=2.0.0, status=sent (delivered via dovecot service)
Apr  4 10:34:47 centos postfix/qmgr[3774]: AE4F55BD387: removed
Apr  4 10:34:47 centos postfix/pickup[5197]: BB7675BD382: uid=501 from=<337805@testdomain.com>
Apr  4 10:34:47 centos postfix/pipe[7476]: AF70A5BD388: to=<service@mydomain2.com>, relay=dovecot, delay=0.05, delays=0/0/0/0.04, dsn=2.0.0, status=sent (delivered via dovecot service)
Apr  4 10:34:47 centos postfix/qmgr[3774]: AF70A5BD388: removed
Apr  4 10:34:47 centos postfix/cleanup[7432]: BB7675BD382: message-id=<tencent_64D8B318567FD91E7E89A932@testdomain.com>
Apr  4 10:34:47 centos postfix/qmgr[3774]: BB7675BD382: from=<337805@testdomain.com>, size=2462, nrcpt=1 (queue active)
Apr  4 10:34:53 centos postfix/smtp[7481]: BB7675BD382: to=<2416045315@testdomain.com>, relay=mx3.testdomain.com[112.90.142.115]:25, delay=5.8, delays=0.01/0/4.2/1.6, dsn=5.0.0, status=bounced (host mx3.testdomain.com[112.90.142.115] said: 550 Mail content denied. http://service.mail.testdomain.com/cgi- … no=1000726 (in reply to end of DATA command))
Apr  4 10:34:53 centos postfix/cleanup[7432]: 934945BD383: message-id=<20120404023453.934945BD383@mail.mydomain.com>
Apr  4 10:34:53 centos postfix/bounce[7482]: BB7675BD382: sender non-delivery notification: 934945BD383
Apr  4 10:34:53 centos postfix/qmgr[3774]: 934945BD383: from=<>, size=4442, nrcpt=1 (queue active)
Apr  4 10:34:53 centos postfix/qmgr[3774]: BB7675BD382: removed
Apr  4 10:34:57 centos postfix/smtp[7481]: 934945BD383: to=<337805@testdomain.com>, relay=mx3.testdomain.com[112.90.138.89]:25, delay=4, delays=0/0/1.2/2.8, dsn=5.0.0, status=bounced (host mx3.testdomain.com[112.90.138.89] said: 550 Mail content denied. http://service.mail.testdomain.com/cgi- … no=1000726 (in reply to end of DATA command))
Apr  4 10:34:57 centos postfix/qmgr[3774]: 934945BD383: removed
Apr  4 10:34:59 centos postfix/smtpd[7427]: connect from unknown[183.60.2.43]
Apr  4 02:35:00 centos policyd: rcpt=52, greylist=abuse, host=183.60.2.43 (unknown), from=337805@testdomain.com, to=service@mydomain.com, size=0
Apr  4 10:35:00 centos postfix/smtpd[7427]: NOQUEUE: reject: RCPT from unknown[183.60.2.43]: 450 4.7.1 <service@mydomain.com>: Recipient address rejected: Policy Rejection- Please try later.; from=<337805@testdomain.com> to=<service@mydomain.com> proto=SMTP helo=<smtpbg127.testdomain.com>
Apr  4 10:35:00 centos postfix/smtpd[7427]: disconnect from unknown[183.60.2.43]
Apr  4 10:37:01 centos postfix/smtpd[7507]: connect from unknown[183.60.2.43]
Apr  4 02:37:02 centos policyd: connection from: 127.0.0.1 port: 41719 slots: 0 of 2044 used
Apr  4 02:37:02 centos policyd: rcpt=53, greylist=abuse, host=183.60.2.43 (unknown), from=337805@testdomain.com, to=service@mydomain.com, size=0
Apr  4 10:37:02 centos postfix/smtpd[7507]: NOQUEUE: reject: RCPT from unknown[183.60.2.43]: 450 4.7.1 <service@mydomain.com>: Recipient address rejected: Policy Rejection- Please try later.; from=<337805@testdomain.com> to=<service@mydomain.com> proto=SMTP helo=<smtpbg127.testdomain.com>
Apr  4 10:37:02 centos postfix/smtpd[7507]: disconnect from unknown[183.60.2.43]
======================================================================================
# cat sieve.log
=======================================================================================
Apr 04 10:16:04 deliver(vopo@mydomain.com): Info: msgid=<tencent_0C3222960DB3B1A04076A777@testdomain.com>: saved mail to INBOX
Apr 04 10:16:14 deliver(service@mydomain2.co.uk): Info: msgid=<tencent_0C3222960DB3B1A04076A777@testdomain.com>: saved mail to INBOX
Apr 04 10:16:24 deliver(service@mydomain2.com): Info: sieve: msgid=<tencent_0C3222960DB3B1A04076A777@testdomain.com>: forwarded to <616847581@testdomain.com>
Apr 04 10:34:47 deliver(service@mydomain2.co.uk): Info: msgid=<tencent_64D8B318567FD91E7E89A932@testdomain.com>: saved mail to INBOX
Apr 04 10:34:47 deliver(service@mydomain2.com): Info: sieve: msgid=<tencent_64D8B318567FD91E7E89A932@testdomain.com>: forwarded to <2416045315@testdomain.com>
==========================================================================================
# service policyd status
policyd (pid  4566) 正在运行...
# service dovecot status
dovecot (pid  3581) 正在运行...
# service amavisd status
amavisd (pid 8295 8294 7970) 正在运行...
# service postfix status
master (pid 3767) 正在运行...
# service pysieved status
pysieved (pid  4596) 正在运行...
# service policyd status
policyd (pid  4566) 正在运行...

==========================================
不知道怎么回事,就是收不到邮件,张工帮我看看是怎么回事,谢谢了

呵呵
张工老大^_^, 感谢你的回复
我的问题是这样:
1.原本的主域名被人中继发了N多垃圾邮件,IP被列入黑名单了
2.我想更换主域,指向另一个IP(我有多个IP),因为现在的主域名是新网的,无法添加dikm记录。
3.怎样禁止公网的SMTP,只允许本地smtp中继呢
4.你是说添加一个虚拟域吗?虚拟域也可以用来做中继吗?
5.总之我要的功能就是让本地网络上的web站点可以通过本地的smtp发送邮件给客户,和接收邮件。

老大,我的邮件服务器要换域名。请问要修改哪些东西
我的邮件:337805@qq.com

问题找到了
storagebasedirectory=''
storagenode=''
数据库中这两项为空,不知道是为什么,我手动添加这两项内容后就OK了,
我的服务器是使用nginx+php+php-fpm+mysql,我怕ieadadmin不支持nginx下的web.py,所以没有安装ieadadmin,而是使用postfixadmin
看来postfixadmin在创建邮箱时并没有把storagebasedirectory,storagenode写入数据库。
但安装iredmail时的第一个账号应该对storagebasedirectory,storagenode进行设置的呀,事实上也没有,postmaster@domain.com的这两项也为空

现在,我是去改/etc/dovecot-mysql.conf中的sql还是去改postfixadmin呢,要怎样改才正确?
storagebasedirectory,storagenode, maildir分别是什么做为,是否可能随意设置,如:
storagebasedirectory=/vmail
storagenode=/user@domain.com
maildir=/store
或者
storagebasedirectory=''
storagenode=''
maildir=/vmail/user@domain.com/store

您好:
感谢你的回复,我好象并没有在英文论坛发帖子,还他的地址也不知道在哪里,不知道为何。不过我给你发过一个邮件。
以下是关于此问题的/etc/dovecot*.conf配置内容(去除了注解):
# cat /etc/dovecot.conf

protocols = pop3 pop3s imap imaps managesieve
listen = *
mail_uid = 501
mail_gid = 502
first_valid_uid = 501
last_valid_uid = 501
log_path = /var/log/dovecot.log
mail_process_size = 1024
disable_plaintext_auth = no
login_process_per_connection=yes
auth_default_realm = domain.com
plugin {
    quota_warning = storage=85%% /usr/local/bin/dovecot-quota-warning.sh 85
    quota_warning2 = storage=90%% /usr/local/bin/dovecot-quota-warning.sh 90
    quota_warning3 = storage=95%% /usr/local/bin/dovecot-quota-warning.sh 95
}
ssl = yes
verbose_ssl = no
ssl_key_file = /etc/pki/tls/private/iRedMail.key
ssl_cert_file = /etc/pki/tls/certs/iRedMail_CA.pem
ssl_ca_file = /etc/pki/tls/certs/iRedMail_CA.pem
mail_location = maildir:/%Lh/Maildir/:INDEX=/%Lh/Maildir/
plugin {
    quota = dict:user::proxy::quotadict
    quota_rule = *:storage=0
}
dict {
    expire = db:/var/lib/dovecot/expire/expire.db
}
plugin {
    expire = Trash 7 Trash/* 7 Junk 30
    expire_dict = proxy::expire
    auth_socket_path = /var/run/dovecot/auth-master
}
plugin {
    sieve = /pathtovmail/sieve/%Ld/%Ln/dovecot.sieve
}
protocol lda {
    postmaster_address = root
    auth_socket_path = /var/run/dovecot/auth-master
    mail_plugins = quota sieve autocreate
    sieve_global_path = /pathtovmail/sieve/dovecot.sieve
    log_path = /var/log/sieve.log
}
protocol imap {
    mail_plugins = quota imap_quota autocreate
    imap_client_workarounds = tb-extra-mailbox-sep
}
protocol pop3 {
    mail_plugins = quota
    pop3_uidl_format = %08Xu%08Xv
    pop3_client_workarounds = outlook-no-nuls oe-ns-eoh
}
auth default {
    mechanisms = plain login
    user = vmail
    passdb sql {
        args = /etc/dovecot-mysql.conf
    }
    userdb sql {
        args = /etc/dovecot-mysql.conf
    }
    socket listen {
        master {
            path = /var/run/dovecot/auth-master
            mode = 0666
            user = vmail
            group = vmail
        }
        client {
            path = /var/spool/postfix/dovecot-auth
            mode = 0666
            user = postfix
            group = postfix
        }
    }
}
plugin {
    autocreate = INBOX
    autocreate2 = Sent
    autocreate3 = Trash
    autocreate4 = Drafts
    autocreate5 = Junk
    autosubscribe = INBOX
    autosubscribe2 = Sent
    autosubscribe3 = Trash
    autosubscribe4 = Drafts
    autosubscribe5 = Junk
}
dict {
    quotadict = mysql:/etc/dovecot-used-quota.conf
}
namespace private {
    separator = /
    prefix =
    inbox = yes
}
namespace shared {
    separator = /
    prefix = Shared/%%u/
    location = maildir:/%%Lh/Maildir/:INDEX=/%%Lh/Maildir/Shared/%%u
    subscriptions = yes
    list = children
}
plugin {
    acl = vfile
    acl_shared_dict = proxy::acl
}
dict {
    acl = mysql:/etc/dovecot-share-folder.conf
}
protocol managesieve {
    listen = 127.0.0.1:4190 # 原端口安装后是 2000,与 pysieved冲突,所以这里改了
}
plugin {
    sieve = /pathtovmail/sieve/%Ld/%Ln/dovecot.sieve
    sieve_dir = /pathtovmail/sieve/%Ld/%Ln/
}

# cat /etc/dovecot-mysql.conf

driver = mysql
default_pass_scheme = CRYPT
connect = host=127.0.0.1 dbname=vmail user=vmail password=pwd
password_query = SELECT password FROM mailbox WHERE username='%u' AND active='1'
user_query = SELECT CONCAT(mailbox.storagebasedirectory, '/', mailbox.storagenode, '/', mailbox.maildir) AS home, CONCAT('*:bytes=', mailbox.quota*1048576) AS quota_rule FROM mailbox,domain WHERE mailbox.username='%u' AND mailbox.domain='%d' AND mailbox.enable%Ls%Lc=1 AND mailbox.domain=domain.domain AND domain.backupmx=0 AND domain.active=1 AND mailbox.active=1

# cat /etc/dovecot-used-quota.conf

connect = host=127.0.0.1 dbname=vmail user=vmailadmin password=pwd
map {
    pattern = priv/quota/storage
    table = mailbox
    username_field = username
    value_field = bytes
}
map {
    pattern = priv/quota/messages
    table = mailbox
    username_field = username
    value_field = messages
}

# cat /etc/dovecot-share-folder.conf

connect = host=127.0.0.1 dbname=vmail user=vmailadmin password=pwd
map {
    pattern = shared/shared-boxes/user/$to/$from
    table = share_folder
    value_field = dummy

    fields {
        from_user = $from
        to_user = $to
    }
}
SELECT `username` , `domain` , `name` , `transport` , `rank` , `local_part` , `storagebasedirectory` , `storagenode` , `maildir`
FROM `mailbox`
WHERE username = 'service@domain.com'

结果为:
username='service@domain.com'
domain=domain.com
name=service
transport=''
rank=normal
local_part=service
storagebasedirectory=''
storagenode=''
maildir = service@domain.com/

找到问题了
# vi /etc/dovecot.conf
protocol managesieve {
    listen = 127.0.0.1:2000 # 这个端口与pysieved的端口冲突了,改成4190就OK
    ......
    listen = 127.0.0.1:4190

## Centos 5.6

# service pysieved start
Starting pysieved:Traceback (most recent call last):
  File "/usr/sbin/pysieved", line 173, in ?
    main()
  File "/usr/sbin/pysieved", line 165, in main
    s = Server((addr, port), handler)
  File "/usr/lib64/python2.4/SocketServer.py", line 330, in __init__
    self.server_bind()
  File "/usr/lib64/python2.4/SocketServer.py", line 341, in server_bind
    self.socket.bind(self.server_address)
  File "<string>", line 1, in bind
socket.error: (98, 'Address already in use')
                                                           [FAILED]

# cat /etc/pysieved.ini
[main]
auth    = Dovecot
userdb  = Virtual
storage = Dovecot
#bindaddr = 127.0.0.1
port      = 2000
pidfile   = /var/run/pysieved/pysieved.pid

[Virtual]
base = /******vmail/sieve
uid  = 501
gid  = 502
hostdirs = True

[Dovecot]
service = sieve
mux     = /var/spool/postfix/dovecot-auth
master  = /var/run/dovecot/auth-master
sievec  = /usr/libexec/dovecot/sievec
scripts = .
active  = dovecot.sieve
uid     = 501
gid     = 502
老大帮我看看呀

Sep 09 15:37:02 IMAP(www@domain.com): Error: mkdir(///domain.com/w/w/w/www-2011.09.09.10.25.19//Maildir/cur) failed: Permission denied (euid=501(vmail) egid=502(vmail) missing +w perm: //)
Sep 09 15:37:02 IMAP(www@domain.com): Error: Sending log messages too fast, throttling..
Sep 09 15:37:03 IMAP(www@domain.com): Error: mkdir(///domain.com/w/w/w/www-2011.09.09.10.25.19//Maildir/cur) failed: Permission denied (euid=501(vmail) egid=502(vmail) missing +w perm: //)
Sep 09 15:37:03 IMAP(www@domain.com): Error: mkdir(///domain.com/w/w/w/www-2011.09.09.10.25.19//Maildir/cur) failed: Permission denied (euid=501(vmail) egid=502(vmail) missing +w perm: //)
Sep 09 15:37:03 IMAP(www@domain.com): Info: Disconnected: Logged out bytes=140/701
Sep 09 15:38:02 imap-login: Info: Login: user=<www@domain.com>, method=PLAIN, rip=127.0.0.1, lip=127.0.0.1, secured
Sep 09 15:38:02 IMAP(www@domain.com): Error: mkdir(///domain.com/w/w/w/www-2011.09.09.10.25.19//Maildir/cur) failed: Permission denied (euid=501(vmail) egid=502(vmail) missing +w perm: //)
Sep 09 15:38:02 IMAP(www@domain.com): Error: mkdir(///domain.com/w/w/w/www-2011.09.09.10.25.19//Maildir/.Sent/cur) failed: Permission denied (euid=501(vmail) egid=502(vmail) missing +w perm: //)
Sep 09 15:38:02 IMAP(www@domain.com): Error: mkdir(///domain.com/w/w/w/www-2011.09.09.10.25.19//Maildir/.Trash/cur) failed: Permission denied (euid=501(vmail) egid=502(vmail) missing +w perm: //)
Sep 09 15:38:02 IMAP(www@domain.com): Error: mkdir(///domain.com/w/w/w/www-2011.09.09.10.25.19//Maildir/.Drafts/cur) failed: Permission denied (euid=501(vmail) egid=502(vmail) missing +w perm: //)
Sep 09 15:38:02 IMAP(www@domain.com): Error: mkdir(///domain.com/w/w/w/www-2011.09.09.10.25.19//Maildir/.Junk/cur) failed: Permission denied (euid=501(vmail) egid=502(vmail) missing +w perm: //)
Sep 09 15:38:02 IMAP(www@domain.com): Error: mkdir_parents(///domain.com/w/w/w/www-2011.09.09.10.25.19//Maildir) failed: Permission denied
Sep 09 15:38:02 IMAP(www@domain.com): Error: mkdir_parents(///domain.com/w/w/w/www-2011.09.09.10.25.19//Maildir) failed: Permission denied
Sep 09 15:38:02 IMAP(www@domain.com): Error: mkdir_parents(///domain.com/w/w/w/www-2011.09.09.10.25.19//Maildir) failed: Permission denied
Sep 09 15:38:02 IMAP(www@domain.com): Error: mkdir_parents(///domain.com/w/w/w/www-2011.09.09.10.25.19//Maildir) failed: Permission denied
Sep 09 15:38:02 IMAP(www@domain.com): Error: mkdir_parents(///domain.com/w/w/w/www-2011.09.09.10.25.19//Maildir) failed: Permission denied

dovecot: Feb 28 16:23:14 Info: pop3-login: Login: user=<ec51@jfppw.com>, method=PLAIN, rip=118.116.12.77, lip=121.14.119.137
dovecot: Feb 28 16:23:14 Error: POP3(ec51@jfppw.com): mkdir(//jfppw.com/ec51//Maildir/cur) failed: Permission denied (euid=500(vmail) egid=500(vmail) missing +w perm: /)
dovecot: Feb 28 16:23:14 Error: POP3(ec51@jfppw.com): Couldn't open INBOX: Internal error occurred. Refer to server log for more information. [2010-02-28 16:23:14]
dovecot: Feb 28 16:23:14 Info: POP3(ec51@jfppw.com): Couldn't open INBOX top=0/0, retr=0/0, del=0/0, size=0

请老大帮我看看咋的了