This file is indexed.

postinst is in ssmtp 2.64-7.

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

set -e

if test -L /usr/doc/ssmtp
then
	rm -f /usr/doc/ssmtp 2>/dev/null || true
fi

. /usr/share/debconf/confmodule

db_get ssmtp/root
root="$RET"

db_get ssmtp/mailhub
mailhub="${RET:-mail}"

db_get ssmtp/port
port="$RET"

db_get ssmtp/hostname
hostname="${RET:-`hostname --fqdn`}"

db_get ssmtp/rewritedomain
rewritedomain="$RET"

if test -s /etc/mailname
then
	:
else
	test -n "$hostname" && MailName="$hostname"
	test -n "$rewritedomain" && MailName="$rewritedomain"

	touch /etc/mailname
	chmod 644 /etc/mailname
	echo "$MailName" > /etc/mailname
fi

db_get ssmtp/fromoverride
test "$RET" = "true" && FromOverride=YES

test -d /etc/ssmtp || exit 1

if test -s /etc/ssmtp/ssmtp.conf
then
	if test "$port" = "25" -o -z "$port"
	then
		:
	else
		mailhub=${mailhub}:$port
	fi
	test -z "$FromOverride" && FromOverride=NO

	touch /etc/ssmtp/ssmtp.conf.tmp
	chmod 644 /etc/ssmtp/ssmtp.conf.tmp

	sed "s/^root=.*/root=$root/;s/^mailhub=.*/mailhub=$mailhub/;s/^rewriteDomain=.*/rewriteDomain=$rewritedomain/;s/^hostname=.*/hostname=$hostname/;s/^FromLineOverride=.*/FromLineOverride=$FromOverride/;s/^#FromLineOverride=.*/FromLineOverride=$FromOverride/" /etc/ssmtp/ssmtp.conf > /etc/ssmtp/ssmtp.conf.tmp
	mv -f /etc/ssmtp/ssmtp.conf.tmp /etc/ssmtp/ssmtp.conf
else
	touch /etc/ssmtp/ssmtp.conf
	chmod 644 /etc/ssmtp/ssmtp.conf

	exec 1>/etc/ssmtp/ssmtp.conf

	echo "#"
	echo "# Config file for sSMTP sendmail"
	echo "#"
	echo "# The person who gets all mail for userids < 1000"
	echo "# Make this empty to disable rewriting."
	echo "root=$root"
	echo
	echo "# The place where the mail goes. The actual machine name is required no "
	echo "# MX records are consulted. Commonly mailhosts are named mail.domain.com"
	if test "$port" = "25" -o -z "$port"
	then
		echo "mailhub=$mailhub"
	else
		echo "mailhub=${mailhub}:$port"
	fi
	echo
	echo "# Where will the mail seem to come from?"
	test -z "$rewritedomain" && echo -n "#"
	echo "rewriteDomain=$rewritedomain"
	echo ""
	echo "# The full hostname"
	echo "hostname=$hostname"
	echo
	echo "# Are users allowed to set their own From: address?"
	echo "# YES - Allow the user to specify their own From: address"
	echo "# NO - Use the system generated From: address"
	test -z "$FromOverride" && echo -n "#"
	echo "FromLineOverride=YES"
fi

# Program End
exit 0