1

(1 篇回复,发表在 iRedMail 技术支持)

System ubuntu1604
iRedMail    v0.9.8
iRedAdmin    v0.9.1 (LDAP)

问题描述

Dovecot配置

root@fk:~# doveconf -n
# 2.2.22 (fe789d2): /etc/dovecot/dovecot.conf
# Pigeonhole version 0.4.13 (7b14904)
# OS: Linux 4.4.0-116-generic x86_64 Ubuntu 16.04.4 LTS
auth_master_user_separator = *
auth_mechanisms = PLAIN LOGIN
deliver_log_format = from=%{from}, envelope_sender=%{from_envelope}, subject=%{subject}, msgid=%m, size=%{size}, %$
dict {
  acl = mysql:/etc/dovecot/dovecot-share-folder.conf
  quotadict = mysql:/etc/dovecot/dovecot-used-quota.conf
}
first_valid_uid = 2000
last_valid_uid = 2000
listen = * [::]
mail_gid = 2000
mail_location = maildir:%Lh/Maildir/:INDEX=%Lh/Maildir/
mail_plugins = quota mailbox_alias acl mail_log notify stats welcome
mail_uid = 2000
managesieve_notify_capability = mailto
managesieve_sieve_capability = fileinto reject envelope encoded-character vacation subaddress comparator-i;ascii-numeric relational regex imap4flags copy include variables body enotify environment mailbox date index ihave duplicate mime foreverypart extracttext
namespace {
  inbox = yes
  location =
  mailbox Archive {
    auto = no
    special_use = \Archive
  }
  mailbox Archives {
    auto = no
    special_use = \Archive
  }
  mailbox "Deleted Messages" {
    auto = no
    special_use = \Trash
  }
  mailbox Drafts {
    auto = subscribe
    special_use = \Drafts
  }
  mailbox Junk {
    auto = subscribe
    special_use = \Junk
  }
  mailbox "Junk E-mail" {
    auto = no
    special_use = \Junk
  }
  mailbox Sent {
    auto = subscribe
    special_use = \Sent
  }
  mailbox "Sent Items" {
    auto = no
    special_use = \Sent
  }
  mailbox "Sent Messages" {
    auto = no
    special_use = \Sent
  }
  mailbox Spam {
    auto = no
    special_use = \Junk
  }
  mailbox Trash {
    auto = subscribe
    special_use = \Trash
  }
  prefix =
  separator = /
  type = private
}
namespace {
  list = children
  location = maildir:%%Lh/Maildir/:INDEX=%%Lh/Maildir/Shared/%%Ld/%%Ln
  prefix = Shared/%%u/
  separator = /
  subscriptions = yes
  type = shared
}
passdb {
  args = /etc/dovecot/dovecot-ldap.conf
  driver = ldap
}
passdb {
  args = /etc/dovecot/dovecot-master-users
  driver = passwd-file
  master = yes
}
plugin {
  acl = vfile
  acl_shared_dict = proxy::acl
  mail_log_events = delete undelete expunge mailbox_delete mailbox_rename
  mail_log_fields = uid box msgid size from subject
  mailbox_alias_new = Sent Messages
  mailbox_alias_new2 = Sent Items
  mailbox_alias_old = Sent
  mailbox_alias_old2 = Sent
  quota = dict:user::proxy::quotadict
  quota_grace = 10%%
  quota_warning = storage=100%% quota-warning 100 %u
  quota_warning2 = storage=95%% quota-warning 95 %u
  quota_warning3 = storage=90%% quota-warning 90 %u
  quota_warning4 = storage=85%% quota-warning 85 %u
  sieve = %Lh/sieve/dovecot.sieve
  sieve_before = /var/vmail/sieve/dovecot.sieve
  sieve_dir = %Lh/sieve
  sieve_global_dir = /var/vmail/sieve
  sieve_max_redirects = 30
  stats_refresh = 30 secs
  stats_track_cmds = yes
  welcome_script = welcome %u
  welcome_wait = yes
}
protocols = pop3 imap sieve lmtp
service auth {
  unix_listener /var/spool/postfix/private/dovecot-auth {
    group = postfix
    mode = 0666
    user = postfix
  }
  unix_listener auth-master {
    group = vmail
    mode = 0666
    user = vmail
  }
  unix_listener auth-userdb {
    group = vmail
    mode = 0660
    user = vmail
  }
}
service dict {
  unix_listener dict {
    group = vmail
    mode = 0660
    user = vmail
  }
}
service imap-login {
  process_limit = 500
  service_count = 1
}
service lmtp {
  executable = lmtp -L
  inet_listener lmtp {
    address = 127.0.0.1
    port = 24
  }
  process_min_avail = 5
  unix_listener /var/spool/postfix/private/dovecot-lmtp {
    group = postfix
    mode = 0600
    user = postfix
  }
  user = vmail
}
service managesieve-login {
  inet_listener sieve {
    address = 127.0.0.1
    port = 4190
  }
}
service pop3-login {
  service_count = 1
}
service quota-warning {
  executable = script /usr/local/bin/dovecot-quota-warning.sh
  unix_listener quota-warning {
    group = vmail
    mode = 0660
    user = vmail
  }
}
service stats {
  fifo_listener stats-mail {
    mode = 0644
    user = vmail
  }
  inet_listener {
    address = 127.0.0.1
    port = 24242
  }
}
service welcome {
  executable = script /usr/local/bin/welcome.sh
  unix_listener welcome {
    group = vmail
    mode = 0660
    user = vmail
  }
}
ssl = required
ssl_cert = </etc/ssl/certs/iRedMail.crt
ssl_cipher_list = ECDH+AESGCM:DH+AESGCM:ECDH+AES256:DH+AES256:ECDH+AES128:DH+AES:ECDH+3DES:DH+3DES:RSA+AESGCM:RSA+AES:RSA+3DES:!aNULL:!MD5
ssl_key = </etc/ssl/private/iRedMail.key
ssl_prefer_server_ciphers = yes
ssl_protocols = !SSLv2 !SSLv3
syslog_facility = local5
userdb {
  args = /etc/dovecot/dovecot-ldap.conf
  driver = ldap
}
protocol lda {
  lda_mailbox_autocreate = yes
  lda_mailbox_autosubscribe = yes
  mail_plugins = quota mailbox_alias acl mail_log notify stats welcome sieve
}
protocol lmtp {
  lmtp_save_to_detail_mailbox = yes
  mail_plugins = quota sieve
  recipient_delimiter = +
}
protocol imap {
  imap_client_workarounds = tb-extra-mailbox-sep
  mail_max_userip_connections = 30
  mail_plugins = quota mailbox_alias acl mail_log notify stats welcome imap_quota imap_acl imap_stats
}
protocol pop3 {
  mail_max_userip_connections = 30
  mail_plugins = quota mailbox_alias acl mail_log notify stats welcome
  pop3_client_workarounds = outlook-no-nuls oe-ns-eoh
  pop3_uidl_format = %08Xu%08Xv
}

======================================================================
以下是welcome.sh

root@fk:~# vi /usr/local/bin/welcome.sh

#!/bin/sh
USER=$1
cat << EOF | /usr/lib/dovecot/dovecot-lda -d $USER
From: admin at fk.com
Subject: Welcome


welcome!

EOF




--
fk.com

Tel: 0769-xxxxxxxx


rc登录报错
Aug 14 13:57:55 fk roundcube: <ln4e1sqe> IMAP Error: Login failed for postmaster@mail.abc123.com from 192.168.1.5. LOGIN: Internal error occurred. Refer to server log for more information. in /opt/www/roundcubemail-1.3.6/program/lib/Roundcube/rcube_imap.php on line 196 (POST /mail/?_task=login&_action=login)
Aug 14 13:58:48 fk roundcube: <ln4e1sqe> IMAP Error: Login failed for postmaster@mail.abc123.com from 192.168.1.5. LOGIN: Internal error occurred. Refer to server log for more information. in /opt/www/roundcubemail-1.3.6/program/lib/Roundcube/rcube_imap.php on line 196 (POST /mail/?_task=login&_action=login)
Aug 14 14:15:25 fk roundcube: <fd4ijo2s> IMAP Error: Login failed for postmaster@mail.abc123.com from 192.168.1.5. LOGIN: Internal error occurred. Refer to server log for more information. in /opt/www/roundcubemail-1.3.6/program/lib/Roundcube/rcube_imap.php on line 196 (POST /mail/?_task=login&_action=login)




dovecot status

root@fk:~# service dovecot status
● dovecot.service - Dovecot IMAP/POP3 email server
   Loaded: loaded (/lib/systemd/system/dovecot.service; enabled; vendor preset: enabled)
   Active: active (running) since Tue 2018-08-14 14:14:53 CST; 1min 17s ago
     Docs: man:dovecot(1)
           http://wiki2.dovecot.org/
  Process: 10002 ExecStop=/usr/bin/doveadm stop (code=exited, status=0/SUCCESS)
  Process: 10010 ExecStart=/usr/sbin/dovecot (code=exited, status=0/SUCCESS)
Main PID: 10014 (dovecot)
    Tasks: 11
   Memory: 6.8M
      CPU: 273ms
   CGroup: /system.slice/dovecot.service
           ├─10014 /usr/sbin/dovecot
           ├─10029 dovecot/lmtp -L
           ├─10031 dovecot/anvil
           ├─10032 dovecot/log
           ├─10033 dovecot/ssl-params
           ├─10035 dovecot/lmtp -L
           ├─10036 dovecot/lmtp -L
           ├─10037 dovecot/lmtp -L
           ├─10039 dovecot/lmtp -L
           ├─10040 dovecot/config
           └─10064 dovecot/auth

Aug 14 14:14:53 fk systemd[1]: Starting Dovecot IMAP/POP3 email server...
Aug 14 14:14:53 fk systemd[1]: dovecot.service: PID file /var/run/dovecot/master.pid not readable (yet?) after start: No such file or directory
Aug 14 14:14:53 fk dovecot[10014]: master: Dovecot v2.2.22 (fe789d2) starting up for pop3, imap, sieve, lmtp (core dumps disabled)
Aug 14 14:14:53 fk systemd[1]: Started Dovecot IMAP/POP3 email server.
Aug 14 14:15:25 fk dovecot[10032]: imap-login: Login: user=<postmaster@mail.abc123.com>, method=PLAIN, rip=127.0.0.1, lip=127.0.0.1, mpid=10065, secured,
Aug 14 14:15:25 fk dovecot[10032]: imap(postmaster@mail.abc123.com): Error: Plugin 'welcome' not found from directory /usr/lib/dovecot/modules
Aug 14 14:15:25 fk dovecot[10032]: imap(postmaster@mail.abc123.com): Error: Internal error occurred. Refer to server log for more information.
lines 1-31/31 (END)


为什么提示找不到modules,这是缺少什么modules没有安装吗?老大这该怎么解决?

If you have postscreen service enabled, you should add DNSBL services for postscreen service instead, so please don't use any reject_rbl_client in smtpd_recipient_restrictions parameter, but use below one instead:

看了文档有点弄不明白,怎么知道是否已经启用postscreen ?请张工指导下!

3

(5 篇回复,发表在 iRedMail 技术支持)

ZhangHuangbin 写道:

使用的是开源版的 iRedAdmin 么?可能有这个问题,没有更新。

是的,张工,确实是开源版的,那这个问题估计什么时候会更新解决?

4

(2 篇回复,发表在 iRedMail 技术支持)

谢谢张工,明白了!就让他们坚持用复杂密码吧

5

(5 篇回复,发表在 iRedMail 技术支持)

ZhangHuangbin 写道:

修改了 iRedAdmin 设置后是否重启了 Apache 或 uwsgi (如果你用 nginx 作为 web server)服务?

有重启apache服务

6

(5 篇回复,发表在 iRedMail 技术支持)

==== 必填信息。没有填写将不予回复 ====
- iRedMail 版本号:9.5
- 使用哪个数据库存储用户帐号(OpenLDAP,MySQL,PostgreSQL):LDAP
- 使用的 Linux/BSD 发行版名称及版本号:ubuntu14.04
- 与您的问题相关的日志信息:
====
root@mail:~# dpkg-reconfigure tzdata

Current default time zone: 'Asia/Shanghai'
Local time is now:      Sat Jul  9 09:06:33 CST 2016.
Universal Time is now:  Sat Jul  9 01:06:33 UTC 2016.
系统时间应该是没有问题的
也修改了iredadmin的settings.py文件

############################################################
# DO NOT TOUCH BELOW LINE.
#
# Import default settings.
# You can always override default settings by placing custom settings in this
# file.
from libs.default_settings import *

############################################################
# timezone.
LOCAL_TIMEZONE = 'GMT+8:00'  (添加了时区)

# General settings.
#
# Site webmaster's mail address.
webmaster = "postmaster@letop.vip"

# Default language.
default_language = 'zh_CN'

# Database backend: ldap.
backend = 'ldap'
但是管理后台的时间还是这样的

    2016-07-09 01:04:16    postmaster@letop.vip    192.168.1.25    Login success
    2016-07-09 01:02:48    postmaster@letop.vip    192.168.1.25    Login success
    2016-07-09 01:00:25    postmaster@letop.vip    192.168.1.25    Login success
    2016-07-09 00:44:48    postmaster@letop.vip    192.168.1.25    Login success
    2016-07-09 00:44:09    postmaster@letop.vip    192.168.1.25    Login success
    2016-07-09 00:34:16    postmaster@letop.vip    192.168.1.25    Login success
    2016-07-09 00:28:44    postmaster@letop.vip    192.168.1.25    Create user: test@letop.vip.
    2016-07-09 00:13:07    postmaster@letop.vip    192.168.1.25    Login success
    2016-07-09 00:08:14    postmaster@letop.vip    192.168.1.25    Login success

7

(1 篇回复,发表在 iRedMail 技术支持)

==== 必填信息。没有填写将不予回复 ====
- iRedMail 版本号:0.9.5-1
- 使用哪个数据库存储用户帐号(OpenLDAP,MySQL,PostgreSQL):LDAP
- 使用的 Linux/BSD 发行版名称及版本号:ubuntu14.04
- 与您的问题相关的日志信息:
====
修改#vi /opt/www/roundcubemail-1.2.0/.htaccess
<IfModule mod_php5.c>
# php_value    error_log    logs/errors

php_value   upload_max_filesize   50M
php_value   post_max_size         50M
php_value   memory_limit          128M

php_flag    register_globals            Off
php_flag    zlib.output_compression     Off
php_flag    magic_quotes_gpc            Off
php_flag    magic_quotes_runtime        Off
php_flag    suhosin.session.encrypt     Off

#php_value   session.cookie_path     /
#php_value   session.hash_function   sha256
php_flag    session.auto_start       Off
php_value   session.gc_maxlifetime   21600
php_value   session.gc_divisor       500
php_value   session.gc_probability   1
</IfModule>

<IfModule mod_rewrite.c>
Options +FollowSymLinks
RewriteEngine On
RewriteRule ^favicon\.ico$ skins/larry/images/favicon.ico

# security rules:
# - deny access to files not containing a dot or starting with a dot
#   in all locations except installer directory
RewriteRule ^(?!installer|\.well-known\/|[a-zA-Z0-9]{16})(\.?[^\.]+)$ - [F]
# - deny access to some locations
RewriteRule ^/?(\.git|\.tx|SQL|bin|config|logs|temp|tests|program\/(include|lib|localization|steps)) - [F]
# - deny access to some documentation files
RewriteRule /?(README\.md|composer\.json-dist|composer\.json|package\.xml|Dockerfile)$ - [F]
</IfModule>

<IfModule mod_deflate.c>
SetOutputFilter DEFLATE
</IfModule>

<IfModule mod_headers.c>
# replace 'append' with 'merge' for Apache version 2.2.9 and later
#Header append Cache-Control public env=!NO_CACHE
# for better privacy/security ask browsers to not set the Referer
#Header set Content-Security-Policy "referrer no-referrer"
</IfModule>

<IfModule mod_expires.c>
ExpiresActive On
ExpiresDefault "access plus 1 month"
</IfModule>

FileETag MTime Size

<IfModule mod_autoindex.c>
Options -Indexes
</ifModule>

php.ini也做了相应的修改,为什么发个10M的附件都发不了呢

谢了张工,是我自己失误,登录没有输入全名,因为我修改了Roundcube的配置文件,把127.0.0.1改成域名了,习惯了输入用户名没有输入后缀!

9

(2 篇回复,发表在 iRedMail 技术支持)

==== 必填信息。没有填写将不予回复 ====
- iRedMail 版本号:0.9.5
- 使用哪个数据库存储用户帐号(OpenLDAP,MySQL,PostgreSQL):LDAP
- 使用的 Linux/BSD 发行版名称及版本号:ubuntu14.04
- 与您的问题相关的日志信息:
====
张工
你好
用户密码修改能设置得简单一些吗?就是说只需要限定几个字符,不需要强制加英文字母和符号,应该修改哪个文件,谢谢。

ZhangHuangbin 写道:

Roundcube 日志文件(和 postfix 日志文件一样)里有什么相关错误信息?

没有找到有日志文件
root@mail:/opt/www/roundcubemail-1.2.0/logs# ls
root@mail:/opt/www/roundcubemail-1.2.0/logs# cd /opt/www/roundcubemail
root@mail:/opt/www/roundcubemail# ls
bin                 config     installer  plugins    robots.txt  temp
CHANGELOG           index.php  LICENSE    program    skins       UPGRADING
composer.json-dist  INSTALL    logs       README.md  SQL         vendor
root@mail:/opt/www/roundcubemail# cd logs/
root@mail:/opt/www/roundcubemail/logs# ls
root@mail:/opt/www/roundcubemail/logs#

==== 必填信息。没有填写将不予回复 ====
- iRedMail 版本号:
- 使用哪个数据库存储用户帐号(OpenLDAP,MySQL,PostgreSQL):
- 使用的 Linux/BSD 发行版名称及版本号:
- 与您的问题相关的日志信息:
==== ==== 必填信息。没有填写将不予回复 ====
- iRedMail 版本号:
- 使用哪个数据库存储用户帐号(OpenLDAP,MySQL,PostgreSQL):
- 使用的 Linux/BSD 发行版名称及版本号:
- 与您的问题相关的日志信息:
==== ==== 必填信息。没有填写将不予回复 ====
- iRedMail 版本号:
- 使用哪个数据库存储用户帐号(OpenLDAP,MySQL,PostgreSQL):
- 使用的 Linux/BSD 发行版名称及版本号:
- 与您的问题相关的日志信息:
==== ==== 必填信息。没有填写将不予回复 ====
- iRedMail 版本号:0.9.5.1
- 使用哪个数据库存储用户帐号(OpenLDAP,MySQL,PostgreSQL):openldap
- 使用的 Linux/BSD 发行版名称及版本号:ubuntu14.04
- 与您的问题相关的日志信息:
====
在roundcube上修改密码提示:无法保存新密码,链接出错。这是什么原因?

请问楼主你的做好了没有?我也是一样的添加了却没有作用!

对了张工,请问下有没有关于iredmail的相关中文文档,我英文很菜,看得很辛苦!!!

谢了张工,修改了灰名单就搞定了,126邮件20秒就到了

plugins = ["reject_null_sender", "reject_sender_login_mismatch", "throttle", "amavisd_wblist", "sql_alias_access_policy"]

这样做的正确的吗?

==== 必填信息。没有填写将不予回复 ====
- iRedMail 版本号:iredmail0.9.5.1
- 使用哪个数据库存储用户帐号:MySQL
- 使用的 Linux/BSD 发行版名称及版本号:ubuntu14.04
- 与您的问题相关的日志信息:
==== 大家好,第一次使用Linux搭建邮件服务器,很多不懂的地方,请大家指教下

外部邮件收取很慢,因为我是使用动态域名做的测试,所以会不会是因为没有固定的IP引起的呢?看了一些网上的说法是说修改vim /etc/policyd/cluebringer.conf 但是找不到有这个文件,之是在安装包里面有,想这样的问题应该怎么去解决,谢谢!