Link to home
Start Free TrialLog in
Avatar of wcws
wcws

asked on

MailScanner Email Archive

Hello All,

There is one option in Mailscanner called mailarchive which looks like

#
# Mail Archiving and Monitoring
# -----------------------------
#

# Space-separated list of any combination of
# 1. email addresses to which mail should be forwarded,
# 2. directory names where you want mail to be stored,
# 3. file names (they must already exist!) to which mail will be appended
#    in "mbox" format suitable for most Unix mail systems.
#
# If you give this option a ruleset, you can control exactly whose mail
# is archived or forwarded. If you do this, beware of the legal implications
# as this could be deemed to be illegal interception unless the police have
# asked you to do this.
#Archive Mail = /var/spool/MailScanner/archive
Archive Mail =/backup/mailarchive/emails

Right now as you can see I am storing all emails but thats not I want , I wanted to store specific emails like

my email address is

abc@abc.com so any thing send or receive by abc@abc.com should be saved in /backup/mailarchive/abc-mailaccount/emails

I know there is a way but there isnt much information, please help me in this matter.

Thanks
Avatar of Pablo Allietti
Pablo Allietti
Flag of Uruguay image

yep but no with Mailscanner, Mailscanner save entire mailboxes of all users.

if you add in the file /etc/aliases for example

realuser:   realuser, backupuser

you have a replica of your mailbox in /var/mail/backupuser

after that you can copy and move anywere.


remeber to execute after modifications newaliasesscript in console prompt
Avatar of wcws
wcws

ASKER

According to your statement you can only save the emails which are coming in ? not outgoing.

I am pretty sure you can do it with MailScanner I've read somewhere but I am not too sure.
Avatar of wcws

ASKER

I've tried the following

FromOrTo: email@email.com   yes forward  /backup/emailarchive/email.mbx

and I've tried

FromOrTo: email@email.com   /backup/emailarchive/email.mbx

Bothways Its not saving any emails also I've also edit the MailScanner.conf file and define the path and everything but still its not saving any emails please let me know what did I do wrong.

Thanks
no nothing this is the rigth sintaxis.  you restart Mailscanner?
Avatar of wcws

ASKER

yes,
ok

you add the file archive.rules in

/etc/mail/Mailscanner/rules/  ???

or in your rules folder?


and the sintaxis are wrong. sorry for comment before that i not realize about this the sintax are

FromOrTo: pablouruguay@yahoo.com yes
From: pablito@yahoo.com no
To: myhome@yahoo.com yes
FromOrTo: default /var/spool/MailScanner/archive/archive.mbx
Avatar of wcws

ASKER

ok I've a email address in my server which is

email@email.com

so Will I do like this

FromOrTo: email@email.com    yes
FromOrTo: default /var/spool/MailScanner/archive/archive.mbx

What does default means will that means It will archive every single emails sending and receiving from my server ? If yes then thats what I dont want. I want only 1 email account to be archive i.e. its sending and receiving.

Thanks
Avatar of wcws

ASKER

yes, I did add the archive.rules in my MailScanner.conf as well in rules folder.
ok, leave this question open i will in vacation until monday, and i answer other experts about these question, in monday i bet to have the answer :)
Avatar of wcws

ASKER

wow
Avatar of wcws

ASKER

Is there any one , please
Avatar of wcws

ASKER

This is a right solution


Into MailScanner.conf:
Archive Mail = /usr/local/etc/MailScanner/rules/arch.rules
where /usr/local/etc/MailScanner/rules/ - rules directory - in Linux may by in
another place

Into arch.rules:
FromOrTo:     abc@abc.com /backup/mailarchive/abc-mailaccount/emails
FromOrTo:     qqq@www.com /some/another/place

I've able to do this myself ?
ASKER CERTIFIED SOLUTION
Avatar of Pablo Allietti
Pablo Allietti
Flag of Uruguay image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
and ??? what happend with this?
Hi there
I have done the proposed solution to archive mail as mentioned above and it works, however now i want to be enabled to restore some of the mail which has attached files inside the mail, how do i do that? i have samba setup on tis machine so that i can access/copy the folder holding the messages to a winclient with for example Thunderbird or Express, do i have to auto rename the files, convert or what? i can open the mail in express with the extension .eml ,but the attached file is included in the entire message and not as a file?

PLS help i really need to have this solved.

se attached mail below, ibelive the last part is the moset interesting since it seems to include the zip file?!

"
------_=_NextPart_001_01C5D870.69EA5DCC
Content-Type: multipart/alternative;
boundary="----_=_NextPart_002_01C5D870.69EA5DCC"


------_=_NextPart_002_01C5D870.69EA5DCC
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

=20

=20

user usersurname
domain i region AB
cityerarev=E4gen 42, 300 00 cityberg
Tfn: 00-000000, Fax: 00-000000, Mobil: 00-00 00 00
E-post: user.user@user.se =
<blocked::mailto:user.user@user.se> Web: =
www.domain.se/region <=20"http://www.domain.se/region>=20
*******************************************************************

domain har en framskjuten position bland Nordens IT -konsultf=F6retag.
domains aff=E4rsid=E9 =E4r att aktivt st=F6dja kundernas =
aff=E4rsutveckling
med effektiva informationssystem.
domain =E4r etablerat med kontor och dotterbolag p=E5 35 platser i =
norra Europa

Detta mail kommer fr=E5n en scan spamfilter Server.
Vill du veta mer om spamfilter och hur ditt f=F6retag
enkelt kan spara resurser klicka p=E5 l=E4nken f=F6r
produktblad och prisuppgifter


=20


------_=_NextPart_002_01C5D870.69EA5DCC
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<html xmlns:o=3D"urn:schemas-microsoft-com:office:office" =
xmlns:w=3D"urn:schemas-microsoft-com:office:word" =
xmlns:st1=3D"urn:schemas-microsoft-com:office:smarttags" =
xmlns=3D"http://www.w3.org/TR/REC-html40">

<head>
<meta http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<meta name=3DGenerator content=3D"Microsoft Word 11 (filtered medium)">
<o:SmartTagType =
namespaceuri=3D"urn:schemas-microsoft-com:office:smarttags"
name=3D"PersonName"/>
<!--[if !mso]>
<style>
st1\:*{behavior:url(#default#ieooui) }
</style>
<![endif]-->
<style>
<!--
/* Font Definitions */
@font-face
{font-family:Garamond;
panose-1:2 2 4 4 3 3 1 1 8 3;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman";}
a:link, span.MsoHyperlink
{color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{color:purple;
text-decoration:underline;}
span.E-postmall17
{mso-style-type:personal-compose;
font-family:Arial;
color:windowtext;}
@page Section1
{size:595.3pt 841.9pt;
margin:70.85pt 70.85pt 70.85pt 70.85pt;}
div.Section1
{page:Section1;}
-->
</style>

</head>

<body lang=3DSV link=3Dblue vlink=3Dpurple>

<div class=3DSection1>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=3DMsoNormal =
style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><st1:PersonN=
ame
ProductID=3D"user usersurname" w:st=3D"on"><font size=3D2 =
face=3DGaramond><span
style=3D'font-size:10.0pt;font-family:Garamond'>user =
usersurname</span></font></st1:PersonName></u1:PersonName><br>
<b><font size=3D2 face=3DGaramond><span =
style=3D'font-size:10.0pt;font-family:Garamond;
font-weight:bold'>domain&nbsp;i <u3:PLACE u2:insAuthor=3D"user =
usersurname" u2:insDate=3D"2005-03-24T12:03:00Z" u2:endInsAuthor=3D"user =
usersurname" u2:endInsDate=3D"2005-03-24T12:03:00Z"><u3:CITY =
u2:insAuthor=3D"user usersurname" u2:insDate=3D"2005-03-24T12:03:00Z" =
u2:endInsAuthor=3D"user usersurname" =
u2:endInsDate=3D"2005-03-24T12:03:00Z">region</u3:CITY>
<u3:STATE u2:insAuthor=3D"user usersurname" =
u2:insDate=3D"2005-03-24T12:03:00Z" u2:endInsAuthor=3D"user usersurname" =
u2:endInsDate=3D"2005-03-24T12:03:00Z">AB<br>
</span></font></b><font size=3D2 face=3DGaramond><span =
style=3D'font-size:10.0pt;
font-family:Garamond'></u3:STATE></u3:PLACE>cityerarev=E4gen 42, 311 =
36
cityberg<br>
Tfn: 0346-71 43 13, Fax: 0346-714 317, Mobil: 0706-75 45 85<br>
E-post:&nbsp;<a href=3D"blocked::mailto:user.user@user.se"
title=3D"BLOCKED::mailto:user.user@user.se&#10;mailto:user.w=
armbold@domain.se"><span
title=3D"BLOCKED::mailto:user.user@user.se"><span
title=3D"BLOCKED::mailto:user.user@user.se&#10;mailto:user.w=
armbold@domain.se">user.user@user.se</span></span></a>&nbsp;
Web: <a href=3D"http://www.domain.se/region"
title=3D"http://www.domain.se/region"><span
title=3D"http://www.domain.se/region"><span
title=3D"http://www.domain.se/region">www.domain.se/region</span></sp=
an></a><br>
</span></font><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;font-family:
Arial'>******************************************************************=
*</span></font><o:p></o:p></p>

<p class=3DMsoNormal =
style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><font
size=3D2 face=3DGaramond><span =
style=3D'font-size:10.0pt;font-family:Garamond'>domain
har en framskjuten position bland Nordens IT -konsultf=F6retag.<br>
domains aff=E4rsid=E9 =E4r att aktivt st=F6dja kundernas =
aff=E4rsutveckling<br>
med effektiva informationssystem.<br>
domain =E4r etablerat med kontor och dotterbolag p=E5 35 platser i =
norra Europa</span></font><o:p></o:p></p>

<p class=3DMsoNormal =
style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><strong><b><=
font
size=3D3 color=3D"#4a4a4a" face=3DGaramond><span =
style=3D'font-size:12.0pt;font-family:
Garamond;color:#4A4A4A'>Detta mail kommer fr=E5n en scan spamfilter =
Server.</span></font></b></strong><b><font
color=3D"#4a4a4a" face=3DGaramond><span =
style=3D'font-family:Garamond;color:#4A4A4A;
font-weight:bold'><br>
<strong><b><font face=3DGaramond><span =
style=3D'font-family:Garamond'>Vill du veta
mer om spamfilter och hur ditt f=F6retag</span></font></b></strong><br>
<strong><b><font face=3DGaramond><span =
style=3D'font-family:Garamond'>enkelt kan
spara resurser klicka p=E5 l=E4nken f=F6r</span></font></b></strong><br>
<strong><b><font face=3DGaramond><span =
style=3D'font-family:Garamond'>produktblad
och prisuppgifter</span></font></b></strong><br>
<strong><b><font face=3DGaramond><span style=3D'font-family:Garamond'><a
href=3D"http://region02.domain.se/scanplus.pdf"
title=3D"http://region02.domain.se/scanplus.pdf"><font size=3D2
title=3D"http://region02.domain.se/scanplus.pdf"><span
title=3D"http://region02.domain.se/scanplus.pdf"><span
title=3D"http://region02.domain.se/scanplus.pdf"><span =
style=3D'font-size:
10.0pt'><span =
title=3D"http://region02.domain.se/scanplus.pdf"><span
title=3D"http://region02.domain.se/scanplus.pdf"><span
title=3D"http://region02.domain.se/scanplus.pdf">http://region02.sy=
steam.se/scanpl</span></font><font
size=3D2><span style=3D'font-size:10.0pt'>u</span></span></font><font =
size=3D2
title=3D"http://region02.domain.se/scanplus.pdf"><span
title=3D"http://region02.domain.se/scanplus.pdf"><span =
style=3D'font-size:
10.0pt'>s</span></span></font></span><font size=3D2
title=3D"http://region02.domain.se/scanplus.pdf"><span
title=3D"http://region02.domain.se/scanplus.pdf"><span =
style=3D'font-size:
10.0pt'>.</span></span></font></span><font size=3D2
title=3D"http://region02.domain.se/scanplus.pdf"><span
title=3D"http://region02.domain.se/scanplus.pdf"><span
title=3D"http://region02.domain.se/scanplus.pdf"><span =
style=3D'font-size:
10.0pt'>p</span></span></span></font><font size=3D2
title=3D"http://region02.domain.se/scanplus.pdf"><span
title=3D"http://region02.domain.se/scanplus.pdf"><span
title=3D"http://region02.domain.se/scanplus.pdf"><span =
style=3D'font-size:
10.0pt'><span =
title=3D"http://region02.domain.se/scanplus.pdf">d</span></span></sp=
an></font></span><font
size=3D2 title=3D"http://region02.domain.se/scanplus.pdf"><span
title=3D"http://region02.domain.se/scanplus.pdf"><span =
style=3D'font-size:
10.0pt'></span><span =
title=3D"http://region02.domain.se/scanplus.pdf"><span
title=3D"http://region02.domain.se/scanplus.pdf"><span
title=3D"http://region02.domain.se/scanplus.pdf">f</span></span></sp=
an></font></span></span></a></span></span></font></b></strong></span></fo=
nt></b><o:p></o:p></p>

<p class=3DMsoNormal><font size=3D3 face=3D"Times New Roman"><span =
style=3D'font-size:
12.0pt'><o:p>&nbsp;</o:p></span></font></p>

</div>

</body>

</html>

------_=_NextPart_002_01C5D870.69EA5DCC--

------_=_NextPart_001_01C5D870.69EA5DCC
Content-Type: application/x-zip-compressed;
name="test med zipfil.zip"
Content-Transfer-Encoding: base64
Content-Description: test med zipfil.zip
Content-Disposition: attachment;
filename="test med zipfil.zip"

UEsDBAoAAAAAAOBOWDMAAAAAAAAAAAAAAAATAAAAdGVzdCBtZWQgemlwZmlsLnR4dFBLAQIUCwoA
AAAAAOBOWDMAAAAAAAAAAAAAAAATAAAAAAAAAAAAIAAAAAAAAAB0ZXN0IG1lZCB6aXBmaWwudHh0
UEsFBgAAAAABAAEAQQAAADEAAAAAAA==

------_=_NextPart_001_01C5D870.69EA5DCC--
"
Thanks for helping





Hi
Ok i resolved it myselv, if anyone is intressted read below:
I read somewhere that the mbx format was supported as eduora mail and
I installed Netscape messenger 4.51 since this was the only app i knew supported this format and voaila, the mailbox was imported with attacment in mails and everything.

Bye