uron 1.2.0 → 1.3.0
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/.travis.yml +0 -2
- data/README.md +28 -16
- data/bin/uron.rb +7 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 072c0d933a2d856884ac242e14aa43d492a67b0c
|
4
|
+
data.tar.gz: 0c6314192d29d6e07b2138f996ff12c068ce3e06
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b67e1876044aeecf5fa4632d6d38b5cdfbaf45b64ae7dd8ee946ff75c7b59391bf595ef3a4382d2694e311478a2a3fd7a304933c6486d44079da1d105ccf2b57
|
7
|
+
data.tar.gz: e5b1b16a386bc3d3d4cfe2f460d79342b742d39cf9d758c2ba4997a067d630384633e55bc0f998fa7cb9f68252367be75968f18b47d04683e6413376dcee74b7
|
data/.travis.yml
CHANGED
data/README.md
CHANGED
@@ -17,7 +17,7 @@ Currently, uron has not been tested well yet.
|
|
17
17
|
Requirement
|
18
18
|
-----------
|
19
19
|
|
20
|
-
Ruby 1.8.7, 1.9.3 or later.
|
20
|
+
Ruby 1.8.7, 1.9.3 or later. (Recommended 2.2 or later.)
|
21
21
|
|
22
22
|
uron assumes that your system follows the Maildir specification.
|
23
23
|
|
@@ -71,23 +71,29 @@ If a block is passed, call the block.
|
|
71
71
|
|
72
72
|
Examples:
|
73
73
|
|
74
|
-
|
74
|
+
```Ruby
|
75
|
+
header :subject => /\A[mailing-list:/, :delivery => "mailing-list"
|
76
|
+
```
|
75
77
|
|
76
78
|
This means that if the subject of the mail starts with `[mailing-list:`,
|
77
79
|
delivery the mail to `mailing-list` directory (it's relative from your
|
78
80
|
Maildir.)
|
79
81
|
|
80
|
-
|
81
|
-
|
82
|
-
|
82
|
+
```Ruby
|
83
|
+
header :subject => /\A[mailing-list:/ do
|
84
|
+
delivery "mailing-list"
|
85
|
+
end
|
86
|
+
```
|
83
87
|
|
84
88
|
Same as above.
|
85
89
|
|
86
90
|
If you want to check multiple headers, simple put them as:
|
87
91
|
|
88
|
-
|
89
|
-
|
90
|
-
|
92
|
+
```Ruby
|
93
|
+
header :subject => /\A[mailing-list:/,
|
94
|
+
:from => /\Amailing-list-owner\b/,
|
95
|
+
:delivery => "mailing-list"
|
96
|
+
```
|
91
97
|
|
92
98
|
When `subject` and `from` are both matched, the mail will be delivered to `mailling-list` directory.
|
93
99
|
|
@@ -102,7 +108,9 @@ The parameter must be relative from your Maildir.
|
|
102
108
|
|
103
109
|
Examples:
|
104
110
|
|
105
|
-
|
111
|
+
```Ruby
|
112
|
+
delivery "mailing-list"
|
113
|
+
```
|
106
114
|
|
107
115
|
#### `transfer`
|
108
116
|
|
@@ -111,7 +119,9 @@ specfied by the parameters.
|
|
111
119
|
|
112
120
|
Examples:
|
113
121
|
|
114
|
-
|
122
|
+
```Ruby
|
123
|
+
transfer "some.host.of.example.com", "foo@example.com"
|
124
|
+
```
|
115
125
|
|
116
126
|
#### `invoke`
|
117
127
|
|
@@ -123,11 +133,13 @@ Returns the status value of the command.
|
|
123
133
|
|
124
134
|
Examples:
|
125
135
|
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
136
|
+
```Ruby
|
137
|
+
if invoke("bsfilter", "-a") == 0
|
138
|
+
delivery ".spam"
|
139
|
+
else
|
140
|
+
false
|
141
|
+
end
|
142
|
+
```
|
131
143
|
|
132
144
|
#### `logging`
|
133
145
|
|
@@ -137,7 +149,7 @@ Takes one String parameter and outout it to the log file.
|
|
137
149
|
License
|
138
150
|
-------
|
139
151
|
|
140
|
-
Copyright (c) 2012
|
152
|
+
Copyright (c) 2012 NAKAMURA Usaku usa@garbagecollect.jp
|
141
153
|
|
142
154
|
Redistribution and use in source and binary forms, with or without
|
143
155
|
modification, are permitted provided that the following conditions are met:
|
data/bin/uron.rb
CHANGED
@@ -34,7 +34,7 @@ require "socket"
|
|
34
34
|
#= uron - a mail delivery agent
|
35
35
|
#
|
36
36
|
class Uron
|
37
|
-
VERSION = "1.
|
37
|
+
VERSION = "1.3.0"
|
38
38
|
|
39
39
|
ConfigError = Class.new(RuntimeError)
|
40
40
|
|
@@ -307,11 +307,15 @@ if __FILE__ == $0
|
|
307
307
|
require "optparse"
|
308
308
|
|
309
309
|
rcfile = "~/.uronrc"
|
310
|
+
check_only = false
|
310
311
|
|
311
312
|
opt = OptionParser.new
|
312
313
|
opt.on('-r RCFILE', '--rc', 'use RCFILE as the ruleset configurations.') do |v|
|
313
314
|
rcfile = v
|
314
315
|
end
|
316
|
+
opt.on('-c', '--check', 'check rcfile syntax only.') do
|
317
|
+
check_only = true
|
318
|
+
end
|
315
319
|
opt.parse!
|
316
320
|
unless ARGV.empty?
|
317
321
|
$stderr.puts "unknown argument(s): #{ARGV.join(' ')}"
|
@@ -321,7 +325,8 @@ if __FILE__ == $0
|
|
321
325
|
end
|
322
326
|
|
323
327
|
begin
|
324
|
-
|
328
|
+
uron = Uron.new(File.expand_path(rcfile))
|
329
|
+
exit uron.run unless check_only
|
325
330
|
rescue
|
326
331
|
$stderr.puts "#{$!.class}: #{$!.message}"
|
327
332
|
$stderr.puts $!.backtrace.join("\n\t")
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: uron
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- U.Nakamura
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-05-
|
11
|
+
date: 2016-05-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|