How can I send emails with sendmail command (MUA) to a smarthost without running a local SMTP server (MTA)
Issue
Mail should be sent from the system via the sendmail command.
Running a local SMTP server is undesired. Mail should be sent directly to a mail relay server.
No SMTP port should be open for security reasons.
If the sendmail service is stopped or DAEMON=no is set in /etc/sysconfig/sendmail sending a mail will produce a error like this:
sendmail: o44F8Gqi030336: from=root, size=8, class=0, nrcpts=2, msgid=<201005041508.o44F8Gqi030336@dhcp-1-216.fab.redhat.com>, relay=root@localhost
sendmail: o44F8Gqi030336: to=noreply@redhat.com,test, ctladdr=root (0/0), delay=00:00:04, xdelay=00:00:00, mailer=relay, pri=60008, relay=[127.0.0.1] [127.0.0.1], dsn=4.0.0, stat=Deferred: Connection refused by [127.0.0.1]
Environment
- Red Hat Enterprise Linux 4
- Red Hat Enterprise Linux 5
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.