Discussion:
Need help with Sendmail sending into Microsoft Server that is a mail relay
Brent Jones
2011-03-13 01:08:11 UTC
Permalink
Hi All.

I have been googling and working on this problem for a couple of days
but can't find the answer.

I have a Linux box (Centos 5.5.) that needs to be able to use a
Microsoft mail server.

IT have set up my access to the mail server.
I can telnet through the mail server.
I can also use Evolution and that works.

But I want to use Sendmail so I can use command line / Script programming.

I had tried to build exim4 instead but multiple versions failed their
builds so I had to give up.

I have modified sendmail.mc and have rebuilt sendmail.cf and restarted
Sendmail.
I have set the smart host to the server and this is recognised.

If I look at maillog it shows the mail has been queued for sending.

I used the -v -t options on Sendmail.
This showed that Sendmail was talking to 127.0.0.1 (local host)

Is this what is meant to be seen or should it have been the IP address
of the the mail server?

In sendmail.mc there is a place where the value is set at 127.0.0.1 but
the comment says this is only for listening for
mail from the server.

Any help greatly appreciated.

Brent





_______________________________________________
NZLUG mailing list ***@linux.net.nz
http://www.linux.net.nz/cgi-bin/mailman/listinfo/nzlug
Nick Rout
2011-03-13 01:18:00 UTC
Permalink
Post by Brent Jones
Hi All.
I have been googling and working on this problem for a couple of days but
can't find the answer.
I have a Linux box (Centos 5.5.) that needs to be able to use a Microsoft
mail server.
IT have set up my access to the mail server.
I can telnet through the mail server.
I can also use Evolution and that works.
But I want to use Sendmail so I can use command line / Script programming.
I had tried to build exim4 instead but multiple versions failed their
builds so I had to give up.
I have modified sendmail.mc and have rebuilt sendmail.cf and restarted
Sendmail.
I have set the smart host to the server and this is recognised.
If I look at maillog it shows the mail has been queued for sending.
I used the -v -t options on Sendmail.
This showed that Sendmail was talking to 127.0.0.1 (local host)
Is this what is meant to be seen or should it have been the IP address of
the the mail server?
In sendmail.mc there is a place where the value is set at 127.0.0.1 but
the comment says this is only for listening for
mail from the server.
Any help greatly appreciated.
Brent
Only suggestion I have is postfix, which is far easier to set up.
_______________________________________________
NZLUG mailing list ***@linux.net.nz
http://www.linux.net.nz/cgi-bin/mailman/listinfo/nzlug
Cliff Pratt
2011-03-13 01:44:23 UTC
Permalink
Post by Brent Jones
Hi All.
I have been googling and working on this problem for a couple of days
but can't find the answer.
I have a Linux box (Centos 5.5.) that needs to be able to use a
Microsoft mail server.
IT have set up my access to the mail server. I can telnet through the
mail server. I can also use Evolution and that works.
But I want to use Sendmail so I can use command line / Script
programming.
I had tried to build exim4 instead but multiple versions failed their
builds so I had to give up.
I have modified sendmail.mc and have rebuilt sendmail.cf and
restarted Sendmail. I have set the smart host to the server and this
is recognised.
If I look at maillog it shows the mail has been queued for sending.
I used the -v -t options on Sendmail. This showed that Sendmail was
talking to 127.0.0.1 (local host)
Is this what is meant to be seen or should it have been the IP
address of the the mail server?
In sendmail.mc there is a place where the value is set at 127.0.0.1
but the comment says this is only for listening for mail from the
server.
Any help greatly appreciated.
Many people have dabbled with sandmail's configurations files and the
backe warily away and used another MTA... But having said that I believe
that there is a series of mc files and that there should be one for
'smart-host'. If you can find such a beast that will be what you should
change.

(Does the current CentOS split the conffiles between receiver and sender
functions? I recall one OS that did that, maybe RHEL).

If you are just trying to send mail through the server, you could try
using mutt in a script rather than sendmail.

Cheers,

Cliff

_______________________________________________
NZLUG mailing list ***@linux.net.nz
http://www.linux.net.nz/cgi-bin/mailman/listinfo/nzlug
Cliff Pratt
2011-03-13 01:46:56 UTC
Permalink
Post by Cliff Pratt
Post by Brent Jones
Hi All.
I have been googling and working on this problem for a couple of days
but can't find the answer.
I have a Linux box (Centos 5.5.) that needs to be able to use a
Microsoft mail server.
IT have set up my access to the mail server. I can telnet through the
mail server. I can also use Evolution and that works.
But I want to use Sendmail so I can use command line / Script
programming.
I had tried to build exim4 instead but multiple versions failed their
builds so I had to give up.
I have modified sendmail.mc and have rebuilt sendmail.cf and
restarted Sendmail. I have set the smart host to the server and this
is recognised.
If I look at maillog it shows the mail has been queued for sending.
I used the -v -t options on Sendmail. This showed that Sendmail was
talking to 127.0.0.1 (local host)
Is this what is meant to be seen or should it have been the IP
address of the the mail server?
In sendmail.mc there is a place where the value is set at 127.0.0.1
but the comment says this is only for listening for mail from the
server.
Any help greatly appreciated.
Many people have dabbled with sandmail's configurations files and the
backe warily away and used another MTA... But having said that I believe
that there is a series of mc files and that there should be one for
'smart-host'. If you can find such a beast that will be what you should
change.
(Does the current CentOS split the conffiles between receiver and sender
functions? I recall one OS that did that, maybe RHEL).
If you are just trying to send mail through the server, you could try
using mutt in a script rather than sendmail.
Oh, and see the second hint in this:

http://www.softpanorama.org/Commercial_linuxes/RHEL/Networking/sendmail_on_rhel.shtml

_______________________________________________
NZLUG mailing list ***@linux.net.nz
http://www.linux.net.nz/cgi-bin/mailman/listinfo/nzlug
Adrian Merrall
2011-03-13 01:49:53 UTC
Permalink
Brent,
Post by Brent Jones
Hi All.
I have been googling and working on this problem for a couple of days but
can't find the answer.
I have a Linux box (Centos 5.5.) that needs to be able to use a Microsoft
mail server.
IT have set up my access to the mail server.
I can telnet through the mail server.
I can also use Evolution and that works.
But I want to use Sendmail so I can use command line / Script programming.
g, it ju
I had tried to build exim4 instead but multiple versions failed their builds
Post by Brent Jones
so I had to give up.
I have modified sendmail.mc and have rebuilt sendmail.cf and restarted
Sendmail.
I have set the smart host to the server and this is recognised.
A couple of thoughts:

1. Can you show us the smart relay line from your sendmail.cf
2. Can you try to ping/dig the MS mailserver address. I see you can telnet
to it but just doing the basics, have you specified a host name in sendmail
but are telnetting to an ip addy?
3. The IT folks have set up access to the mail server but they specifically
need to allow your box to relay through it.
4. You should be able to use telnet to type the SMTP commands yourself to
test it. Use sendmail with the -v option I think to see an example.

Not much help I'm afraid but I have done this several times on RHEL and once
the sendmail smart relay is in and the MS software allows relaying, it
usually just works.

Cheers,

Adrian
_______________________________________________
NZLUG mailing list ***@linux.net.nz
http://www.linux.net.nz/cgi-bin/mailman/listinfo/nzlug
Ron Wilson
2011-03-13 04:32:29 UTC
Permalink
If the exchange server is on your network and you want to send mail
externally from exchange you will need to allow relay on exchange server.
Use ESM to give relay permissions to the sendmail server
Post by Adrian Merrall
Brent,
Post by Brent Jones
Hi All.
I have been googling and working on this problem for a couple of days but
can't find the answer.
I have a Linux box (Centos 5.5.) that needs to be able to use a Microsoft
mail server.
IT have set up my access to the mail server.
I can telnet through the mail server.
I can also use Evolution and that works.
--
*Ron Wilson*
_______________________________________________
NZLUG mailing list ***@linux.net.nz
http://www.linux.net.nz/cgi-bin/mailman/listinfo/nzlug
Steve Holdoway
2011-03-13 03:53:10 UTC
Permalink
Post by Brent Jones
Hi All.
I have been googling and working on this problem for a couple of days
but can't find the answer.
I have a Linux box (Centos 5.5.) that needs to be able to use a
Microsoft mail server.
IT have set up my access to the mail server.
I can telnet through the mail server.
I can also use Evolution and that works.
But I want to use Sendmail so I can use command line / Script programming.
I had tried to build exim4 instead but multiple versions failed their
builds so I had to give up.
I have modified sendmail.mc and have rebuilt sendmail.cf and restarted
Sendmail.
I have set the smart host to the server and this is recognised.
If I look at maillog it shows the mail has been queued for sending.
I used the -v -t options on Sendmail.
This showed that Sendmail was talking to 127.0.0.1 (local host)
Is this what is meant to be seen or should it have been the IP address
of the the mail server?
In sendmail.mc there is a place where the value is set at 127.0.0.1 but
the comment says this is only for listening for
mail from the server.
Any help greatly appreciated.
Brent
So you want to forward all traffic through the Exchange server, right??

OK first off, make backups of the complete /etc/mail directory.

Then, you need the config package ( I'm assuming logged in as root as
I'm not going to keep prepending each command with sudo )

yum install sendmail-cf

You then need to add the exchange server ( usually by name - make one up
if necessary and add to /etc/hosts ). In /etc/mail/sendmail.mc, modify
the line that probably says:

dnl define(`SMART_HOST', `smtp.your.provider')dnl

to

define(`SMART_HOST', `smtp.your.provider')dnl

where smtp.your.provider is replaced with the name of the exchange
server that you *may* have added to /etc/hosts

Then regen /etc/mail/sendmail.cf

cd /etc/mail
make sendmail.cf

Stop sendmail

/etc/init.d/sendmail stop

( use ps to wait until all sendmail processes are finished. Any that
have been lying around for ages will need a kill -9 <PID> and are spam
anyway ).

and start it again

/etc/init.d/sendmail start

You now have sendmail set up and will send mail to the outside world via
the exchange server.

If you want sendmail to accept *incoming* mail from the outside world in
general, then you need to get sendmail to listen on the external ip
address, as well as the loopback. To do this,
edit /etc/mail/sendmail.mc, and change

DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')dnl

to

DAEMON_OPTIONS(`Port=smtp, Name=MTA')dnl

and rebuild as above. If you have multiple networks and only want to
listen on some, then

DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')dnl
DAEMON_OPTIONS(`Port=smtp,Addr=a.b.c.d, Name=MTA')dnl
DAEMON_OPTIONS(`Port=smtp,Addr=e.f.g.h, Name=MTA')dnl


is an alternative format.

You may also need to open port 25 in your firewall to allow traffic
through.

Does this cover what you're trying to do? You'll still have to set
exchange up to allow this server to relay mail, and I haven't a clue how
to do that... whenever I need to go clickety click, the BOFH takes over
and I get my wrists smacked (:

And for all those saying 'I wouldn't start from here', is sendmail
really that difficult?


Steve
--
Steve Holdoway BSc(Hons) MNZCS <***@greengecko.co.nz>
http://www.greengecko.co.nz
MSN: ***@greengecko.co.nz
Skype: sholdowa
Dagan McGregor
2011-03-13 04:59:48 UTC
Permalink
Post by Brent Jones
Hi All.
I want to use Sendmail so I can use command line / Script
programming.
What are your actual requirements to send email?

How are you generating the email, and in what volume?

If you're calling from a script, can you call a simple command-line
tool like mailx to send the email?

Sendmail or Postfix or Exim might be greatly overcomplicating things
if you only need to send basic email alerts.

Dagan

_______________________________________________
NZLUG mailing list ***@linux.net.nz
http://www.linux.net.nz/cgi-bin/mailman/listinfo/nzlug

Loading...