Koozali.org: home of the SME Server

Inbox problems

Offline Paperguides

  • ****
  • 118
  • +0/-0
Inbox problems
« on: August 03, 2016, 11:38:54 PM »
I recently had a problem which resulted in my server running out of disk space.  I fixed the problem but since then I've had a problem with messages in my email inbox.

I use Thunderbird with IMAP to access my email and initially, after reboot, I can see my messages both headers and message content but this soon disappears.  I tried webmail and initially I could see my messages and interact I now get a blank page.  Intermittently Thunderbird loses it connection to the server.  I can see and read all the messages in other IMAP folders on the server. I tried ClawsMail as well and this show no messages in the inbox.

Any pointers on how I solve this problems?

T

Tony
...

Offline ReetP

  • *
  • 3,949
  • +6/-0
Re: Inbox problems
« Reply #1 on: August 04, 2016, 12:50:33 AM »
Hi,

I recently had a problem which resulted in my server running out of disk space.  I fixed the problem but since then I've had a problem with messages in my email inbox.

Hmmm..... you say you fixed the problem, but you still have a problem. So maybe you didn't actually fix it.

Can you please be a bit more specific about:

The system, updates, contribs installed etc etc

What caused the original problem

What you did to 'fix' it



Quote
I use Thunderbird with IMAP to access my email and initially, after reboot, I can see my messages both headers and message content but this soon disappears.  I tried webmail and initially I could see my messages and interact I now get a blank page.  Intermittently Thunderbird loses it connection to the server.  I can see and read all the messages in other IMAP folders on the server. I tried ClawsMail as well and this show no messages in the inbox.

Any pointers on how I solve this problems?

I think the first thing is to see how you got to this point before anyone can make a stab at helping you.

One thing you could possibly try is to fire up 'mc' and have a peek in your actual mail folders as I think the mails are probably there but your client can't see them. Remember, each mail is stored as a file so we should be able to see them.

Try to navigate to something like

/home/e-smith/files/users/yourusername/Maildir/cur or ./new

Any files in there ?

They will have odd names like:

1323795907.19545.esmith:2,Sd

You can see the content with mc or on the CLI :

cat 1323795907.19545.esmith:2,Sd

If so we know that at least your mail is actually there.

Are there any errors in :

/var/log/messages
/var/log/imap/current
/var/log/imaps/current

If you come back with more details someone may be able to help further.

B. Rgds
John
...
1. Read the Manual
2. Read the Wiki
3. Don't ask for support on Unsupported versions of software
4. I have a job, wife, and kids and do this in my spare time. If you want something fixed, please help.

Bugs are easier than you think: http://wiki.contribs.org/Bugzilla_Help

If you love SME and don't want to lose it, join in: http://wiki.contribs.org/Koozali_Foundation

Offline Paperguides

  • ****
  • 118
  • +0/-0
Re: Inbox problems
« Reply #2 on: August 04, 2016, 01:47:08 AM »
The system, updates, contribs installed etc etc  SME 9.1 set up as server only; fully updated with no contribs currently installed.

What caused the original problem

Moving data from a suspect portable HD - put simply, I didn't check carefully enough how much space I needed to complete the transfer to a new disk.

What you did to 'fix' it

Moved the data back off the server drive to a new USB drive.

Try to navigate to something like

/home/e-smith/files/users/yourusername/Maildir/cur or ./new

Any files in there ?


over 3900 files - I need to do some housekeeping on my email folder. :-(

see attached (from WinSCP)

I can see no error messages in /var/log/messages relating to IMAP or IMAPS.

/var/log/imap/current
/var/log/imaps/current


As far as I can see in WinSCP, these directories do not exist on my server.

However /var/log/dovecot/current contains lots of the following:

2016-08-03 23:46:59.294408500 imap-login: Info: Login: user=<tony>, method=PLAIN, rip=46.xx.xxx.130, lip=192.168.200.10, mpid=5129, TLS
2016-08-03 23:47:00.373743500 imap(tony): Error: open(/home/e-smith/files/users/tony/Maildir/cur/1435849344.9590.main:2,Sa) failed: Permission denied (euid=5000(office$) egid=5000(office$) missing +r perm: /home/e-smith/files/users/tony/Maildir/cur/1435849344.9590.main:2,Sa, euid is not dir owner)
2016-08-03 23:47:00.373751500 imap(tony): Info: Disconnected: Internal error occurred. Refer to server log for more information. [2016-08-03 23:47:00] bytes=647/197804

Does this mean there is a miss-match between my logon ID and the file permissions?  I suspect that a change to the directory/file permission will not fix this.

Thanks,

Tony

...

Offline ReetP

  • *
  • 3,949
  • +6/-0
Re: Inbox problems
« Reply #3 on: August 04, 2016, 02:29:15 AM »
The system, updates, contribs installed etc etc  SME 9.1 set up as server only; fully updated with no contribs currently installed.

OK

Quote
What caused the original problem

Moving data from a suspect portable HD - put simply, I didn't check carefully enough how much space I needed to complete the transfer to a new disk.

:-) We all make mistakes. just some are worse than others !

Quote
What you did to 'fix' it

Moved the data back off the server drive to a new USB drive.


And absolutely nothing else ? Exactly what 'data'  ? Just wondering why you have a server with mail, but no data. Was this an upgrade or something ? Just trying to make sure we get ALL the facts and history - the devil lies in the details usually... please spell out exactly what you were doing.

Quote

over 3900 files - I need to do some housekeeping on my email folder. :-(



Is that all ? :-)
(On a side note, it is generally reckoned Thunderbird is happier when you keep under 10,000 per folder, so you are OK for now......)

Quote
see attached (from WinSCP)

Unfortunately it isn't that clear. But it looks like they are at least owned by user 'office' and as you say, you seem to be user 'tony'

Quote
I can see no error messages in /var/log/messages relating to IMAP or IMAPS.

OK

Quote
/var/log/imap/current
/var/log/imaps/current


As far as I can see in WinSCP, these directories do not exist on my server.

Sorry - was looking at the wrong server my end !

Can you use putty to get a command line ?

Quote
However /var/log/dovecot/current contains lots of the following:

2016-08-03 23:46:59.294408500 imap-login: Info: Login: user=<tony>, method=PLAIN, rip=46.xx.xxx.130, lip=192.168.200.10, mpid=5129, TLS
2016-08-03 23:47:00.373743500 imap(tony): Error: open(/home/e-smith/files/users/tony/Maildir/cur/1435849344.9590.main:2,Sa) failed: Permission denied (euid=5000(office$) egid=5000(office$) missing +r perm: /home/e-smith/files/users/tony/Maildir/cur/1435849344.9590.main:2,Sa, euid is not dir owner)
2016-08-03 23:47:00.373751500 imap(tony): Info: Disconnected: Internal error occurred. Refer to server log for more information. [2016-08-03 23:47:00] bytes=647/197804

Does this mean there is a miss-match between my logon ID and the file permissions? 

That's a good guess....

Quote
I suspect that a change to the directory/file permission will not fix this.

And that is probably a bad one :-)


Clearly something isn't right here.... you have neglected to mention something somewhere.

Here are a couple of lines from one of my servers for some mail of mine - my login is 'john':

-rw------- 1 john john     1203 Aug  3 23:00 1470258025.4751_3.esmith:2,S
-rw------- 1 john john   202612 Aug  4 00:23 1470262981.10135_3.esmith:2,Sl
-rw------- 1 john john    30326 Aug  4 01:34 1470267282.13332_3.esmith:2,Sl

So yes it look like your mail files and possibly directories have the wrong ownership.

The question is how did that happen ? Or were you a different user in another life ?

What about this showing us this from Putty (you really need to get to the command line to sort some of this):

cat /etc/passwd |grep -i tony

and

ll /home/e-smith/files/users/tony/Maildir

The situation is possibly fixable, but we really need to understand how you got there in case there are other issues.

B. Rgds
John
...
1. Read the Manual
2. Read the Wiki
3. Don't ask for support on Unsupported versions of software
4. I have a job, wife, and kids and do this in my spare time. If you want something fixed, please help.

Bugs are easier than you think: http://wiki.contribs.org/Bugzilla_Help

If you love SME and don't want to lose it, join in: http://wiki.contribs.org/Koozali_Foundation

Offline Paperguides

  • ****
  • 118
  • +0/-0
Re: Inbox problems
« Reply #4 on: August 04, 2016, 09:52:24 AM »
HI,

Sorry in the delay in replying.  It was getting late. :-)

I recently moved to this new server as part of an exercise to upgrade to from V8 to V9.  It is an HP micro server but only had a small (250G) hard disk.  The 'plan' is (was?) to upgrade again to a larger drive and/or RAID.  It's supports email for my business (a one man band) but as there are only 4 users there very little need to share data between users.  I have tended to use it as a space to backup data from the workstations and laptops.

The data was accumulated dross; pictures, ebooks, and music.  I created an ibay, shared it and started the transfer using win 10.    I suspect that the system continued to receive the horrendous volume of SPAM and ran out of disk space.  Admin messages are directed to my mailbox so it would have been writing there when the problem arose.

WinSCP set up to open a putty window every time so.........

[root@main ~]# cat /etc/passwd |grep -i tony
tony:x:5000:5000:Tony Smith-Crallan:/home/e-smith/files/users/tony:/usr/bin/rssh

[root@main ~]# ll /home/e-smith/files/users/tony/Maildir
total 5944
drwxr-xr-x 2 office$ office$  258048 Aug  4 06:47 cur
-rw-r--r-- 1 office$ office$   79044 Aug  3 22:40 dovecot.index
-rw-r--r-- 1 office$ office$ 5644288 Aug  4 06:46 dovecot.index.cache
-rw-r--r-- 1 office$ office$   31596 Aug  4 06:47 dovecot.index.log
-rw------- 1 office$ office$     120 Oct  8  2015 dovecot-keywords
-rw-r--r-- 1 office$ office$     120 Aug  3 19:31 dovecot.mailbox.log
-rw-r--r-- 1 office$ office$  160250 Aug  4 07:08 dovecot-uidlist
-rw-r--r-- 1 office$ office$       8 Aug  2 23:39 dovecot-uidvalidity
-r--r--r-- 1 office$ office$       0 Jul 12 15:42 dovecot-uidvalidity.578501dc
drwxr-xr-x 2 office$ office$    4096 Aug  4 08:14 new
-rw-r--r-- 1 office$ office$     976 Aug  3 19:31 subscriptions
drwxr-xr-x 2 office$ office$    4096 Aug  4 08:14 tmp
[root@main ~]#

Thanks for the advice so far.

Tony
...

Offline Stefano

  • *
  • 10,894
  • +3/-0
Re: Inbox problems
« Reply #5 on: August 04, 2016, 10:27:06 AM »
you messed your server..

and you missed to tell us how did you try to upgrade/move your setup

try

Code: [Select]
signal-event user-modify tony


Offline ReetP

  • *
  • 3,949
  • +6/-0
Re: Inbox problems
« Reply #6 on: August 04, 2016, 10:29:25 AM »
HI,
Sorry in the delay in replying.  It was getting late. :-)

Was for me too here in Spain :-)

Quote
I recently moved to this new server as part of an exercise to upgrade to from V8 to V9.  It is an HP micro server but only had a small (250G) hard disk.  The 'plan' is (was?) to upgrade again to a larger drive and/or RAID.  It's supports email for my business (a one man band) but as there are only 4 users there very little need to share data between users.  I have tended to use it as a space to backup data from the workstations and laptops.

Ahhh, slowly the truth will out as they say..... best laid plans of mice and men. A good reason to follow a strict plan, avoid guesswork and not take chances with production servers.

7 Ps....

Prior Preparation and Planning Prevent P*iss Poor Performance, as they say in the Army ;-)

Quote
The data was accumulated dross; pictures, ebooks, and music.  I created an ibay, shared it and started the transfer using win 10.    I suspect that the system continued to receive the horrendous volume of SPAM and ran out of disk space.  Admin messages are directed to my mailbox so it would have been writing there when the problem arose.

Hmmmm. I am suspecting we are still missing something here. Did you follow the standard backup procedure ? i.e. disconnect server, backup to drive, stop old server, start new server, restore, check all is in place, connect new server ?


Quote
WinSCP set up to open a putty window every time so.........

OK

Quote
[root@main ~]# cat /etc/passwd |grep -i tony
tony:x:5000:5000:Tony Smith-Crallan:/home/e-smith/files/users/tony:/usr/bin/rssh

[root@main ~]# ll /home/e-smith/files/users/tony/Maildir
total 5944
drwxr-xr-x 2 office$ office$  258048 Aug  4 06:47 cur
-rw-r--r-- 1 office$ office$   79044 Aug  3 22:40 dovecot.index
-rw-r--r-- 1 office$ office$ 5644288 Aug  4 06:46 dovecot.index.cache
-rw-r--r-- 1 office$ office$   31596 Aug  4 06:47 dovecot.index.log
-rw------- 1 office$ office$     120 Oct  8  2015 dovecot-keywords
-rw-r--r-- 1 office$ office$     120 Aug  3 19:31 dovecot.mailbox.log
-rw-r--r-- 1 office$ office$  160250 Aug  4 07:08 dovecot-uidlist
-rw-r--r-- 1 office$ office$       8 Aug  2 23:39 dovecot-uidvalidity
-r--r--r-- 1 office$ office$       0 Jul 12 15:42 dovecot-uidvalidity.578501dc
drwxr-xr-x 2 office$ office$    4096 Aug  4 08:14 new
-rw-r--r-- 1 office$ office$     976 Aug  3 19:31 subscriptions
drwxr-xr-x 2 office$ office$    4096 Aug  4 08:14 tmp
[root@main ~]#

Can you just show us:

cat /etc/passwd |grep -i office

What I do not understand is how you managed to transfer your mail directories. I have a feeling you have tried a manual transfer somehow and that is where it has gone wrong, but as you have still only told us part of the story it is hard to know.

B. Rgds
John
...
1. Read the Manual
2. Read the Wiki
3. Don't ask for support on Unsupported versions of software
4. I have a job, wife, and kids and do this in my spare time. If you want something fixed, please help.

Bugs are easier than you think: http://wiki.contribs.org/Bugzilla_Help

If you love SME and don't want to lose it, join in: http://wiki.contribs.org/Koozali_Foundation

Offline Paperguides

  • ****
  • 118
  • +0/-0
Re: Inbox problems
« Reply #7 on: August 04, 2016, 04:42:38 PM »
Did you follow the standard backup procedure ? i.e. disconnect server, backup to drive, stop old server, start new server, restore, check all is in place, connect new server ?

That was basically the sequence. Disconnect the mail server from the Internet, take workstation backup, build server from DVD, yum update, restore from workstation backup, re-make the link to the mail server.   AFAICT, the server was working perfectly OK prior to the problem with running out of disk space. I am confused.

Checking the other users, all their mail directories are 'owned' by them.  office$ isn't a valid user on my system.

Stefano,

What does:

signal-event user-modify tony

do?

Thanks for your interest and help.

Tony

...

Offline Stefano

  • *
  • 10,894
  • +3/-0
Re: Inbox problems
« Reply #8 on: August 04, 2016, 05:03:56 PM »
Stefano,

What does:

Code: [Select]
signal-event user-modify tony
do?

Thanks for your interest and help.

Tony



I re read all the things that command do and no, it won't fix your issue

you'd try

Code: [Select]
chown -R tony:tony /home/e-smith/files/users/tony

the only file I see with a different owner (user:group) is the symbolic link to .qmail-default (which has root:admin)

Offline Stefano

  • *
  • 10,894
  • +3/-0
Re: Inbox problems
« Reply #9 on: August 04, 2016, 05:05:51 PM »
P.S. tony, May I suggest/kindly ask you to use standard [ quote ] and [ code ] tags?

thank you for your collaboration and patience

Offline Paperguides

  • ****
  • 118
  • +0/-0
Re: Inbox problems
« Reply #10 on: August 04, 2016, 05:13:27 PM »
Code: [Select]
chown -R tony:tony /home/e-smith/files/users/tony

That produced:

[root@main ~]# chown -R tony:tony /home/e-smith/files/users/tony
chown: invalid group: `tony:tony'
[root@main ~]#


Sorry I missed the quote flag at the top.

Tony
...

Offline Stefano

  • *
  • 10,894
  • +3/-0
Re: Inbox problems
« Reply #11 on: August 04, 2016, 05:17:03 PM »
please, post the output of

Code: [Select]
grep tony /etc/group

you'd have something like (among other lines)
Code: [Select]
tony:x:5000:tony

I repeat, you messed up your server in some way

Offline Paperguides

  • ****
  • 118
  • +0/-0
Re: Inbox problems
« Reply #12 on: August 04, 2016, 05:26:26 PM »
[root@main ~]# grep tony /etc/group
shared:x:500:admin,group_data,jenni,music,nicky,photos,public,rebekah,tony,work,www
[root@main ~]#

I suspected that running out disk space on a working mail server would cause some problems but I may well have done something else. :-(

I would really like to retain my email but if the only solution is to delete my user ID and re-create then I will. :-(((

Tony
...

Offline Stefano

  • *
  • 10,894
  • +3/-0
Re: Inbox problems
« Reply #13 on: August 04, 2016, 05:28:39 PM »
no, deleting and recreating won't help you

please, check if in /etc/group you have a group with id 5000 (a line like the one I posted above).. if not:

- make a copy of /etc/group
- edit /etc/group and add a line like above
- save

try again the chown command and report back

Offline Paperguides

  • ****
  • 118
  • +0/-0
Re: Inbox problems
« Reply #14 on: August 04, 2016, 05:37:33 PM »
I found the following lines:

.
slocate:x:21:
office$:x:5000:
nicky:x:5001:nicky
.

Do I edit the office$ line, replace it with tony:x:5000:tony or add it as additional line at the end?

Thanks
...