this is hackish but probably the best we can do. There is something on the way https://github.com/mikel/mail/pull/705 but we need to move on without that. I suggest we move the hacks to a helper method that we can control. For example:

```ruby
def mail_side_effects
  old_observers = Mail.class_variable_get(:@@delivery_notification_observers)
  old_delivery_interceptors = Mail.class_variable_get(:@@delivery_interceptors)
  yield
ensure
  Mail.class_variable_set(:@@delivery_notification_observers, old_observers)
  Mail.class_variable_set(:@@delivery_interceptors, old_delivery_interceptors)
end
```