enum mail_auth_request_flags {
/* Connection has TLS compression enabled */
- MAIL_AUTH_REQUEST_FLAG_TLS_COMPRESSION = 0x01
+ MAIL_AUTH_REQUEST_FLAG_TLS_COMPRESSION = BIT(0),
+ /* Connection is secure (SSL or just trusted) */
+ MAIL_AUTH_REQUEST_FLAG_CONN_SECURED = BIT(1),
+ /* Connection is secured using SSL specifically */
+ MAIL_AUTH_REQUEST_FLAG_CONN_SSL_SECURED = BIT(2),
};
/* Authentication request. File descriptor may be sent along with the
unsigned int client_pid;
uint8_t cookie[MASTER_AUTH_COOKIE_SIZE];
- /* Local and remote IPs of the connection. The file descriptor
+ /* Properties of the connection. The file descriptor
itself may be a local socketpair. */
struct ip_addr local_ip, remote_ip;
+ in_port_t local_port, remote_port;
uint32_t flags;
req.auth_id = anvil_request->auth_id;
req.local_ip = client->local_ip;
req.remote_ip = client->ip;
+ req.local_port = client->local_port;
+ req.remote_port = client->remote_port;
req.client_pid = getpid();
if (client->ssl_iostream != NULL &&
ssl_iostream_get_compression(client->ssl_iostream) != NULL)
req.flags |= MAIL_AUTH_REQUEST_FLAG_TLS_COMPRESSION;
+ if (client->secured)
+ req.flags |= MAIL_AUTH_REQUEST_FLAG_CONN_SECURED;
+ if (client->ssl_secured)
+ req.flags |= MAIL_AUTH_REQUEST_FLAG_CONN_SSL_SECURED;
memcpy(req.cookie, anvil_request->cookie, sizeof(req.cookie));
buf = t_buffer_create(256);