Commit | Line | Data |
---|---|---|
9312c29d MW |
1 | #!/usr/bin/perl |
2 | ||
3 | require DebianNet; | |
4 | ||
5 | $| = 1; | |
6 | ||
7 | my $action = shift; | |
8 | ||
9 | if ( $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 | ||
26 | By default qmail will deliver mail to ~/Mailbox instead of /var/spool/mail. | |
27 | To learn how to deal with this, read the file /usr/doc/qmail/INSTALL.mbox. | |
28 | Disregard the warning in INSTALL.mbox about qmail-alias using flock to lock | |
29 | the mailbox. | |
30 | ||
31 | If you were using sendmail (or smail) previously, you will want to read | |
32 | the "qmail-upgrade" manpage, which details user-visible differences between | |
33 | sendmail and qmail. | |
34 | ||
35 | If you are new to qmail, you will want to at least peruse the qmail FAQ, which | |
36 | can be found in /usr/doc/qmail | |
37 | ||
38 | EOT1 | |
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'; | |
46 | Qmail will be started at the next reboot. Or you can start qmail manually when | |
47 | you are ready by typing (as root) "/etc/init.d/qmail start" at a shell prompt. | |
48 | EOT2 | |
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 |
60 | exit 0; |
61 | ||
bcb3f3eb | 62 | __END__ |