Some organizations grant different amounts of access to email to different users. In particular, some are allowed to send mail outside the organization and some can’t.
One approach that’s a little harder to set up but easier to administer is to use a single copy of qmail but to check the mail as users send it. If you use the old-fashioned fixup scheme to handle injected mail, you can check whether a user is allowed to send external mail in the fixup script. Modify ~alias/.qmail-fixup-default to something like this:
Example:- checkrestrict script for .qmail-fixme
case “$DEFAULT” in *@example.com) # our domain, always permitted exit 0 ;; *@*) # external address if egrep -q “^($SENDER)$” authorized-users then exit 0 else bouncesaying “You cannot send external mail.” fi ;; *) # local mail, always permitted exit 0 ;; esac
This script needs to be ruggedized a little, because mail from user fred might have a sender of fred or fred@example.com depending on how his mail program is set up, and a local recipient address might be mary@EXAMPLE.COM in uppercase, but the checking remains quite simple.
A script which would help deleting modules cleanly from your system.
use strict; use IO::Dir; use ExtUtils::Packlist; use ExtUtils::Installed;
sub emptydir($) { my ($dir) = @_; my $dh = IO::Dir->new($dir) || return(0); my @count = $dh->read(); $dh->close(); return(@count == 2 ? 1 : 0); }
# Find all the installed packages print(”Finding all installed modules…\n”); my $installed = ExtUtils::Installed->new();
foreach my $module (grep(!/^Perl$/, $installed->modules())) { my $version = $installed->version($module) || “???”; print(”Found module $module Version $version\n”); print(”Do you want to delete $module? [n] “); my $r = <>; chomp($r); if ($r && $r =~ /^y/i) { # Remove all the files foreach my $file (sort($installed->files($module))) { print(”rm $file\n”); unlink($file); } my $pf = $installed->packlist($module)->packlist_file(); print(”rm $pf\n”); unlink($pf); foreach my $dir (sort($installed->directory_tree($module))) { if (emptydir($dir)) { print(”rmdir $dir\n”); rmdir($dir); } } } }
Note: Please check the script before trying; it has always worked for me; exceptions cannot be denied.