post_office 0.3.1 → 0.3.3

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -24,9 +24,12 @@ Usage
24
24
 
25
25
  -v, --verbose Output more information
26
26
  -l, --logfile FILE Write log to FILE. Outputs to STDOUT (or /var/log/post_office.log when daemonized) by default.
27
+ -s, --smtp PORT Specify SMTP port to use
28
+ -p, --pop3 PORT Specify POP3 port to use
29
+
27
30
  -h, --help Display this screen
28
31
 
29
- This starts the service and listens on port 25 and 110. Configure your POP3 client with any username and password.
32
+ This starts the service and listens on the specified ports (or 25 for SMTP and 110 for POP3 by default). Configure your POP3 client with any username and password.
30
33
 
31
34
  Daemon
32
35
  ------
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.3.1
1
+ 0.3.3
data/bin/post_office CHANGED
@@ -24,6 +24,16 @@ optparse = OptionParser.new do |opts|
24
24
  opts.on( '-l', '--logfile FILE', 'Write log to FILE. Outputs to STDOUT (or /var/log/post_office.log when daemonized) by default.' ) do |file|
25
25
  options[:logfile] = file
26
26
  end
27
+
28
+ options[:smtp_port] = nil
29
+ opts.on( '-s', '--smtp PORT', 'Specify SMTP port to use' ) do |port|
30
+ options[:smtp_port] = port
31
+ end
32
+
33
+ options[:pop3_port] = nil
34
+ opts.on( '-p', '--pop3 PORT', 'Specify POP3 port to use' ) do |port|
35
+ options[:pop3_port] = port
36
+ end
27
37
 
28
38
  options[:startup_item] = nil
29
39
  opts.on('--install-osx-startup-item', 'Installs Post Office as OS X Startup Item') do
@@ -60,13 +70,14 @@ $log = Logger.new(options[:logfile] || STDOUT)
60
70
  $log.level = options[:verbose] ? Logger::DEBUG : Logger::INFO
61
71
 
62
72
  begin
63
- smtp_server = Thread.new{ SMTPServer.new }
64
- pop_server = Thread.new{ POPServer.new }
73
+ smtp_server = Thread.new{ SMTPServer.new(options[:smtp_port] || 25) }
74
+ pop_server = Thread.new{ POPServer.new(options[:pop3_port] || 110) }
65
75
 
66
76
  smtp_server.join
67
77
  pop_server.join
68
78
  rescue Interrupt
69
79
  $log.info "Interrupt..."
70
80
  rescue Errno::EACCES
71
- $log.error "I need root access to open ports 25 and 110. Please sudo #{__FILE__}"
81
+ $log.error "I need root access to open ports #{options[:smtp_port] || 25} and / or #{options[:pop3_port] || 110}. Please sudo #{__FILE__}"
72
82
  end
83
+
data/lib/pop_server.rb CHANGED
@@ -6,8 +6,8 @@ require 'digest/md5'
6
6
 
7
7
  class POPServer < GenericServer
8
8
  # Create new server listening on port 110
9
- def initialize
10
- super(:port => 110)
9
+ def initialize(port)
10
+ super(:port => port)
11
11
  end
12
12
 
13
13
  # Send a greeting to client
data/lib/smtp_server.rb CHANGED
@@ -7,9 +7,9 @@ class SMTPServer < GenericServer
7
7
  attr_accessor :client_data
8
8
 
9
9
  # Create new server listening on port 25
10
- def initialize
10
+ def initialize(port)
11
11
  self.client_data = Hash.new
12
- super(:port => 25)
12
+ super(:port => port)
13
13
  end
14
14
 
15
15
  # Send a greeting to client
Binary file
Binary file
data/post_office.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{post_office}
8
- s.version = "0.3.1"
8
+ s.version = "0.3.3"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Rene van Lieshout"]
12
- s.date = %q{2011-08-16}
12
+ s.date = %q{2011-09-13}
13
13
  s.description = %q{A mock SMTP/POP3 server to aid in the development of applications with mail functionality.}
14
14
  s.email = %q{rene@bluerail.nl}
15
15
  s.executables = ["post_office", "post_officed"]
@@ -31,6 +31,8 @@ Gem::Specification.new do |s|
31
31
  "pkg/post_office-0.2.0.gem",
32
32
  "pkg/post_office-0.2.1.gem",
33
33
  "pkg/post_office-0.3.0.gem",
34
+ "pkg/post_office-0.3.1.gem",
35
+ "pkg/post_office-0.3.2.gem",
34
36
  "post_office.gemspec",
35
37
  "startup_item/PostOffice/PostOffice",
36
38
  "startup_item/PostOffice/StartupParameters.plist"
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: post_office
3
3
  version: !ruby/object:Gem::Version
4
- hash: 17
4
+ hash: 21
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 3
9
- - 1
10
- version: 0.3.1
9
+ - 3
10
+ version: 0.3.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - Rene van Lieshout
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-08-16 00:00:00 +02:00
18
+ date: 2011-09-13 00:00:00 +02:00
19
19
  default_executable:
20
20
  dependencies: []
21
21
 
@@ -43,6 +43,8 @@ files:
43
43
  - pkg/post_office-0.2.0.gem
44
44
  - pkg/post_office-0.2.1.gem
45
45
  - pkg/post_office-0.3.0.gem
46
+ - pkg/post_office-0.3.1.gem
47
+ - pkg/post_office-0.3.2.gem
46
48
  - post_office.gemspec
47
49
  - startup_item/PostOffice/PostOffice
48
50
  - startup_item/PostOffice/StartupParameters.plist