diff --git a/src/libsystemd/sd-network/sd-network.c b/src/libsystemd/sd-network/sd-network.c index a5ab5b3c364..acfab8ed74f 100644 --- a/src/libsystemd/sd-network/sd-network.c +++ b/src/libsystemd/sd-network/sd-network.c @@ -260,6 +260,10 @@ _public_ int sd_network_link_get_pop3_servers(int ifindex, char ***pop3) { return network_link_get_strv(ifindex, "POP3_SERVERS", pop3); } +_public_ int sd_network_link_get_smtp_servers(int ifindex, char ***ret) { + return network_link_get_strv(ifindex, "SMTP_SERVERS", ret); +} + _public_ int sd_network_link_get_dns_default_route(int ifindex) { char path[STRLEN("/run/systemd/netif/links/") + DECIMAL_STR_MAX(ifindex) + 1]; _cleanup_free_ char *s = NULL; diff --git a/src/systemd/sd-network.h b/src/systemd/sd-network.h index ea06c9d8752..c185e2ce304 100644 --- a/src/systemd/sd-network.h +++ b/src/systemd/sd-network.h @@ -170,6 +170,9 @@ int sd_network_link_get_sip_servers(int ifindex, char ***sip); /* Get the pop3 servers for a given link. */ int sd_network_link_get_pop3_servers(int ifindex, char ***pop3); +/* Get the SMTP servers for a given link. */ +int sd_network_link_get_smtp_servers(int ifindex, char ***smtp); + /* Get whether this link shall be used as 'default route' for DNS queries */ int sd_network_link_get_dns_default_route(int ifindex);