Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: [Original edit by JustinMason] adding note about new functionality

...

These tips may be useful to developers of SpamAssassin plugins.

Setting Output Headers and Custom Template Tags

If you want to add custom headers in the rewritten mail message, the Mail::SpamAssassin::PerMsgStatus::set_tag() API is the way to do it.

...

You can also get the value of a tag using the Mail::SpamAssassin::PerMsgStatus::get_tag() API from inside a plugin, although note that some of the tags will not be filled in until after the scan completes, and may not be available.

In SpamAssassin 3.1.0 onwards, you can use C<set_tag> and provide a subroutine reference, like so:

No Format

  my $data = "hello world";
  $permsgstatusobject->set_tag ("MYTAG", sub {
        return $data;
      });