uron 1.3.0 → 1.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/uron.rb +14 -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: f871350a697b79679efebff3405e7dbb41ab1482
|
4
|
+
data.tar.gz: 24bab3b0b45859b16274052414a1e4e6a4a02420
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 53e08437fb63416cd5092ff0f6fab00806d60a1f16218e42e983e46119b25b3e63d2a2488f6400acb6030c40907332032eed3750fd5cf56a9762a1671285b22e
|
7
|
+
data.tar.gz: c90e87d74ffdb389ad50fefb652c2130994256da2ca9c040b57d7cc68bcf7ccea24af3821a21c3217a83f840afbde89b8216049e2d1c2ece6098ad83654845ee
|
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.3.
|
37
|
+
VERSION = "1.3.1"
|
38
38
|
|
39
39
|
ConfigError = Class.new(RuntimeError)
|
40
40
|
|
@@ -82,7 +82,7 @@ class Uron
|
|
82
82
|
def run(io = $stdin)
|
83
83
|
@mail = self.class::Mail.read(io)
|
84
84
|
|
85
|
-
logging "From #{(@mail.headers[:from] || []).first} #{Time.now}"
|
85
|
+
logging @mail.from || "From #{(@mail.headers[:from] || []).first} #{Time.now}"
|
86
86
|
logging " Subject: #{@mail.headers[:subject].first[0, 69]}" if @mail.headers.include?(:subject)
|
87
87
|
|
88
88
|
catch(:tag) do
|
@@ -241,6 +241,9 @@ class Uron
|
|
241
241
|
self.new(io.binmode.read)
|
242
242
|
end
|
243
243
|
|
244
|
+
# `From` line from MTA, if exists
|
245
|
+
attr_reader :from
|
246
|
+
|
244
247
|
# a Hash of mail headers
|
245
248
|
attr_reader :headers
|
246
249
|
|
@@ -254,6 +257,9 @@ class Uron
|
|
254
257
|
#
|
255
258
|
# _plain_ is the original mail text.
|
256
259
|
def initialize(plain)
|
260
|
+
@from = nil
|
261
|
+
@headers = {}
|
262
|
+
@body = []
|
257
263
|
@plain = plain.dup
|
258
264
|
parse(@plain)
|
259
265
|
end
|
@@ -262,8 +268,14 @@ class Uron
|
|
262
268
|
#
|
263
269
|
# _plain_ is the original mail text.
|
264
270
|
def parse(plain)
|
271
|
+
@from = nil
|
265
272
|
@headers = {}
|
266
273
|
@body = []
|
274
|
+
|
275
|
+
if plain.sub!(/\AFrom .*?\r?\n/, '')
|
276
|
+
@from = $&.chomp
|
277
|
+
end
|
278
|
+
|
267
279
|
header_p = true
|
268
280
|
prev = nil
|
269
281
|
plain.each_line do |line|
|
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.3.
|
4
|
+
version: 1.3.1
|
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-
|
11
|
+
date: 2016-06-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|