Manoj Alex wrote:
> Is there any way that I can stop people sending and receiving mails with
> attached files with extensions like .jpg,.mpg etc.I am using Linux 5.0.Need
> help.Thanx in advance.
I've never done this, but I can take an informed shot at it ;-) Since you
did not specify your reasoning, I'll give a couple of options.
You can't stop your users from sending attachments unless you are willing to
queue all mail (sendmail can be made to do this) and have a script look for
particular headers and strings. The script would then have to handle the
offending messages (bounce or delete, notify user). Then it would have to
run the queue. Take a look around the sendmail.org site and the
moongroup.com site for info on handling sendmail.
For incoming mail, you can use a global procmailrc (/etc/procmailrc) to
check the headers and attachments and write a script to handle the message
appropriately.
The scripts could probably be written in bash, with awk and/or sed or using
perl. Depending on the amount of mail you have to process, this could slow
things down.
If you are concerned about storage, you could setup quotas on /home and have
procmail deliver to the users home directory. I think you have to edit the
makefile and compile this option into procmail. Or you could put a link from
/var/spool/mail/username to the real mail folder in
/home/username/mail/username. Your useradd/userdel scripts would have to
create/delete this link for each user.
If you are concerned about large messages going in/out, you could reduce the
maximum message size sendmail will accept. This is best done by editing
sendma.mc and using the m4 macro utility to rebuild sendmail.cf.
Alternatively, you could edit sendmail.cf directly (look for the
MaxMessageSize option).
--
Anthony E. Greene <[EMAIL PROTECTED]>
Homepage & PGP Key <http://www.pobox.com/~agreene/>
If it's too good to be true, it's probably Linux.
--
To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe"
as the Subject.