Class Mailtrap
In: lib/mailtrap.rb
Parent: Object

Mailtrap creates a TCP server that listens on a specified port for SMTP clients. Accepts the connection and talks just enough of the SMTP protocol for them to deliver a message which it writes to disk.

Methods

accept   new   serve   write  

Constants

VERSION = '0.2.1'

Public Class methods

Create a new Mailtrap on the specified host:port. If once it true it will listen for one message then exit. Specify the msgdir where messages are written.

Public Instance methods

Service one or more SMTP client connections

Talk pidgeon-SMTP to the client to get them to hand over the message and go away.

Write a plain text dump of the incoming email to a text file. The file will be in the @msgdir folder and will be called smtp0001.msg, smtp0002.msg, and so on.

[Validate]