File: config

package info (click to toggle)
msmtp 1.4.32-2
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 2,008 kB
  • ctags: 601
  • sloc: ansic: 10,910; sh: 5,461; python: 121; makefile: 83; sed: 16
file content (50 lines) | stat: -rw-r--r-- 785 bytes parent folder | download | duplicates (6)
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
#!/bin/sh

set -e


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

config_to_debconf () {
	if [ -f /etc/msmtprc ]; then
		var=$(grep ^$1 /etc/msmtprc | awk '{ print $2 }')
		if [ "x$var" = "xon" ]; then
			db_set msmtp/$1 true
		elif [ "x$var" != "x" ]; then
			db_set msmtp/$1 $var
		fi
	fi
	db_input $2 msmtp/$1 || true
	db_go
}

if [ -f /etc/msmtprc ]; then
	db_set msmtp/sysconfig true
else
	db_input medium msmtp/sysconfig || true
	db_go
fi

db_get msmtp/sysconfig
if [ "$RET" = "false" ]; then
	exit 0
else

	config_to_debconf host high

	config_to_debconf port low

	config_to_debconf auto_from medium

	db_get msmtp/auto_from
	if [ "$RET" = "true" ] ; then
		config_to_debconf maildomain medium
	fi

	config_to_debconf tls low
fi

db_stop