1
0
mirror of https://blitiri.com.ar/repos/chasquid synced 2025-12-18 14:47:03 +00:00
Files
go-chasquid-smtp/internal/queue/queue.proto
Alberto Bertogli 55b03c8cf0 queue: Use a local envelope-from when forwarding
If there's an alias to forward email to a non-local domain, using the original
From is problematic, as we may not be an authorized sender for it.

Some MTAs (like Exim) will do it anyway, others (like gmail) will construct a
special address based on the original address.

This patch implements the latter approach, which is safer and allows the
receiver to properly enforce SPF.

We construct a (hopefully) reasonable From based on the local user, and
embedding the original From (but transformed for IDNA, as the receiver may not
support SMTPUTF8).
2016-10-10 00:51:05 +01:00

53 lines
993 B
Protocol Buffer

syntax = "proto3";
package queue;
import "github.com/golang/protobuf/ptypes/timestamp/timestamp.proto";
message Message {
// Message ID. Uniquely identifies this message, it is used for
// auditing and troubleshooting.
string ID = 1;
// The envelope for this message.
string from = 2;
repeated string To = 3;
repeated Recipient rcpt = 4;
bytes data = 5;
// Creation timestamp.
google.protobuf.Timestamp created_at_ts = 6;
// Hostname of the server receiving this message.
string hostname = 7;
}
message Recipient {
// Address to send the message to.
// This is the final one, after expanding aliases.
string address = 1;
enum Type {
EMAIL = 0;
PIPE = 1;
}
Type type = 2;
enum Status {
PENDING = 0;
SENT = 1;
FAILED = 2;
}
Status status = 3;
string last_failure_message = 4;
// Address that this recipient was originally intended to.
// This is before expanding aliases and only used in very particular
// cases.
string original_address = 5;
}