4 alias stripwhitespace
="sed -e 's/^[[:blank:]]*//' -e 's/[[:blank:]]*$//'"
6 installeddebconfversion
="$(dpkg -s debconf | sed -ne '/^Version/s/^Version: //p')"
7 if [ "reconfigure" != "$1" ] && \
8 dpkg
--compare-versions "${installeddebconfversion}" "le" "1.4" && \
9 [ "$exim4postinstisrunning" != "true" ] ; then
10 echo "exim4-config.postinst: [WARN] Installed debconf version is broken. Aborting preconfigure." 1>&2
14 .
/usr
/share
/debconf
/confmodule
16 if [ -n "$EX4DEBUG" ]; then
17 echo "now debugging $0 $@"
21 UE4CC
="/etc/exim4/update-exim4.conf.conf"
27 echo -n "internet site; mail is sent and received directly using SMTP"
30 echo -n "mail sent by smarthost; received via SMTP or fetchmail"
33 echo -n "mail sent by smarthost; no local mail"
36 echo -n "local delivery only; not on a network"
39 echo -n "no configuration at this time"
46 "internet site; mail is sent and received directly using SMTP")
49 "mail sent by smarthost; received via SMTP or fetchmail")
52 "mail sent by smarthost; no local mail")
55 "local delivery only; not on a network")
58 "no configuration at this time")
64 convert_transport_to_long
()
68 echo -n "Maildir format in home directory"
71 echo -n "mbox format in /var/mail/"
74 echo -n "locally customized"
78 convert_transport_to_short
()
81 "Maildir format in home directory")
82 echo -n "maildir_home"
84 "mbox format in /var/mail/")
93 # store environment variables in debconf db.
95 dc_eximconfig_configtype
="$(printf '%s\n' "${dc_eximconfig_configtype}" | stripwhitespace)"
96 dc_local_interfaces
="$(printf '%s\n' "${dc_local_interfaces}" | stripwhitespace)"
97 dc_other_hostnames
="$(printf '%s\n' "${dc_other_hostnames}" | stripwhitespace)"
98 dc_readhost
="$(printf '%s\n' "${dc_readhost}" | stripwhitespace)"
99 dc_relay_domains
="$(printf '%s\n' "${dc_relay_domains}" | stripwhitespace)"
100 dc_relay_nets
="$(printf '%s\n' "${dc_relay_nets}" | stripwhitespace)"
101 dc_smarthost
="$(printf '%s\n' "${dc_smarthost}" | stripwhitespace)"
102 dc_minimaldns
="$(printf '%s\n' "${dc_minimaldns}" | stripwhitespace)"
103 dc_use_split_config
="$(printf '%s\n' "${dc_use_split_config}" | stripwhitespace)"
104 dc_hide_mailname
="$(printf '%s\n' "${dc_hide_mailname}" | stripwhitespace)"
105 # store externally changed values to debconf.db
106 db_set exim
4/dc_eximconfig_configtype \
107 "$(convert_to_long ${dc_eximconfig_configtype})"
108 db_set exim
4/dc_local_interfaces
"${dc_local_interfaces}"
109 db_set exim
4/dc_other_hostnames
"${dc_other_hostnames}"
110 db_set exim
4/dc_readhost
"${dc_readhost}"
111 db_set exim
4/dc_relay_domains
"${dc_relay_domains}"
112 db_set exim
4/dc_relay_nets
"${dc_relay_nets}"
113 db_set exim
4/dc_smarthost
"${dc_smarthost}"
114 if [ "${dc_minimaldns}" != "" ]; then
115 db_set exim
4/dc_minimaldns
"${dc_minimaldns}"
117 db_set exim
4/use_split_config
"${dc_use_split_config}"
118 db_set exim
4/hide_mailname
"${dc_hide_mailname}"
119 # do not store "locally customized" in debconf db, otherwise simply
120 # removing the custom dc_localdelivery from ue4cc won't work.
121 if [ "${dc_localdelivery}" != "" ] &&
122 [ "$(convert_transport_to_long ${dc_localdelivery})" != "locally customized" ] ; then
123 db_set exim
4/dc_localdelivery \
124 "$(convert_transport_to_long ${dc_localdelivery})"
126 db_fset
"exim4/dc_other_hostnames" mailname
"${dc_mailname_in_oh}"
129 # ipv6: replace double colons in colon-separated host lists with umlaut-o
130 # replace ':' with ' : ', add leading and ending whitespace.
131 # return empty string if custom delimiter was used:
132 # local_domains = <; 172.16.0.0/12; 3ffe:ffff:836f::/48
133 # e.g: 'localhost : 172.16.0.1 :3ffe::ffff::836f::::: foo.org'
134 # ===> ' localhost : 172.16.0.1 : 3ffeöffffö836föö : foo.org '
135 alias coloncolon2oe
="env -u LC_ALL LC_CTYPE=C sed -e 's/[[:blank:]]*//g' -e '/^</d' -e 's/:::::/:öö/g' -e 's/::::/öö/g' -e 's/:::/:ö/g' -e 's/::/ö/g' -e 's/:/ : /g' -e 's/^/ /' -e 's/$/ /'"
137 # try to parse exim3 configuration file - works only if it was generated
140 dc_mailname
="$(head -n 1 /etc/mailname | stripwhitespace)" || true
142 # get the .... entries from
143 # host_accept_relay = 127.0.0.1 : ::::1 : ......
144 # if they exist, ie. parse list, and remove "127.0.0.1", "::::1"
145 # and "localhost" from it.
147 dc_relay_nets
="$(cat $1 | grep -h '^host_accept_relay[[:blank:]]*=' | sed -e 's/^host_accept_relay[[:blank:]]*=//' | coloncolon2oe | env -u LC_ALL LC_CTYPE=C sed -e 's/ 127\.0\.0\\.1 //g' -e 's/ localhost //g' -e 's/ öö1//g' -e 's/[[:blank:]]*//g' -e 's/::/:/g' -e 's/^://' -e 's/:$//' -e 's/ö/::/g')"
149 # 'local_domains = $colonhostnames', including mailname and "localhost"
151 dc_other_hostnames
="$(cat $1 | grep -h '^local_domains[[:blank:]]*=' | sed -e 's/^local_domains[[:blank:]]*=//' | coloncolon2oe | env -u LC_ALL LC_CTYPE=C sed -e 's/ localhost //g' -e "s
/ ${dc_mailname} //g
" -e 's/[[:blank:]]*//g' -e 's/::/:/g' -e 's/^://' -e 's/:$//' -e 's/ö/::/g')"
153 # relay_domains = some.domain
154 dc_relay_domains
="$(cat $1 | grep -h '^relay_domains = ' | sed -e 's/^relay_domains[[:blank:]]*=[[:blank:]]*//' -e 's/[[:blank:]]*$//')"
156 # lookuphost router exist ---> dc_eximconfig_configtype=internet
158 if cat $1 |
grep -h -A2 '^lookuphost:' | \
159 grep -h -A1 '[[:blank:]]*driver = lookuphost' | \
160 grep -h -q '[[:blank:]]*transport = remote_smtp' ; then
161 dc_eximconfig_configtype
=internet
163 # smart:-director exists ---> dc_eximconfig_configtype=satellite
165 # Later we need the new_address directive to find dc_readhost.
166 # ' || true' is required for "set -e"
167 dc_readhost
="$(cat $1 | grep -h -A2 '^smart:' | grep -h -A1 '^[[:blank:]]*driver = smartuser' | grep -h '^[[:blank:]]*new_address' || true)"
169 # smarthost router exists --> dc_eximconfig_configtype is satellite or smarthost
171 # we need the route_list directive to find dc_smarthost
172 # ' || true' is required for "set -e"
173 dc_smarthost
="$(< $1 grep -A3 '^smarthost:' | grep -A2 '[[:blank:]]*driver = domainlist' | grep -A1 '^[[:blank:]]*transport = remote_smtp' | grep '^[[:blank:]]*route_list = ".
*"' || true)"
175 if [ ! -z "${dc_readhost}" ] ; then
176 dc_eximconfig_configtype
=satellite
177 elif [ ! -z "${dc_smarthost}" ] ; then
178 dc_eximconfig_configtype
=smarthost
179 elif ! cat "$1" |
grep -h -q '^remote_smtp:'; then
180 # dc_eximconfig_configtype=local has no remote_smtp transport.
181 dc_eximconfig_configtype
=local
183 # handcrafted config. We probably misparsed, reset values
185 dc_eximconfig_configtype
=''
186 dc_local_interfaces
='notset'
187 dc_other_hostnames
=''
197 case ${dc_eximconfig_configtype} in
202 dc_hide_mailname
='false'
205 # new_address = ${local_part}@$readhost
206 dc_readhost
="$(printf '%s\n' "${dc_readhost}" | sed -e 's/^.*@//' -e 's/[[:blank:]]*$//')"
207 # route_list = "* $smtphost bydns_a"
208 dc_smarthost
="$(printf '%s\n' "${dc_smarthost}" | \
209 sed -e 's/^ *route_list = "\
* //' -e 's
/ bydns_a
"//' -e 's/[[:blank:]]*$//')"
210 dc_hide_mailname
='true'
214 # route_list = "* $smtphost bydns_a"
215 dc_smarthost
="$(printf '%s\n' "${dc_smarthost}" | \
216 sed -e 's/^ *route_list = "\
* //' -e 's
/ bydns_a
"//' -e 's/[[:blank:]]*$//')"
217 dc_hide_mailname
='false'
224 mailname2otherhostnames
() {
225 # u-ex4.conf no longer includes mailname in local domains,
226 # insert it once into other_hostnames.
227 # The debconf script might run twice, we need to store the result
228 # in a file to pass it to postinst..
229 [ -d /var
/lib
/exim4
] || \
230 install -d -oroot -groot -m755 /var
/lib
/exim4
231 dc_mailname
="$(head -n 1 /etc/mailname | stripwhitespace)" || true
232 if [ -z "${dc_other_hostnames}" ] ; then
233 dc_other_hostnames
="${dc_mailname}"
235 dc_other_hostnames
="$(printf '%s\n' "${dc_other_hostnames}" | stripwhitespace)":${dc_mailname}
237 printf '%s\n' dc_other_hostnames
="'""${dc_other_hostnames}""'" > \
238 /var
/lib
/exim
4/addmailname2oh
239 db_fset
"exim4/dc_other_hostnames" mailname true
240 dc_mailname_in_oh
="true"
242 mailname2otherhostnamesdcloop
() {
243 # append mailname to other_hostnames, once. on fresh installations.
244 if [ "${dc_mailname_in_oh}" != "true" ] ;then
245 db_get exim
4/mailname
246 dc_mailname
="$(printf '%s\n' "$RET"| stripwhitespace)"
247 db_get
"exim4/dc_other_hostnames"
248 dc_other_hostnames
="$(printf '%s\n' "$RET"| stripwhitespace)"
249 if [ -z "${dc_other_hostnames}" ] ; then
250 dc_other_hostnames
="${dc_mailname}"
252 dc_other_hostnames
="${dc_other_hostnames}:${dc_mailname}"
254 db_set exim
4/dc_other_hostnames
"${dc_other_hostnames}"
255 db_fset
"exim4/dc_other_hostnames" mailname true
256 dc_mailname_in_oh
="true"
262 # set to dummy value, so we can differ between unset vs (seen or set outside debconf)
263 dc_local_interfaces
=notset
265 db_settitle exim
4/exim4-config-title
266 db_get exim
4/dc_eximconfig_configtype
267 dc_eximconfig_configtype
="$(convert_to_short "$RET")"
268 db_get exim
4/use_split_config
269 dc_use_split_config
="$RET"
270 # Did we append mailname to other_hostnames yet?
271 db_fget
"exim4/dc_other_hostnames" mailname || true
272 dc_mailname_in_oh
="$RET"
274 if [ -e $UE4CC ] ; then
276 # on upgrades _once_ add mailname to other_hostnames
277 if [ -n "$2" ] && [ "$1" = "configure" ] && \
278 [ "${dc_mailname_in_oh}" != "true" ] ; then
279 mailname2otherhostnames
281 # set defaults using these values
284 # If there are no debconf answers (running first time) and we are
285 # making a cross upgrade from exim3, try to parse its config file
286 # to seed debconf db.
287 if [ "${dc_eximconfig_configtype}" = "" ] && [ -r /etc
/exim
/exim.conf
] ; then
288 # parse old configfile
290 # first do unfolding of lines continued with backslash, by:
291 # 1. remove comment lines
292 # 2. remove blank lines
293 # 3. remove "\<optional space><newline><optional space>"
294 exim3confunfolded
="$(tempfile -p EX3)"
298 s/^[[:space:]]*#[^\n]*\n//mg;
300 s/\\[[:space:]]*\n[[:space:]]*//g;
303 }' < /etc
/exim
/exim.conf
> "$exim3confunfolded"
304 if parseexim3
"$exim3confunfolded" ; then
305 # set defaults using these values
308 rm -f "$exim3confunfolded"
312 ## set up default values, we cannot do this in templates file because
313 ## config script is called two times before update-exim4.conf.conf exists.
314 [ "${dc_eximconfig_configtype}" = "" ] && \
315 dc_eximconfig_configtype
="local" && \
316 db_set exim
4/dc_eximconfig_configtype
"$(convert_to_long ${dc_eximconfig_configtype})"
319 if [ -e /etc
/mailname
] ; then
320 dc_mailname
="$(head -n 1 /etc/mailname | stripwhitespace)" || true
322 db_set exim
4/mailname
"${dc_mailname}"
324 db_get exim
4/mailname
328 #Set default mailname
329 if [ "${dc_mailname}" = "" ] ; then
330 dc_mailname
="$(hostname --fqdn 2>/dev/null)" || dc_mailname
="$(hostname)" && \
331 dc_mailname
="$(printf '%s\n' "${dc_mailname}" | stripwhitespace)" && \
332 db_set exim
4/mailname
"${dc_mailname}"
334 fqdn
="$(hostname --fqdn 2>/dev/null)" || fqdn
=''
335 db_subst exim
4/dc_other_hostnames fqdn
"$fqdn"
337 # initialize env-vars from debconf_db, if they haven't been set yet either by
338 # parseexim3() or by sourcing $UE4CC
339 if [ "${dc_readhost}" = "" ] ; then
340 db_get exim
4/dc_readhost
343 if [ "${dc_smarthost}" = "" ] ; then
344 db_get exim
4/dc_smarthost
347 # Tricky! An empty value for this option is significant, therefore both
348 # envvar and debconf-value default to "nonset" instead of "", the
349 # following line will only change then envvars value if the config-script
350 # runs the second time without existing $UE4CC or
351 # if the debconf-db has been preseeded by other means.
352 if [ "${dc_local_interfaces}" = "notset" ]; then
353 db_get exim
4/dc_local_interfaces
354 dc_local_interfaces
="$RET"
356 if [ "${dc_minimaldns}" = "" ] ; then
357 db_get exim
4/dc_minimaldns
361 if [ "${dc_use_split_config}" = "" ] ; then
362 if [ "${2}" = "" ] ; then
364 db_set exim
4/use_split_config false
365 dc_use_split_config
="false"
367 db_set exim
4/use_split_config true
368 dc_use_split_config
="true"
372 if [ "${dc_localdelivery}" = "" ] ; then
373 db_get exim
4/dc_localdelivery
374 dc_localdelivery
="$(convert_transport_to_short "$RET")"
375 elif [ "$(convert_transport_to_long ${dc_localdelivery})" = "locally customized" ] ; then
376 dc_localdelivery
="custom"
384 # state to continue for all values
389 while [ "$STATE" != 0 ] && [ "$STATE" -le "$STATELIMIT" ]; do
394 BACKSTATE
=$
(($STATE - 1))
395 FORWSTATE
=$
(($STATE + 1))
399 EX4QUESTION
="exim4/dc_eximconfig_configtype"
400 BACKSTATE
=$
(($STATE - 1))
401 FORWSTATE
=$
(($STATE + 1))
403 db_input medium
"$EX4QUESTION" || true
407 db_get exim
4/dc_eximconfig_configtype
408 dc_eximconfig_configtype
="$(convert_to_short "$RET")"
409 BACKSTATE
=$
(($STATE - 1))
410 case "${dc_eximconfig_configtype}" in
412 # dont ask more questions
413 #FORWSTATE=$(($STATELIMIT + 1))
429 # Should not happen. Break loop
430 FORWSTATE
=$
(($STATELIMIT + 1))
436 # show additional info for type=none
437 EX4QUESTION
="exim4/no_config"
438 BACKSTATE
=$CONFIGTYPEQUESTION
439 FORWSTATE
=$
(($STATE + 1))
440 # same priority as configtype because of danger of loop?
441 db_input medium
"$EX4QUESTION" || true
445 BACKSTATE
=$CONFIGTYPEQUESTION
446 db_get exim
4/no_config || true
447 if [ "$RET" = "false" ]; then
448 FORWSTATE
=$CONFIGTYPEQUESTION
457 EX4QUESTION
="exim4/mailname"
458 db_input medium
"$EX4QUESTION" || true
459 BACKSTATE
=$CONFIGTYPEQUESTION
460 FORWSTATE
=$
(($STATE + 1))
463 EX4QUESTION
="exim4/dc_local_interfaces"
464 BACKSTATE
=$
(($STATE - 1))
465 FORWSTATE
=$
(($STATE + 1))
466 if [ "${dc_local_interfaces}" = "notset" ] ; then
467 dc_local_interfaces
=''
468 db_set exim
4/dc_local_interfaces
''
470 db_input medium
"$EX4QUESTION" || true
473 EX4QUESTION
="exim4/dc_other_hostnames"
474 BACKSTATE
=$
(($STATE - 1))
475 FORWSTATE
=$
(($STATE + 1))
476 mailname2otherhostnamesdcloop
477 db_input medium
"$EX4QUESTION" || true
480 EX4QUESTION
="exim4/dc_relay_domains"
481 db_input medium
"$EX4QUESTION" || true
482 BACKSTATE
=$
(($STATE - 1))
483 FORWSTATE
=$
(($STATE + 1))
486 EX4QUESTION
="exim4/dc_relay_nets"
487 db_input medium
"$EX4QUESTION" || true
488 BACKSTATE
=$
(($STATE - 1))
489 FORWSTATE
=$
(($STATE + 1))
492 EX4QUESTION
="exim4/dc_minimaldns"
493 BACKSTATE
=$
(($STATE - 1))
494 FORWSTATE
=$
(($STATE + 1))
495 db_input low
"$EX4QUESTION" || true
498 EX4QUESTION
="exim4/dc_localdelivery"
499 BACKSTATE
=$
(($STATE - 1))
501 # do not ask question if user has set a different transport
502 # than maildir or mailspool
503 if [ "${dc_localdelivery}" != "custom" ] ; then
504 db_input low
"$EX4QUESTION" || true
510 # internet site with smarthost
511 EX4QUESTION
="exim4/mailname"
512 db_input medium
"$EX4QUESTION" || true
513 BACKSTATE
=$CONFIGTYPEQUESTION
514 FORWSTATE
=$
(($STATE + 1))
517 EX4QUESTION
="exim4/dc_local_interfaces"
518 BACKSTATE
=$
(($STATE - 1))
519 FORWSTATE
=$
(($STATE + 1))
520 if [ "${dc_local_interfaces}" = "notset" ] ; then
521 dc_local_interfaces
='127.0.0.1 ; ::1'
522 db_set exim
4/dc_local_interfaces
'127.0.0.1 ; ::1'
524 db_input medium
"$EX4QUESTION" || true
527 EX4QUESTION
="exim4/dc_other_hostnames"
528 BACKSTATE
=$
(($STATE - 1))
529 FORWSTATE
=$
(($STATE + 1))
530 mailname2otherhostnamesdcloop
531 db_input medium
"$EX4QUESTION" || true
534 EX4QUESTION
="exim4/dc_relay_domains"
535 BACKSTATE
=$
(($STATE - 1))
536 FORWSTATE
=$
(($STATE + 1))
537 db_get
"$EX4QUESTION" || true
538 dc_relay_domains
="$RET"
539 # Only ask for relay domains if non-empty, since this only
540 # really works for internet site hosts. (See comment near
541 # smarthost router definition in configuration file.)
542 if [ "${dc_relay_domains}" != "" ] ; then
543 db_input medium
"$EX4QUESTION" || true
547 EX4QUESTION
="exim4/dc_relay_nets"
548 db_input medium
"$EX4QUESTION" || true
549 BACKSTATE
=$
(($STATE - 1))
550 FORWSTATE
=$
(($STATE + 1))
553 EX4QUESTION
="exim4/dc_smarthost"
554 if [ "${dc_smarthost}" = "" ] ; then
555 # default to mail.mailname
556 dc_smarthost
="mail.${dc_mailname}"
557 db_set exim
4/dc_smarthost
"${dc_smarthost}"
559 db_input medium
"$EX4QUESTION" || true
560 BACKSTATE
=$
(($STATE - 1))
561 FORWSTATE
=$
(($STATE + 1))
564 EX4QUESTION
="exim4/hide_mailname"
565 BACKSTATE
=$
(($STATE - 1))
566 FORWSTATE
=$
(($STATE + 1))
567 db_get exim
4/mailname || true
569 db_get exim
4/dc_other_hostnames || true
570 dc_other_hostnames
="$RET"
571 db_subst exim
4/hide_mailname mailname
${dc_mailname}
572 db_subst exim
4/hide_mailname dc_other_hostnames \
573 ${dc_other_hostnames}
574 db_get
$EX4QUESTION || true
575 dc_hide_mailname
="$RET"
576 if [ "${dc_hide_mailname}" = "" ] ; then
577 dc_hide_mailname
='false'
578 db_set exim
4/hide_mailname
"${dc_hide_mailname}"
580 db_input medium
"$EX4QUESTION" || true
583 EX4QUESTION
="exim4/dc_readhost"
584 BACKSTATE
=$
(($STATE - 1))
585 FORWSTATE
=$
(($STATE + 1))
586 db_get exim
4/hide_mailname
587 dc_hide_mailname
="$RET"
588 if [ "${dc_hide_mailname}" = "true" ];then
589 if [ "${dc_readhost}" = "" ] ; then
590 # default to mailname
591 dc_readhost
="${dc_mailname}"
592 db_set exim
4/dc_readhost
"${dc_readhost}"
594 db_input medium
"$EX4QUESTION" || true
600 EX4QUESTION
="exim4/dc_minimaldns"
601 BACKSTATE
=$
(($STATE - 1))
602 FORWSTATE
=$
(($STATE + 1))
603 db_input low
"$EX4QUESTION" || true
606 EX4QUESTION
="exim4/dc_localdelivery"
607 BACKSTATE
=$
(($STATE - 1))
609 # do not ask question if user has set a different transport
610 # than maildir or mailspool
611 if [ "${dc_localdelivery}" != "custom" ] ; then
612 db_input low
"$EX4QUESTION" || true
618 EX4QUESTION
="exim4/mailname"
619 db_input medium
"$EX4QUESTION" || true
620 BACKSTATE
=$CONFIGTYPEQUESTION
621 FORWSTATE
=$
(($STATE + 1))
624 EX4QUESTION
="exim4/dc_local_interfaces"
625 BACKSTATE
=$
(($STATE - 1))
626 FORWSTATE
=$
(($STATE + 1))
627 if [ "${dc_local_interfaces}" = "notset" ] ; then
628 dc_local_interfaces
='127.0.0.1 ; ::1'
629 db_set exim
4/dc_local_interfaces
'127.0.0.1 ; ::1'
631 db_input medium
"$EX4QUESTION" || true
634 EX4QUESTION
="exim4/dc_other_hostnames"
635 BACKSTATE
=$
(($STATE - 1))
636 FORWSTATE
=$
(($STATE + 1))
637 mailname2otherhostnamesdcloop
638 db_input medium
"$EX4QUESTION" || true
641 EX4QUESTION
="exim4/dc_readhost"
642 BACKSTATE
=$
(($STATE - 1))
643 FORWSTATE
=$
(($STATE + 1))
644 # satellite requires a mail-hub, no use asking whether there
646 db_set exim
4/hide_mailname
"true"
647 dc_hide_mailname
="true"
648 if [ "${dc_readhost}" = "" ] ; then
649 # default to domain of mailname
650 dc_readhost
="${dc_mailname}"
651 db_set exim
4/dc_readhost
"${dc_readhost}"
653 db_input medium
"$EX4QUESTION" || true
656 EX4QUESTION
="exim4/dc_smarthost"
657 BACKSTATE
=$
(($STATE - 1))
658 FORWSTATE
=$
(($STATE + 1))
659 db_get exim
4/dc_readhost
661 if [ "${dc_smarthost}" = "" ] ; then
662 # default to read_host
663 dc_smarthost
="${dc_readhost}"
664 db_set exim
4/dc_smarthost
"${dc_smarthost}"
666 db_input medium
"$EX4QUESTION" || true
669 EX4QUESTION
="exim4/dc_relay_domains"
670 BACKSTATE
=$
(($STATE - 1))
671 FORWSTATE
=$
(($STATE + 1))
672 db_get
"$EX4QUESTION" || true
673 dc_relay_domains
="$RET"
674 # Only ask for relay domains if non-empty, since this only
675 # really works for internet site hosts. (See comment near
676 # smarthost router definition in configuration file.)
677 if [ "${dc_relay_domains}" != "" ] ; then
678 db_input medium
"$EX4QUESTION" || true
683 BACKSTATE
=$
(($STATE - 1))
684 FORWSTATE
=$
(($STATE + 1))
685 # satellite-system! Only ask for relay_nets if they are
686 # nonempty - we cannot distinguish whether they were set outside debconf
687 # or whether the user switched dc_eximconfig_configtype
688 db_get exim
4/dc_relay_nets || true
690 if [ "${dc_relay_nets}" != "" ] ; then
691 db_input medium exim
4/dc_relay_nets || true
692 FORWSTATE
=$
(($STATE + 1))
696 EX4QUESTION
="exim4/dc_minimaldns"
697 BACKSTATE
=$
(($STATE - 1))
698 FORWSTATE
=$
(($STATE + 1))
699 db_input low
"$EX4QUESTION" || true
702 EX4QUESTION
="exim4/dc_localdelivery"
703 BACKSTATE
=$
(($STATE - 1))
705 # Only ask question if it is set to a value that is both supported
706 # by debconf (maildir_home and mail_spool) and is not set to the
707 # default value (maildir_home) since this is only used for
709 if [ "${dc_localdelivery}" = "maildir_home" ] ; then
710 db_input low
"$EX4QUESTION" || true
716 EX4QUESTION
="exim4/mailname"
717 db_input medium
"$EX4QUESTION" || true
718 BACKSTATE
=$CONFIGTYPEQUESTION
719 FORWSTATE
=$
(($STATE + 1))
723 BACKSTATE
=$
(($STATE - 1))
724 FORWSTATE
=$
(($STATE + 1))
725 if [ "${dc_local_interfaces}" = "notset" ] ; then
726 dc_local_interfaces
='127.0.0.1 ; ::1'
727 db_set exim
4/dc_local_interfaces
'127.0.0.1 ; ::1'
729 db_input medium exim
4/dc_local_interfaces || true
733 EX4QUESTION
="exim4/dc_other_hostnames"
734 BACKSTATE
=$
(($STATE - 1))
735 FORWSTATE
=$
(($STATE + 1))
736 mailname2otherhostnamesdcloop
737 db_input medium
"$EX4QUESTION" || true
742 BACKSTATE
=$
(($STATE - 1))
743 FORWSTATE
=$
(($STATE + 1))
744 # local mail only -system! Only ask for relay_nets/relay_domains if they are
745 # nonempty - we cannot distinguish whether they were set outside debconf
746 # or whether the user switched dc_eximconfig_configtype
747 db_get exim
4/dc_relay_nets || true
749 db_get exim
4/dc_relay_domains || true
750 dc_relay_domains
="$RET"
752 if [ "${dc_relay_nets}" != "" ] ; then
753 db_input medium exim
4/dc_relay_nets || true
755 if [ "${dc_relay_domains}" != "" ] ; then
756 db_input medium exim
4/dc_relay_domains || true
760 EX4QUESTION
="exim4/dc_minimaldns"
761 BACKSTATE
=$
(($STATE - 1))
762 FORWSTATE
=$
(($STATE + 1))
763 db_input low
"$EX4QUESTION" || true
766 EX4QUESTION
="exim4/dc_localdelivery"
767 BACKSTATE
=$
(($STATE - 1))
769 # do not ask question if user has set a different transport
770 # than maildir or mailspool
771 if [ "${dc_localdelivery}" != "custom" ] ; then
772 db_input low
"$EX4QUESTION" || true
776 EX4QUESTION
="exim4/use_split_config"
778 FORWSTATE
=$
(($STATELIMIT + 1))
779 db_input medium
"$EX4QUESTION" || true
789 if [ "$STATE" = 0 ] ; then
790 # User pressed back on the first question, go back to previous
791 # package if run by base-config 2.0. #222773.
795 # make sure dc_local_interfaces is set to sane value
796 if [ "${dc_local_interfaces}" = "notset" ] ; then
797 dc_local_interfaces
=''
798 db_set exim
4/dc_local_interfaces
''
801 if [ ! -e /etc
/aliases
] || \
802 ! grep -q '^root:[[:space:]]*[[:alnum:]]' /etc
/aliases
; then
803 db_get exim
4/dc_postmaster
804 if [ -z "$RET" ] && db_get passwd
/username
; then
805 db_set exim
4/dc_postmaster
"${RET}"
807 db_input medium exim
4/dc_postmaster || true
811 db_get exim
4/dc_postmaster || true
812 dc_postmaster
="$(printf '%s\n' "$RET" | stripwhitespace)"
814 # this has been commented out for a long time, remove by the end of 2007
815 # if [ "${dc_eximconfig_configtype}" = "satellite" ] || [ "${dc_eximconfig_configtype}" = "local" ] ; then
816 # # reset dc_relay_domains dc_relay_nets and dc_other_hostnames
817 # db_set exim4/dc_relay_domains ""
818 # db_set exim4/dc_relay_nets ""
819 # db_set exim4/dc_other_hostnames ""