allow environmental variable for user and pass
fix regression with attachment handling