Operating System - Linux
1819814 Members
2735 Online
109607 Solutions
New Discussion юеВ

Re: Linux /etc/mail.rc & mail command...

 
SOLVED
Go to solution
Jayson Hurd_2
Advisor

Linux /etc/mail.rc & mail command...

I am trying to use the 'mail' command to send mail on a RedHat AS 3.0 box. I am able to use it to send mail when sendmail is running but it just gets deferred mails when sendmail is not running.

I need to be able to send mail without running sendmail. We use a smarthost, i.e. another server to relay mail. That is in the sendmail.cf, but unfortunately the 'mail' command line utility won't use that if sendmail is not running. I've tried the mail.rc file in /etc but haven't been able to get anything working right...

Any ideas?
Most things worth having don't come easily.
6 REPLIES 6
Stuart Browne
Honored Contributor

Re: Linux /etc/mail.rc & mail command...

You need to run 'sendmail' in it's default mode (listening on 127.0.0.1 only).

Either run it like that, or completely reconfigure the sendmail subsystems (you good at configuring sendmail m4's?).

RH's sendmail has been that way since RH8.
One long-haired git at your service...
Jayson Hurd_2
Advisor

Re: Linux /etc/mail.rc & mail command...

I've done some reconfiguration in the sendmail.cf file, but nothing too crazy. We only relay mails through a 'smarthost' due to security restrictions. This is the 'DS' parameter in sendmail.cf.

I guess the bottom line is that we need to run sendmail on the server in order to relay mail using the 'mail' program? I tried changing the port in sendmail.cf, but then mail won't send. Our security guys just don't like sendmail to be running.
Most things worth having don't come easily.
Paul_504
Frequent Advisor

Re: Linux /etc/mail.rc & mail command...

I agree with your security guys, as when we enhanced our security sendmail was one of the first to go. However, this is in a Tru64 environment. I have a RH9 Linux system here, and I'm trying to get an answer to you about this a.s.a.p.

Currently on Tru64, the sendmail daemon doesn't have to be running for mail to be sent. The mail program starts sendmail automatically when it needs to send a mail, and directly after sending it kills sendmail again. However, how this happens I'm still figuring out :-).

I'll try my best to get you an answer quick.
Ermin Borovac
Honored Contributor
Solution

Re: Linux /etc/mail.rc & mail command...

I think that /bin/mail uses /etc/mail/submit.cf. You can create submit.cf from submit.mc using m4.

Currently in /etc/mail/submit.mc you probably have the following line.

FEATURE(`msp', `[127.0.0.1]')dnl

Modify 127.0.0.1 to IP address of your smart host (relay).

FEATURE(`msp', `[
I think you will have to install sendmail-cf rpm for the following to work (m4 needs /usr/share/sendmail-cf/m4/cf.m4 which is in sendmail-cf).

# m4 /etc/mail/submit.mc > /etc/mail/submit.cf

Now /bin/mail should forward email to your smart host.

Paul_504
Frequent Advisor

Re: Linux /etc/mail.rc & mail command...

Hi

The last entry about the submit.mc and submit.cf files do work. I've just tested it. However, does your system only need to send mail, or should it receive mail too.

I've sent a mail to the system on which I configured submit, and I'm still waiting for it. It could be slow mail servers, but I'm 99% sure it won't receive mail without an MTA running.

Just a thought.
Jayson Hurd_2
Advisor

Re: Linux /etc/mail.rc & mail command...

The submit.cf thing did it. I had noticed in the mail log that mail was using 127.0.0.1 when the sendmail was not running. Changing the submit.cf entry to use my remote mail server did the trick so that we can send mails without running sendmail.

Thanks!!!!!!
Most things worth having don't come easily.