fix deprecation warnings and mailgun spec
fix tests for 1.8