User Tools

Site Tools


reference:error_handling_script

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>)

  • component - number indicating which component generated the message (eg Mail Collector, Mail Sender)
  • id - number indicating the id of the component (eg which Mail Collector)
  • type - number indicating the type of the message
  • severity - number indicating the severity of the message
  • error -
  • connect_error - boolean indicating whether the error is a connection error or not
  • title_id - numeric ID of the message title/subject
  • title - text of the message title/subject
  • template_id - numeric ID of the message body template
  • message - text of the message body
  • target - email address of the target
  • sender - email address of the 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)

  • 1 = Mail Sender
  • 2 = Mail Collector
  • 4 = NNTP Collector
  • 8 = Misc
  • 16 = Message Filtering
  • 32 = Message Routing

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

  • 0 = default
  • 2 = Archive
  • 3 = Startup
  • 4 = Database Backup
  • 1003 = Logger
  • 1004 = Call-forward verification
  • 1005 = SMTP forwarding
  • 1006 = Spam filter
  • 1007 = Message recycle bin
  • 2000 = Lua scripting

Types

  • 1 = Protocol (SMTP, POP3, NNTP)
  • 2 = TCP/IP
  • 8 = Misc

Severities

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

  • 1 = Info
  • 2 = Warning
  • 4 = Error
  • 8 = Fatal
  • 16 = Panic
reference/error_handling_script.txt · Last modified: 2023/11/20 10:18 by paul