syntax = "proto3"; package spam; option go_package = "./proto;spam"; service Spam { rpc Classify(ClassifyRequest) returns (ClassifyResponse) {} } // Check whether an email is likely to be spam based on its attributes message ClassifyRequest { // The raw body of the email including headers etc per RFC 822. Alternatively, use the other parameters to correctly format the message string email_body = 1; // The email address it is being sent to string to = 2; // The email address it has been sent from string from = 3; // The subject of the email string subject = 4; // the plain text version of the email body string text_body = 5; // the HTML version of the email body string html_body = 6; } message ClassifyResponse { // Is it spam? Returns true if its score is > 5 bool is_spam = 1; // The score evaluated for this email. A higher number means it is more likely to be spam double score = 2; // The rules that have contributed to this score repeated string details = 3; }