-
Notifications
You must be signed in to change notification settings - Fork 933
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding Exim as it's own delivery manager for Issue 70
- Loading branch information
Mikel Lindsaar
committed
Jan 14, 2012
1 parent
9fe9fc1
commit 632c05e
Showing
5 changed files
with
48 additions
and
11 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
module Mail | ||
|
||
class Exim < Sendmail | ||
|
||
def deliver!(mail) | ||
envelope_from = mail.return_path || mail.sender || mail.from_addrs.first | ||
return_path = "-f \"#{envelope_from.to_s.shellescape}\"" if envelope_from | ||
arguments = [settings[:arguments], return_path].compact.join(" ") | ||
self.class.call(settings[:location], arguments, mail) | ||
end | ||
|
||
def self.call(path, arguments, mail) | ||
IO.popen("#{path} #{arguments}", "w+") do |io| | ||
io.puts mail.encoded.to_lf | ||
io.flush | ||
end | ||
end | ||
|
||
end | ||
end |
This file contains 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