Re: Logging the message body from an MTA

2004-06-18 Thread Geert Hendrickx
On Thu, Jun 17, 2004 at 11:22:44PM +, Lonnie Santella wrote:
 I need to log the message body of incoming and outgoing messages on my 
 FreeBSD 5.2.1 Release server. I'm running Exim right now, but I really 
 don't have a preference of MTA. The main thing is I need to facilitate the 
 logging of message bodies.

I don't know about Exim, but since you don't care switching MTA, Postfix
has an always_bcc option.  Every mail processed by Postfix (both
incoming and outgoing) will be forwarded to that address.  You could
then make that address use procmail or some other pipe to store the
e-mail in your database.  

GH

 
 I don't want to flood you with too many details, but we want to archive 
 messages (including message body) to a MySQL database, so that we can 
 quickly run queries and review messages from months/years ago - no matter 
 who's mailbox it ended up in.
 
 To accomplish this, we need to first log the message body somehow... 
 anyhow... then commit the logs to the MySQL database.
 
 I'd settle for learning how to do the first step. I've read through Exim 
 docs and Sendmail docs, as well as various newsgroups - plenty of info on 
 logging various data - but nothing on message bodies. I posted a message to 
 the Exim news group - but no luck there.
 
 I'm not set on Exim - I just want to log message bodies. Any help or a push 
 in the right direction would be GREATLY appreciated.
 
 Thanks,
 
 Lonnie
 
 
 ___
 [EMAIL PROTECTED] mailing list
 http://lists.freebsd.org/mailman/listinfo/freebsd-questions
 To unsubscribe, send any mail to [EMAIL PROTECTED]
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Logging the message body from an MTA

2004-06-17 Thread Lonnie Santella
I need to log the message body of incoming and outgoing messages on my 
FreeBSD 5.2.1 Release server. I'm running Exim right now, but I really don't 
have a preference of MTA. The main thing is I need to facilitate the logging 
of message bodies.

I don't want to flood you with too many details, but we want to archive 
messages (including message body) to a MySQL database, so that we can 
quickly run queries and review messages from months/years ago - no matter 
who's mailbox it ended up in.

To accomplish this, we need to first log the message body somehow... 
anyhow... then commit the logs to the MySQL database.

I'd settle for learning how to do the first step. I've read through Exim 
docs and Sendmail docs, as well as various newsgroups - plenty of info on 
logging various data - but nothing on message bodies. I posted a message to 
the Exim news group - but no luck there.

I'm not set on Exim - I just want to log message bodies. Any help or a push 
in the right direction would be GREATLY appreciated.

Thanks,
Lonnie
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: Logging the message body from an MTA

2004-06-17 Thread Lucas Holt
Maybe you can use procmail.  I had a procmail script that backed up 
messages in another mbox file while you were testing new rules.  You 
could do something similar to backup all incoming messages and then 
write a program that could read the file or use a pop3 interface to 
read the messages and then store them in mysql or whatever.

On Jun 17, 2004, at 7:22 PM, Lonnie Santella wrote:
I need to log the message body of incoming and outgoing messages on my 
FreeBSD 5.2.1 Release server. I'm running Exim right now, but I really 
don't have a preference of MTA. The main thing is I need to facilitate 
the logging of message bodies.

I don't want to flood you with too many details, but we want to 
archive messages (including message body) to a MySQL database, so that 
we can quickly run queries and review messages from months/years ago - 
no matter who's mailbox it ended up in.

To accomplish this, we need to first log the message body somehow... 
anyhow... then commit the logs to the MySQL database.

I'd settle for learning how to do the first step. I've read through 
Exim docs and Sendmail docs, as well as various newsgroups - plenty of 
info on logging various data - but nothing on message bodies. I posted 
a message to the Exim news group - but no luck there.

I'm not set on Exim - I just want to log message bodies. Any help or a 
push in the right direction would be GREATLY appreciated.

Thanks,
Lonnie
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to 
[EMAIL PROTECTED]


Lucas Holt
[EMAIL PROTECTED]

FoolishGames.com  (Jewel Fan Site)
JustJournal.com (Free blogging)
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: Logging the message body from an MTA

2004-06-17 Thread Jez Hancock
On Thu, Jun 17, 2004 at 11:22:44PM +, Lonnie Santella wrote:
 I need to log the message body of incoming and outgoing messages on my 
 FreeBSD 5.2.1 Release server. I'm running Exim right now, but I really 
 don't have a preference of MTA. The main thing is I need to facilitate the 
 logging of message bodies.
 
 I don't want to flood you with too many details, but we want to archive 
 messages (including message body) to a MySQL database, so that we can 
 quickly run queries and review messages from months/years ago - no matter 
 who's mailbox it ended up in.
 
 To accomplish this, we need to first log the message body somehow... 
 anyhow... then commit the logs to the MySQL database.
 
 I'd settle for learning how to do the first step. I've read through Exim 
 docs and Sendmail docs, as well as various newsgroups - plenty of info on 
 logging various data - but nothing on message bodies. I posted a message to 
 the Exim news group - but no luck there.
 
 I'm not set on Exim - I just want to log message bodies. Any help or a push 
 in the right direction would be GREATLY appreciated.

If it helps, there's a reply on the exim-users list about archiving all
email passing through the mta 'unseen'.  I'll paste the relevant parts,
for the whole thread you might want to check out the MARC mailing list
archives - you should be able to find the thread by searching on the
subject line or one of the other identifying headers.

As for the rest of your problem, no doubt it's been done before of
course, the hard part is finding out how :P  The exim list is worth
checking out if you decide to go down that route, the people on that
list are very knowledgeable and it has probably been done before.

Here is the mail in question re archiving messages anyway:


From [EMAIL PROTECTED] Wed Apr 14 17:41:01 2004
To: [EMAIL PROTECTED]
Subject: RE: [Exim] Archive Email
In-Reply-To: [EMAIL PROTECTED]
Message-ID: [EMAIL PROTECTED]
References: [EMAIL PROTECTED]
List-Help: mailto:[EMAIL PROTECTED]
List-Post: mailto:[EMAIL PROTECTED]
List-Subscribe: http://www.exim.org/mailman/listinfo/exim-users,
mailto:[EMAIL PROTECTED]
List-Id: A user list for the exim MTA exim-users.exim.org
List-Archive: http://www.exim.org/pipermail/exim-users/
Date: Wed, 14 Apr 2004 16:34:59 + (GMT)

Add a router, before the routers that would normally deal with
incoming mail for the domain(s) in question.

archiver:
  driver = redirect
  verify = false
  expn = false
  domains = ${lookup{$domain}lsearch{/etc/exim/mailarch}{$domain}fail}
  data = ${lookup{$domain}lsearch{/etc/exim/mailarch}}
  file_transport = address_file
  pipe_transport = address_pipe
  unseen = true
  repeat_use = false

Add lines in /etc/exim/mailarch (any other name could be used
instead) for the domains in question:

domain1: [EMAIL PROTECTED], [EMAIL PROTECTED]
domain2: /home/customer/mail/domain2
domain3: |procmail -m /etc/procmailrcs/domain3-arch

-aw

On Tue, 13 Apr 2004, fxpbackup.com wrote:

 Could you give me more specifics on that? I really haven't done anything
 with exim beyond setting up mailscanner / clamAV and fixing some cPanel
 induced bugs.

 http://www.FXPBackup.com
 Encrypted Backup Hosting
 Dedicated Servers
 -Original Message-
 From: A. Wik [mailto:[EMAIL PROTECTED]
 Sent: Tuesday, April 13, 2004 8:46 PM
 To: [EMAIL PROTECTED]
 Subject: Re: [Exim] Archive Email

 On Tue, 13 Apr 2004 [EMAIL PROTECTED] wrote:

  I need to find a simple way to either forward a copy of all
  emails for a domain to a specific account or to actually copy the
  message files themselves within the server to a storage area for
  ongoing archiving. More and more businesses are requesting this
  for legal purposes and I have yet to find a way to do it in Exim
  itself.

 I do something like that using the unseen = true router option
 for for keeping archives of some mailing lists I run.

 -aw



-- 
Jez Hancock
 - System Administrator / PHP Developer

http://munk.nu/
http://jez.hancock-family.com/  - Another FreeBSD Diary
http://ipfwstats.sf.net/- ipfw peruser traffic logging
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: Logging the message body from an MTA

2004-06-17 Thread Adam Smith
On Thu, Jun 17, 2004 at 07:43:58PM -0400, Lucas Holt said:
 Maybe you can use procmail.  I had a procmail script that backed up 
 messages in another mbox file while you were testing new rules.  You 
 could do something similar to backup all incoming messages and then 
 write a program that could read the file or use a pop3 interface to 
 read the messages and then store them in mysql or whatever.

Changing the topic slightly, but why?  Why not set up a new rule, and then
bounce an existing message to yourself that will match the rule?

That way it retains all the correct headers, and you don't have to sit and
wait for one of those emails to arrive before testing.

That's what I do.


-- 
Adam Smith
Internode   : http://www.internode.on.net
Phone   : (08) 8228 2999

Dog for sale:  Eats lots and is fond of children.
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]