# check if postfix was installed before
message "${MESSAGE_COLOR}Probing for previously casted $SPELL...${DEFAULT_COLOR}"  &&

if  [ ! -f  /etc/postfix/main.cf  ];  then
  message "${MESSAGE_COLOR}Previous install not detected.${DEFAULT_COLOR}"
else
  message "${MESSAGE_COLOR}Previous install detected.${DEFAULT_COLOR}"
fi  &&

config_query  BENCH   "install smtpstone benckmarking tools?"  n

message "${MESSAGE_COLOR}smtp configuration files loss may expose your system to SPAM relaying. You should backup and restore configuration files and reply y to the next two questions...${DEFAULT_COLOR}"

config_query  BACKUP   "backup config on dispel?"  y
config_query  RESTORE  "restore config on rebuild/update?"  y

message "${MESSAGE_COLOR}You should run newaliases after each aliases file update, and on first $spell cast...${DEFAULT_COLOR}"
config_query  ALIAS    "run newaliases after cast?"  y

if  spell_ok  mysql;  then
  config_query  MYSQL  "Add MySQL support?"  y
else
  config_query  MYSQL  "Add MySQL support?"  n
fi  &&

if  spell_ok  linux-pam;  then
  config_query  PAM  "Add PAM support?"  y
else
  config_query  PAM  "Add PAM support?"  n
fi  &&

if  spell_ok  openssl;  then
  config_query  SSL  "Add SSL support?"  y
else
  config_query  SSL  "Add SSL support?"  n
fi  &&

if  spell_ok  openldap;  then
  config_query  LDAP  "Add LDAP support?"  y
else
  config_query  LDAP  "Add LDAP support?"  n
fi  &&

if  spell_ok  cyrus-sasl;  then
  config_query  SASL  "Add SASL support?"  y
else
  config_query  SASL  "Add SASL support?"  n
fi  &&

#
# Don't default to 'y' even if postgresql is installed
#
#
#  The PostgreSQL patch is outdated
#
#config_query  PGSQL    "Apply Postgresql patch (EXPERIMENTAL)?"  n
config_query  SSL_TLS  "Apply SSL/TLS patch (EXPERIMENTAL)?"  n
config_query  VDA      "Apply Virtual Delivery Agent (VDA) patch (EXPERIMENTAL?)"  n
