mt 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/LICENSE +19 -0
- data/README.md +39 -0
- data/bin/mt +35 -0
- data/mt.gemspec +14 -0
- metadata +49 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: fd369684f5f1ac2f44c5e3176378a5607a61bf62
|
4
|
+
data.tar.gz: 24d8cc0d16b7e4f4280d3dff6676945e4f785f70
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 90353be27ce04bd369118e1f3dde03163773e737043be2948bdf0925fb67daf36a22208665785f35cb95e3986abffb9adc40785494943c9dbb55dfe20f43c745
|
7
|
+
data.tar.gz: 0f6c3673e2d129e38ecbc46f41326188dbe655b1ffa5c722e66b597ea9904a0ad954d4da1e7cfa9feb9d8c16524799c037b761461225f9b0aaff602da70bde18
|
data/LICENSE
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
Copyright (c) 2013 Michel Martens
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
4
|
+
of this software and associated documentation files (the "Software"), to deal
|
5
|
+
in the Software without restriction, including without limitation the rights
|
6
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
7
|
+
copies of the Software, and to permit persons to whom the Software is
|
8
|
+
furnished to do so, subject to the following conditions:
|
9
|
+
|
10
|
+
The above copyright notice and this permission notice shall be included in
|
11
|
+
all copies or substantial portions of the Software.
|
12
|
+
|
13
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
14
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
15
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
16
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
17
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
18
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
19
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,39 @@
|
|
1
|
+
mt
|
2
|
+
==
|
3
|
+
|
4
|
+
Mail tester daemon.
|
5
|
+
|
6
|
+
Description
|
7
|
+
-----------
|
8
|
+
|
9
|
+
Fake a SMTP server and print email to stdout.
|
10
|
+
|
11
|
+
It binds to port 25 by default, so probably you
|
12
|
+
will have to sudo it. If you want to run it in
|
13
|
+
a different port, pass the port number as the
|
14
|
+
first argument.
|
15
|
+
|
16
|
+
Examples
|
17
|
+
--------
|
18
|
+
|
19
|
+
``` console
|
20
|
+
$ mt
|
21
|
+
|
22
|
+
# Email contents will be displayed here.
|
23
|
+
|
24
|
+
$ mt 2525
|
25
|
+
|
26
|
+
# Tell mt to bind to port 2525 instead.
|
27
|
+
|
28
|
+
$ mt &
|
29
|
+
|
30
|
+
# Run it in the background.
|
31
|
+
```
|
32
|
+
|
33
|
+
## Installation
|
34
|
+
|
35
|
+
You can install it using rubygems.
|
36
|
+
|
37
|
+
```
|
38
|
+
$ gem install mt
|
39
|
+
```
|
data/bin/mt
ADDED
@@ -0,0 +1,35 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require 'socket'
|
4
|
+
|
5
|
+
server = TCPServer.open(ARGV.fetch(0, 25))
|
6
|
+
|
7
|
+
loop do
|
8
|
+
client = server.accept
|
9
|
+
client.puts "220 OK"
|
10
|
+
|
11
|
+
str = client.gets
|
12
|
+
|
13
|
+
while str != "DATA\r\n"
|
14
|
+
client.puts "250 OK"
|
15
|
+
str = client.gets
|
16
|
+
end
|
17
|
+
|
18
|
+
client.puts "354 OK"
|
19
|
+
|
20
|
+
res = []
|
21
|
+
str = client.gets
|
22
|
+
|
23
|
+
while str != ".\r\n"
|
24
|
+
res.push(str)
|
25
|
+
str = client.gets
|
26
|
+
end
|
27
|
+
|
28
|
+
puts '---'
|
29
|
+
puts res.join
|
30
|
+
puts '---'
|
31
|
+
|
32
|
+
client.puts "250 OK"
|
33
|
+
client.gets
|
34
|
+
client.puts "221 OK"
|
35
|
+
end
|
data/mt.gemspec
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
Gem::Specification.new do |s|
|
4
|
+
s.name = "mt"
|
5
|
+
s.version = "0.0.1"
|
6
|
+
s.summary = "Mail tester daemon"
|
7
|
+
s.description = "Fake a SMTP server and print email to stdout."
|
8
|
+
s.authors = ["Michel Martens"]
|
9
|
+
s.email = ["michel@soveran.com"]
|
10
|
+
s.homepage = "https://github.com/soveran/mt"
|
11
|
+
s.files = `git ls-files`.split("\n")
|
12
|
+
s.license = "MIT"
|
13
|
+
s.executables.push("mt")
|
14
|
+
end
|
metadata
ADDED
@@ -0,0 +1,49 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: mt
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Michel Martens
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2013-09-19 00:00:00.000000000 Z
|
12
|
+
dependencies: []
|
13
|
+
description: Fake a SMTP server and print email to stdout.
|
14
|
+
email:
|
15
|
+
- michel@soveran.com
|
16
|
+
executables:
|
17
|
+
- mt
|
18
|
+
extensions: []
|
19
|
+
extra_rdoc_files: []
|
20
|
+
files:
|
21
|
+
- LICENSE
|
22
|
+
- README.md
|
23
|
+
- bin/mt
|
24
|
+
- mt.gemspec
|
25
|
+
homepage: https://github.com/soveran/mt
|
26
|
+
licenses:
|
27
|
+
- MIT
|
28
|
+
metadata: {}
|
29
|
+
post_install_message:
|
30
|
+
rdoc_options: []
|
31
|
+
require_paths:
|
32
|
+
- lib
|
33
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
34
|
+
requirements:
|
35
|
+
- - '>='
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: '0'
|
38
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
39
|
+
requirements:
|
40
|
+
- - '>='
|
41
|
+
- !ruby/object:Gem::Version
|
42
|
+
version: '0'
|
43
|
+
requirements: []
|
44
|
+
rubyforge_project:
|
45
|
+
rubygems_version: 2.0.3
|
46
|
+
signing_key:
|
47
|
+
specification_version: 4
|
48
|
+
summary: Mail tester daemon
|
49
|
+
test_files: []
|