Skip to content
Snippets Groups Projects
Commit c0523b1c authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

An example mail processor for MarisaG

Asked for a way to expand list of recipients for a specified user
parent e3365aa3
No related branches found
No related tags found
No related merge requests found
// A mail processor that expands a recipient list for mail received for a specific user
// Configure in mailproc.ini like:
// [multi]
// Command = mailproc_multi.js
// to = username
// Passthru = true
var recipients = ["another@mailbox"];
var rcptlst = new File(recipient_list_filename);
if(!rcptlst.open("r")) {
alert("Failed to open " + rcptlst.name);
exit();
}
var list=rcptlst.iniGetAllObjects("number");
rcptlst.close();
for(var i = 0; i < recipients.length; ++i) {
list.push( { number: list.length, To: recipients[i], ToNetType: 2 });
}
if(!rcptlst.open("w")) {
alert("Failed to open/create " + rcptlst.name);
exit();
}
rcptlst.iniSetAllObjects(list, "number");
rcptlst.close();
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment