Test attachment ID's if they are non-integer

Currently intval is currently an empty ID `` into `0`. Instead of this it
should be removed
Prevent locking in new thread

Currently it checks if E-Mail account associated with thread exists but in
new thread there is no E-Mail ID and thus E-Mail account associated with
it
Corrected coding standards
Merge pull request #150 from VarunAgw/email-accounts

Email accounts