kumomta
kumomta copied to clipboard
Extract All URLs from a message and return an array.
In speaking with Abusix, their engineer informed us that one thing that would greatly help those using the MTA for anti-abuse, and which is not really available in existing MTAs, is the ability to call a function that would extract all URLs from an email message and return them, making it much easier to do certain lookups and analysis when deciding on the disposition of the message.
gist of implementation is:
- See this method for inspiration on how to trigger the message parser: https://github.com/KumoCorp/kumomta/blob/2037371793df4b6b615af224e3ad22c6a622524a/crates/message/src/message.rs#L864-L887
- use a some means to match and extract all urls from the message
- return it as an array
- expose it to lua as a method of the message object