#include "handler.ih"

void Handler::verifyAddress()       // if the address is not in the mailing
{                                   // then simply ignore the mail
    string line;

    while (getline(g_options.addresses(), line))
    {
        if (String::casecmp(line, d_from) == 0)
        {
            log() << "Mail received from `" << d_from << "'\n";
            g_mailer.setTo(d_from);
            return;
        }
    }

    throw Exception{NO_MAIL} << "verifyAddress: " << d_from << 
                            " not found in " << g_options.addressesFilename();
}
