mirror of
https://git.FreeBSD.org/ports.git
synced 2024-12-26 05:02:18 +00:00
4688c2ff1e
Give Seamus Venasse maintainership PR: 31095 Submitted by: new maintainer
40 lines
1.1 KiB
Perl
40 lines
1.1 KiB
Perl
#!/usr/bin/perl
|
|
|
|
use strict;
|
|
|
|
my $qmailDir;
|
|
my ( $uid, $gid );
|
|
local *F;
|
|
|
|
# ensure we are running only as post installation
|
|
exit 0 if $ARGV[ 1 ] ne "POST-INSTALL";
|
|
|
|
# find location of qmail
|
|
if ( -f "/var/qmail/bin/qmail-send" ) {
|
|
$qmailDir = "/var/qmail";
|
|
} else {
|
|
$qmailDir = "/usr/local/qmail";
|
|
}
|
|
|
|
# create virusalert use as root
|
|
print "==> Creating virusalert user as root\n";
|
|
open( F, ">${qmailDir}/alias/.qmail-virusalert" );
|
|
print F "root\n";
|
|
close( F );
|
|
|
|
# move qmail-queue to qmail-queue-real
|
|
print "==> Moving qmail-queue\n";
|
|
if ( ! -f "${qmailDir}/bin/qmail-queue-real" ) {
|
|
system( "mv ${qmailDir}/bin/qmail-queue ${qmailDir}/bin/qmail-queue-real" );
|
|
system( "cp /usr/local/sbin/amavis ${qmailDir}/bin/qmail-queue" );
|
|
( undef, undef, $uid, $gid ) = getpwnam( "qmailq" );
|
|
chown $uid, $gid, "${qmailDir}/bin/qmail-queue";
|
|
chmod 04711, "${qmailDir}/bin/qmail-queue";
|
|
} else {
|
|
print "FAILURE: ${qmailDir}/bin/qmail-queue-real already exists!!\n";
|
|
exit 1;
|
|
}
|
|
|
|
print "==> Changing permissions on suidperl\n";
|
|
chmod 04755, "/usr/bin/suidperl";
|