1 (edited by harshilshah.oic 2019-11-13 18:59:05)

Topic: want my mail box on an external hdd

==== REQUIRED BASIC INFO OF YOUR IREDMAIL SERVER ====
- iRedMail version (check /etc/iredmail-release): latest stable
- Deployed with iRedMail Easy or the downloadable installer?
- Linux/BSD distribution name and version: Ubuntu server 18.04 lts
- Store mail accounts in which backend (LDAP/MySQL/PGSQL):  MySQL
- Web server (Apache or Nginx): Nginx
- Manage mail accounts with iRedAdmin-Pro?
- [IMPORTANT] Related original log or error message is required if you're experiencing an issue.
====

I am using iredmail on a raspberry pi 4 that is running ubuntu 18.04. Iredmail works perfectly fine on the sd card. Still the rpi boots from sd card only i just want the mail box in an external hdd.

did this:

https://forum.iredmail.org/topic9308-ir … boxes.html

But after moving the mail box to hdd, than login in roundcube it shows error occured and boom all the mails are gone. when i shift the mail box from hdd to back on the sd card to /var/vmail it is all back to normal.

Please tell me what am i suppose to do.
Thanks

----

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

2

Re: want my mail box on an external hdd

- What error did you get? Check /var/log/maillog and /var/log/dovecot/*.log please.
- Did you set correct owner/group/permission for the moved mailbox folder?

3

Re: want my mail box on an external hdd

Permission is root for the mail folder which is in the hdd and also the owner ship is root

about the logs you asked for, i am unable to write them all down here as forum has a limited space. Should i kind of give u a link or something for all the logs?

4

Re: want my mail box on an external hdd

/var/vmail/vmail1 must be owned by user/group "vmail:vmail", with permission 0700.

5

Re: want my mail box on an external hdd

hey, i changed the owner ship as u mentioned but still getting the same error when i go to domain.com/mail (at roundcube)
the error says "Server Error: SELECT: Internal error occurred. Refer to server log for more information."
and i don't know where to find these logs

6 (edited by harshilshah.oic 2019-11-18 14:20:50)

Re: want my mail box on an external hdd

root@mail:/var/vmail# ls -l
total 24
drwx------ 2 root     root     4096 Nov 18 05:44 backup
drwx------ 2 mlmmj    mlmmj    4096 Nov 18 05:44 mlmmj
drwx------ 2 mlmmj    mlmmj    4096 Nov 18 05:44 mlmmj-archive
drwx------ 2 www-data www-data 4096 Nov 18 05:44 pgp-keys
drwx------ 2 vmail    vmail    4096 Nov 18 05:44 public
drwx------ 2 vmail    vmail    4096 Nov 18 06:07 sieve
lrwxrwxrwx 1 vmail    vmail      31 Nov 18 06:09 vmail1 -> /mount/ubuntu/maail/new/vmail1/



this is the output after doing chown vmail:vmail and chmod 0700 to vmail1

7

Re: want my mail box on an external hdd

root@mail:/mount/ubuntu/maail/new/vmail# ls -l
total 28
drwxr-xr-x 2 root     root     4096 Nov 18 05:44 backup
drwx------ 2 mlmmj    mlmmj    4096 Nov 18 05:44 mlmmj
drwx------ 2 mlmmj    mlmmj    4096 Nov 18 05:44 mlmmj-archive
drwxr-xr-x 2 www-data www-data 4096 Nov 18 05:44 pgp-keys
drwxr-xr-x 2 vmail    vmail    4096 Nov 18 05:44 public
drwxr-xr-x 2 vmail    vmail    4096 Nov 18 06:07 sieve
drwx------ 3 vmail    vmail    4096 Nov 18 05:44 vmail1


I moved the vmail to a folder. Mounted the hard disk at /mount/ubuntu/maail     /new is just a folder and inside it is the vmail.

I have redone all the permissions taking this as a reference:https://forum.iredmail.org/topic14652-help-need-to-move-the-varvmail-directory.html


Please reply asap I need to set it up asap. And thanks for replying till now!

8

Re: want my mail box on an external hdd

Please show us output of commands below:

ls -dl /mount/ubuntu/maail/new/vmail1
ls -dl /mount/ubuntu/maail/new
ls -dl /mount/ubuntu/maail
ls -dl /mount/ubuntu
ls -dl /mount

Also turn on debug mode in Dovecot and paste related error log here.

9

Re: want my mail box on an external hdd

Hey, thanks for replying but here is another problem and now i am pretty sure iredmail is causing it. Sometimes like now i am unable to ssh to my server. This happens only after installation of iredmail. And it's not that every time it happens. Sometimes on a simply reboot ssh starts working and else connection is refused.

Have any solution for this? Cause now to see the permissions of the dir you have asked for i will have to go to the server and it's a bit far away....

10

Re: want my mail box on an external hdd

Alright again i called up someone near to serve and asked to reboot and the ssh suddenly started to work. Here is the output that you asked:

drwx------ 3 vmail vmail 4096 Nov 18 05:44 /mount/ubuntu/maail/new/vmail1
drwxr-xr-x 3 vmail vmail 4096 Nov 19 03:40 /mount/ubuntu/maail/new
drwx------ 4 ubuntu ubuntu 4096 Nov 18 08:19 /mount/ubuntu/maail
drwxr-xr-x 3 root root 4096 Jan 28  2018 /mount/ubuntu
drwxr-xr-x 3 root root 4096 Jan 28  2018 /mount

I guess is it that i have to change the ownership of all of them to vmail:vmail and permission to 0700??? Is that what is wrong here?

11 (edited by harshilshah.oic 2019-11-19 17:40:11)

Re: want my mail box on an external hdd

UPDATE:
tried creating the whole scene in a virtual box, created a new virtualbox with ubuntu 18 LTS server os.
Mounted a virtual a hdd at /media/demo/maail
moved the vmail1 folder to the mounted location
Given the permission, ownership that you have already told to and also created the symlink

and it still gives the same error......

Also tried moving the vmail1 folder simpy to desktop, that worked very well. I didn't even had to change the ownership for that!

I tried moving  vmail1 and the whole vmail folder but the results were the same as above in both the cases....

Please help!!!

12

Re: want my mail box on an external hdd

harshilshah.oic wrote:

drwx------ 4 ubuntu ubuntu 4096 Nov 18 08:19 /mount/ubuntu/maail

This directory permission is the problem. With 0700 on /mount/ubuntu/maail/, only user "ubuntu" can access this directory. That's why "vmail" user can not access /mount/ubuntu/maail/new/vmail1.

You should set it to 0755 on /mount/ubuntu/maail. If "/mount/ubuntu" is some user's HOME directory, you'd better mount "vmail1" to other directories like /mnt/vmail.

13

Re: want my mail box on an external hdd

Sure, let me try that and will reply back soon!

14

Re: want my mail box on an external hdd

Instead should i just change the ownership and permission of this location??
/mount/Ubuntu/maail

15

Re: want my mail box on an external hdd

hey Zhang!! Thank you so much for your help buddy I just changed the permission and ownership of /mount/ubuntu/maail and it all started working!! Thanks a lot man!

One last question, I am unable to login into  domain.com/netdata can you please tell me something about that too??

16

Re: want my mail box on an external hdd

harshilshah.oic wrote:

One last question, I am unable to login into  domain.com/netdata can you please tell me something about that too??

Excuse me, about what of netdata?
You can find more details here:

https://www.netdata.cloud
https://github.com/netdata/netdata

17

Re: want my mail box on an external hdd

When i was installing iredmail, it asked me if i want to also install netdata to monitor traffic on my server. I selected it to install.

Now when i try to access domain.com/netdata it just pops a dialog box to enter user id and pass.

In the end of configuration of iredmail it didn't told me what are the credentials for netdata.

Any idea about that??

18

Re: want my mail box on an external hdd

It uses the postmaster@<first-mail-domain> and its password by default. You should be able to find it in file iRedMail-0.9.9/config.

19

Re: want my mail box on an external hdd

my hostname -f is mail.domain.com

so you mean to say the username will be "postmaster@mail" and password will be same as i enter in iredadmin?

correct??

20

Re: want my mail box on an external hdd

It's "postmaster@<your-first-mail-domain-name>", the first mail domain name is the one you inputed during iRedMail installation, it's NOT your server hostname.

21

Re: want my mail box on an external hdd

okay, let me try that once again! thanks for answering it in such detail....

22

Re: want my mail box on an external hdd

Hey Zhang, you may close this thread as for a few days I won't be able to check up the server. I will start a new one if needed.
And thanks for all the help!