X-Git-Url: https://git.distorted.org.uk/~mdw/qmail/blobdiff_plain/2117e02ec495fdfd6e96b39778b701a5bcff8aa5..9312c29dd4ff4591809c01f71361d8cfe92db67c:/debian/postinst diff --git a/debian/postinst b/debian/postinst new file mode 100644 index 0000000..8014036 --- /dev/null +++ b/debian/postinst @@ -0,0 +1,57 @@ +#!/usr/bin/perl + +require DebianNet; + +$| = 1; + +my $action = shift; + +if ( $action eq 'configure' or $action eq 'abort-upgrade' or $action eq 'abort-deconfigure' or $action eq 'abort-remove' ) { + my $old_version = shift; + + DebianNet::add_service('smtp stream tcp nowait qmaild /usr/sbin/tcpd /usr/bin/tcp-env /usr/sbin/qmail-smtpd', + "MAIL"); + DebianNet::enable_service('smtp'); + + # Add rc?.d links + system('update-rc.d qmail defaults >/dev/null'); + + if ( ! -r '/var/qmail/control/me' ) { + system("/usr/sbin/qmailconfig"); + } + + if ( !defined($old_version) || $old_version eq '' ) { + print <<'EOT1'; + +By default qmail will deliver mail to ~/Mailbox instead of /var/spool/mail. +To learn how to deal with this, read the file /usr/doc/qmail/INSTALL.mbox. +Disregard the warning in INSTALL.mbox about qmail-alias using flock to lock +the mailbox. + +If you were using sendmail (or smail) previously, you will 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 = ; + if ( $answer =~ /^\s*[yY]/ ) { + system("/etc/init.d/qmail start"); + } + else { + print <<'EOT2'; +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. +EOT2 + } + } + else { + system("/etc/init.d/qmail start"); + } +} + +exit 0; +