#!/bin/bash

echo "Update Virtru Gateway ENV file to include the lan ip of the Gateway."
echo "Use the lan IP and not the loopback (127.0.0.1)"
read -p "SMTP Server: " server
read -p "SMTP Port: " port
read -p "FROM: " from
read -p "TO: " to

# create message
mail_input() {
  echo "ehlo $(hostname -f)"
  echo "mail from: <$from>"
  echo "rcpt to: <$to>"
  echo "data"
  echo "Subject: Virtru Gateway Test"
  echo "Test message through Virtru Gateway"
  echo "."
  echo "quit"
}

mail_input | netcat $server $port || err_exit




