( cd usr/sbin ; rm -rf sendmail )
( cd usr/sbin ; ln -sf ssmtp sendmail )
( cd usr/sbin ; rm -rf mailq )
( cd usr/sbin ; ln -sf ssmtp mailq )
( cd usr/sbin ; rm -rf newaliases )
( cd usr/sbin ; ln -sf ssmtp newaliases )

config() {
  NEW="$1"
  OLD="$(dirname $NEW)/$(basename $NEW .new)"
  # If there's no config file by that name, mv it over:
  if [ ! -r $OLD ]; then
    mv $NEW $OLD
  elif [ "$(cat $OLD | md5sum)" = "$(cat $NEW | md5sum)" ]; then
    rm $NEW # toss the redundant copy
  fi
  # Otherwise, we leave the .new copy for the admin to consider...
}

config etc/ssmtp/ssmtp.conf.new
config etc/ssmtp/revaliases.new
