mailtrap 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. data.tar.gz.sig +0 -0
  2. data/README.txt +18 -5
  3. data/lib/mailtrap.rb +7 -3
  4. metadata +3 -3
  5. metadata.gz.sig +0 -0
data.tar.gz.sig CHANGED
Binary file
data/README.txt CHANGED
@@ -8,9 +8,9 @@ Mailtrap is a mock SMTP server for use in Rails development.
8
8
 
9
9
  Mailtrap waits on your choosen port for a client to connect and talks _just enough_ SMTP protocol for ActionMailer to successfully deliver its message.
10
10
 
11
- Mailtrap makes *no* attempt to actually deliver messages and, instead, writes them into sequentially numbered files on disk (hence the name Mail_trap_).
11
+ Mailtrap makes *no* attempt to actually deliver messages and, instead, writes them into a file (hence the name Mail_trap_). Handy tip: use tail -f to see emails being received.
12
12
 
13
- You can configure the hostname (default: localhost) and port (default: 2525) for the server and also where the messages get written (default: /var/tmp). Messages will get written to files named smtp0001.msg, smtp0002.msg, and so on.
13
+ You can configure the hostname (default: localhost) and port (default: 2525) for the server and also where the messages get written (default: /var/tmp/mailtrap.log).
14
14
 
15
15
  == FEATURES/PROBLEMS:
16
16
 
@@ -21,17 +21,30 @@ You can configure the hostname (default: localhost) and port (default: 2525) for
21
21
 
22
22
  == SYNOPSIS:
23
23
 
24
+ To use the defaults host:localhost, port:2525, file:/var/log/mailtrap.log
25
+
26
+ * mailtrap start
27
+
28
+ Customise startup:
29
+
30
+ * sudo mailtrap start --host my.host --port 25 --once --file=/var/log/messages.txt
31
+
32
+ (sudo because you want to use restricted port 25)
33
+
34
+ For more info:
35
+
24
36
  * mailtrap --help (to see Daemonization options)
25
37
  * mailtrap start --help (to see Mailtrap options)
26
38
 
27
- * mailtrap start --host localhost --port 8025 --once --msgdir=/var/tmp
28
-
29
39
  == REQUIREMENTS:
30
40
 
31
- * Rubygems
41
+ * Hoe rubygem
42
+ * Rubygems rubygem
32
43
  * Daemons rubygem
33
44
  * Trollop rubygem
34
45
 
46
+ All these are automatically installed if you use gem install -y
47
+
35
48
  == INSTALL:
36
49
 
37
50
  * sudo gem install -y mailtrap
@@ -10,7 +10,7 @@ require 'trollop'
10
10
  # for them to deliver a message which it writes to disk.
11
11
  #
12
12
  class Mailtrap
13
- VERSION = '0.2.0'
13
+ VERSION = '0.2.1'
14
14
 
15
15
  # Create a new Mailtrap on the specified host:port. If once it true it
16
16
  # will listen for one message then exit. Specify the msgdir where messages
@@ -21,7 +21,10 @@ class Mailtrap
21
21
  @once = once
22
22
  @msgfile = msgfile
23
23
 
24
- puts "Mailtrap starting at #{@host}:#{port} and writing to #{@msgfile}"
24
+ File.open( @msgfile, "a" ) do |file|
25
+ file.puts "\n* Mailtrap started at #{@host}:#{port}\n"
26
+ end
27
+
25
28
  service = TCPServer.new( @host, @port )
26
29
  accept( service )
27
30
  end
@@ -59,11 +62,12 @@ class Mailtrap
59
62
 
60
63
  # Append to the end of the messages file
61
64
  File.open( @msgfile, "a" ) do |file|
62
- file.puts "****************************************"
65
+ file.puts "* Message begins"
63
66
  file.puts "From: #{from}"
64
67
  file.puts "To: #{to_list.join(", ")}"
65
68
  file.puts "Body:"
66
69
  file.puts message
70
+ file.puts "\n* Message ends"
67
71
  end
68
72
 
69
73
  end
metadata CHANGED
@@ -3,15 +3,15 @@ rubygems_version: 0.9.4
3
3
  specification_version: 1
4
4
  name: mailtrap
5
5
  version: !ruby/object:Gem::Version
6
- version: 0.2.0
7
- date: 2007-10-04 00:00:00 +01:00
6
+ version: 0.2.1
7
+ date: 2007-10-12 00:00:00 +01:00
8
8
  summary: Mailtrap is a mock SMTP server for use in Rails development
9
9
  require_paths:
10
10
  - lib
11
11
  email: self@mattmower.com
12
12
  homepage: " by Matt Mower <self@mattmower.com>"
13
13
  rubyforge_project: rubymatt
14
- description: "Mailtrap is a mock SMTP server for use in Rails development. Mailtrap waits on your choosen port for a client to connect and talks _just enough_ SMTP protocol for ActionMailer to successfully deliver its message. Mailtrap makes *no* attempt to actually deliver messages and, instead, writes them into sequentially numbered files on disk (hence the name \tMail_trap_). You can configure the hostname (default: localhost) and port (default: 2525) for the server and also where the messages get written (default: /var/tmp). Messages will get written to files named smtp0001.msg, smtp0002.msg, and so on. == FEATURES/PROBLEMS:"
14
+ description: "Mailtrap is a mock SMTP server for use in Rails development. Mailtrap waits on your choosen port for a client to connect and talks _just enough_ SMTP protocol for ActionMailer to successfully deliver its message. Mailtrap makes *no* attempt to actually deliver messages and, instead, writes them into a file (hence the name \tMail_trap_). Handy tip: use tail -f to see emails being received. You can configure the hostname (default: localhost) and port (default: 2525) for the server and also where the messages get written (default: /var/tmp/mailtrap.log). == FEATURES/PROBLEMS:"
15
15
  autorequire:
16
16
  default_executable:
17
17
  bindir: bin
metadata.gz.sig CHANGED
Binary file