1

Topic: create_mail_user_MySQL.sh issues

==== Required information ====
- iRedMail version: 0.8.1
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): MySQL
- Linux/BSD distribution name and version: Ubuntu Server 12.04 LTS
- Related log if you're reporting an issue: -
====

Hi,

the above-mentioned file is not in the 0.8.1 pkg downloaded. Instead there is a create_mail_user_SQL.sh file which is empty.

so I went to download a copy from your posting in Google Code (http://code.google.com/p/iredmail/sourc … 02ec40ca35) instead.

then tried to run the script with "# sh create_mail_user_MySQL.sh abc.com john.ng apple.lim joshua.ong ...."

E1) a few errors occurred regarding unexpected operator in line 72, 94/96 and a few other lines that are all related to the if...then...else statements. Thought just the extra "; " in the statements, but after removing those "; " still have a list of warning regarding unexpected operators.

I ignored those error and try to load them into the MySQL without any problem. But when I view the mailbox table using phpmyadmin, saw a few more problems.

E2) password field empty. I did changed the values for " DEFAULT_PASSWD='ABC@defg890' " and " USE_DEFAULT_PASSWD='YES' "

E3) initially using the default " STORAGE_BASE_DIRECTORY="/var/vmail/vmail1" ", but the path shown in the table is diff from those account created manually using the iRedAdmin. So need to amend this to " STORAGE_BASE_DIRECTORY="/var/vmail "

E4) " MAILDIR_STYLE='hashed' " not working at all. The path created by the script points to /var/vmail/vmail1/abc.com/john.ng + timestamp in the database table.

E5) referring to the path in E4), when I went into /var/vmail/vmail1/abc.com, I don't see any of the new accounts directory created using the scripts

Hope you create come out with the amended script ASAP, as I have close to 200 accounts to create and sync over to iRedMail using the imapsync script.

If you need help to test the modified script, you can contact me via winson  @  aceagape.com

----

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

2

Re: create_mail_user_MySQL.sh issues

winson wrote:

the above-mentioned file is not in the 0.8.1 pkg downloaded. Instead there is a create_mail_user_SQL.sh file which is empty.

This file is shipped in iRedMail-0.8.1, please use the latest version which is available here:
https://bitbucket.org/zhb/iredmail/src/ … Mail/tools

The one in Google Code is out of date, don't use it please.

3

Re: create_mail_user_MySQL.sh issues

ok, will try it out.

btw, how to enable ssh on the firewall so that I can use putty to access the command line. don't seem to get it to work.

4

Re: create_mail_user_MySQL.sh issues

SSH is enabled by default.

5

Re: create_mail_user_MySQL.sh issues

ZhangHuangbin wrote:

SSH is enabled by default.

Still unable to connect to iRedMail server via ssh using CryptoTerm / Putty.

6

Re: create_mail_user_MySQL.sh issues

Hi Huangbin,

downloaded the latest script but still having similar problems with additional findings.

E1) unexpected operator warnings still there. Below are the actual output:
create_mail_user_SQL.sh: 75: [: XYES: unexpected operator
create_mail_user_SQL.sh: 98: [: Xhashed: unexpected operator
create_mail_user_SQL.sh: 121: [: XMaildir: unexpected operator
create_mail_user_SQL.sh: 98: [: Xhashed: unexpected operator
create_mail_user_SQL.sh: 121: [: XMaildir: unexpected operator

line 98 and 121 repeating 'cos I am testing with 2 users

I ignored these warning and go ahead with the mysql inputs:

E2) password field empty when I changed the values for " DEFAULT_PASSWD='ABC@defg890' " and " USE_DEFAULT_PASSWD='YES' ". But this time round discovered something else: the first run, I forgotten to change the USE_DEFAULT_PASSWD value to YES, and it did generate password in the database table when value is NO. But when I changed it to YES, it did not gen any password.

previously reported E3) now ok.

E4) " MAILDIR_STYLE='hashed' " still not working. The path created by the script still points to /var/vmail/vmail1/abc.com/john.ng + timestamp in the database table.

As for E5) reported earlier, just realised system will only create those directory after user has login vi webmail (not tested with other email client yet).

Hope to hear from you soon.

7

Re: create_mail_user_MySQL.sh issues

winson wrote:

E1) unexpected operator warnings still there. Below are the actual output:
create_mail_user_SQL.sh: 75: [: XYES: unexpected operator

Please execute this script with bash, not "sh". For example:

# cd iRedMail-0.8.1/tools/
# bash create_mail_user_SQL.sh

The "sh" shell is /bin/dash by default, not /bin/bash.