126

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

==== 必填信息。没有填写将不予回复 ====
- iRedMail 版本号:iRedMail 0.6.0
- 使用哪个数据库存储用户帐号(OpenLDAP,MySQL,PostgreSQL):iRedAdmin-Pro-LDAP-2.7.0
- 使用的 Linux/BSD 发行版名称及版本号: CentOS7.3
- 与您的问题相关的日志信息:
====
1).
CentOS7.3
/etc/openldap]# ll
總計 24
drwxr-xr-x. 2 root root   85 11月  6 09:22 certs
-rw-r--r--  1 root root  121 11月  6 09:22 check_password.conf
-rw-r--r--  1 ldap ldap  172 11月 18 11:36 ldap.conf
-rw-r--r--. 1 root root  363 11月 17 15:54 ldap.conf.2016.11.17.15.47.48
drwxr-xr-x. 2 root root 4096  1月 24 13:25 schema
-rw-r--r--  1 root root 7624  1月 24 13:26 slapd.conf
drwxr-x---. 3 ldap ldap   43 11月  6 09:22 slapd.d

CentOS6.8
/etc/openldap]# ll
總計 64
drwxr-xr-x. 2 root root 4096 2016-05-11 07:32 certs
-rw-r-----  1 root ldap  121 2016-05-11 07:32 check_password.conf
-rw-r-----  1 ldap ldap  270 2016-10-12 10:53 ldap.conf
-rw-r--r--. 1 root root  280 2014-08-18 13:46 ldap.conf.2014.08.18.13.40.14

drwxr-xr-x. 2 root root 4096 2017-01-24 13:19 schema
-rw-r-----  1 ldap ldap 8834 2017-01-24 13:18 slapd.conf

drwxr-x---. 3 ldap ldap 4096 2016-05-11 07:32 slapd.d


slapd.conf 因該為 640 或 644 ?
兩個系統版本不同的設定權限也不同.

2). openldap 版更後
切loglevel  128  ,出現

Jan 24 13:48:49 mail slapd[11521]: slapd starting
Jan 24 13:59:50 mail slapd[11521]: daemon: shutdown requested and initiated.
Jan 24 13:59:50 mail slapd[11521]: slapd shutdown: waiting for 0 operations/tasks to finish
Jan 24 13:59:50 mail slapd[11521]: slapd stopped.
Jan 24 13:59:50 mail slapd[11718]: @(#) $OpenLDAP: slapd 2.4.40 (Nov  6 2016 01:21:28) $#012#011mockbuild@worker1.bsys.centos.org:/builddir/build/BUILD/openldap-2.4.40/openldap-2.4.40/servers/slapd
Jan 24 13:59:50 mail slapd[11721]: config_back_db_open: line 0: warning: cannot assess the validity of the ACL scope within backend naming context
Jan 24 13:59:50 mail slapd[11721]: mdb_monitor_db_open: monitoring disabled; configure monitor database to enable
Jan 24 13:59:50 mail slapd[11721]: slapd starting

這一行是否正常:
Jan 24 13:59:50 mail slapd[11721]: config_back_db_open: line 0: warning: cannot assess the validity of the ACL scope within backend naming context
改為 loglevel  0 , 不會出現

==== 必填信息。没有填写将不予回复 ====
- iRedMail 版本号:0.6
- 使用哪个数据库存储用户帐号(OpenLDAP,MySQL,PostgreSQL):OpenLDAP
- 使用的 Linux/BSD 发行版名称及版本号:CentOS 6.8
- 与您的问题相关的日志信息:
====
PS: 另一台 CentOS7 更新正常

目前為 iRedAdmin-Pro-LDAP-2.6.1 ;
依照在Upgrade from iRedMail-0.9.5-1 文件, 出現錯誤

iRedAdmin-Pro 版 有需要做  iRedAdmin 的 upgrade 動作?



錯誤訊息如下:
~/iRedAdmin-0.7/tools]# bash upgrade_iredadmin.sh
* Detected Linux/BSD distribution: RHEL
* HTTP server root: /var/www
* Found iRedAdmin directory: /var/www/iredadmin, symbol link of iRedAdmin-Pro-LDAP-2.6.1
* Found iRedAdmin config file: /var/www/iredadmin/settings.py
* Copying new version to /var/www/iRedAdmin-0.7
* Removing old symbol link /var/www/iredadmin
* Creating symbol link /var/www/iredadmin to /var/www/iRedAdmin-0.7
* Delete all existing sessions, admins are forced to re-login to iRedAdmin.
* Check and install dependent Python modules:
  + [required] json or simplejson
  + [required] dnspython
  + [required] pycurl
  + [optional] BeautifulSoup
  + [optional] lxml
* Check SQL tables, and add missed ones - if there's any
ERROR 1142 (42000) at line 8 in file: '/var/www/iredadmin/SQL/iredadmin.mysql': CREATE command denied             to user 'iredadmin'@'localhost' for table 'sessions'
ERROR 1142 (42000) at line 17 in file: '/var/www/iredadmin/SQL/iredadmin.mysql': CREATE command denied             to user 'iredadmin'@'localhost' for table 'log'
ERROR 1142 (42000) at line 37 in file: '/var/www/iredadmin/SQL/iredadmin.mysql': CREATE command denied             to user 'iredadmin'@'localhost' for table 'updatelog'
ERROR 1142 (42000) at line 45 in file: '/var/www/iredadmin/SQL/iredadmin.mysql': CREATE command denied             to user 'iredadmin'@'localhost' for table 'deleted_mailboxes'
ERROR 1142 (42000) at line 68 in file: '/var/www/iredadmin/SQL/iredadmin.mysql': CREATE command denied             to user 'iredadmin'@'localhost' for table 'tracking'
ERROR 1142 (42000) at line 76 in file: '/var/www/iredadmin/SQL/iredadmin.mysql': CREATE command denied             to user 'iredadmin'@'localhost' for table 'domain_ownership'
* iRedAdmin has been successfully upgraded.
* Restarting httpd service to use new iRedAdmin release ...
正在停止 httpd:                                           [  確定  ]
正在啟動 httpd:                                           [  確定  ]
* Upgrading completed.
<<< NOTE >>> If iRedAdmin doesn't work as expected, please post your issue in
<<< NOTE >>> our online support forum: http://www.iredmail.org/forum/

ZhangHuangbin 写道:

dovecot 在非 debug 模式应该不会记录 ldap(xxx): 才对

是的, 我今查看dovecot.log 14,15,16  這三天確實沒 ldap 的log 出現 .
故可不用啟動此參數 .

感謝不厭其煩回覆. Thank's.

感謝版主回覆.
我可能未說清楚 .
1.
# grep '98.158.177.98' /var/log/maillog|wc -l
5236
我是想說 在 postfix 下的maillog 有出現過幾次 .

2.
# fail2ban-regex -v /var/log/maillog /etc/fail2ban/filter.d/postfix.iredmail.conf

部分內容可看到有抓到,該擋的IP:

Results
=======
Failregex: 3607 total
|-  #) [# of hits] regular expression
|   1) [2372] \[<HOST>\]: SASL (PLAIN|LOGIN) authentication failed

|      45.63.34.194  Wed Jan 04 17:41:05 2017
|      45.63.34.194  Wed Jan 04 17:41:19 2017
|      45.63.34.194  Wed Jan 04 17:41:38 2017
|      45.63.34.194  Wed Jan 04 17:41:48 2017
|      45.63.34.194  Wed Jan 04 17:42:00 2017
|      45.63.34.194  Wed Jan 04 17:42:15 2017

|      98.158.177.98  Thu Jan 05 20:12:12 2017
|      98.158.177.98  Thu Jan 05 20:12:22 2017
|      98.158.177.98  Thu Jan 05 20:12:22 2017
|      98.158.177.98  Thu Jan 05 20:12:22 2017
|      98.158.177.98  Thu Jan 05 20:12:35 2017
|      98.158.177.98  Thu Jan 05 20:12:35 2017
|      98.158.177.98  Thu Jan 05 20:12:35 2017
|      98.158.177.98  Thu Jan 05 20:12:50 2017
|      98.158.177.98  Thu Jan 05 20:12:50 2017
|      98.158.177.98  Thu Jan 05 20:12:50 2017
|      98.158.177.98  Thu Jan 05 20:13:09 2017
|      98.158.177.98  Thu Jan 05 20:13:09 2017

3.
正如版主說的: "如果在非 debug mode 也有这些 log,我们可以添加上去"

所以我還是安全起見:
在 dovecot.iredmail.conf
再加入原先修正的條件
(pam|passwd-file|ldap)\(\S*,<HOST>(\)|\S*\)): (invalid credentials|unknown user|Login attempt with empty password)\s*$.

再次感謝版主回覆 ; 此po 文可關掉了.

PS: 剛再查了一下 ;在關掉 dovecot debug mode 後仍有如下log

#  grep '176.123.1.251' /var/log/dovecot.log

Jan 13 02:29:04 auth: Info: ldap(mail@mydomain.com,176.123.1.251): unknown user
Jan 13 02:29:04 auth: Info: ldap(a@mydomain.com,176.123.1.251): unknown user
Jan 13 02:29:04 auth: Info: ldap(mail.mydomain.com@mydomain,176.123.1.251): unknown user
13 02:29:04 auth: Info: ldap(mydomain.com@mydomain.com,176.123.1.251): unknown user
Jan 13 02:29:04 auth: Info: ldap(mydomain@mysomain.com,176.123.1.251): unknown user

fail2ban-regex -v /var/log/dovecot.log /etc/fail2ban/filter.d/dov-ired.conf

|      98.158.177.98  Sat Jan 07 00:13:22 2017
|      98.158.177.98  Sat Jan 07 00:13:40 2017
|      176.123.1.251  Fri Jan 13 02:29:04 2017
|      176.123.1.251  Fri Jan 13 02:29:04 2017
|      176.123.1.251  Fri Jan 13 02:29:04 2017
|      176.123.1.251  Fri Jan 13 02:29:04 2017
|      176.123.1.251  Fri Jan 13 02:29:04 2017

所以應該要啟用此參數. 在 postfix.iredmail.conf 一樣抓得到此IP .

在maillog 裡 是可抓到
# grep '45.63.34.194' /var/log/maillog|wc -l
434
# grep '98.158.177.98' /var/log/maillog|wc -l
5236

# fail2ban-regex -v /var/log/maillog /etc/fail2ban/filter.d/postfix.iredmail.conf

Thank's

ZhangHuangbin 写道:

这些日志是否需要在 dovecot 里启用 debug mode?

是的:
# Debug
mail_debug = yes
auth_verbose = yes

==== 必填信息。没有填写将不予回复 ====
- iRedMail 版本号:iRedMail 0.9.5-1
- 使用哪个数据库存储用户帐号(OpenLDAP,MySQL,PostgreSQL):OpenLDAP
- 使用的 Linux/BSD 发行版名称及版本号:CentOS 7
- 与您的问题相关的日志信息:
====
#下面log 抓不到IP         (dovecot.log檔)

Jan 04 17:40:55 auth: Info: ldap(root@mydomain,45.63.34.194): unknown user
Jan 05 20:07:04 auth: Info: ldap(root@mydomain,98.158.177.98): unknown user
Jan 05 20:06:50 auth: Info: ldap(test@mydomain,98.158.177.98): Login attempt with empty password
Jan 05 20:08:45 auth: Info: ldap(backup@mydomain,98.158.177.98): unknown user
Jan 05 20:08:45 auth: Info: ldap(mail@mydomain,98.158.177.98): unknown user
Jan 05 20:08:45 auth: Info: ldap(smtp@mydomain,98.158.177.98): unknown user
Jan 05 20:12:25 auth: Info: ldap(postmaster@mydomain,98.158.177.98): Login attempt with empty password
Jan 05 20:12:40 auth: Info: ldap(postmaster@mydomain,98.158.177.98): invalid credentials

grep '45.63.34.194' dovecot.log|wc -l
110
grep '98.158.177.98' dovecot.log|wc -l
1648

dovecot.iredmail.conf 或預設安裝的 dovecot.conf 皆無法抓到以上兩IP

現使用dovecot.iredmail.conf 
最後兩行合併為一行:
         ^%(__prefix_line)s(auth|auth-worker\(\d+\)): (pam|passwd-file)\(\S+,<HOST>\): unknown user\s*$
            ^%(__prefix_line)s(auth|auth-worker\(\d+\)): Info: ldap\(\S*,<HOST>,\S*\): invalid credentials\s*$

           #改為
            (pam|passwd-file|dap)\(\S*,<HOST>(\)|\S*\)): (invalid credentials|unknown user|Login attempt with empty password)\s*$.

是可抓到;
不知版主有何其他看法意見.

Thanks.

Thank's

cloudlll 写道:

NOQUEUE: reject: RCPT from [58.100.201.195]:55227: 550 5.7.1 Service unavailable; client [58.100.201.195] blocked using zen.spamhaus.org;

請問版主:
若要繼續使用postscreen , 而不阻擋 58.100.201.195 , 應如何設定.

135

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

感謝版主回覆 , 此問題現可關閉.

我再重新安裝一次 , 現已ok.

我從認識iRedMail 就一直用putty 來安裝.

我的猜測可能是, 下載packages 時出錯  , 會連結到 .hk 的源出現not found.
這次在Fresh OS 安裝後 ;  馬上執行 yum update 時,有注意到 直向 .tw
再執行後續安裝步驟 , 現一切正常 .

Thanks.

136

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

==== 必填信息。没有填写将不予回复 ====
- iRedMail 版本号:0.9.5-1
- 使用哪个数据库存储用户帐号(OpenLDAP,MySQL,PostgreSQL):OpenLDAP
- 使用的 Linux/BSD 发行版名称及版本号:CentOS 7
- 与您的问题相关的日志信息:
====

安裝兩次,出現相同錯誤訊息

*************************************************************************
***************************** WARNING ***********************************
*************************************************************************
*                                                                       *
* Below file contains sensitive infomation (username/password), please  *
* do remember to *MOVE* it to a safe place after installation.          *
*                                                                       *
*   * /root/iRedMail-0.9.5-1/config
*                                                                       *
*************************************************************************
********************** Review your settings *****************************
*************************************************************************
# 出現錯誤訊息
* Storage base directory:
Can't make sub-window at (13,18), size (1,70).
* Mailboxes:
Can't make sub-window at (13,18), size (1,70)./vmail1
* Daily backup of SQL/LDAP databases:
Can't make sub-window at (13,18), size (1,70)./backup
* Store mail accounts in:               OpenLDAP
* Web server:                           Apache
* First mail domain name:
can't make sub-window at (13,18), size (1,70).
* Mail domain admin:                    postmaster@
can't make sub-window at (13,18), size (1,70).
* Additional components:                iRedAdmin Roundcubemail Awstats Fail2ban

< Question > Continue? [y|N]

.. . . . . . 省略  . . . .
packages 安裝
. . . . . . . 省略 . . .. .

  unzoo.x86_64 0:4.4-16.el7
下方又有錯誤訊息:
Complete!

********************************************************************
* Start iRedMail Configurations
********************************************************************
[ INFO ] Create self-signed SSL certification files (2048 bits).
[ INFO ] Generate Diffie Hellman Group with openssl, please wait.
[ INFO ] Create required system account: vmail, iredadmin, iredapd.
/root/iRedMail-0.9.5-1/functions/system_accounts.sh: line 12: [: too many arguments
/root/iRedMail-0.9.5-1/functions/system_accounts.sh: line 13: [: too many arguments
/root/iRedMail-0.9.5-1/functions/system_accounts.sh: line 14: [: too many arguments
chown: invalid user: 'vmail:vmail'
chown: invalid user: 'vmail:vmail'
[ INFO ] Configure Apache web server.
[ INFO ] Configure PHP.
[ INFO ] Configure LDAP server: OpenLDAP.
[ INFO ] Setup daily cron job to backup LDAP data with
Can't make sub-window at (13,18), size (1,70)./backup/backup_openldap.sh
/root/iRedMail-0.9.5-1/functions/ldap_server.sh: line 138: [: too many arguments
basename: extra operand 'sub-window'
Try 'basename --help' for more information.
cp: target '(1,70)./backup/backup_openldap.sh' is not a directory
chown: cannot access '(1,70)./backup/backup_openldap.sh': No such file or directory
chmod: cannot access '(1,70)./backup/backup_openldap.sh': No such file or directory
Can't do inplace edit: Can't is not a regular file.
Can't do inplace edit: make is not a regular file.
Can't do inplace edit: sub-window is not a regular file.
Can't do inplace edit: at is not a regular file.
Can't do inplace edit: (13,18), is not a regular file.
Can't do inplace edit: size is not a regular file.
Can't open (1,70)./backup/backup_openldap.sh: No such file or directory.
Can't do inplace edit: Can't is not a regular file.
Can't do inplace edit: make is not a regular file.
Can't do inplace edit: sub-window is not a regular file.
Can't do inplace edit: at is not a regular file.
Can't do inplace edit: (13,18), is not a regular file.
Can't do inplace edit: size is not a regular file.
Can't open (1,70)./backup/backup_openldap.sh: No such file or directory.
Can't do inplace edit: Can't is not a regular file.
Can't do inplace edit: make is not a regular file.
Can't do inplace edit: sub-window is not a regular file.
Can't do inplace edit: at is not a regular file.
Can't do inplace edit: (13,18), is not a regular file.
Can't do inplace edit: size is not a regular file.
Can't open (1,70)./backup/backup_openldap.sh: No such file or directory.
[ INFO ] Configure MySQL database server.
[ INFO ] Setup daily cron job to backup SQL databases with
Can't make sub-window at (13,18), size (1,70)./backup/backup_mysql.sh
/root/iRedMail-0.9.5-1/functions/mysql.sh: line 229: [: too many arguments
cp: target '(1,70)./backup/backup_mysql.sh' is not a directory
chown: cannot access '(1,70)./backup/backup_mysql.sh': No such file or directory
chmod: cannot access '(1,70)./backup/backup_mysql.sh': No such file or directory
Can't do inplace edit: Can't is not a regular file.
Can't do inplace edit: make is not a regular file.
Can't do inplace edit: sub-window is not a regular file.
Can't do inplace edit: at is not a regular file.
Can't do inplace edit: (13,18), is not a regular file.
Can't do inplace edit: size is not a regular file.
Can't open (1,70)./backup/backup_mysql.sh: No such file or directory.
Can't do inplace edit: Can't is not a regular file.
Can't do inplace edit: make is not a regular file.
Can't do inplace edit: sub-window is not a regular file.
Can't do inplace edit: at is not a regular file.
Can't do inplace edit: (13,18), is not a regular file.
Can't do inplace edit: size is not a regular file.
Can't open (1,70)./backup/backup_mysql.sh: No such file or directory.
Can't do inplace edit: Can't is not a regular file.
Can't do inplace edit: make is not a regular file.
Can't do inplace edit: sub-window is not a regular file.
Can't do inplace edit: at is not a regular file.
Can't do inplace edit: (13,18), is not a regular file.
Can't do inplace edit: size is not a regular file.
Can't open (1,70)./backup/backup_mysql.sh: No such file or directory.
Can't do inplace edit: Can't is not a regular file.
Can't do inplace edit: make is not a regular file.
Can't do inplace edit: sub-window is not a regular file.
Can't do inplace edit: at is not a regular file.
Can't do inplace edit: (13,18), is not a regular file.
Can't do inplace edit: size is not a regular file.
Can't open (1,70)./backup/backup_mysql.sh: No such file or directory.
[ INFO ] Configure Postfix (MTA).
postconf: fatal: /etc/postfix/main.cf, line 208-210: missing '=' after attribute name: "Can't make sub-window at (13,18), size (1,70)."
[ INFO ] Configure Dovecot (POP3/IMAP/Managesieve/LMTP/LDA).
cp: target '(1,70)./sieve/dovecot.sieve' is not a directory
chown: invalid user: 'vmail:vmail'
chmod: cannot access '(1,70)./sieve/dovecot.sieve': No such file or directory
chown: invalid user: 'vmail:vmail'
chown: invalid user: 'vmail:vmail'
chown: invalid user: 'vmail:vmail'
[ INFO ] Configure ClamAV (anti-virus toolkit).
[ INFO ] Configure Amavisd-new (interface between MTA and content checkers).
chown: cannot access '(1,70)..pem': No such file or directory
ERROR 1 (HY000) at line 105 in file: '/root/iRedMail-0.9.5-1/samples/amavisd/amavisd.mysql': Can't create/write to file '/var/tmp/ibfUluRf' (Errcode: 13)
ERROR 1 (HY000) at line 146 in file: '/root/iRedMail-0.9.5-1/samples/amavisd/amavisd.mysql': Can't create/write to file '/var/tmp/ibkWSgg2' (Errcode: 13)
ERROR 1 (HY000) at line 147 in file: '/root/iRedMail-0.9.5-1/samples/amavisd/amavisd.mysql': Can't create/write to file '/var/tmp/ibZ8njVO' (Errcode: 13)
ERROR 1 (HY000) at line 197 in file: '/root/iRedMail-0.9.5-1/samples/amavisd/amavisd.mysql': Can't create/write to file '/var/tmp/ibaChfxC' (Errcode: 13)
ERROR 1 (HY000) at line 198 in file: '/root/iRedMail-0.9.5-1/samples/amavisd/amavisd.mysql': Can't create/write to file '/var/tmp/ibl9uqpq' (Errcode: 13)
ERROR 1 (HY000) at line 199 in file: '/root/iRedMail-0.9.5-1/samples/amavisd/amavisd.mysql': Can't create/write to file '/var/tmp/ib603gve' (Errcode: 13)
ERROR 1 (HY000) at line 201 in file: '/root/iRedMail-0.9.5-1/samples/amavisd/amavisd.mysql': Can't create/write to file '/var/tmp/ibKrinR2' (Errcode: 13)
ERROR 1 (HY000) at line 202 in file: '/root/iRedMail-0.9.5-1/samples/amavisd/amavisd.mysql': Can't create/write to file '/var/tmp/iblKLItR' (Errcode: 13)
ERROR 1 (HY000) at line 203 in file: '/root/iRedMail-0.9.5-1/samples/amavisd/amavisd.mysql': Can't create/write to file '/var/tmp/ib61PjmG' (Errcode: 13)
ERROR 1 (HY000) at line 204 in file: '/root/iRedMail-0.9.5-1/samples/amavisd/amavisd.mysql': Can't create/write to file '/var/tmp/ibDEeavv' (Errcode: 13)
ERROR 1 (HY000) at line 205 in file: '/root/iRedMail-0.9.5-1/samples/amavisd/amavisd.mysql': Can't create/write to file '/var/tmp/ib05TLYk' (Errcode: 13)
ERROR 1 (HY000) at line 232 in file: '/root/iRedMail-0.9.5-1/samples/amavisd/amavisd.mysql': Can't create/write to file '/var/tmp/ibjxzhpb' (Errcode: 13)
ERROR 1 (HY000) at line 233 in file: '/root/iRedMail-0.9.5-1/samples/amavisd/amavisd.mysql': Can't create/write to file '/var/tmp/ibMpt471' (Errcode: 13)
ERROR 1 (HY000) at line 248 in file: '/root/iRedMail-0.9.5-1/samples/amavisd/amavisd.mysql': Can't create/write to file '/var/tmp/ibr41aDT' (Errcode: 13)
[ INFO ] Configure SpamAssassin (content-based spam filter).
[ INFO ] Configure iRedAPD (postfix policy daemon).
[ INFO ] Configure iRedAdmin (official web-based admin panel).
[ INFO ] Configure Fail2ban (authentication failure monitor).
[ INFO ] Configure Roundcube webmail.
[ INFO ] Configure Awstats (logfile analyzer for mail and web server).

*************************************************************************
* iRedMail-0.9.5-1 installation and configuration complete.
*************************************************************************

/root/iRedMail-0.9.5-1/functions/cleanup.sh: line 299: ${FILE_IREDMAIL_INSTALLATION_DETAILS}: ambiguous redirect
/root/iRedMail-0.9.5-1/functions/cleanup.sh: line 306: ${FILE_IREDMAIL_INSTALLATION_DETAILS}: ambiguous redirect
/root/iRedMail-0.9.5-1/functions/cleanup.sh: line 308: ${FILE_IREDMAIL_LINKS}: ambiguous redirect
/root/iRedMail-0.9.5-1/functions/cleanup.sh: line 314: ${FILE_IREDMAIL_LINKS}: ambiguous redirect
chown: invalid user: 'vmail:vmail'
chmod: cannot access 'Can\'t': No such file or directory
chmod: cannot access 'make': No such file or directory
chmod: cannot access 'sub-window': No such file or directory
chmod: cannot access 'at': No such file or directory
chmod: cannot access '(13,18),': No such file or directory
chmod: cannot access 'size': No such file or directory
chmod: cannot access '(1,70)./vmail1/': No such file or directory
chmod: cannot access 'can\'t': No such file or directory
chmod: cannot access 'make': No such file or directory
chmod: cannot access 'sub-window': No such file or directory
chmod: cannot access 'at': No such file or directory
chmod: cannot access '(13,18),': No such file or directory
chmod: cannot access 'size': No such file or directory
chmod: cannot access '(1,70)./p/o/s/postmaster-2016.11.08.09.49.00//Maildir/new/details.eml': No such file or directory
chmod: cannot access 'Can\'t': No such file or directory
chmod: cannot access 'make': No such file or directory
chmod: cannot access 'sub-window': No such file or directory
chmod: cannot access 'at': No such file or directory
chmod: cannot access '(13,18),': No such file or directory
chmod: cannot access 'size': No such file or directory
chmod: cannot access '(1,70)./vmail1/': No such file or directory
chmod: cannot access 'can\'t': No such file or directory
chmod: cannot access 'make': No such file or directory
chmod: cannot access 'sub-window': No such file or directory
chmod: cannot access 'at': No such file or directory
chmod: cannot access '(13,18),': No such file or directory
chmod: cannot access 'size': No such file or directory
chmod: cannot access '(1,70)./p/o/s/postmaster-2016.11.08.09.49.00//Maildir/new/links.eml': No such file or directory
[ INFO ] Disable SELinux in /etc/selinux/config.
< Question > Would you like to use firewall rules provided by iRedMail?
< Question > File: /etc/firewalld/zones/iredmail.xml, with SSHD port: 9999. [Y|n]y
[ INFO ] Copy firewall sample rules: /etc/firewalld/zones/iredmail.xml.
< Question > Restart firewall now (with SSHD port 9999)? [y|N]y
[ INFO ] Restarting firewall ...
< Question > Would you like to use MySQL configuration file shipped within iRedMail now?
< Question > File: /etc/my.cnf. [Y|n]y
[ INFO ] Copy MySQL sample file: /etc/my.cnf.
[ INFO ] Enable SSL support for MySQL server.
[ INFO ] Updating ClamAV database (freshclam), please wait ...
ERROR: Can't change dir to /var/lib/clamav
********************************************************************
* URLs of installed web applications:
*
* - Roundcube webmail: httpS://mail.l.DOMAIN.com/mail/
*
* - Web admin panel (iRedAdmin): httpS://mail.l.DOMAIN.com/iredadmin/
*
* You can login to above links with below credential:
*
* - Username: postmaster@
can't make sub-window at (13,18), size (1,70).
* - Password:
Can't make sub-window at (13,18), size (1,70).
*
*
********************************************************************
* Congratulations, mail server setup completed successfully. Please
* read below file for more information:
*
*   - /root/iRedMail-0.9.5-1/iRedMail.tips
*
* And it's sent to your mail account postmaster@
can't make sub-window at (13,18), size (1,70)..
*
********************* WARNING **************************************
*
* Please reboot your system to enable all mail services.
*
********************************************************************

版主:
我又重新再fresh 安裝iRedMail
還是會出現 " UNKNOWN_MYSQL_US'@'localhost" 現象.

MariaDB [sogo]> show tables;
+----------------------+
| Tables_in_sogo       |
+----------------------+
| sogo_alarms_folder   |
| sogo_folder_info     |
| sogo_sessions_folder |
| sogo_user_profile    |
+----------------------+
4 rows in set (0.00 sec)

正常 第135~ 137  行 是需要產生的嗎?

這次安裝除了啟動 Mariadb的 debug log外 ,未安裝其他套件或更改設定 .

因我使用grep -v '//' sogo.conf|sed '/^$/d'
我也不知會這樣 .
查看 sogo.conf  原始檔
129-132 是有產生

    //NGImap4DisableIMAP4Pooling = NO
    SOGoProfileURL = "mysql://sogo:GD0V7w1mFHdgy8WosMMTIQAFFT1Qb3@127.0.0.1:3306/sogo/sogo_user_profile";
    OCSFolderInfoURL = "mysql://sogo:GD0V7w1mFHdgy8WosMMTIQAFFT1Qb3@127.0.0.1:3306/sogo/sogo_folder_info";
    OCSSessionsFolderURL = "mysql://sogo:GD0V7w1mFHdgy8WosMMTIQAFFT1Qb3@127.0.0.1:3306/sogo/sogo_sessions_folder";
    OCSEMailAlarmsFolderURL = "mysql://sogo:GD0V7w1mFHdgy8WosMMTIQAFFT1Qb3@127.0.0.1:3306/sogo/sogo_alarms_folder";

    // Default language in the web interface
    SOGoLanguage = English;

135~ 137  未產生

    OCSCacheFolderURL = "PH_SOGO_DB_TYPE://PH_SOGO_DB_USER:PH_SOGO_DB_PASSWD@PH_SQL_SERVER_ADDRESS:PH_SQL_SERVER_PORT/PH_SOGO_DB_NAME/PH_SOGO_DB_TABLE_CACHE_FOLDER";
    OCSStoreURL = "PH_SOGO_DB_TYPE://PH_SOGO_DB_USER:PH_SOGO_DB_PASSWD@PH_SQL_SERVER_ADDRESS:PH_SQL_SERVER_PORT/PH_SOGO_DB_NAME/PH_SOGO_DB_TABLE_STORE";
    OCSAclURL = "PH_SOGO_DB_TYPE://PH_SOGO_DB_USER:PH_SOGO_DB_PASSWD@PH_SQL_SERVER_ADDRESS:PH_SQL_SERVER_PORT/PH_SOGO_DB_NAME/PH_SOGO_DB_TABLE_ACL";

SOGo 的  timezone 問題 ,為SOGo 的bug

http://www.iredmail.org/forum/topic9117 … ified.html

感謝回覆 , 請問題應可結束 .

/etc/sogo/sogo.conf 此檔內容如下 ;
我只更改設定 >  WOLogFile = /var/log/sogo/sogo.log;

# grep -v '//' sogo.conf|sed '/^$/d'

{
    WOPort = 127.0.0.1:20000;
    WOLogFile = /var/log/sogo/sogo.log;
    WOWorkersCount = 10;
    SOGoMaximumPingInterval = 3540;
    SOGoMaximumSyncInterval = 3540;
    SOGoInternalSyncInterval = 30;
    WOWatchDogRequestTimeout = 60;
    SOGoMaximumSyncWindowSize = 100;
    SOGoMaximumSyncResponseSize = 2048;
    SOGoLanguage = English;
    SOGoLoginModule = Mail;
    SOGoForceExternalLoginWithEmail = YES;
    SOGoMailCustomFromEnabled = YES;
    SOGoEnableEMailAlarms = YES;
    SOGoSMTPServer = 127.0.0.1;
    SOGoMailingMechanism = smtp;
    SOGoSieveFolderEncoding = UTF-8;
    SOGoMemcachedHost = 127.0.0.1;
    SOGoTimeZone = "America/New_York";
    SOGoFirstDayOfWeek = 1;
    SOGoRefreshViewCheck = every_5_minutes;
    SOGoMailReplyPlacement = below;
    SOGoAppointmentSendEMailNotifications = YES;
    SOGoFoldersSendEMailNotifications = YES;
    SOGoACLsSendEMailNotifications = YES;
    SOGoPasswordChangeEnabled = YES;
    /* SQL backend
    SOGoUserSources = (
        {
            type = sql;
            id = users;
            canAuthenticate = YES;
            userPasswordAlgorithm = ssha;
            prependPasswordScheme = YES;
            isAddressBook = YES;
            displayName = "Domain Address Book";
            SOGoEnableDomainBasedUID = YES;
            DomainFieldName = "domain";
        },
    );
    SQL backend */

    SOGoUserSources = (
        {
            type = ldap;
            baseDN = "o=domains,dc=l,dc=domain1,dc=com";
            bindDN = "cn=vmailadmin,dc=l,dc=domain1,dc=com";
            bindPassword = "1fhITkS26z8bkSYBFcb0uFVQlt7EG8";
            filter = "objectClass=mailUser AND accountStatus=active AND enabledService=mail AND enabledService=sogo";
            scope = SUB;
            userPasswordAlgorithm = ssha;
            IDFieldName = mail;
            bindFields = (mail);
            CNFieldName = cn;
            UIDFieldName = mail;
            IMAPLoginFieldName = mail;
            SearchFieldNames = (cn, sn, displayName, telephoneNumber, mail, shadowAddress);
            canAuthenticate = YES;
            displayName = "Global Address Book";
            id = ldap_auth;
            isAddressBook = YES;
        }
    );

}

Sogo 不熟 , 此次是第二次安裝 , 第一次未仔細研究即砍掉重裝 .

感謝回復 .

# ll /var/www/iredadmin/settings.py*

-r--------  1 iredadmin iredadmin 4326 10月 19 15:29 /var/www/iredadmin/settings.py
-r--------  1 root      root      1677 10月 20 02:01 /var/www/iredadmin/settings.pyc
-r-xr-xr-x. 1 iredadmin iredadmin 4138 10月 17 09:36 /var/www/iredadmin/settings.py.ldap.sample
-r-xr-xr-x. 1 iredadmin iredadmin 3512 10月 17 09:36 /var/www/iredadmin/settings.py.mysql.sample
-r-xr-xr-x. 1 iredadmin iredadmin 3494 10月 17 09:36 /var/www/iredadmin/settings.py.pgsql.sample

# chown iredadmin:iredadmin settings.pyc

# python ireddate.py
Traceback (most recent call last):
  File "ireddate.py", line 5, in <module>
    from settings import LOCAL_TIMEZONE
ImportError: No module named settings


相同錯誤

==== 必填信息。没有填写将不予回复 ====
- iRedMail 版本号:0.9.5-1
- 使用哪个数据库存储用户帐号(OpenLDAP,MySQL,PostgreSQL):OpenLDAP
- 使用的 Linux/BSD 发行版名称及版本号:CentOS7
- 与您的问题相关的日志信息:
====

grep -n log_level /etc/amavisd/amavisd.conf

38:$log_level = 0;              # verbosity 0..5, -d
359:# Custom short log template (at log_level 0), add SpamAssassin testing result (Tests: [xxx])
440:    #log_level => 4,
593:$log_level = 0;
594:# SpamAssassin debugging (require $log_level). Default if off (0).

==== 必填信息。没有填写将不予回复 ====
- iRedMail 版本号:0.9.5-1 iRedAdmin 0.6.3
- 使用哪个数据库存储用户帐号(OpenLDAP,MySQL,PostgreSQL):OpenLDAP
- 使用的 Linux/BSD 发行版名称及版本号:CentOS7
- 与您的问题相关的日志信息:
====
更正 admin log , 重[ 登出在登入後. 顯示正常

版主:
1).
Sogo > sogo.log 檔案紀錄時間慢 12 小時
iRedAdim 登入 的admin log 時間 慢8小時

2).
var/www/iredadmin/setttings.py
已加入
LOCAL_TIMEZONE = 'GMT+08:00'

3).
etc/php.ini
已更改
;date.timezone = GMT
date.timezone = "Asia/Taipei"

重啟 sogo 及 httpd 無效

4).參考:
http://www.iredmail.org/forum/topic1146 … erent.html
移除紅色部分
<td style="white-space: nowrap;">{{ r.time_iso |set_datetime_format | utc_to_timezone(timezone=session['timezone']) }}</td>

5).
在 /var/www/iredadmin/templates/default/panel/log.html
只有
<td style="white-space: nowrap;">{{ log.timestamp |set_datetime_format |convert_utc_to_timezone }}</td>
內容不一樣

另執行:# python /var/www/iredadmin/libs/ireddate.py 出現如下錯誤
Traceback (most recent call last):
  File "/var/www/iredadmin/libs/ireddate.py", line 5, in <module>
    from settings import LOCAL_TIMEZONE
ImportError: No module named settings



6). 應如何修正

timezone 時間錯誤印象中 ,好像問題常常有人會提問 .

版主:

我重新fresh 安裝 iRedMail
CentOS7,iRedMail 0.9.5-1 ,iRedAdmin0.6.3 ( Pro版未裝上)
和先前那台差異,多裝 Sogo

在 mariadb 啟動 general_log = 1
重新restart mariadb 後
仍然出現:

34-161019 11:38:00  InnoDB: Starting shutdown...
35-161019 11:38:01  InnoDB: Shutdown completed; log sequence number 2225190
36-161019 11:38:01 [Note] /usr/libexec/mysqld: Shutdown complete
37-
38-161019 11:38:01 mysqld_safe mysqld from pid file /var/run/mariadb/mariadb.pid ended
39-/usr/libexec/mysqld, Version: 5.5.50-MariaDB (MariaDB Server). started with:
40-Tcp port: 3306  Unix socket: (null)
41-Time                 Id Command    Argument
42:161019 11:48:39          1 Connect   Access denied for user 'UNKNOWN_MYSQL_US'@'localhost' (using passwor      d: NO)
43:                 1 Connect   UNKNOWN_MYSQL_US@localhost as anonymous on
44:161019 11:49:01          2 Connect   sogo@localhost as anonymous on sogo
45-                 2 Query     SET CHARACTER SET utf8
46-                 2 Query     SELECT count(*) FROM sogo_sessions_folder WHERE c_lastseen <= 1476847141
47:                 3 Connect   sogo@localhost as anonymous on sogo
48-                 3 Query     SET CHARACTER SET utf8
49-                 3 Query     BEGIN
50-                 3 Query     SELECT t1.c_alarm_number, t1.c_name, t1.c_path, t1.c_recurrence_id, t1.c_uid       FROM  sogo_alarms_folder t1 WHERE t1.c_alarm_date >= 1476848640 AND t1.c_alarm_date <= 1476848940
51-                 3 Query     ROLLBACK
52-                 3 Query     BEGIN
53-                 3 Query     DELETE FROM sogo_alarms_folder WHERE c_alarm_date <= 1476848940
54-                 3 Query     COMMIT

請問這還是正常?


PS:安裝時中間出現
warning: /var/cache/yum/x86_64/7/epel/packages/amavisd-new-2.10.1-5.el7.noarch.rpm: Header V3 RSA/SHA256 Signature, key ID 352c64e5: NOKEY
Public key for amavisd-new-2.10.1-5.el7.noarch.rpm is not installed
--------------------------------------------------------------------------------
Total                                              2.1 MB/s | 218 MB  01:45
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
Importing GPG key 0x352C64E5:
Userid     : "Fedora EPEL (7) <epel@fedoraproject.org>"
Fingerprint: 91e9 7d7c 4a5e 96f1 7f3e 888f 6a2f aea2 352c 64e5
Package    : epel-release-7-6.noarch (@extras)
From       : /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
Running transaction check


等很久時間後,繼續自動安裝 ,這有影響?

/usr/sbin/mysqld, Version: 10.0.27-MariaDB (MariaDB Server). started with:
Tcp port: 3306  Unix socket: /var/lib/mysql/mysql.sock
Time                 Id Command    Argument
161014 10:43:38     2 Connect   root@localhost as anonymous on
                    2 Quit
161014 10:44:00     3 Connect   iredadmin@localhost as anonymous on iredadmin
                    3 Query     SELECT bytes FROM used_quota WHERE username = 'domainspam@domain.com'

上面, 是另一台 CentOS6 的 log , 差異為下面這一行
[161014 10:43:38     2 Connect   root@localhost as anonymous on
                    2 Quit
161014 10:44:00     3 Connect   iredadmin@localhost as anonymous on iredadmin


而先前PO的文 , CentOS7 那一台是
591:161013 16:11:34         1 Connect   Access denied for user 'UNKNOWN_MYSQL_US'@'localhost' (using password: NO)
592:                1 Connect   UNKNOWN_MYSQL_US@localhost as anonymous on
593:161013 16:11:47         2 Connect   iredadmin@localhost as anonymous on iredadmin

其無 root@localhost ,這一行 .
ps: CentOs7 異常這一台 ,我有自己安裝 Let's Encrypt , OpenDmarc, Dspam ,python-policyd-spf
在這幾個新增的模組 ,有可能造成的錯誤機率, 有可能是哪個?

==== ==== 必填信息。没有填写将不予回复 ====
- iRedMail 版本号:iredmail 0.9.5-1 + PRO-2.6.1
- 使用哪个数据库存储用户帐号(OpenLDAP,MySQL,PostgreSQL):OpenLDAP
- 使用的 Linux/BSD 发行版名称及版本号:CentOS7
- 与您的问题相关的日志信息:
====
版主:

請問這是否正常的log

588-/usr/libexec/mysqld, Version: 5.5.50-MariaDB (MariaDB Server). started with:
589-Tcp port: 3306  Unix socket: (null)
590-Time                 Id Command    Argument
591:161013 16:11:34         1 Connect   Access denied for user 'UNKNOWN_MYSQL_US'@'localhost' (using password: NO)
592:                1 Connect   UNKNOWN_MYSQL_US@localhost as anonymous on
593:161013 16:11:47         2 Connect   iredadmin@localhost as anonymous on iredadmin
594-                2 Query     SELECT bytes FROM used_quota WHERE username = 'test@l.domain.com'
595-                2 Query     SELECT messages FROM used_quota WHERE username = 'test@l.domain.com'

/etc/my.cnf

 [mariadb]
bind-address            = 127.0.0.1
port                    = 3306
general_log = 1
general_log_file = /var/log/mariadb/mariadb.log
log-error=/var/log/mariadb/mariadb_error.log
slow_query_log
slow_query_log_file = /var/log/mariadb/mariadb_slow.log
skip-external-locking
query-cache-type    = 1
query-cache-size    = 8M
query_cache_limit   = 1M
thread_cache_size =4k
innodb_file_per_table
ssl-cert = /etc/pki/tls/certs/iRedMail.crt
ssl-key = /etc/pki/tls/private/iRedMail.key
ssl-cipher = ALL
[client]
default-character-set=utf8
[mariadb_safe]
log-error   = /var/log/mariadb/mariadb_error.log
pid-file    = /var/run/mariadb/mariadb.pid

因全部隔離信件已全部 release, 現沒有及時錯誤訊息 ;
但從mod_security 的log檔 , 查出應為  "500 Internal Server Error" ;
此錯誤訊息是在我按下 release 確認後 , UI 畫面不動 ,需等一段時間才出現的 .

我再附上 modsec_audit 的log檔(已寄出) , 並解說如下:   (另modsec_debug.log 這段時間沒有訊息)

1).
##### 2016:14:02:49 出現 500 Internal Server Error
--5b953a0b-A--
[14/Jul/2016:14:02:49 +0800]
--5b953a0b-B--
POST /XXXXX/activities/quarantined/page/1 HTTP/1.1
--5b953a0b-F--
HTTP/1.1 500 Internal Server Error
--5b953a0b-H--
Message: .

Message: .

Message: .

Message: .
Apache-Error: [file "/builddir/build/BUILD/httpd-2.2.15/server/util_script.c"] [line 441] [level 19] Script timed out before returning headers: iredadmin.py, referer: https://mail.domain.com/XXXXX/activities/quarantined


2).
##### 2016:14:04:10 下面錯誤,同上訊息
--de3cb845-A--
[14/Jul/2016:14:04:10 +0800]
--de3cb845-B--
POST /XXXXX/activities/quarantined/page/1 HTTP/1.1

3).
##### 2016:14:04:18 到 2016:14:06:17
##### 下面錯誤同上訊息 , 差異在 由 POST 改 GET
--2eb7092d-A--
[14/Jul/2016:14:04:18 +0800]
--2eb7092d-B--
GET /XXXXX/ HTTP/1.1
或:
GET /XXXXX/activities/quarantined/raw/j2hS96b2pCwK HTTP/1.1

4). 正常的audit log
#####  2016:14:17:00 第一次release 1封
--dbd6ba0e-A--
[14/Jul/2016:14:17:00 +0800]
--dbd6ba0e-B--
POST /XXXXX/activities/quarantined/page/1 HTTP/1.1

#####  2016:14:17:15 第二次release 2封
--bc5bd627-A--
[14/Jul/2016:14:17:15 +0800]
--bc5bd627-B--
POST /XXXXX/activities/quarantined/page/1 HTTP/1.1

#####  2016:14:17:28  第三次release 剩下全部
--92f40457-A--
[14/Jul/2016:14:17:28 +0800]
--92f40457-B--
POST /XXXXX/activities/quarantined/page/1 HTTP/1.1

5). 由audit log 檔 , mod_security 只作 DETECTION_ONLY動作, 而非 ENABLED .
--xxxxxxxx-H--
Engine-Mode: "DETECTION_ONLY"

==== 必填信息。没有填写将不予回复 ====
- iRedMail 版本号:0.9.5-1
- 使用哪个数据库存储用户帐号(OpenLDAP,MySQL,PostgreSQL):iRedAdmin-Pro-LDAP-2.6.0
- 使用的 Linux/BSD 发行版名称及版本号:CentOS6.X
- 与您的问题相关的日志信息:
====
iRedadmin-Pro 要釋放隔離信件 , 剛開始無法做到, 隔幾分鐘後再做釋放 ,則可以.

何以會這樣? 附檔為log 檔.(已寄出)

1).14:00 剛開始登入做 release 動作(全選), 網頁不動 ,最後出現 通知"postmaster@" 的訊息 ; 應是timeout 造成

2).14:16 再重新做release 1封 , 再2封 ;再全選 , 皆可釋放.

另有安裝:mod_security , 對區網有開放權限.

Thanks.

" Firewalld ,如何大量增設 block IP . "

經查找網路 . 也許使用 ip-set 可簡易的達到.
http://www.firewalld.org/2015/12/ipset-support/
Firewalld 需0.4.0 , 目前 CentOS7 為 0.3.9
有空會試試. 

Thanks.

感謝版主回覆,

rain6966 写道:

CentOS7 改採  iptables 來管理防火牆 ,對 iRedMail 是否有其他須注意?

iRedMail 在CentOS7 有可能改採 iptables ?


Thanks