lib/backup/notifier/mail.rb in backup-3.0.22 vs lib/backup/notifier/mail.rb in backup-3.0.23

- old
+ new

@@ -19,10 +19,14 @@ # # `:sendmail` [::Mail::Sendmail] # : Settings used only by this method: # : `sendmail`, `sendmail_args` # + # `:exim` [::Mail::Exim] + # : Settings used only by this method: + # : `exim`, `exim_args` + # # `:file` [::Mail::FileDelivery] # : Settings used only by this method: # : `mail_folder` # attr_accessor :delivery_method @@ -83,10 +87,23 @@ # So, if set here, be sure to set all the arguments you require. # Example: '-i -t -X/tmp/traffic.log' attr_accessor :sendmail_args ## + # When using the `:exim` `delivery_method` option, + # this may be used to specify the absolute path to `exim` (if needed) + # Example: '/usr/sbin/exim' + attr_accessor :exim + + ## + # Optional arguments to pass to `exim` + # Note that this will override the defaults set by the Mail gem (currently: '-i -t') + # So, if set here, be sure to set all the arguments you require. + # Example: '-i -t -X/tmp/traffic.log' + attr_accessor :exim_args + + ## # Folder where mail will be kept when using the `:file` `delivery_method` option. # Default location is '$HOME/Backup/emails' # Example: '/tmp/test-mails' attr_accessor :mail_folder @@ -142,11 +159,11 @@ ## # Configures the Mail gem by setting the defaults. # Creates and returns a new email, based on the @delivery_method used. def new_email - method = %w{ smtp sendmail file test }. + method = %w{ smtp sendmail exim file test }. index(@delivery_method.to_s) ? @delivery_method.to_s : 'smtp' options = case method when 'smtp' @@ -160,9 +177,14 @@ :openssl_verify_mode => @openssl_verify_mode } when 'sendmail' opts = {} opts.merge!(:location => File.expand_path(@sendmail)) if @sendmail opts.merge!(:arguments => @sendmail_args) if @sendmail_args + opts + when 'exim' + opts = {} + opts.merge!(:location => File.expand_path(@exim)) if @exim + opts.merge!(:arguments => @exim_args) if @exim_args opts when 'file' @mail_folder ||= File.join(Config.root_path, 'emails') { :location => File.expand_path(@mail_folder) } when 'test' then {}