Class RubyQmail::Queue
In: lib/queue.rb
Parent: Object

Methods

Included Modules

Process

Constants

QMAIL_QUEUE_SUCCESS = 0
QMAIL_ERRORS = { -1 => "Unknown Error", 0 => "Success", 11 => "Address too long", 31 => "Mail server permanently refuses to send the message to any recipients.", 51 => "Out of memory.", 52 => "Timeout.", 53 => "Write error; e.g., disk full.", 54 => "Unable to read the message or envelope.", 55 => "Unable to read a configuration file.", 56 => "Problem making a network connection from this host.", 61 => "Problem with the qmail home directory.", 62 => "Problem with the queue directory.", 63 => "Problem with queue/pid.", 64 => "Problem with queue/mess.", 65 => "Problem with queue/intd.", 66 => "Problem with queue/todo.", 71 => "Mail server temporarily refuses to send the message to any recipients.", 72 => "Connection to mail server timed out.", 73 => "Connection to mail server rejected. ", 74 => "Connection to mail server succeeded, but communication failed.", 81 => "Internal bug; e.g., segmentation fault.", 91 => "Envelope format error"

Attributes

message  [RW] 
options  [RW] 
recipients  [RW] 
response  [RW] 
return_path  [RW] 
success  [RW] 

Public Class methods

Class Method to place the message into the Qmail queue.

Recipients can be a filename, array or other object that responds to :each, or to_s resolves to an email address Message can be a filename, string, or other object that responds to :each

Public Instance methods

Sends email directly via qmail-remote. It does not store in the queue, It will halt the process and wait for the network event to complete. If multiple recipients are passed, it will run qmail-remote delivery for each at a time to honor VERP return paths.

Builds the QMQP request, and opens a connection to the QMQP Server and sends This implemtents the QMQP protocol, so does not need Qmail installed on the host system. System defaults will be used if no ip or port given. Returns true on success, false on failure (see @response), or nul on deferral

This calls the Qmail-Queue program, so requires qmail to be installed (does not require it to be currently running).

Forks, sets up stdin and stdout pipes, and starts qmail-queue. IF a block is passed, yields to it with [sendpipe, receivepipe], and returns the exist cod, otherwise returns {:msg=>pipe, :env=>pipe, :pid=>@child} It exits 0 on success or another code on failure. Qmail-queue Protocol: Reads mail message from File Descriptor 0, then reads Envelope from FD 1 Envelope Stream: ‘F’ + sender_email + "\0" + ("T" + recipient_email + "\0") … + "\0"

Forks, sets up stdin and stdout pipes, and starts the command. IF a block is passed, yeilds to it with [sendpipe, receivepipe], returing the exit code, otherwise returns {:send=>, :recieve=>, :pid=>} qmail-queue does not work with this as it reads from both pipes.

[Validate]