fix db column names and foreign key references
for mail addresses mentioned smtps should be configurable, too
add debug config option
log messages only when debugging mode is enabled