mailman 0.7.0 → 0.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -0
- data/USER_GUIDE.md +20 -1
- data/lib/mailman/application.rb +11 -4
- data/lib/mailman/configuration.rb +4 -1
- data/lib/mailman/version.rb +1 -1
- metadata +27 -27
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1c3b65580c2e1e59760378031bdd07edec3e63b5
|
4
|
+
data.tar.gz: 720c4e3338e79516337ff085a4fe2bad691f35a9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b0ca65554bb294ae609e7843a6f7cf8f6e8965cc7e901295523761b61edfd6e91d6e4ea6c0d18f9aadde3a06cd5081f69f8038e7a3c9bb3e8239ce4b3f3e074a
|
7
|
+
data.tar.gz: 9f58307d28c7f097bcfec95f219ceb9be9efd651aaa5ed00439527448b811f6132f846b6c1d8b437e9e3d6562a5397e448b3251c58b6168d5441caa533bf7322
|
data/CHANGELOG.md
CHANGED
data/USER_GUIDE.md
CHANGED
@@ -173,6 +173,7 @@ with the `Mailman.config.ignore_stdin` option.
|
|
173
173
|
|
174
174
|
**Example**: `cat plain_message.eml | ruby mailman_app.rb`
|
175
175
|
|
176
|
+
*Note that the standard input receiver is not supported on Windows platforms.*
|
176
177
|
|
177
178
|
### POP3
|
178
179
|
|
@@ -185,6 +186,24 @@ that you use a mail retriever with the Maildir receiver. You could also use
|
|
185
186
|
Gmail and set it to keep messages after they have been retrieved with POP3.
|
186
187
|
|
187
188
|
|
189
|
+
### IMAP
|
190
|
+
|
191
|
+
The IMAP receiver is enabled when the `Mailman.config.imap` hash is set.
|
192
|
+
Polling can be set with `Mailman.config.poll_interval`. This will read all unread messages in the INBOX by default.
|
193
|
+
Here are example settings for gmail.
|
194
|
+
|
195
|
+
```ruby
|
196
|
+
Mailman.config.imap = {
|
197
|
+
server: 'imap.gmail.com',
|
198
|
+
port: 993, # usually 995, 993 for gmail
|
199
|
+
ssl: true,
|
200
|
+
username: 'foo@somedomain.com',
|
201
|
+
password: 'totallyunsecuredpassword'
|
202
|
+
}
|
203
|
+
|
204
|
+
```
|
205
|
+
* When using gmail, remember to [enable IMAP](https://support.google.com/mail/troubleshooter/1668960)
|
206
|
+
|
188
207
|
### Maildir
|
189
208
|
|
190
209
|
The Maildir receiver is enabled when `Mailman.config.maildir` is set to a
|
@@ -294,4 +313,4 @@ end
|
|
294
313
|
|
295
314
|
# Add it to the Mailman middleware stack
|
296
315
|
Mailman.config.middleware.add ErrorLoggingMiddleware
|
297
|
-
```
|
316
|
+
```
|
data/lib/mailman/application.rb
CHANGED
@@ -1,4 +1,8 @@
|
|
1
|
+
require 'rbconfig'
|
2
|
+
|
1
3
|
module Mailman
|
4
|
+
IS_WINDOWS = (RbConfig::CONFIG['target_os'] =~ /mswin|mingw|cygwin/i)
|
5
|
+
|
2
6
|
# The main application class. Pass a block to {#new} to create a new app.
|
3
7
|
class Application
|
4
8
|
|
@@ -66,7 +70,7 @@ module Mailman
|
|
66
70
|
end
|
67
71
|
|
68
72
|
# STDIN
|
69
|
-
if !config.ignore_stdin && $stdin.fcntl(Fcntl::F_GETFL, 0) == 0
|
73
|
+
if !IS_WINDOWS && !config.ignore_stdin && $stdin.fcntl(Fcntl::F_GETFL, 0) == 0
|
70
74
|
Mailman.logger.debug "Processing message from STDIN."
|
71
75
|
@processor.process($stdin.read)
|
72
76
|
|
@@ -95,16 +99,18 @@ module Mailman
|
|
95
99
|
if config.watch_maildir
|
96
100
|
require 'listen'
|
97
101
|
Mailman.logger.debug "Monitoring the Maildir for new messages..."
|
102
|
+
base = Pathname.new(@maildir.path)
|
98
103
|
|
99
104
|
callback = Proc.new do |modified, added, removed|
|
100
105
|
added.each do |new_file|
|
101
|
-
message = Maildir::Message.new(@maildir,
|
106
|
+
message = Maildir::Message.new(@maildir, Pathname.new(new_file).relative_path_from(base).to_s)
|
102
107
|
@processor.process_maildir_message(message)
|
103
108
|
end
|
104
109
|
end
|
105
110
|
|
106
|
-
@listener = Listen.
|
111
|
+
@listener = Listen::Listener.new(File.join(@maildir.path, 'new'), &callback)
|
107
112
|
@listener.start
|
113
|
+
sleep
|
108
114
|
end
|
109
115
|
end
|
110
116
|
end
|
@@ -131,9 +137,10 @@ module Mailman
|
|
131
137
|
begin
|
132
138
|
connection.connect
|
133
139
|
connection.get_messages
|
134
|
-
connection.disconnect
|
135
140
|
rescue SystemCallError => e
|
136
141
|
Mailman.logger.error e.message
|
142
|
+
ensure
|
143
|
+
connection.disconnect
|
137
144
|
end
|
138
145
|
|
139
146
|
break unless polling?
|
@@ -5,7 +5,10 @@ module Mailman
|
|
5
5
|
attr_accessor :logger
|
6
6
|
|
7
7
|
# @return [Hash] the configuration hash for POP3
|
8
|
-
attr_accessor :pop3
|
8
|
+
attr_accessor :pop3
|
9
|
+
|
10
|
+
# @return [Hash] the configuration hash for IMAP
|
11
|
+
attr_accessor :imap
|
9
12
|
|
10
13
|
# @return [Fixnum] the poll interval for POP3 or IMAP. Setting this to 0
|
11
14
|
# disables polling
|
data/lib/mailman/version.rb
CHANGED
metadata
CHANGED
@@ -1,97 +1,97 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mailman
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jonathan Rudenberg
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2014-06-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mail
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: 2.0.3
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: 2.0.3
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: activesupport
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: 2.3.4
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: 2.3.4
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: listen
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- -
|
45
|
+
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version:
|
47
|
+
version: 2.2.0
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- -
|
52
|
+
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version:
|
54
|
+
version: 2.2.0
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: maildir
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- -
|
59
|
+
- - ">="
|
60
60
|
- !ruby/object:Gem::Version
|
61
61
|
version: 0.5.0
|
62
62
|
type: :runtime
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- -
|
66
|
+
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: 0.5.0
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: i18n
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
|
-
- -
|
73
|
+
- - ">="
|
74
74
|
- !ruby/object:Gem::Version
|
75
75
|
version: 0.4.1
|
76
76
|
type: :runtime
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
|
-
- -
|
80
|
+
- - ">="
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: 0.4.1
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: rspec
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
|
-
- - ~>
|
87
|
+
- - "~>"
|
88
88
|
- !ruby/object:Gem::Version
|
89
89
|
version: '2.10'
|
90
90
|
type: :development
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
|
-
- - ~>
|
94
|
+
- - "~>"
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: '2.10'
|
97
97
|
description: Mailman makes it easy to process incoming emails with a simple routing
|
@@ -103,29 +103,29 @@ executables:
|
|
103
103
|
extensions: []
|
104
104
|
extra_rdoc_files: []
|
105
105
|
files:
|
106
|
+
- CHANGELOG.md
|
107
|
+
- LICENSE
|
108
|
+
- README.md
|
109
|
+
- USER_GUIDE.md
|
106
110
|
- bin/mailman
|
111
|
+
- examples/simple_route.rb
|
112
|
+
- lib/mailman.rb
|
107
113
|
- lib/mailman/application.rb
|
108
114
|
- lib/mailman/cli.rb
|
109
115
|
- lib/mailman/configuration.rb
|
110
116
|
- lib/mailman/message_processor.rb
|
111
117
|
- lib/mailman/middleware.rb
|
118
|
+
- lib/mailman/receiver.rb
|
112
119
|
- lib/mailman/receiver/imap.rb
|
113
120
|
- lib/mailman/receiver/pop3.rb
|
114
|
-
- lib/mailman/
|
121
|
+
- lib/mailman/route.rb
|
115
122
|
- lib/mailman/route/condition.rb
|
116
123
|
- lib/mailman/route/conditions.rb
|
117
124
|
- lib/mailman/route/matcher.rb
|
118
125
|
- lib/mailman/route/regexp_matcher.rb
|
119
126
|
- lib/mailman/route/string_matcher.rb
|
120
|
-
- lib/mailman/route.rb
|
121
127
|
- lib/mailman/router.rb
|
122
128
|
- lib/mailman/version.rb
|
123
|
-
- lib/mailman.rb
|
124
|
-
- examples/simple_route.rb
|
125
|
-
- LICENSE
|
126
|
-
- README.md
|
127
|
-
- USER_GUIDE.md
|
128
|
-
- CHANGELOG.md
|
129
129
|
homepage: https://github.com/titanous/mailman
|
130
130
|
licenses: []
|
131
131
|
metadata: {}
|
@@ -135,17 +135,17 @@ require_paths:
|
|
135
135
|
- lib
|
136
136
|
required_ruby_version: !ruby/object:Gem::Requirement
|
137
137
|
requirements:
|
138
|
-
- -
|
138
|
+
- - ">="
|
139
139
|
- !ruby/object:Gem::Version
|
140
140
|
version: '0'
|
141
141
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
142
142
|
requirements:
|
143
|
-
- -
|
143
|
+
- - ">="
|
144
144
|
- !ruby/object:Gem::Version
|
145
145
|
version: '0'
|
146
146
|
requirements: []
|
147
147
|
rubyforge_project: mailman
|
148
|
-
rubygems_version: 2.
|
148
|
+
rubygems_version: 2.2.2
|
149
149
|
signing_key:
|
150
150
|
specification_version: 4
|
151
151
|
summary: A incoming email processing microframework
|