Functional

Functional except patch for smtp