标签 iredmail 下的文章

为iredadmin添加密码保护 - Basic Authentication

现象:将nginx的Basic Authentication配置内容,添加到/etc/nginx/templates/iredadmin.tmpl页头或页尾,不起作用。

尝试:调整位置,可以Basic Authentication的配置内容添加到/etc/nginx/templates/iredadmin.tmpl文件中的python配置里。

如:

# Python scripts
location ~ ^/admin(.*) {                        # <- Changed
    rewrite ^/admin(/.*)$ $1 break;             # <- Changed

    include /etc/nginx/templates/hsts.tmpl;

    include uwsgi_params;
    uwsgi_pass unix:/run/uwsgi/iredadmin.socket;
    uwsgi_param UWSGI_CHDIR /var/www/iredadmin;
    uwsgi_param UWSGI_SCRIPT iredadmin;
    uwsgi_param SCRIPT_NAME /admin;             # <- Changed

    auth_basic           "Administrator’s Area";
    auth_basic_user_file /etc/apache2/.htpasswd; 

    # Access control
    #allow 127.0.0.1;
    #allow 192.168.1.10;
    #allow 192.168.1.0/24;
    #deny all;
}

参考:

腾讯服务器 - iredmail - 安装问题 - python web.py

环境:腾讯云香港机,iredmail 1.3.1,centos7

问题:iredmail安装完成后,在浏览器里访问 iredadmin 提示 Internal Server Error 出错。

过程:查看 /var/log/message 内容,

Jul 22 13:35:30 mail uwsgi: *** Operational MODE: preforking ***
Jul 22 13:35:30 mail uwsgi: Traceback (most recent call last):
Jul 22 13:35:30 mail uwsgi:  File "iredadmin.py", line 9, in <module>
Jul 22 13:35:30 mail uwsgi:
Jul 22 13:35:30 mail uwsgi: from libs import iredbase
Jul 22 13:35:30 mail uwsgi:  File "/opt/www/iRedAdmin-1.0/libs/iredbase.py", line 7, in <module>
Jul 22 13:35:30 mail uwsgi:
Jul 22 13:35:30 mail uwsgi: import web
Jul 22 13:35:30 mail uwsgi: ImportError
Jul 22 13:35:30 mail uwsgi: :
Jul 22 13:35:30 mail uwsgi: No module named web
Jul 22 13:35:30 mail uwsgi:
Jul 22 13:35:30 mail uwsgi: unable to load app 0 (mountpoint='') (callable not found or import error)
Jul 22 13:35:30 mail uwsgi: *** no app loaded. going in full dynamic mode ***

回查安装过程中,有相关的错误提示内容:

Complete!
[ INFO ] Installing required Python-3 modules with pip3: web.py>=0.51 web.py>=0.51
WARNING: Running pip install with root privileges is generally not a good idea. Try `pip3 install --user` instead.
Collecting web.py>=0.51
  The repository located at mirrors.tencentyun.com is not a trusted or secure host and is being ignored. If this repository is available via HTTPS it is recommended to use HTTPS instead, otherwise you may silence this warning and allow it anyways with '--trusted-host mirrors.tencentyun.com'.
  Could not find a version that satisfies the requirement web.py>=0.51 (from versions: )
No matching distribution found for web.py>=0.51
[ INFO ] Installing required Python-2 modules with pip2: web.py>=0.51 more-itertools==5.0.0 web.py>=0.51 more-itertools==5.0.0
Collecting web.py>=0.51
  The repository located at mirrors.tencentyun.com is not a trusted or secure host and is being ignored. If this repository is available via HTTPS it is recommended to use HTTPS instead, otherwise you may silence this warning and allow it anyways with '--trusted-host mirrors.tencentyun.com'.
  Could not find a version that satisfies the requirement web.py>=0.51 (from versions: )
No matching distribution found for web.py>=0.51
You are using pip version 8.1.2, however version 20.1.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.

那么可尝试手工安装python的相关包,
pip3 install web.py>=0.51
pip2 install web.py>=0.51 more-itertools==5.0.0

然后再重启相应服务(iredamin和iredpad等),或重启系统后测试,可以正常登录到iredadmin进行管理了。

参考:https://forum.iredmail.org/topic17082-internal-server-error-iredadmin.html

修改 iredmail 套件中 roundcube web邮箱登录界面的logo

环境:CentOS7 里安装了 iredmail-1.1。

过程:

  1. /opt/www/roundcubemail/skins/elastic/images/logo.svg # 替换默认 roundcube 的logo
  2. /opt/www/roundcubemail/skins/elastic/images/favicon.ico # 替换默认 roundcube 的站标
  3. 在 /opt/www/roundcubemail/config/config.inc.php 配置文件里,增加一行,修改登录界面的文字说明,默认是“Roundcube Webmail”,如 $rcmail_config['product_name'] = 'AnQun Webmail';

参考:

iRedMail - 修改附件大小

需求:iRedMail-0.9.9,nginx和centOS7环境。需通过邮件发送的附件增加到200M。

步骤:

1.先修改 postfix 的值:

postconf -e message_size_limit='254857600'
postconf -e mailbox_size_limit='254857600'

2.systemctl restart posfix # 重启postfix服务

3.修改php.ini的几个参数: /etc/php.ini

memory_limit = 1250M;
upload_max_filesize = 250M;
post_max_size = 250M;
max_input_time = 900
max_execution_time = 900

4.systemctl restart php-fpm # 重启php-fpm进程

5.修改nginx的参数:/etc/nginx/conf-enabled/client_max_body_size.conf
client_max_body_size 250m;

6.systemctl restart nginx # 重启nginx服务

参考:https://docs.iredmail.org/change.mail.attachment.size-zh_CN.html

iRedMail - 禁用amavisd clamav 和 spamassassin

现象:默认安装的iRedMail,有查杀病毒的 ClamAV 功能,在低内存(如1GB)的机子上收发邮件,会很吃内存。可尝试停用 ClamAV的功能。

尝试:
1.编辑配置文件 /etc/postfix/main.cf ,将以下一行注释掉,如:
content_filter = smtp-amavis:[127.0.0.1]:10024

2.编辑配置文件 /etc/postfix/master.cf ,将以下一行注释掉,如:
-o content_filter=smtp-amavis:[127.0.0.1]:10026

3.重启postfix服务

4.禁用amavisd和clamav的服务

参考:https://docs.iredmail.org/completely.disable.amavisd.clamav.spamassassin.html