I am using the Postie plugin for a couple of WordPress sites. But in one site, it literally took my hours and lot of coffee to fix it. Note I was using the mail server as mail.mysitename.com (Read mysitename as my domain)
The debug result was:
There was an error connecting to the server php_network_getaddresses: getaddrinfo failed: Name or service not known
How I solved this?
Installed SMTP mailer plugin (Any smtp plugin may work). In server info tab, in the first line, it says OS: Linux and the server name was written on the same line.
Copied the server name and pasted in Postie settings.
VOILA. It worked. If someone have access to cpanel or any hosting control panel, please copy the exact servername and paste in Postie settings.