marlam / msmtp

SMTP client with sendmail compatible interface
https://marlam.de/msmtp
GNU General Public License v3.0
168 stars 36 forks source link

should NET_EHOSTNOTFOUND map to EX_TEMPFAIL? #116

Closed greg-minshall closed 1 year ago

greg-minshall commented 1 year ago

hi.

currently net_open_socket() in net.c, if getaddrinfo(3) returns non-zero, returns NET_EHOSTNOTFOUND, which, iiuc, gets mapped to an msmtp exit status of EX_NOHOST.

i wonder if get addrinfo returns, e.g., EAI_AGAIN, maybe net_open_socket() should instead return something that would map to EX_TEMPFAIL, the same as when trying to connect to the host fails (i.e., return NET_ECONNECT).

i'm guessing this issue of different sendmail return codes, when to pass which, how to respond to which, is, umm, complicated.

cheers.

marlam commented 1 year ago

Yes, it's complicated ;) But in this case you are right and I think the best we can do is fix these things as they come up. This is done now (the patch will show up on the github mirror in a few hours).

greg-minshall commented 1 year ago

thanks!