I rock! Mail back online

| geek

Stymied by the sudden breakage in my mail setup, I racked my brain
for another way to get to the mail server in order to deliver my mail.
None of the shell accounts I had on other systems were active, and
none of the people I pinged were online.

I remembered that /etc/services was a list of well-known ports. If
mail.hosting.qsr.com.ph was listening on another standard port, that
would be a good place to find it. Searching this file for “smtp”
turned up port 25 (smtp) and port 465 (smtp over SSL).

A quick check confirmed that port 465 was accessible from my computer
even without tunneling.

All I had to do, then, was set up my mail system to use the new port.

I tried putting the port in directly. I also tried playing around with
the configuration, but I couldn't find a clear tutorial.

I found stunnel along the way. Stunnel is a generic SSL tunnel for any
network service, and it was really easy to set up. Here's my
/etc/init.d/stunnel-mail based on
http://www.technovelty.org/linux/tips/exim4ssmtp.html :

#!/bin/sh
case "$1" in
  start)
    echo -n "Starting ssmtp tunnel "
    start-stop-daemon --start --quiet --exec /usr/sbin/stunnel -- -c -d ssmtp -r mail.hosting.qsr.com.ph:ssmtp
    echo "stunnel."
    ;;
  stop)
    echo -n "Stopping ssmtp tunnel "
    start-stop-daemon --stop --quiet --oknodo --retry 2 --exec /usr/sbin/stunnel
    echo "stunnel."
    ;;
  restart)
    $0 stop
    sleep 1
    $0 start
    ;;
  *)
    echo "Usage: /etc/init.d/ssmtp-tunnel {start|stop|restart|reload|force-reload}"
    exit 1
esac

Then it was just a matter of adding new entries to my sasl_passwd file
and regenerating the map.

Nothing like a good problem solved!

Random Emacs symbol: visible-frame-list – Function: Return a list of all frames now “visible” (being updated).

You can comment with Disqus or you can e-mail me at sacha@sachachua.com.