This is a modification of the Apple Mail script available in the script menu in Mail…
Add message(s) to DEVONthink Message Link.scpt.zip (6.0 KB)
And here’s a modified Mail rule script…
Mail Rule - Add messages to DEVONthink - Link.scpt.zip (4.1 KB)
Given there are more than one set of mail rules and mail scripts, perhaps we could make this a preference in Preferences > Mail and pass the message ID to a handler if set in the prefs, @cgrunenberg?