目次



RedmineでPOP before SMTP で通知メールを送るための設定


メール通知がPOP before SMTPに対応していない模様。
以下の方法で対応可。

  1. "app\models\Mailer.rb"の先頭で接続先のSMTPサーバの設定を行う。
    # vi /home/htdocs/redmine-2.4.3/app/models/Mailer.rb
    
    ---(ここから)-----------------------------------------------------------
    require 'net/pop'
    
    ActionMailer::Base.delivery_method = :smtp
    ActionMailer::Base.smtp_settings = {
      :address => 'smtp.hogehoge.com',   # SMTPサーバのアドレス
      :port => 25,
      :domain => 'localhost',            # メールを送信する自身のドメイン
      :authentication => 'none'          # 認証はなし
    }
    ---(ここまで)-----------------------------------------------------------

  2. 後方にあるreminderメソッド内でPOP認証を行う。
    def reminder(user, issues, days)
      set_language_if_valid user.language
      @issues = issues
      @days = days
      @issues_url = url_for(:controller => 'issues', :action => 'index',
                                  :set_filter => 1, :assigned_to_id => user.id,
                                  :sort => 'due_date:asc')
      mail :to => user.mail,
        :subject => l(:mail_subject_reminder, :count => issues.size, :days => days)
    
      # POP before SMTPの設定                                                             ← これを追加
      Net::POP3.auth_only('pop.hogehoge.com', 110, 'ユーザ名', 'パスワード')              ← これを追加
    
    end


トップ   編集 凍結解除 差分 履歴 添付 複製 名前変更 リロード   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS
Last-modified: 2023-05-10 (水) 20:53:56