#!/bin/bash
if ! [ -e ~/.config/debathena/nmh-in-path ]; then
    mkdir -p ~/.config/debathena >/dev/null 2>&1 && echo yes > ~/.config/debathena/nmh-in-path
fi

if ! [ -e ~/.config/debathena/nmh-cyrus-warned ]; then
    cat <<EOF >&2
If you are seeing this message, you are using POP to connect to MIT's
legacy mail ("Cyrus") infrastructure.

Please note that MIT is planning to retire the Cyrus IMAP/POP servers
in December 2013.  You will be contacted individually prior to your
scheduled migration.  After your migration, you will no longer be able
to use "inc" to check your e-mail, and will have to migrate to a
different e-mail client such as Pine.

For more information, please see http://debathena.mit.edu/inc
(You will only receive this message once.)
EOF
    mkdir -p ~/.config/debathena >/dev/null 2>&1 && touch ~/.config/debathena/nmh-cyrus-warned
fi

exec -a inc /usr/bin/mh/inc.debathena-orig -host "${ATHENA_USER:-$USER}.mail.mit.edu" -sasl "$@"
