fixed extra sql for emailsearchview (missed with the new email restructure)
fixed trying to find a non-existing file for attachment formset forms