func die(msg string, code int) {
	fmt.Fprintln(os.Stderr, msg)
	os.Exit(code)
}
die writes msg to stderr and aborts the program with the given status code.
package main
import (
	"bufio"
	"bytes"
	"flag"
	"fmt"
	"io"
	"net/mail"
	"net/textproto"
	"os"
	"os/exec"
	"time"
)
const (
	ExDataErr = 65
	ExTempFail = 75
)
var dryRun = flag.Bool("dry-run", false, "show what would be done, don't actually forward mail")
var path = flag.String("path", "", "override $PATH with this value when executing binaries")
var rpHeader = flag.String("rp-header", "Return-Path", "header name containing the return-path (MAIL FROM) value")
var sendmailPath = flag.String("sendmail-path", "sendmail", "path to the sendmail binary (deprecated: use --path instead)")
var srsAddr = flag.String("srs-addr", "localhost:10001", "TCP address for SRS lookups")
func lookupTCP(addr, key string) (string, error) {
	c, err := textproto.Dial("tcp", addr)
	if err != nil {
		return "", err
	}
	id, err := c.Cmd("get " + key)
	if err != nil {
		return "", err
	}
	c.StartResponse(id)
	defer c.EndResponse(id)
	code, msg, err := c.ReadCodeLine(-1)
	if err != nil {
		return "", err
	}
	switch code {
	case 200:
		return msg, nil
	case 500:
		fmt.Fprintf(os.Stderr, "warning: srs: returncode 500 (%v)\n", msg)
		return key, nil
	default:
		return "", fmt.Errorf("srs: unexpected returncode %d (%v)", code, msg)
	}
}