Last active
December 15, 2016 23:02
-
-
Save woodie/363e76e589aa2b642ad320dab9b4682d to your computer and use it in GitHub Desktop.
Local mail delivery on Windows Server using IIS SMTP Service
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# config/environments/production.rb | |
# Local mail delivery using IIS SMTP Service | |
require 'shim/mail_message' # fix line endings | |
config.action_mailer.delivery_method = :file | |
config.action_mailer.file_settings = { location: "#{ENV['SystemDrive']}/InetPub/MailRoot/Pickup" } | |
# lib/shim/mail_message.rb | |
# Patch Mail::Message to enforce proper line-endings for Windows IIS file-type delivery. | |
module Mail | |
class Message | |
alias :_encoded :encoded | |
def encoded | |
_encoded.encode(universal_newline: true) | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment