head	1.12;
access;
symbols;
locks; strict;
comment	@# @;


1.12
date	2001.12.15.11.47.05;	author matt;	state Exp;
branches;
next	1.11;

1.11
date	2001.04.16.12.09.00;	author matt;	state Exp;
branches;
next	1.10;

1.10
date	2001.03.22.12.49.53;	author matt;	state Exp;
branches;
next	1.9;

1.9
date	2001.03.22.12.42.58;	author matt;	state Exp;
branches;
next	1.8;

1.8
date	2001.03.21.21.17.01;	author matt;	state Exp;
branches;
next	1.7;

1.7
date	2001.03.19.13.26.51;	author matt;	state Exp;
branches;
next	1.6;

1.6
date	2001.03.19.12.48.00;	author matt;	state Exp;
branches;
next	1.5;

1.5
date	2000.09.29.14.59.24;	author matt;	state Exp;
branches;
next	1.4;

1.4
date	2000.09.10.10.00.33;	author matt;	state Exp;
branches;
next	1.3;

1.3
date	2000.08.29.11.20.11;	author matt;	state Exp;
branches;
next	1.2;

1.2
date	2000.08.29.11.15.26;	author matt;	state Exp;
branches;
next	1.1;

1.1
date	2000.05.05.17.05.08;	author matt;	state Exp;
branches;
next	;


desc
@Initial revision.
@


1.12
log
@No longer add symlink into /usr/doc.
@
text
@#!/bin/sh -e
#
# $Id: postinst,v 1.11 2001/04/16 12:09:00 matt Exp matt $
#

if test -L /usr/doc/ssmtp
then
	rm -f /usr/doc/ssmtp 2>/dev/null || true
#else
#	if cd /usr/doc 2>/dev/null
#	then
#		ln -sf ../share/doc/ssmtp ssmtp
#	fi
#
fi

. /usr/share/debconf/confmodule

db_get ssmtp/overwriteconfig
OverwriteConfig="${RET:-true}"

db_get ssmtp/root
PostMaster="${RET:-postmaster}"

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

db_get ssmtp/port
RemotePort="$RET"

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

db_get ssmtp/rewritedomain
RewriteDomain="$RET"

if test -s /etc/mailname
then
	:
else
	test -n "$FQDN" && MailName="$FQDN"
	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="$RET"

test -d /etc/ssmtp || exit 1

if test -s /etc/ssmtp/ssmtp.conf
then
	if test "$OverwriteConfig" = "false"
	then
		exit 0
	fi
fi
exec 1>/etc/ssmtp/ssmtp.conf

echo "***     This file is auto-generated using debconf on install.     ***"
echo "*** Any changes made may be overwritten on next upgrade depending ***"
echo "***  on your answer to the question on overwriting config files.  ***"
echo "#"
echo "# Config file for sSMTP sendmail"
echo "#"
echo "# The person who gets all mail for userids < 1000"
echo "root=$PostMaster"
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 "$RemotePort" = "25" -o -z "$RemotePort"
then
	echo "mailhub=$MailHub"
else
	echo "mailhub=${MailHub}:$RemotePort"
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=$FQDN"
echo
echo "# Set this to never rewrite the "From:" line (unless not given) and to"
echo "# use that address in the "from line" of the envelope."
test -z "$FromOverride" && echo -n "#"
echo "FromLineOverride=YES"

# Program End
exit 0
@


1.11
log
@Added patch for SMTP port selection.
@
text
@d3 1
a3 1
# $Id: postinst,v 1.10 2001/03/22 12:49:53 matt Exp matt $
d8 7
a14 3
	:
else
	(cd /usr/doc && ln -sf ../share/doc/ssmtp ssmtp)
d37 1
a37 1
if ! test -s /etc/mailname
d39 2
@


1.10
log
@Changed wording on /etc/ssmtp/ssmtp.conf template.
@
text
@d3 1
a3 1
# $Id: postinst,v 1.9 2001/03/22 12:42:58 matt Exp matt $
d24 3
d68 6
a73 1
echo "mailhub=$MailHub"
@


1.9
log
@Make sure permissions are OK on /etc/mailname.
@
text
@d3 1
a3 1
# $Id: postinst,v 1.8 2001/03/21 21:17:01 matt Exp matt $
d54 3
a56 3
echo "*** This file is auto-generated using debconf on install/upgrade. ***"
echo "*** Any changes made will be overwritten on next upgrade. Use the ***"
echo "*** command 'dpkg-reconfigure ssmtp' to amend this configuration. ***"
@


1.8
log
@Added RCS ID
@
text
@d1 1
a1 1
#!/bin/sh
d3 1
a3 1
# $Id$
d34 3
@


1.7
log
@Fixed problem with automatically overwriting the config file.
@
text
@d2 3
@


1.6
log
@Changed system UIDs from <10 to <1000.
@
text
@d3 7
d12 3
d38 8
@


1.5
log
@Fix for bug #71632.
@
text
@d36 1
a36 1
echo "# The person who gets all mail for userids < 10"
@


1.4
log
@Checkpoint.
@
text
@d11 3
d17 6
a22 3
db_get ssmtp/hostname
FQDN="${RET:-`hostname --fqdn`}"
echo "$FQDN" > /etc/mailname
@


1.3
log
@Updated to fix bug 65195.
@
text
@d19 1
a19 1
FromOverride="$RET"
d47 1
a47 1
echo "FromLineOverride=${FromOverride:-YES}"
@


1.2
log
@Checkpoint.
@
text
@d18 3
d24 3
d28 1
a28 1
echo "# Config file for sSMTP sendmail."
d46 2
a47 1
echo "#FromLineOverride=YES"
@


1.1
log
@Initial revision
@
text
@d1 1
a1 1
#!/bin/sh -e
d3 1
a3 50
#
# Figure out the system's mailname
#

syshostname=`hostname --fqdn`
if [ ! -f /etc/mailname ]; then
  echo 'Please enter the "mail name" of your system.  This is the hostname'
  echo 'portion of the address to be shown on outgoing news and mail messages.'
  echo "The default is $syshostname, your system's host name."
  echo
  echo -n "Mail name [$syshostname]: "
  read mailname
  echo
  if [ "$mailname" ]; then
    echo $mailname >/etc/mailname
  else
    echo $syshostname >/etc/mailname
  fi
fi

#
# Generate configuration file if necessary
#

if [ ! -s /etc/ssmtp/ssmtp.conf ];
then
	cat >>/etc/ssmtp/ssmtp.conf <<EOF
#
# /etc/ssmtp.conf -- a config file for sSMTP sendmail.
#
# The person who gets all mail for userids < 10
root=postmaster

# The place where the mail goes. The actual machine name is required
# no MX records are consulted. Commonly mailhosts are named mail.domain.com
# The example will fit if you are in domain.com and you mailhub is so named.
mailhub=mail

# Where will the mail seem to come from?
#rewriteDomain=`cat /etc/mailname`

# The full hostname
hostname=`hostname --fqdn`

# Set this to never rewrite the "From:" line (unless not given) and to
# use that address in the "from line" of the envelope.
#FromLineOverride=YES
EOF
	echo "Please check the configuration file in /etc/ssmtp/ssmtp.conf for correctness."
fi
d5 39
a43 1
#DEBHELPER#
@
