0

I followed the following guide on how to setup sendmail to use a remote SMTP server and authenticate: https://www.smtp2go.com/docs/sendmail/

However, sendmail shows that it sends emails out, but debug shows that it connects to localhost and not the remote host.

I execute the following command to send emails:

sendmail -X sendmail_log -fname=email_to_send_out_from@host1.com myemail@host1.com < /tmp/email.txt

My host 'host1.com' does only allow emails sent from 'email_to_send_out_from@host1.com'.

email.txt:

Subject: Terminal Email Send

Email Content line 1
Email Content line 2

This is where in the log file localhost is used:

07460 <<< Subject: Terminal Email Send
07460 <<<
07460 <<< Email Content line 1
07460 <<< Email Content line 2
07460 <<< [EOF]
07460 === CONNECT [127.0.0.1]

closed as unclear what you're asking by strugee, Jenny D, dhag, cuonglm, G-Man Sep 14 '15 at 15:13

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • 3
    please post the relevant configuration files and logs. – strugee Sep 14 '15 at 8:19
  • My configuration is standard Ubuntu 14 sendmail and additions from that guide. I am going to add logs in a minute. – Jonas Hoffmann Sep 14 '15 at 8:26
1

Sendmail-8.12+: Non set root uid installation => sending via 127.0.0.1:25

"Sendmail by sendmail.org" before sendmail-8.12 used to be installed as set root uid program. It had used to create endless security problems. Sendmail-8.12 to avoid such security risks passes messages to sendmail daemon running as root and listening at 127.0.0.1:25.

If you want to test you configuration you may execute your test command as root with -Am added to sendmail's command line options.

Sendmail by default uses submit.cf configuration file and sends messages to 127.0.0.1:25. Some command line options (including -Am) make sendmail use sendmail.cf configuration file but (usually) it requires root privileges to run correctly.

https://www.sendmail.com/sm/open_source/security/secure-install/
http://linux.die.net/man/8/sendmail.sendmail

  • Did you not make a mistake there, when you mentioned 'sendmail.cf' 2 times? Do you mean sendmail.mc? – Jonas Hoffmann Sep 14 '15 at 15:00
  • @Stein FIXED. Thank you for making me aware. – AnFi Sep 14 '15 at 16:47

Not the answer you're looking for? Browse other questions tagged or ask your own question.