debian/rules: Use `git' potty wrapper.
[qmail] / debian / postinst
CommitLineData
9312c29d
MW
1#!/usr/bin/perl
2
3require DebianNet;
4
5$| = 1;
6
7my $action = shift;
8
9if ( $action eq 'configure' or $action eq 'abort-upgrade' or $action eq 'abort-deconfigure' or $action eq 'abort-remove' ) {
10 my $old_version = shift;
11
12 DebianNet::add_service('smtp stream tcp nowait qmaild /usr/sbin/tcpd /usr/bin/tcp-env /usr/sbin/qmail-smtpd',
13 "MAIL");
14 DebianNet::enable_service('smtp');
15
16 # Add rc?.d links
17 system('update-rc.d qmail defaults >/dev/null');
18
19 if ( ! -r '/var/qmail/control/me' ) {
20 system("/usr/sbin/qmailconfig");
21 }
22
23 if ( !defined($old_version) || $old_version eq '' ) {
24 print <<'EOT1';
25
26By default qmail will deliver mail to ~/Mailbox instead of /var/spool/mail.
27To learn how to deal with this, read the file /usr/doc/qmail/INSTALL.mbox.
28Disregard the warning in INSTALL.mbox about qmail-alias using flock to lock
29the mailbox.
30
31If you were using sendmail (or smail) previously, you will want to read
32the "qmail-upgrade" manpage, which details user-visible differences between
33sendmail and qmail.
34
35If you are new to qmail, you will want to at least peruse the qmail FAQ, which
36can be found in /usr/doc/qmail
37
38EOT1
39 print 'Do you want to start qmail now? [y/N] ';
40 my $answer = <STDIN>;
41 if ( $answer =~ /^\s*[yY]/ ) {
42 system("/etc/init.d/qmail start");
43 }
44 else {
45 print <<'EOT2';
46Qmail will be started at the next reboot. Or you can start qmail manually when
47you are ready by typing (as root) "/etc/init.d/qmail start" at a shell prompt.
48EOT2
49 }
50 }
51 else {
52 system("/etc/init.d/qmail start");
53 }
54}
55
bcb3f3eb
MW
56-e "/usr/doc/qmail" or
57 symlink("../share/doc/qmail", "/usr/doc/qmail") or
58 die "symlink: $!";
59
9312c29d
MW
60exit 0;
61
bcb3f3eb 62__END__