Error Handling Scripting

For most error messages that VPOP3 generates, it allows control of error messages, eg to limit the frequency of error messages if they would be generated repeatedly. These limits are set in Settings → Admin Settings → Message Control. However, if you want more granular control, you can use Lua scripting for more fine-grained control

ProcessMessage3()

This function is called for each controlled message which is generated. The function can force the message to be sent, even if the settings would filter it out, or you could set the target to <blank> to suppress the message even if it would be sent. The function can also change the message subject, text, recipient or sender

ProcessMessage3(<component>, <id>, <type>, <severity>, <error>, <connect_error>, <title_id>, <title>, <template_id>, <message>, <target>, <sender>)

The function should return 5 values

  1. new title (subject)
  2. new message text
  3. new target
  4. new sender
  5. boolean to indicate whether the error message should be forced regardless of normal message controls

A 'do nothing' version of the function would be:

function ProcessMessage3(comp, id, type, sev, error, connectError, titleId, title, formatId, message, target, sender)
  return title, message, target, sender, false;
end

Components

This is a bit-mask of the following items (usually just one of them)

IDs

This is usually the numeric ID of the component, eg the ID of the Mail Sender or Mail Collector

When 'Component = Misc' then these are the IDs

Types

Severities

This is a bit-mask of the following items (usually just one of them)