Koozali.org: home of the SME Server

Obsolete Releases => SME 7.x Contribs => Topic started by: devtay on April 28, 2009, 09:18:20 PM

Title: Email Archiving
Post by: devtay on April 28, 2009, 09:18:20 PM
I am curious how everyone archives email on their servers. I am not referring to using Thunderbird or Outlook to make additional PST files, etc. I mean from a server admin side of things, how do you keep reasonably easily searchable archives of the email through the server?

What I do is what is described here: http://wiki.contribs.org/Email#Keep_a_copy_of_all_emails. I have a logger account and every email sent or received goes into that account. I use an email client to IMAP connect to the logger account and sort the mail to a folder for the current month (ie jan 2009). That enables me to go back to that time frame and look at the emails there. What I am worried about is the amount of storage that is now amassed on my server holding these emails. I think there has to be a better way. Any input is appreciated.
Title: Re: Email Archiving
Post by: janet on April 29, 2009, 03:19:24 AM
devtay

If you need real time access, then upgrade your hard disk to a bigger one.
There's no magic answer to storing more data in less space.

If you just need to access them whenever (without urgency), then back them up (compressed of course) to DVD or external hard drive and then delete them from the server.

Title: Re: Email Archiving
Post by: shawnbishop on April 29, 2009, 05:28:42 PM
Hi

Try using MailArchiva..open source and how to on the Wiki
Title: Re: Email Archiving
Post by: devtay on April 29, 2009, 06:53:53 PM
shawnbishop,

Thanks for bringing this up. I found out about it a little after I posted this question. I actually downloaded and installed the windows version to play with. It seems to chat with my test account without issue. The config was a little more than I thought but now I have the experience. The only problem I had was it is a memory hog in the windows environment. I would hate to put this on my production SME Server (I don't have a test server here) and have it basically shut down when this program starts.

I believe the FAQ said MailArchiva likes a 3 gig Xeon processor. That was for windows though. I have a 2.4Ghz P4 with 1 Gig RAM running on my SME Server now. We only have about 50 mailboxes so it seems to be OK. I have never seen it go above 10% on the processor when I have been looking at top in the shell.

Thanks for the help. Do you currently use MailArchiva?
Title: Re: Email Archiving
Post by: shawnbishop on April 30, 2009, 08:35:05 AM
Hi

I am using it in a windows environment, and SME environment...

I have found it easy to configure and use once you have done a it a few times, and the customer love being able to recover mail easily, especially in the Insurance industry where they are required to keep copies of all mail

Great product and should work on your configuration, 50 mail boxes is not alot, I have it working on a SME server with 900 users  with SMTP / POP from 6 different countries around the world., and that machine is busy, about 90GB of mail a month ( Dual Core 2.6 with 2GB RAM and 250GB HDD, the archiving is done to external drives.)

Cheers
Title: Re: Email Archiving
Post by: devtay on April 30, 2009, 08:20:13 PM
Great product and should work on your configuration, 50 mail boxes is not alot, I have it working on a SME server with 900 users  with SMTP / POP from 6 different countries around the world., and that machine is busy, about 90GB of mail a month ( Dual Core 2.6 with 2GB RAM and 250GB HDD, the archiving is done to external drives.)

Cheers

That really puts things in perspective. I was planning an email server upgrade, but I would probably just be able to use an older box I have here with SME on it as the MailArchiva archive server. I have two years of mail on my SME mail server now and it is about 35 Gig. I just did a fresh install and am going to have to work out the logistics. I am thinking about just making a logger account on my new "server" and using the email panel to setup POP3 to my main mail server. It looks like the MailArchiva default uses localhost as a mail source. The good thing about it is I can mess around with it and if I screw something up, just do a re-install and restore on the new box.

Thanks for chatting. It sure helps to talk to someone that has been there and done that.
Title: Re: Email Archiving
Post by: devtay on May 09, 2009, 03:34:13 PM
Ok, so I am trying to get mailarchiva up and running on my SME box. I went through the instructions on the wiki entry (I didn't have tomcat so I followed those instructions). When I try to connect to the server on port 8090, I get a page load error saying that my browser can't connect on that port. I did the instructions exactly except I used the newer version of the mailarchiva OSE files (1.9.6). Also, I went back and checked the sme server specific settings and did a config show mailarchiva and got this back:

Code: [Select]
mailarchiva=service
    TCPPort=8090
    access=private
    status=enabled

Next I looked at the ln command and went to /etc/rc.d/rc7.d/ and the S99mailarchiva file is there.

I did a chkconfig --list and don't see a mailarchiva service listed.

I am using a brand new installation of SME 7.4 fully updated. There are only two users on the system (admin and maillog) and no extra contribs installed.

I can connect to the server-manager and to the default page on the server. I checked the messages log and see the normal sort of stuff in there (services restarting, expand actions, smb getpeername errors, etc.). I checked the httpd/access.log and see where I have been accessing the server manager and also this entry:

Code: [Select]
192.168.2.161 - - [09/May/2009:08:02:13 -0500] "GET /server-manager HTTP/1.1" 302 218 "-" "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.8) Gecko/2009032609 Firefox/3.0.8"
192.168.2.161 - - [09/May/2009:08:02:13 -0500] "GET /server-manager HTTP/1.1" 307 285 "-" "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.8) Gecko/2009032609 Firefox/3.0.8"

There is nothing in the httpd/error_log other than the warning that I don't have a favicon.ico file in the primary ibay. Do I need to open up a port on the firewall to access 8090? Maybe I am missing the java files? The non-tomcat installation went off without a hitch and didn't give me any warnings. I allocated 1000m to the heap during install. Any help would be appreciated.
Title: Re: Email Archiving
Post by: Franco on May 09, 2009, 04:11:42 PM
Hi,
Mailarchiva uses it's own webserver, hence the reason why you have no logs on the smeserver httdp.
Also there's no reason to open the firewall.
I'm also running the latest version of SME and Mailarchiva is working just fine.
what does
Code: [Select]
ps aux | grep mailarchiva return?
Title: Re: Email Archiving
Post by: devtay on May 09, 2009, 04:39:08 PM
Thanks for the reply and the clarification. Here is the output of ps aux | grep mailarchiva.

Code: [Select]
root       954  0.0  0.0  4632  556 pts/0    S+   09:37   0:00 grep mailarchiva
Title: Re: Email Archiving
Post by: Franco on May 09, 2009, 05:36:55 PM
It's not running  :sad:
But that you already knew!

Can you force the start by
Code: [Select]
/etc/init.d/mailarchiva startThen check again if it's running?

The logs are here:
Code: [Select]
/usr/local/mailarchiva/server/logs
Title: Re: Email Archiving
Post by: devtay on May 09, 2009, 06:39:54 PM
Now we are on the track of the problem. Thanks for the help. Here is what I get.

Code: [Select]
-bash: /etc/init.d/mailarchiva: No such file or directory
I have /etc/init.d/ but no mailarchiva. I looked at the other ln command (from the install instructions on the wiki) directories and they are there. I did know it wasn't running, but not how to start it. Sometimes I have to use the /etc/init.d and sometimes svc -option to get things reloaded on SME server. Confused as to when to use each. I guess you can tell I am low on the totem pole of Linux admins.  :???:
Title: Re: Email Archiving
Post by: Stefano on May 09, 2009, 07:34:52 PM
Quote
Next I looked at the ln command and went to /etc/rc.d/rc7.d/ and the S99mailarchiva file is there.

it's a symbolic link.. to which file?

Ciao
Stefano
Title: Re: Email Archiving
Post by: devtay on May 09, 2009, 08:10:24 PM
it's a symbolic link.. to which file?

Code: [Select]
ln -s /etc/rc.d/init.d/e-smith-service /etc/rc.d/rc7.d/S99mailarchiva
Both of the files in the ln command are there. I just don't have anything at /etc/init.d/mailarchiva. This is the command I typed from the install wiki.
Title: Re: Email Archiving
Post by: Stefano on May 09, 2009, 09:34:40 PM
try
Code: [Select]
service mailarchiva start

it should work

Ciao
Stefano
Title: Re: Email Archiving
Post by: devtay on May 09, 2009, 11:45:54 PM
Here is what I got:

Code: [Select]
[root@mailarchive ~]# service mailarchiva start
/etc/rc7.d/S99mailarchiva: Couldn't find/execute init script for service mailarchiva

I looked at the scrip (S99mailarchiva) and it is looking for /etc/rc.d/init.d/supervise/$SERVICE where $SERVICE is a long string beginning with basename. I don't know what basename is but it seems like that is the problem. I need to read through the script some more with my perl reference to understand more of it. Looking...
Title: Re: Email Archiving
Post by: devtay on May 19, 2009, 06:20:29 PM
Ok, mailarchiva is working. I am able to archive emails just fine. I am having trouble getting the emails I have saved in folders other than the inbox pulled off of the server. This is because mailarchiva only looks at the inbox. I have been using Thunderbird to move the emails from the folder I created to the inbox. The problem is either the server or Thunderbird errors out and it is taking a long time.

I understand the Maildir /cur /new scheme, but I don't know if I am looking at this the right way. If I go to the shell and move the files manually, am I going to mess something up? I know the dovecot file is the index file for the folder so I don't want to mess that up. What I am trying to do is a little hard to describe in a post so here is an example.

IMAP connection. I made a folder called apr2009 under the logger Maildir folder using Thunderbird. As I read the emails I moved them from the inbox to the apr2009 folder. As everyone already knows you have the dovecot files and a /tmp, /cur and /new directory for each IMAP folder you create. I want to use the shell to  move the files from /apr2009/cur, /new and /tmp to the inbox. I tried this with a test account and the files moved. The problem was they were deleted when I logged into the account. I am assuming this is because there was no appropriate index. Any help with this would be appreciated.
Title: Re: Email Archiving
Post by: janet on May 19, 2009, 11:49:25 PM
devtay

You say it's a little hard to describe what you do, then go on to describe what you do ???

It would be easier for you (and clearer for us) if you quote the specific commands you use eg
Move the files using mc
or command line,
if command line quote the exact command
eg (an appropriate command would be)
mv /home/e-smith/files/users/username/Maildir/apr2009/cur/*  /home/e-smith/files/users/username/Maildir/new

If you are logged in as root, then you will/may need to correct the file ownership with chown (depending how you moved or copied the message files)

chown -R username:username /home/e-smith/files/users/username/Maildir
Title: Re: Email Archiving
Post by: devtay on May 20, 2009, 03:03:23 AM
devtay

You say it's a little hard to describe what you do, then go on to describe what you do ???

It would be easier for you (and clearer for us) if you quote the specific commands you use eg
Move the files using mc
or command line,
if command line quote the exact command
eg (an appropriate command would be)
mv /home/e-smith/files/users/username/Maildir/apr2009/cur/*  /home/e-smith/files/users/username/Maildir/new

If you are logged in as root, then you will/may need to correct the file ownership with chown (depending how you moved or copied the message files)

chown -R username:username /home/e-smith/files/users/username/Maildir

Mary,

Take your pick, mc (I am assuming midnight commander) or mv. I don't really care. From your post I guess you fully understood what I was asking.

I just want to know if I can move email files from the /cur directory in one folder to the /cur directory in another without messing up the dovecot index file. From what I have read so far on the net it looks like I can because the dovecot index is not implicitly trusted. Thanks for the reminder on the chown. I will be logged in as root to the logger account.
Title: Re: Email Archiving
Post by: janet on May 20, 2009, 08:25:40 AM
devtay

Quote
Take your pick, mc (I am assuming midnight commander) or mv. I don't really care. From your post I guess you fully understood what I was asking.

Yes I do understand, and yes you can move files, but I suspect incorrect permissions is probably the issue, due to copying inappropriately.
 
You need to tell us which method you use and the exact command so the source of your "problem" can be determined.
It does not help to tell me to pick whichever one.

Anyway I quoted you an exact move command that should work, replacing the names where appropriate of course, followed by the chown command.
Title: Re: Email Archiving
Post by: devtay on May 21, 2009, 03:57:52 AM
Quote
I just want to know if I can move email files from the /cur directory in one folder to the /cur directory in another without messing up the dovecot index file. From what I have read so far on the net it looks like I can because the dovecot index is not implicitly trusted. Thanks for the reminder on the chown. I will be logged in as root to the logger account.

This is the only issue that I still have. The moving and permissions were taken care of in Mary's previous posting. I just need to know I am not losing emails due to a bad index. Thanks.
Title: Re: Email Archiving
Post by: devtay on May 27, 2009, 02:57:57 PM
For future reference to any who have this problem. I solved it by changing the user database for the logger account to allow me shell access. I then turned off the mailarchiva server so it would not try to get messages before they were moved over. I logged into the shell with the logger account and then moved the files to the ./Maildir/.hiddendirectory/* to the ./Maildir/cur directory. After moving all of the files in a hidden directory, I enabled the account on the mailarchiva server and it started collecting mail.

I had a problem with moving the files because there were too many. I had to use wild cards in the mv statement to get a few files at a time. I decided against using midnight commander because the process was too tedious right-clicking each file individually and I didn't want to try and learn more about midnight commander.

I never did get mailarchiva working on an sme box. I ended up installing it on an Ubuntu server.
Title: Re: Email Archiving
Post by: Stefano on May 27, 2009, 03:39:00 PM
I just want to know if I can move email files from the /cur directory in one folder to the /cur directory in another without messing up the dovecot index file. From what I have read so far on the net it looks like I can because the dovecot index is not implicitly trusted. Thanks for the reminder on the chown. I will be logged in as root to the logger account.

yes.. all you need is imapsync.. it works even on two accounts on the same server

Ciao
Stefano
Title: Re: Email Archiving
Post by: devtay on May 27, 2009, 07:07:52 PM
yes.. all you need is imapsync.. it works even on two accounts on the same server

Ciao
Stefano

Thanks Stefano. I will definitely look at this in the future. Thanks for the help.
Title: Re: Email Archiving
Post by: mudra on May 28, 2009, 11:03:01 AM
Devtay,

I have followed the instructions on the WIKI to install MailArchiva, and it was working well, until I rebooted my server. I am running SME 7.4.

When I reboot my server I get the same error that you were experiencing.

/etc/rc7.d/S99mailarchiva: Couldn't find/execute init script for service mailarchiva

Please can you let me know how you cured this problem.

Do I need to open a bug report, and if so, where / how should I do this ?

Thanks for any help.

Mudra.
Title: Re: Email Archiving
Post by: janet on May 28, 2009, 12:46:59 PM
mudra

What do these commands show
config show mailarchiva
ls -al /etc/rc.d/rc7.d

Title: Re: Email Archiving
Post by: mudra on May 28, 2009, 01:16:27 PM
Mary,

The output of the commands is as follows:-

config show mailarchiva

mailarchiva=service
    TCPPort=8090
    access=private
    status=enabled

ls -al /etc/rc.d/rc7.d (I have editied this as the list was quite long and I didn't think that you needed anything else).
....
lrwxrwxrwx   1 root root    32 Nov 24  2008 S98haldaemon -> /etc/rc.d/init.d/e-smith-service
lrwxrwxrwx   1 root root    32 Nov 24  2008 S99local -> /etc/rc.d/init.d/e-smith-service
lrwxrwxrwx   1 root root    32 Oct  9  2008 S99mailarchiva -> /etc/rc.d/init.d/e-smith-service
lrwxrwxrwx   1 root root    32 Mar  5 08:34 S99mysql.init -> /etc/rc.d/init.d/e-smith-service
.....
I hope that this helps

Thanks for your help.

Murda
Title: Re: Email Archiving
Post by: Stefano on May 28, 2009, 01:56:00 PM
ok..

is there a mailarchiva script in /etc/rc.d/init.d?

Ciao
Stefano
Title: Re: Email Archiving
Post by: devtay on May 28, 2009, 02:44:11 PM
Please can you let me know how you cured this problem.

Mudra,

I am sorry my friend. I didn't get it going and gave up. My mailarchiva server is installed on an Ubuntu box and works like the install said it should. I will say that the install on the SME server was dramatically different than the Ubuntu server. Maybe it is the version difference that is causing the issue (I installed the latest and the wiki is for another version). Good luck.
Title: Re: Email Archiving
Post by: mudra on May 29, 2009, 12:06:00 PM
Stefano,

I have the following from /etc/init.d/rc.d

ls m*
masq  mdmonitor  mdmpd  messagebus  microcode_ctl  mysqld  mysql.init

It appears that I have no mailarchiva script !! Is there a step missing from the wiki instructions, as I cut and paste them into my server.

Let me know if you need anymore information, or if this give you any ideas.

I look forward to hearing from you.

Mudra
Title: Re: Email Archiving
Post by: Stefano on May 29, 2009, 01:29:15 PM
I have the following from /etc/init.d/rc.d

I think you mean /etc/rc.d/init.d, right?

Quote
ls m*
masq  mdmonitor  mdmpd  messagebus  microcode_ctl  mysqld  mysql.init

It appears that I have no mailarchiva script !! Is there a step missing from the wiki instructions, as I cut and paste them into my server.

Let me know if you need anymore information, or if this give you any ideas.

I look forward to hearing from you.

Mudra

well.. mailarchiva should install mailarchiva init script

I see in the tgz, in mailarchiva_dist/mailarchiva/server/ directory a file "mailarchiva".. please copy it to /etc/rc.d/init.d and make it executable

it should work.

NOTE: I never tried it, so I can't go far from here :-)

Ciao
Stefano
Title: Re: Email Archiving
Post by: Franco on May 29, 2009, 03:21:04 PM
All I can say is: I have followed the install from the wiki 03 times, installing including the latest version of mailarchiva, and works just fine.
The instructions tell:
Quote
SME Server specific config changes
config set mailarchiva service TCPPort 8090 access private status enabled
ln -s /etc/rc.d/init.d/e-smith-service /etc/rc.d/rc7.d/S99mailarchiva
Title: Re: Email Archiving
Post by: mudra on May 30, 2009, 12:19:19 PM
Stefano,

I have done as you suggested, and that appears to have cured my problems. I am at a total loss as to why, after following the instructions as Franco did, I did not end up with a a working install. Thanks for everyone's help.

Mudra