This article shows how the gmail Android app flags spam for it's server - is there a way to send the same data to the gmail server in AquaMail?
Gmail app has its own proprietary protocol for communicating with Gmail server.
However, I believe when any other e-mail app moves a message to Gmail's Spam folder, Gmail server takes a note and analyzes that message as Spam.
Again, the FAQ for Aquamail has an item "Moving messages into spam folder" that describes how to set it up.
pcadvisor co uk host at /how-to/google-android/how-block-spam-email-on-android-3634213 (I'm not allowed to post a link, for some reason)
That's an anti-spam measure to limit forum spam. After a few postings, you'll be able to post links.
Could AquaMail run a background script to open a minimalist email server that notifies the email host (perhaps via webmail) of spam to filter?
There is no such protocol defined. The only tool (for those e-mail servers that have ability to deal with that) is to move to the Spam folder, as described above.