Email Channel

Syntax

dp_connect email -address email_adress -identifier unique_id

Comments

email_address is the address to which outgoing messages will be sent, and from which they will be received 

unique_id must be a unique identifier that will be used to generate the files associated with the email channels (see below). It is mandatory when opening the first email channel, and optional when opening subsequent ones. If given, the value of the parameter has to be the same for all opened email channels. Different identifiers can be used to open email channels in independent processes that run dp. The value of the identifier can also be used to recover information from the email files after a crash of dpsh (this feature is not implemented). 

Incoming email messages will be filtered and the relevant ones will be directed toward the files associated with the email channels. All incoming messages will be also forwarded to the address(es) given in the original ~/.forward file or, if this did not exist, to the user's mailbox. The messages sent through email channels will always have "email channel" in their subject line. 

Opening several email channels associated with the same address is possible, but an incoming message will be delivered only to one of them. 

An email channel is always writable, and will never block. The channel specific options are the following: 

Temporary Files 

When the first email channel is opened file ~/.forward is created (or extended, if it exists already) to include dpfilter. Dpfilter is an utility that selectes incoming email messages for which an email channel was opened. These will be stored in files ~/.emailSpool<unique_id>. File ~/.emailSeek<unique_id> serves as an index for ~/.emailSpool<unique_id> ~/.emailChannel<unique_id> stores the addresses corresponding to the opened email channel. To synchronize the activity of dpsh and dpfilter, a symbolic link ~/.emailLock<unique_id> is sometimes created. 

If dpsh crashes with at least one open email channel, one should delete files ~/.email*, and restore the initial state or delete the ~/.forward file. 

Examples 

set first [dp_connect email -address root -identifier 100] 
set second [dp_connect email -address foobar@cs.foo.edu] 
fconfigure $first -peek yes -sequence yes