I am trying to setup sendmail to send mail via a Mail Relay I know the Mail Relay works as its been tested elsewhere
I followed quite a few guidance pages and the following is in the sendmail.mc file:
define(`SMART_HOST', `10.*.*.*')dnl
define(`RELAY_MAILER',`esmtp')dnl
define(`RELAY_MAILER_ARGS', `TCP $h 587')dnl
define(`ESMTP_MAILER_ARGS', `TCP $h 587')dnl
define(`confAUTH_MECHANISMS', `EXTERNAL GSSAPI DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')dnl
FEATURE(`authinfo',`hash -o /etc/mail/authinfo/authinfo.db')dnl
define(`confAUTH_OPTIONS', `A p')dnl
TRUST_AUTH_MECH(`EXTERNAL DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')dnl
FEATURE(`nocanonify', `canonify_hosts')
But when any mail is triggered through it, I always get the same error:
Nov 22 08:51:04 localhost sm-mta[17199]: 3AH97jas061031: to=<[email protected]>, ctladdr=<www-data@operations> (33/33), delay=4+23:43:19, xdelay=00:00:00, mailer=relay, pri=65370405, relay=10.*.*.*, dsn=4.0.0, stat=Deferred: Name server: 10.*.*.*: host name lookup failure
Can anyone help me as to what might be the issue here? I'm struggling to find the answer based on anyone elses posts. Most other posts seem to relate to people using an incorrect SMART HOST URL but I'm using an IP.
I Appreciate its the wrong place so thanks for pointing that out guys But, in case anyone else stumbles across this, the issue was when using a Smart Host that is an IP instead of a hostname, it needs to be in brackets, for example: