Cleanup question.

Use this forum if you have installed hMailServer and want to ask a question related to a production release of hMailServer. Before posting, please read the troubleshooting guide. A large part of all reported issues are already described in detail here.
Post Reply
Cassy
Normal user
Normal user
Posts: 37
Joined: 2009-08-11 12:24

Cleanup question.

Post by Cassy » 2009-10-27 08:05

Hi!

Can I delete the unneeded eml files from an account in Hmailserver just by deleting them in Windows explorer, or will this damage some kind of indexing system or something?

Thanks.
C.

roi
Normal user
Normal user
Posts: 153
Joined: 2009-09-20 12:56
Location: Chiba, Japan

Re: Cleanup question.

Post by roi » 2009-10-27 08:22

Yes... the metadata database will get out of sync with the eml files stored (or listed in the database as stored) in the Data folders. Best to log in the account using an email client and delete un-needed email from there.
hMS: 5.2.1-B361 | DB: Internal MySQL from hMS 4.4 | OS: W2K3 1Gb VM

Cassy
Normal user
Normal user
Posts: 37
Joined: 2009-08-11 12:24

Re: Cleanup question.

Post by Cassy » 2009-10-27 10:16

Thanks!

C.

^DooM^
Site Admin
Posts: 13861
Joined: 2005-07-29 16:18
Location: UK

Re: Cleanup question.

Post by ^DooM^ » 2009-10-27 12:03

Quickest way would be to delete the account in the admin and re-add it assuming you know the password.
If at first you don't succeed, bomb disposal probably isn't for you! ヅ

User avatar
sheffters
Senior user
Senior user
Posts: 453
Joined: 2009-07-01 20:46
Contact:

Re: Cleanup question.

Post by sheffters » 2009-10-27 12:09

^Doom^: Cassy, I have a very, very, very cunning plan.
Cassy: Is it as cunning as a fox what used to be Professor of Cunning at Oxford University but has moved on and is now working for the U.N. at the High Commission of International Cunning Planning?
^Doom^: Yes it is.
Cassy: Hmm... that's cunning.

:) .. gotta love Blackadder!

S.

^DooM^
Site Admin
Posts: 13861
Joined: 2005-07-29 16:18
Location: UK

Re: Cleanup question.

Post by ^DooM^ » 2009-10-27 12:16

lol nutter :D
If at first you don't succeed, bomb disposal probably isn't for you! ヅ

roi
Normal user
Normal user
Posts: 153
Joined: 2009-09-20 12:56
Location: Chiba, Japan

Re: Cleanup question.

Post by roi » 2009-10-27 13:39

I'm not privy to your private cunning joke. In any case, I'll share with you the story of the cunning farmer and his watermelons (you may have already heard this.)

A farmer had been pestered by a thief who had been taking liberty on his watermelons without hindrance. The high fence he built around his farm had no effect whatsoever.

Then he got a really bright idea. He put up the sign:
"Warning - One of these watermelons is poisoned."
Now that was really cunning. The farmer could not help congratulating himself for such a simple, cunning solution.

The next morning, the farmer walked to his watermelon farm with a smile. "Surely, the thief would not have dared steal a watermelon," he thought. He was right.

What he found was his sign edited with red paint:
"Warning - Two of these watermelons are poisoned."
hMS: 5.2.1-B361 | DB: Internal MySQL from hMS 4.4 | OS: W2K3 1Gb VM

User avatar
sheffters
Senior user
Senior user
Posts: 453
Joined: 2009-07-01 20:46
Contact:

Re: Cleanup question.

Post by sheffters » 2009-10-27 13:44

haha classic :)

the cunning one is a quote from http://en.wikipedia.org/wiki/Blackadder an 80's comdy thing in the UK.

S.

Arnold van Walen
Normal user
Normal user
Posts: 31
Joined: 2008-03-02 12:17
Location: Netherlands
Contact:

Re: Cleanup question.

Post by Arnold van Walen » 2009-10-31 18:22

roi wrote:Yes... the metadata database will get out of sync with the eml files stored (or listed in the database as stored) in the Data folders. Best to log in the account using an email client and delete un-needed email from there.
But there is an other problem in hMailserver.
After a while there are a lot of .eml files in the directories without a reference in the database.

hMailserver went that slow that i had to act.
I found 700Mb !!??!!?? :shock: :shock: emails that could be deleted.

Cassy
Normal user
Normal user
Posts: 37
Joined: 2009-08-11 12:24

Re: Cleanup question.

Post by Cassy » 2009-10-31 19:32

Arnold van Walen wrote:But there is an other problem in hMailserver.
After a while there are a lot of .eml files in the directories without a reference in the database.

hMailserver went that slow that i had to act.
I found 700Mb !!??!!?? :shock: :shock: emails that could be deleted.
So we're back to where we were.

Is there a command in hms to repair the database, or to re-index? If so, how does one access it?

Thanks.
C.

User avatar
sheffters
Senior user
Senior user
Posts: 453
Joined: 2009-07-01 20:46
Contact:

Re: Cleanup question.

Post by sheffters » 2009-10-31 20:31

are you getting a lot of database errors in the logs? ... seems weird to have so many orphaned files :(

S.

^DooM^
Site Admin
Posts: 13861
Joined: 2005-07-29 16:18
Location: UK

Re: Cleanup question.

Post by ^DooM^ » 2009-10-31 21:23

Take a look at the following three links.

First, howto repair corrupted SQL tables but while you are in there you can optimize etc.
http://www.hmailserver.com/documentatio ... pair_mysql

Now the next two links are dependant on what you want to do.

Re-Enter database entries based on the emails that are orphaned.
http://www.hmailserver.com/documentatio ... ssage_list

Or a cleanup with this script i wrote a while back to removed orphaned emails if their database info does not exist.
http://www.hmailserver.com/forum/viewto ... 20&t=15514
If at first you don't succeed, bomb disposal probably isn't for you! ヅ

Cassy
Normal user
Normal user
Posts: 37
Joined: 2009-08-11 12:24

Re: Cleanup question.

Post by Cassy » 2009-10-31 21:59

Thanks, Doom; so far, so good.

As far as I know, my db isn't corrupted (yet), but there's one thing I want to clarify:

http://www.hmailserver.com/documentatio ... pair_mysql says:

"Enter your main hMailServer Administrator password. This is the password you specified during the installation when you first installed hMailServer. Click OK."

I never entered a server name. I just click "Enter" to ender the HMS Administrator. What do I enter for that step to repair the db?

Thanks.
C.

^DooM^
Site Admin
Posts: 13861
Joined: 2005-07-29 16:18
Location: UK

Re: Cleanup question.

Post by ^DooM^ » 2009-10-31 22:40

If at first you don't succeed, bomb disposal probably isn't for you! ヅ

Arnold van Walen
Normal user
Normal user
Posts: 31
Joined: 2008-03-02 12:17
Location: Netherlands
Contact:

Re: Cleanup question.

Post by Arnold van Walen » 2009-11-03 11:20

sheffters wrote:are you getting a lot of database errors in the logs? ... seems weird to have so many orphaned files :(

S.
No i do not get database errors in the log.
To get rid of the problem i wrote a program that checkes the files versus the database.
If the file is orphaned then i delete the file.
The only files i have to delete manually are the orphaned files in the root directory.
Queued files that are not processed.
That problem occurred when the mailserver crashed about once a day leaving a number of queued messages in the directory.

Since i stopped checking the email with WinClam the CPU usage dropped from 80-90% to max 5%.
Now i only see orphaned email after a system reboot. (Microsoft updates).

westdam
Senior user
Senior user
Posts: 728
Joined: 2006-08-01 21:24
Location: Padova, Italy
Contact:

Re: Cleanup question.

Post by westdam » 2009-11-03 12:01

try to run DDS , it will check for orphan file..

exis
New user
New user
Posts: 22
Joined: 2010-04-22 09:44

Re: Cleanup question.

Post by exis » 2010-04-22 18:51

after only a few days of running hMS with ~150 accounts and ~20 domains, we have in the respective data directories too many empty folders (containing 0 (zero) files in them)

is it safe to manually shift+delete them?

if yes, is there a way that this cleanup task is done via the hMS?

User avatar
Slug
Moderator
Moderator
Posts: 1369
Joined: 2005-03-13 05:42
Location: Sydney Australia
Contact:

Re: Cleanup question.

Post by Slug » 2010-04-22 19:10

You can delete them, but your wasting your time. They will only be rewritten at a later date if needed, and are left for performance reasons.

Michael
Missing Hmailserver ... Now running Debian servers

^DooM^
Site Admin
Posts: 13861
Joined: 2005-07-29 16:18
Location: UK

Re: Cleanup question.

Post by ^DooM^ » 2010-04-22 20:24

If at first you don't succeed, bomb disposal probably isn't for you! ヅ

exis
New user
New user
Posts: 22
Joined: 2010-04-22 09:44

Re: Cleanup question.

Post by exis » 2010-04-23 11:04

^DooM^ wrote:Why do you want to remove them?

http://www.hmailserver.com/documentatio ... in_datadir
we were just wondering why all the empty folders, your link (FAQ) was very enlightening

thank you

Post Reply