1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117
|
#!/usr/bin/perl
$| = 1;
my $action = shift;
my $hostsallow = "/etc/hosts.allow" ;
if ( $action eq 'configure' or $action eq 'abort-upgrade' or $action eq 'abort-deconfigure' or $action eq 'abort-remove' ) {
my $old_version = shift;
if ( !defined($old_version) || $old_version le "1.01-7" ) {
check_hosts_allow() ;
print ("Updating /etc/tcp.smtp database for tcpserver\n");
system("/usr/bin/tcprules /etc/tcp.smtp.cdb /etc/tcp.smtp.tmp < /etc/tcp.smtp") ;
}
# Add rc?.d links
system('update-rc.d qmail defaults >/dev/null');
system("/usr/sbin/qmail-newu");
if ( ! -r '/var/qmail/control/me' ) {
system("/usr/lib/qmail/qmailconfig");
}
$checkstart = 0 ;
if ( !defined($old_version) || $old_version eq '' ) {
print <<'EOT1';
Before making any changes to your qmail configuration, please read
/usr/doc/qmail/README.debian. This contains a description of the differences
bewtween other mailers on Debian, qmail on Debian, and qmail on other systems.
If you were using sendmail (or smail) previously, you will also want to read
the "qmail-upgrade" manpage, which details user-visible differences between
sendmail and qmail.
If you are new to qmail, you will want to at least peruse the qmail FAQ, which
can be found in /usr/doc/qmail
EOT1
print 'Do you want to start qmail now? [y/N] ';
my $answer = <STDIN>;
if ( $answer =~ /^\s*[yY]/ ) {
system("/etc/init.d/qmail start");
}
else {
print <<'EOT4';
Qmail will be started at the next reboot. Or you can start qmail manually when
you are ready by typing (as root) "/etc/init.d/qmail start" at a shell prompt.
EOT4
}
}
elsif ( $old_version le '1.01-7' ) {
if ( -f '/var/qmail/control/recipientmap' ) {
print <<'EOT2';
WARNING: recipientmap is gone from qmail-1.02. The virtualdomains mechanism
has been expanded to support virtual users. You will need to fix your setup.
EOT2
}
print <<'EOT3';
WARNING: qlist has been split into a separate package by Dan Bernstein (the
author of qmail) since qmail-1.02.
I was not planning on debianising qlist, because ezmlm does a better job,
so if you still want qlist, you can either get it direct from
http://pobox.com/~djb/qlist.html,
or you can pester me about it, in which case I may package it if there
is enough demand.
Please check in /usr/doc/qmail and the man pages for changes since qmail 1.01
EOT3
print 'Do you want to start qmail now? [Y/n] ';
my $answer = <STDIN>;
if ( $answer eq "" || $answer =~ /^\s*[yY]/ ) {
system("/etc/init.d/qmail start");
}
else {
print <<'EOT4';
Qmail will be started at the next reboot. Or you can start qmail manually when
you are ready by typing (as root) "/etc/init.d/qmail start" at a shell prompt.
EOT4
}
}
else {
system("/etc/init.d/qmail start");
}
}
sub check_hosts_allow {
if (open(HOSTSA,"$hostsallow")) {
@hostsa = <HOSTSA> ;
close(HOSTSA) ;
if (grep(m/smtp:/,@hostsa)) {
print <<'EOT5';
inetd does not handle qmail terribly effectively, so I have decided
to make the default instalation use tcpserver from ucspi-tcp instead.
For this reason, I have disabled the smtp line in /etc/inetd.conf.
This means that you must configure things such as RELAYCLIENT using
/etc/tcp.smtp, rather than hosts allow (see /usr/doc/qmail/README for details)
EOT5
print 'Press <RETURN> to continue ' ;
my $answer = <STDIN>;
}
}
}
exit 0;
|