You keep talking about scripts having to run on every node. I am agreeing with that. I am talking about the code that processes the output of the script in a future block. Are we talking about the same thing?
You haven't answered to that:
Now you got me lost, WHY do you think VM output will result in AM? Assuming that would be the case:
WHAT would that NXTsmtp plugin DO with that AM?
(or any other plugin)
My assumption is that NXT VM script will do process its inputs, do math, etc and then create and could create output data which would be stored in an AM.
Then the forging block would scan the AM and check to see if it is asking to invoke a plugin. If it is the forging block, it would call the action function. If it is not the forging block, then at some future block, it calls the verification function.
Easy to get confused without a concrete example, that is why I selected email just to illustrate data flow.
NXT VM script decides to generate email and encodes it into an output AM
NXT core scans AM validates plugin and:
if forging block actually sends it
then for email we can't verify, but for examples sake, lets just say all nodes can check to see if the email came in, so the verification step would be to checksum the email and compare it to the expected data.