Wants to Keep a copy of outgoing emails

Taking care of your Linux box.
Post Reply
aamirhussain
Lance Naik
Posts: 29
Joined: Fri Jul 08, 2005 1:11 pm

Wants to Keep a copy of outgoing emails

Post by aamirhussain »

AOA, I'm using Sendmail as MTA on RHEL 3 and for compliance issues, our company wants to keep a record of all outgoing / incoming messages of few users.

Kindly guide how do I configure Sendmail to forward a copy of inbound/outbound emails to a monitoring account.

Regards,

Aamir
lambda
Major General
Posts: 3452
Joined: Tue May 27, 2003 7:04 pm
Location: Lahore
Contact:

Post by lambda »

perhaps you can use something like this.
Watch out for the Manners Taliban!
Isn't it amazing how so many people can type "linuxpakistan.net" into their browsers but not "google.com"?
syedbilalmasaud
Naib Subedar
Posts: 347
Joined: Thu Aug 18, 2005 9:25 am
Location: Attock
Contact:

Post by syedbilalmasaud »

Use Maildroprc , it will solve your problem

http://www.courier-mta.org/maildrop/
Cheers :)

:D B I L A L :D
lambda
Major General
Posts: 3452
Joined: Tue May 27, 2003 7:04 pm
Location: Lahore
Contact:

Post by lambda »

yet another useless suggestion by our favorite job poster. no, maildrop won't help at all.
Watch out for the Manners Taliban!
Isn't it amazing how so many people can type "linuxpakistan.net" into their browsers but not "google.com"?
syedbilalmasaud
Naib Subedar
Posts: 347
Joined: Thu Aug 18, 2005 9:25 am
Location: Attock
Contact:

Post by syedbilalmasaud »

Lambda,

maildroprc is one of my tested and working solution to archive all outgoing and incoming emails with sendmail as well as postfix , if you want configuration file let me know I will paste here

and please don't take things personal
Cheers :)

:D B I L A L :D
syedbilalmasaud
Naib Subedar
Posts: 347
Joined: Thu Aug 18, 2005 9:25 am
Location: Attock
Contact:

Re: Wants to Keep a copy of outgoing emails

Post by syedbilalmasaud »

aamirhussain wrote:AOA, I'm using Sendmail as MTA on RHEL 3 and for compliance issues, our company wants to keep a record of all outgoing / incoming messages of few users.

Kindly guide how do I configure Sendmail to forward a copy of inbound/outbound emails to a monitoring account.

Regards,

Aamir

Dude ,

I am searching for config file because our firm is migrated to Zimbra the solution what I had created three years back , I am looking in to backup devices as soon as I found it I will paste here and maildroprc can do the exact job what you have requested
Cheers :)

:D B I L A L :D
lambda
Major General
Posts: 3452
Joined: Tue May 27, 2003 7:04 pm
Location: Lahore
Contact:

Post by lambda »

please paste the script here, for sendmail.
Watch out for the Manners Taliban!
Isn't it amazing how so many people can type "linuxpakistan.net" into their browsers but not "google.com"?
syedbilalmasaud
Naib Subedar
Posts: 347
Joined: Thu Aug 18, 2005 9:25 am
Location: Attock
Contact:

Post by syedbilalmasaud »

Here you go

This was running on sendmail first than later migrated to postfix but as far I remember I had not made any change while migration to postfix and I have changed the domain names to domain-1 , domain-2 , domain-3 and some test users commented which I add first for testing but first\.last is like bilal.masaud@whateverdomain.com or whatever it is


but at the end I am getting all emails archived at archive@what... .com


hope now its clear


---------------------------------------------------------------

# Global maildrop filter file

# Uncomment this line to make maildrop default to ~/Maildir for
# delivery- this is where courier-imap (amongst others) will look.
#DEFAULT="$HOME/Maildir"
VERBOSE=ON
SHELL="/bin/sh"
logfile "/var/log/maildrop.log"
dirname=`date +%Y-%m`
maildir="/var/spool/virtmail/quarantine"
#if ( (/^Delivered-To: first\.last@domain-1\.com/ \
# && $SIZE < 26144 )

#{
# exception {
# xfilter "/usr/bin/spamassassin"
# }
#}

#if ( /^Return-Path: \<MAILER-DAEMON\>$/)
#{
# to $HOME
#}


if ( $SIZE < 99800 )
{
if ( /^Return-Path: \<.*@domain-1\.com\>$/)
{
to $HOME
}
if ( /^Return-Path: \<.*@my2connect\.com\>$/)
{
to $HOME
}
if ( /^From: MAILER-DAEMON@runner\.domain-1\.com/)
{
to $HOME
}
if ( /^Return-Path: \<.*@domain-4\.com\>$/)
{
to $HOME
}

if ( /^Return-Path: \<.*@domain-2\.com\>$/)
{
to $HOME
}

# New Entry domain-3.com

if ( /^Return-Path: \<.*@domain-3\.com\>$/)
{
to $HOME
}


if (/^Delivered-To: archive@domain-1\.com$/)
{
to $HOME
}

if (/^Delivered-To: .*@domain-1\.com$/)
{
exception {
xfilter "/usr/bin/spamassassin"
}

# if ( (/^Delivered-To: first\.last@domain-1\.com$/) \
# || (/^Delivered-To: first\.last@domain-1\.com$/) \
# || (/^Delivered-To: martin@domain-1\.com$/) \
# || (/^Delivered-To: first\.last@domain-1\.com$/) \
# || (/^Delivered-To: first\.last@domain-1\.com$/) \
# || (/^Delivered-To: eyad@domain-1\.com$/) \
# \
# )
# {
if ( /^X-Spam-Status: *Yes/)
{
`test -d $maildir/domain-1.com/.$dirname`
if( $RETURNCODE == 1 )
{
`/usr/bin/maildirmake -f $dirname $maildir/domain-1.com`
}

to "$maildir/domain-1.com/.$dirname/"
}
# }
}

if (/^Delivered-To: .*@domain-4\.com$/)
{
exception {
xfilter "/usr/bin/spamassassin --siteconfigpath /etc/spamassassin/domain-4.com/"
}
if ( /^X-Spam-Status: *Yes/)
{
`test -d $maildir/domain-4.com/.$dirname`
if( $RETURNCODE == 1 )
{
`/usr/bin/maildirmake -f $dirname $maildir/domain-4.com`
}

to "$maildir/domain-4.com/.$dirname/"
}

}
# New Entry for domain-3.com

if (/^Delivered-To: .*@domain-3\.com$/)
{
exception {
xfilter "/usr/bin/spamassassin --siteconfigpath /etc/spamassassin/domain-3.com/"
}
if ( /^X-Spam-Status: *Yes/)
{
`test -d $maildir/domain-3.com/.$dirname`
if( $RETURNCODE == 1 )
{
`/usr/bin/maildirmake -f $dirname $maildir/domain-3.com`
}

to "$maildir/domain-3.com/.$dirname/"
}

}



if (/^Delivered-To: .*@domain-2\.com$/)
{
exception {
xfilter "/usr/bin/spamassassin --siteconfigpath /etc/spamassassin/domain-2.com/"
}

}
}


---------------------------------------------------------------

I am also looking for sendmail.cf and sendmail.mc files but may be someone deleted because we are not using sendmail or postfix standalone on mail server , this all was done 2.5 to 3 years back
Cheers :)

:D B I L A L :D
syedbilalmasaud
Naib Subedar
Posts: 347
Joined: Thu Aug 18, 2005 9:25 am
Location: Attock
Contact:

Post by syedbilalmasaud »

this script is also doing the spam check for incoming emails and I am still looking for sendmail config scripts , I am afraid might I lost it but I will keep try up to few hours in different locations

by the way I have found the last postfix files main and master , if you need I can send you via email

thanks
Cheers :)

:D B I L A L :D
lambda
Major General
Posts: 3452
Joined: Tue May 27, 2003 7:04 pm
Location: Lahore
Contact:

Post by lambda »

i don't see any place where it hooks into sendmail to record outgoing emails. configuring maildrop (or procmail, or whatever) is trivial; connecting it to your mail server isn't.
Watch out for the Manners Taliban!
Isn't it amazing how so many people can type "linuxpakistan.net" into their browsers but not "google.com"?
Post Reply