#!/bin/sh usage() { echo " usage: $0 [qpsmtpd username]" echo " " exit } if [ -z $1 ]; then usage fi DOMAIN=$1 SMTPD=$2 if [ -z $SMTPD ]; then SMTPD="smtpd" fi # create a directory for each DKIM signing domain mkdir -p $DOMAIN cd $DOMAIN # create a selector in the format mmmYYYY (apr2013) date '+%h%Y' | tr "[:upper:]" "[:lower:]" > selector # generate a private and public keys openssl genrsa -out private 2048 chmod 400 private openssl rsa -in private -out public -pubout # make it really easy to publish the public key in DNS cat > dns <