• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 216
  • Last Modified:

Mail Monitoring

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
checkin
Asked:
checkin
  • 3
  • 3
  • 3
  • +2
1 Solution
 
marcelofrCommented:
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
 
ozoCommented:
you can add an entry in the aliases file
0
 
JYoungmanCommented:
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
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
checkinAuthor Commented:
JYoungman :

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


0
 
davidmwilliamsCommented:
 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
 
checkinAuthor Commented:
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
 
davidmwilliamsCommented:
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
 
ozoCommented:
james:"| /usr/local/bin/filterattachments"
0
 
davidmwilliamsCommented:
 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
 
checkinAuthor Commented:
Where do I get the filterattachments program from OZO ?
0
 
ozoCommented:
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

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

  • 3
  • 3
  • 3
  • +2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now