20170529000002_setting_delivery_permanent_failed.rb 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. # Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. class SettingDeliveryPermanentFailed < ActiveRecord::Migration[4.2]
  3. def up
  4. # return if it's a new setup
  5. return if !Setting.exists?(name: 'system_init_done')
  6. setting = Setting.find_by(name: '0900_postmaster_filter_bounce_check')
  7. if setting
  8. setting.name = '0900_postmaster_filter_bounce_follow_up_check'
  9. setting.state = 'Channel::Filter::BounceFollowUpCheck'
  10. setting.save!
  11. else
  12. Setting.create_if_not_exists(
  13. title: 'Defines postmaster filter.',
  14. name: '0900_postmaster_filter_bounce_follow_up_check',
  15. area: 'Postmaster::PreFilter',
  16. description: 'Defines postmaster filter to identify postmaster bounced - to handle it as follow-up of the original ticket.',
  17. options: {},
  18. state: 'Channel::Filter::BounceFollowUpCheck',
  19. frontend: false
  20. )
  21. end
  22. Setting.create_if_not_exists(
  23. title: 'Defines postmaster filter.',
  24. name: '0950_postmaster_filter_bounce_delivery_permanent_failed',
  25. area: 'Postmaster::PreFilter',
  26. description: 'Defines postmaster filter to identify postmaster bounced - disable sending notification on permanent deleivery failed.',
  27. options: {},
  28. state: 'Channel::Filter::BounceDeliveryPermanentFailed',
  29. frontend: false
  30. )
  31. end
  32. end