This file is indexed.

postinst is in msmtp 1.4.31-1.

This file is a maintainer script. It is executed when installing (*inst) or removing (*rm) the package.

The actual contents of the file can be viewed below.

 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
#!/bin/sh
set -e

if [ -e /usr/share/debconf/confmodule ]; then
	. /usr/share/debconf/confmodule
fi



write_config () {
	exec 1> /etc/msmtprc.new
	echo "account default"

	db_get msmtp/host
	if [ "x$RET" != "x" ]; then
		echo "host $RET"
	fi

	db_get msmtp/port
	if [ "$RET" != "25" ]; then
		echo "port $RET"
	fi

	db_get msmtp/auto_from
	if [ "$RET" = "true" ]; then
		echo "auto_from on"
		db_get msmtp/maildomain
		hostname=`hostname --fqdn`
		echo "maildomain ${RET:-$hostname}"
	fi

	db_get msmtp/tls
	if [ "$RET" = "true" ]; then
		echo "tls on"
	fi
}

case $1 in
	configure)
		db_get msmtp/sysconfig
		if [ "$RET" = "true" ]; then
			write_config
			if [ -f /etc/msmtprc ]; then
				ucf --debconf-ok /etc/msmtprc.new /etc/msmtprc
				rm -f /etc/msmtprc.new
			else
				mv /etc/msmtprc.new /etc/msmtprc
			fi
		fi
		;;
	*)
		exit 0
		;;
esac