1

Topic: Hi wish to use iRedMail for all my needs

==== Required information ====
- iRedMail version (check /etc/iredmail-release): 0.9.4
- Linux/BSD distribution name and version: Centos 6.7
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): all
- Web server (Apache or Nginx): using zpanel
- Manage mail accounts with iRedAdmin-Pro?
- Related log if you're reporting an issue:
====
Hi I just contracted a VPS which will be mainly used for mail, although it also holds my websites. I am finding zpanel installed by default increasingly cumbersome, cannot chown at the end of succesful mail backups, and am looking for a fresh configuration through iRedMail

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.

2

Re: Hi wish to use iRedMail for all my needs

Dear iRedMail Community,
I've found four challenges regarding installation. Thanks for your kind help!


This is the output I get regarding hostnames.
[root@vps ~]# hostname -f
localhost.localdomain
[root@vps ~]# hostname
vps.server.com
I own three email domains. Would the hostname remain server or would I choose one of my existing domains?


[root@vps /]# /etc/selinux/config
-bash: /etc/selinux/config: No such file or directory
[root@vps /]#


how do I disable third-party yum repositories?
how do I enable CentOs official yum repositories?


[root@vps ~]# tar 094 iRedMail-0.9.4.tar.bz2
tar: Options `-[0-7][lmh]' not supported by *this* tar

3

Re: Hi wish to use iRedMail for all my needs

rroopstr wrote:

I own three email domains. Would the hostname remain server or would I choose one of my existing domains?

Server hostname can NOT be the same as your mail domain names. It will cause conflict.

rroopstr wrote:

[root@vps /]# /etc/selinux/config

This is a file, not a command.

rroopstr wrote:

how do I disable third-party yum repositories?
how do I enable CentOs official yum repositories?

Check files under /etc/yum.repos.d/, CentOS just uses 'CentOS-Base.repo'.

rroopstr wrote:

[root@vps ~]# tar 094 iRedMail-0.9.4.tar.bz2
tar: Options `-[0-7][lmh]' not supported by *this* tar

Follow our installation guide please, you're typing wrong command.

4 (edited by rroopstr 2016-04-28 13:00:00)

Re: Hi wish to use iRedMail for all my needs

Dear ZhangHuangbin,

Thanks very much for replying. Wll leave localhost as it is. Succesfully disabled SELinux through the permissive option.

[root@vps selinux]# vi .config.swp
[root@vps selinux]# setenforce 0
setenforce: SELinux is disabled
[root@vps selinux]#

Checked CentOS-Base.repo and everything comes from Centos so I left it intact.

Corrected my previous typo and tar command was succesful. I am now on the blue screen.
This is the first time in my life I install new software on Linux and am very grateful to you for having provided me this opportunity.

Best regards.

Progress a while later: Installation was almost succesful except for the fact that there was a mismatch with the old mySQL password stored at zpanel, which led to errors that I hope have become fixed now that I just restored on my VPS the password originally assigned by zpanel. VPS was rebooted and I read & saved file /root/iRedMail-x.y.z/iRedMail.tips for future reference. Tomorrow I'll continue with section Setup DNS records for your mail server. Congratulations again on this software that really seems the best I've ever seen regarding email.

5

Re: Hi wish to use iRedMail for all my needs

rroopstr wrote:

Wll leave localhost as it is

Use 'localhost' as server hostname is NOT good for mail server. many mail servers (including iRedMail) will check the SMTP HELO identity, if you use server hostname "localhost" as HELO identity, your email MAY be rejected.

iRedMail has a HELO restriction rule to reject "localhost":
https://bitbucket.org/zhb/iredmail/src/ … ss.pcre-33

So, please use a valid FQDN as server hostname, and it must be resolvable in DNS.

rroopstr wrote:

Installation was almost succesful except for the fact that there was a mismatch with the old mySQL password stored at zpanel, which led to errors

As clearly mentioned in iRedMail installation guide, it requires a fresh server.

if your server has MySQL running BEFORE iRedMail installation, the simplest solution is setting an empty for mysql root user, then perform iRedMail installation.

Note: in upcoming iRedMail release (iRedMail-0.9.5), it's able to specify the mysql root password while running iRedMail installer like this:

# MYSQL_ROOT_PASSWORD='xxx' bash iRedMail.sh

6 (edited by rroopstr 2016-04-29 02:24:27)

Re: Hi wish to use iRedMail for all my needs

ZhangHuangbin wrote:

if your server has MySQL running BEFORE iRedMail installation, the simplest solution is setting an empty for mysql root user, then perform iRedMail installation.

After iRedMail installation my websites and zpanel went down. I was able to get then back up by accessing mysql through the old password generated by zpanel. I am trying to resume proper installation of iRedMail and at /etc/sysconfig/network inserted HOSTNAME="mlp.riverocooper.com"

Then at /etc/hosts inserted 127.0.0.1 mlp.riverocooper.com mlp mlplocal mlplocal.riverocooper

Then reloaded and hostname continues to be vps.server.com --- and /etc/hosts again reverts to
127.0.0.1 localhost.localdomain localhost mlp.riverocooper.com mlp mlplocal.riverocooper mlplocal
# Auto-generated hostname. Please do not remove this comment.
5.226.169.119 vps.server.com  vps mlp.riverocooper.com mlp
::1         mlplocal mlplocal.riverocooper mlplocal

server.com is not a domain of mine and am unable to remove it.

I would definitely like to have a fresh server so that I can install iRedMail from scratch. My websites are in a secure backup and it would be no problem for me to upload them again if necessary. Please let me know how can I make my server fresh. Thanks very much for your time and precise instructions.

Edited: some DNS conflict caused zpanel to be unaccessible as well as all my sites. I look forward to reinstalling my VPS, perhaps it would be a good idea to take the opportunity to upgrade to Centos 7 and support Nginx rather than Apache in preparation to release of iRedMail 1. I do log in normally to root via putty and my ip address. Also got this while trying to connect to mysql:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)

7 (edited by rroopstr 2016-04-29 18:53:07)

Re: Hi wish to use iRedMail for all my needs

Uninstalled zpanel through 3 service stops, 18 yum removes, and 9 rm removes.
Requested my VPS provider to check their OS image (may be corrupted), during reboot any changes configured at /etc/sysconfig/network or /etc/hosts are ignored.
Server is fresh. I'll properly reinstall iRedMail once ISP solves the issue of not letting me change hostname and localhost from defaults.

8

Re: Hi wish to use iRedMail for all my needs

My VPS provider just performed the necessary changes on localhost and hostname (some restriction prevented me to do them myself). Now I proceed to reinstall iRedMail but probably previous failed installation won't let me. Should I uninstall it first?

[root@mlp /]# tar xjf iRedMail-0.9.4.tar.bz2
tar (child): iRedMail-0.9.4.tar.bz2: Cannot read: Is a directory
tar (child): At beginning of tape, quitting now
tar (child): Error is not recoverable: exiting now

bzip2: Compressed file ends unexpectedly;
        perhaps it is corrupted?  *Possible* reason follows.
bzip2: Invalid argument
        Input file = (stdin), output file = (stdout)

It is possible that the compressed file(s) have become corrupted.
You can use the -tvv option to test integrity of such files.

You can use the `bzip2recover' program to attempt to recover
data from undamaged sections of corrupted files.

tar: Child returned status 2
tar: Error is not recoverable: exiting now

9

Re: Hi wish to use iRedMail for all my needs

Re-download iRedMail-0.9.5 (released few minutes ago), and try again.

10 (edited by rroopstr 2016-05-03 19:29:56)

Re: Hi wish to use iRedMail for all my needs

(1) Redownloaded iRedMail-0.9.4 (no 0.9.5 with that name) and installed is as follows:
[root@mlp /]# cd /root/iRedMail-0.9.4/
[root@mlp iRedMail-0.9.4]# bash iRedMail.sh
[ INFO ] Checking configuration file: /root/iRedMail-0.9.4/config ... [FOUND]
< Question > Use it for mail server setting? [y|N]y
[ INFO ] Use config file: /root/iRedMail-0.9.4/config for mail server setting.
[ INFO ] Import installation process status from file: /root/iRedMail-0.9.4/runtime/install.status.
< SKIP > Function: install_all.

********************************************************************
* Start iRedMail Configurations
********************************************************************
< SKIP > Function: generate_ssl_keys.
< SKIP > Function: add_required_users.
< SKIP > Function: web_server_config.
[ INFO ] Configure MySQL database server.
< SKIP > Function: mysql_initialize.
< SKIP > Function: mysql_import_vmail_users.
< SKIP > Function: mysql_cron_backup.
< SKIP > Function: postfix_config.
< SKIP > Function: enable_dovecot.
< SKIP > Function: clamav_config.
< SKIP > Function: amavisd_config_rhel.
< SKIP > Function: amavisd_config_general.
< SKIP > Function: amavisd_import_sql.
Can't open /etc/amavisd/amavisd.conf: No such file or directory.
< SKIP > Function: sa_config.
< SKIP > Function: iredapd_setup.
< SKIP > Function: iredadmin_config.
< SKIP > Function: fail2ban_config.
< SKIP > Function: rcm_install.
< SKIP > Function: rcm_import_sql.
< SKIP > Function: rcm_config.
< SKIP > Function: rcm_plugin_managesieve.
< SKIP > Function: rcm_plugin_password.
< SKIP > Function: sogo_config.
< SKIP > Function: cleanup.
[root@mlp iRedMail-0.9.4]# cd ..

(2)
updated release
[root@mlp /]# cat /etc/iredmail-release
0.9.5

(3) some commands are not found
[root@mlp ~]# tar xjf iRedAPD-1.9.0.tar.bz2
[root@mlp ~]# cd iRedAPD-1.9.0/tools/
[root@mlp tools]# bash upgrade_iredapd.sh
* Detected Linux/BSD distribution: RHEL
* Found iRedAPD directory: /opt/iredapd, symbol link of /opt/iRedAPD-1.8.0
* Found iRedAPD config file: /opt/iredapd/settings.py
upgrade_iredapd.sh: line 322: mysql: command not found
upgrade_iredapd.sh: line 335: mysql: command not found
upgrade_iredapd.sh: line 354: mysql: command not found
* Checking dependent Python modules:
  + [required] python-sqlalchemy
  + [required] dnspython
* Create directory /opt/iRedAPD-1.9.0.
* Copying new version to /opt/iRedAPD-1.9.0
* Copy old config file: settings.py: /opt/iredapd/settings.py -> /opt/iRedAPD-1.9.0/settings.py
* Set correct owner and permission for /opt/iRedAPD-1.9.0: root:root, 0500.
* Set permission for iRedAPD config file: /opt/iRedAPD-1.9.0/settings.py -> 0400.
* Re-create symbol link: /opt/iredapd -> /opt/iRedAPD-1.9.0
* Copy new SysV init script.
* Remove deprecated plugins.
chown: invalid user: `iredapd:iredapd'
* Remove all *.pyc files.
* Restarting iRedAPD service.
iredapd is already stopped.
Starting iredapd ...
* Upgrade completed.
Traceback (most recent call last):
  File "/opt/iredapd/iredapd.py", line 277, in <module>
    main()
  File "/opt/iredapd/iredapd.py", line 248, in main
    p = pwd.getpwnam(settings.run_as_user)

< NOTE > If iRedAPD doesn't work as expected, please post your issue in our
< NOTE > online support forum: http://www.iredmail.org/forum/
< NOTE >
< NOTE > * Turn on debug mode: http://www.iredmail.org/docs/debug.iredapd.html
< NOTE > * iRedAPD log file is /var/log/iredapd/iredapd.log.

KeyError: 'getpwnam(): name not found: iredapd'
[root@mlp tools]#

(4) iRedAdmin upgrade
[root@mlp ~]# tar xjf iRedAdmin-0.6.tar.bz2
[root@mlp ~]# cd iRedAdmin-0.6/tools/
[root@mlp tools]# bash upgrade_iredadmin.sh
* Detected Linux/BSD distribution: RHEL
* HTTP server root: /var/www
* Found iRedAdmin directory: /var/www/iredadmin, symbol link of /var/www/iRedAdmin-0.5
* Found iRedAdmin config file: /var/www/iredadmin/settings.py
* Copying new version to /var/www/iRedAdmin-0.6
chown: invalid user: `iredadmin:iredadmin'
* Removing old symbol link /var/www/iredadmin
* Creating symbol link /var/www/iredadmin to /var/www/iRedAdmin-0.6
Traceback (most recent call last):
  File "delete_sessions.py", line 19, in <module>
    conn = ira_tool_lib.get_db_conn('iredadmin')
  File "/var/www/iRedAdmin-0.6/tools/../tools/ira_tool_lib.py", line 66, in get_db_conn
    print_error(e)
  File "/var/www/iRedAdmin-0.6/tools/../tools/ira_tool_lib.py", line 41, in print_error
    print '< ERROR > ' + msg
TypeError: cannot concatenate 'str' and 'exceptions.ImportError' objects
* Check and install dependent Python modules:
  + [required] json or simplejson
  + [optional] BeautifulSoup
  + [optional] lxml
* iRedAdmin was successfully upgraded, restarting web service is required.
* Restart service (uwsgi) to use new iRedAdmin release now? [Y|n]

(5) LDAP
cd /etc/postfix/ldap/
-bash: cd: /etc/postfix/ldap/: No such file or directory

Will continue going through the rest of the update, however I'm writing to you as I see errors here and there

11

Re: Hi wish to use iRedMail for all my needs

What a mess sad

iRedMail requires a fresh server OS, otherwise it may be not able to correctly/properly configure files due to unknown content in config files.

So, please, use a fresh server OS.

By the way, many VPS vendors support restoring VPS to a fresh OS by yourself, like Linode. Your VPS vendor is not that good sad

12

Re: Hi wish to use iRedMail for all my needs

How can I try restoring my VPS to a fresh OS by myself? Maybe I could give it another try.

13

Re: Hi wish to use iRedMail for all my needs

Does your VPS vendor support this?

14 (edited by rroopstr 2016-05-04 00:51:55)

Re: Hi wish to use iRedMail for all my needs

Well, I told them that I need to configure iRedMail first and only then I will configure my LAMP server. They agree that it is my VPS and that I have the right to configure any way I want it. For the time being I removed three tars (iRedMail, iRedADP and iRedADmin) and also removed all their uncompressed files and folders. So my root is clean again and will try to reinstall.

My VPS provider are not very knowledgeable on linux, most of their customers use control panel, but they encourage me to learn as much as I can so that I can enjoy my service. Perhaps we'll teach them one thing or two. Thanks Zhang for your continued assistance.

15

Re: Hi wish to use iRedMail for all my needs

rroopstr wrote:

For the time being I removed three tars (iRedMail, iRedADP and iRedADmin) and also removed all their uncompressed files and folders. So my root is clean again and will try to reinstall.

No, this is not clear.
Clean, fresh for installing iRedMail means a newly installed server OS.

16 (edited by rroopstr 2016-05-04 02:26:00)

Re: Hi wish to use iRedMail for all my needs

ZhangHuangbin wrote:
rroopstr wrote:

For the time being I removed three tars (iRedMail, iRedADP and iRedADmin) and also removed all their uncompressed files and folders. So my root is clean again and will try to reinstall.

No, this is not clear.
Clean, fresh for installing iRedMail means a newly installed server OS.

[root@mlp ~]# cd /root/
[root@mlp ~]# tar xjf iRedMail-0.9.4.tar.bz2
[root@mlp ~]# cd /root/iRedMail-0.9.4/
[root@mlp iRedMail-0.9.4]# bash iRedMail.sh
[ INFO ] Checking new version of iRedMail ...
<< ERROR >> Your iRedMail version (0.9.4) is out of date, please
<< ERROR >> download the latest version and try again:
<< ERROR >> http://www.iredmail.org/download.html
I do not find any fresh iRedMail-0.9.5 version to download.

[root@mlp ~]# ls -l
-rwxrwxrwx  1 root root   30168 Jul 29  2013 installer-10-1-0-centos-64.sh.x
-rw-r--r--  1 root root   23374 May  4  2014 installer-10-1-0-centos-64.sh.x.tar.gz

is the installer above appropriate for OS ?

In the mean time I contacted my VPS provider about the possibility of reinstalling fresh OS.

Update at 2:25 pm Eastern Time: Dear Zhang, my VPS provider confirmed they will be happy to reinstall OS for me.

17

Re: Hi wish to use iRedMail for all my needs

I upgraded server from CentOs 6.7 to CentOs 7
[root@mlp ~]# cat /etc/*release
CentOS Linux release 7.0.1406 (Core)
NAME="CentOS Linux"
VERSION="7 (Core)"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="7"
PRETTY_NAME="CentOS Linux 7 (Core)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:centos:centos:7"
HOME_URL="https://www.centos.org/"
BUG_REPORT_URL="https://bugs.centos.org/"

CentOS Linux release 7.0.1406 (Core)
CentOS Linux release 7.0.1406 (Core)

Again, I get the same results as during the afternoon:
[root@mlp ~]# tar xjf iRedMail-0.9.4.tar.bz2
[root@mlp ~]# cd /root/iRedMail-0.9.4/
[root@mlp iRedMail-0.9.4]# bash iRedMail.sh
[ INFO ] Checking new version of iRedMail ...

<< ERROR >> Your iRedMail version (0.9.4) is out of date, please
<< ERROR >> download the latest version and try again:
<< ERROR >> http://www.iredmail.org/download.html

18

Re: Hi wish to use iRedMail for all my needs

Download the latest version (0.9.5) here:
http://www.iredmail.org/download.html

19 (edited by rroopstr 2016-05-04 12:59:00)

Re: Hi wish to use iRedMail for all my needs

It seems that this time everything worked smoothly!
A few details from the installation text output:

Delta RPMs disabled because /usr/bin/applydeltarpm not installed.
warning: /var/cache/yum/x86_64/7/epel/packages/altermime-0.3.10-10.el7.x86_64.rp                                             m: Header V3 RSA/SHA256 Signature, key ID 352c64e5: NOKEY
Public key for altermime-0.3.10-10.el7.x86_64.rpm is not installed

Installing : 1:dovecot-2.2.10-5.el7.x86_64                             82/248
warning: %post(dovecot-1:2.2.10-5.el7.x86_64) scriptlet failed, exit status 1
Non-fatal POSTIN scriptlet failure in rpm package 1:dovecot-2.2.10-5.el7.x86_64

ERROR: Corrupted database file /var/lib/clamav/main.cvd: Can't verify database i                                             ntegrity
Corrupted database file renamed to /var/lib/clamav/main.cvd.broken
Trying again in 5 secs...
ClamAV update process started at Wed May  4 00:18:08 2016
WARNING: Your ClamAV installation is OUTDATED!
WARNING: Local version: 0.99.1 Recommended version: 0.99.2
DON'T PANIC! Read http://www.clamav.net/documents/upgrading-clamav

Thanks so much for your great coding work. Will do my best to use iRedMail very soon! smile

20

Re: Hi wish to use iRedMail for all my needs

Good luck and enjoy. smile

21 (edited by rroopstr 2016-05-11 07:29:42)

Re: Hi wish to use iRedMail for all my needs

Greetings Zhang! I received invitation to upgrade to 0.9.5.1 but prefer to configure the previous release first. I am going through "Setup DNS records for your iRedMail server (A, PTR, MX, SPF, DKIM)" which I suppose should include ns1 and ns2 for the nginx server. My three websites are parked on /var/www waiting for my DNS configuration, they are still down.

I am reading the following tutorials:
http://www.unixmen.com/setting-dns-server-centos-7/
https://www.digitalocean.com/community/ … n-centos-7
https://www.centos.org/docs/5/html/Depl … -bind.html
(it seems that CentOs has no deployment guide for versions 6 and 7)
https://access.redhat.com/documentation … Definition

/etc/hostname is fresh in the sense that it only includes as output
mlp.riverocooper.com
which was the only thing we configured recently.

How do I start typing info? so that eventually it gets in the form
NAME                TTL     TYPE    DATA

www.mydomain.com.   1800    A       192.168.1.2
mail.mydomain.com.  1800    A       192.168.1.5

And how should I design my private address structure 192.169.1.0/24 so that everything will point out to my unique 5.226.169.119 address of my VPS which will host my three sites and their mails?

By the way, my ISP fixed the previous problem that I needed to open support ticket for them to reconfigure hostname and localhost files, I am able to reconfigure them myself, reboot the VPS and finally my new configurations are saved. They say that maybe the migration to CentOs 7 solved that issue.

Thanks very much for your assistance. I use linuxquestions fora as a Newbie and experienced users just give up and tell me: "I decided years ago that my zone files didn't change very often so BIND was one less thing to worry about. I use GD for my own DNS and Dynect for company DNS." I am sure that with enthusiasm, time, concentration and hard work I will be able to overcome these issues wink

22

Re: Hi wish to use iRedMail for all my needs

Did you buy your domain names from a domain registration vendor? Does your domain registration vendor host your domain names? Or you have to host DNS service yourself?

23

Re: Hi wish to use iRedMail for all my needs

ZhangHuangbin wrote:

Did you buy your domain names from a domain registration vendor?

Yes. Two domains will expire in June 2016 and the third domain will expire in March 2017.

ZhangHuangbin wrote:

Does your domain registration vendor host your domain names?

No. My new hosting provider was contracted three weeks ago while my three domains are still under the old registrar. As they expire I will renew them with my new hosting provider.
My websites were operational after migration of hosting providers because I instructed my registrar to point domains to my new IP address. Last week I installed iRedMail which required a fresh server. Now that iRedMail is installed I should get my websites operational again.

ZhangHuangbin wrote:

Or you have to host DNS service yourself?

I would be happy to host DNS service myself, just as I would be happy to host mail service myself. I found another tutorial at https://devops.profitbricks.com/tutoria … -centos-7/
and downloaded BIND 9 Administrator Reference Manual. I am slowly catching up with the challenge. The questions I asked you are those which, after a plain language answer from you, will facilitate my reading of all the gathered documentation.

24 (edited by rroopstr 2016-05-22 23:22:18)

Re: Hi wish to use iRedMail for all my needs

BIND was succesfully configured. Changed from NGINX to APACHE because it is easier to find support. All my websites are up. SPF, DKIM and google site verification TXT records were easily added to BIND DNS configuration. Will finally be able to configure and use iRedMail in the next few days. Also upgraded to 0.9.5-1
Do I need to perform any additional step? My saved iRedMail installation still supports nginx, but during the last few days I migrated from nginx to Apache. What should I do to disable nginx for iRedMail and enable apache for iRedMail?

25

Re: Hi wish to use iRedMail for all my needs

iRedAdmin requires mod_wsgi for Apache. Others should be fine.