Skip to content
This repository has been archived by the owner on Nov 27, 2018. It is now read-only.

Commit

Permalink
Merge pull request #92 from Klortho/master
Browse files Browse the repository at this point in the history
Fix bug causing crash on Windows
  • Loading branch information
titanous committed Dec 8, 2013
2 parents 70679b4 + 5e3135d commit f867433
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions USER_GUIDE.md
Expand Up @@ -173,6 +173,7 @@ with the `Mailman.config.ignore_stdin` option.

**Example**: `cat plain_message.eml | ruby mailman_app.rb`

*Note that the standard input receiver is not supported on Windows platforms.*

### POP3

Expand Down
6 changes: 5 additions & 1 deletion lib/mailman/application.rb
@@ -1,4 +1,8 @@
require 'rbconfig'

module Mailman
IS_WINDOWS = (RbConfig::CONFIG['target_os'] =~ /mswin|mingw|cygwin/i)

# The main application class. Pass a block to {#new} to create a new app.
class Application

Expand Down Expand Up @@ -66,7 +70,7 @@ def run
end

# STDIN
if !config.ignore_stdin && $stdin.fcntl(Fcntl::F_GETFL, 0) == 0
if !IS_WINDOWS && !config.ignore_stdin && $stdin.fcntl(Fcntl::F_GETFL, 0) == 0
Mailman.logger.debug "Processing message from STDIN."
@processor.process($stdin.read)

Expand Down

0 comments on commit f867433

Please sign in to comment.