Solved

Mail Monitoring

Posted on 1998-10-24
11
210 Views
Last Modified: 2010-04-20
Is it possible to make a copy of all incoming mail for certain accounts and send it to another account to be monitored ??  Also is it possible to stop certain accounts receiving attachments ??  If any of these are possible how can I acheive this ?
0
Comment
Question by:checkin
  • 3
  • 3
  • 3
  • +2
11 Comments
 
LVL 3

Expert Comment

by:marcelofr
ID: 1638339
If you can put privacy issues aside, qmail (http://www.qmail.org/) does this by default: each incoming mail is forwarded to the account and to an special account for accounting pourposes. You can turn this to whatever you want.

Cutting off attachments may need some more work but it´s not impossible...
0
 
LVL 84

Expert Comment

by:ozo
ID: 1638340
you can add an entry in the aliases file
0
 
LVL 2

Expert Comment

by:JYoungman
ID: 1638341
To elaborate on ozo's answer, for Sendmail you put this in /etc/aliases:-

james: \james, /var/spy/mail/james

This makes james's mail go to him, but also saves a copy in that file.

0
Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

 

Author Comment

by:checkin
ID: 1638342
JYoungman :

If I wanted to make a copy to say my account could I point the file directly to my mailbox ?


0
 
LVL 4

Accepted Solution

by:
davidmwilliams earned 100 total points
ID: 1638343
 Yes, you can point directly to your mailbox using the aliases file.
  If you wanted to spy on 'james', and your account was 'fred', you would edit /etc/aliases or /etc/mail/aliases to have a line that read -

james:  james, fred

  After you edit the file, be sure to run the newaliases command.

  Now James gets his mail as normal, and without knowing you are spying, and you will also receive mail for him in your mailbox.
0
 

Author Comment

by:checkin
ID: 1638344
Thank you David, thats just what I needed.  Now all is I have to figure out is how to stop certain accounts receiving attachments.
0
 
LVL 4

Expert Comment

by:davidmwilliams
ID: 1638345
Unfortunately, I don't think that is actually possible, because the SMTP server does not know what it is receiving.  However, if you have any control over the mail reader that people use, perhaps you could prevent any readers being installed that handle MIME - because then any attachments received will not be decodable.
0
 
LVL 84

Expert Comment

by:ozo
ID: 1638346
james:"| /usr/local/bin/filterattachments"
0
 
LVL 4

Expert Comment

by:davidmwilliams
ID: 1638347
 Is 'filterattachments' a real program?  Where do you get it from?  It certainly doesn't come with any release of Unix that I know of ...
0
 

Author Comment

by:checkin
ID: 1638348
Where do I get the filterattachments program from OZO ?
0
 
LVL 84

Expert Comment

by:ozo
ID: 1638349
sorry, as far as I know, you would write it. (which is why I thought it would be in /usr/local/bin/)
the above notation is just how you would invoke it from aliases

perhaps such a program might look something like:

#!/usr/bin/perl
$/="\n\n";
$_ = <>;
die "attachments rejected" if /^Content-Type: multipart/im;
open(MAIL,">>/usr/spool/mail/james") or die "can't append to mailbox:$!";
print MAIL;
while( <> ){ print MAIL }
0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
gdb doesn't stop on breakpoint 2 67
video edge NVR Device Discovery Problem 4 45
linux 13 49
How to check currently configured static routes on CentOS 7? 1 28
Over the last ten+ years I have seen Linux configuration tools come and go. In the early days there was the tried-and-true, all-powerful linuxconf that many thought would remain the one and only Linux configuration tool until the end of times. Well,…
Setting up Secure Ubuntu server on VMware 1.      Insert the Ubuntu Server distribution CD or attach the ISO of the CD which is in the “Datastore”. Note that it is important to install the x64 edition on servers, not the X86 editions. 2.      Power on th…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question