ses-proxy 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -7,7 +7,7 @@ require 'mongoid'
7
7
  require 'daemons'
8
8
  require 'tmpdir'
9
9
 
10
- require './app/web_panel'
10
+ require File.join SesProxy::ROOT, 'app', 'web_panel'
11
11
 
12
12
  module SesProxy
13
13
 
@@ -55,6 +55,8 @@ module SesProxy
55
55
 
56
56
  option ["-d","--demonize"], :flag, "Demonize application", :default => false
57
57
 
58
+ option ["--pid-dir"], "PID_DIR", "Pid Directory", :default => Dir.tmpdir
59
+
58
60
  @@env = "development"
59
61
 
60
62
  def execute
@@ -75,14 +77,14 @@ module SesProxy
75
77
  server = Rack::Server.new options
76
78
 
77
79
  if demonize?
78
- options = {:app_name => "ses_proxy", :dir_mode=>:normal, :dir=>Dir.tmpdir, :multiple=>true}
80
+ options = {:app_name => "ses_proxy", :dir_mode=>:normal, :dir=>pid_dir, :multiple=>true}
79
81
  group = Daemons::ApplicationGroup.new('ses_proxy', options)
80
82
  options[:mode] = :proc
81
83
  options[:proc] = Proc.new { EM.run{ SesProxy::SmtpServer.start smtp_host, smtp_port } }
82
- pid = Daemons::PidFile.new Dir.tmpdir, "ses_proxy_smtp"
84
+ pid = Daemons::PidFile.new pid_dir, "ses_proxy_smtp"
83
85
  @smtp = Daemons::Application.new(group, options, pid)
84
86
  options[:proc] = Proc.new { server.start }
85
- pid = Daemons::PidFile.new Dir.tmpdir, "ses_proxy_http"
87
+ pid = Daemons::PidFile.new pid_dir, "ses_proxy_http"
86
88
  @http = Daemons::Application.new(group, options, pid)
87
89
  @smtp.start
88
90
  @http.start
@@ -136,8 +138,10 @@ module SesProxy
136
138
  end
137
139
 
138
140
  class StopCommand < Clamp::Command
141
+ option ["--pid-dir"], "PID_DIR", "Pid Directory", :default => Dir.tmpdir
142
+
139
143
  def execute
140
- options = {:app_name => "ses_proxy", :dir_mode=>:normal, :dir=>Dir.tmpdir, :multiple=>true}
144
+ options = {:app_name => "ses_proxy", :dir_mode=>:normal, :dir=>pid_dir, :multiple=>true}
141
145
  group = Daemons::ApplicationGroup.new('ses_proxy', options)
142
146
  group.setup
143
147
  group.applications.each do |application|
@@ -63,8 +63,8 @@ module SesProxy
63
63
 
64
64
  def receive_message
65
65
  return false unless verified
66
- bounced = Bounce.where({:email=>{"$in"=>recipients}}).map(&:email)
67
66
  mail = Mail.read_from_string(message)
67
+ bounced = Bounce.where({:email=>{"$in"=>recipients|mail.cc_addrs|mail.bcc_addrs}}).map(&:email)
68
68
  #TODO: Define policy for retry when bounce is not permanent
69
69
  actual_recipients = recipients - bounced
70
70
  actual_cc_addrs = mail.cc_addrs - bounced
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ses-proxy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: