Relaying mail from sendmail

Author
Discussion

Graham

Original Poster:

16,368 posts

285 months

Monday 17th July 2006
quotequote all
Ok then in the ongoing saga of sending out automatic mails with attatchments its looking like im going to have to set up sendmail to relay all its mail...

Im slowley working out the way there exchange box sends its mail and i need to try and duplicate that.


the exchange box sits behind the firewall and is set to relay its mail to an external mail host. the mail from the exchange box first hits the firewall and is sent via the mailsweeper then back through the firewall to the external mail host and then on to the recipient.

the firewall has now been sent to forward mails from my servers Ip address through the same route...


so now i need to setup the forwarding on my send mail server... so first job is to get it to masquarade as the exchange box? and then set forwarding to the external mail host...

im assuming if i get that right and it comes from the correct external lan address as its going through the firewall it should work?

So may next question is how the heck do i configure the sendmail config file to get that to happen. im only interested in out going mail not incomming on this server

G

malman

2,258 posts

260 months

Monday 17th July 2006
quotequote all
Why not just send the mail via the exchange box in the first place. I would think that mutt thing you were using should be able to do it.

Graham

Original Poster:

16,368 posts

285 months

Monday 17th July 2006
quotequote all
They are reluctant to change anything on the exchange box that was my first thought... Its been like pulling teeth to get this far !!!!


but even then as far as sendmail is concerend the setup is probably the same isnt it? and mutt still uses sendmail to do the actuall sending...


what im doing is a automatic query on the database that creates a file and this then gets sent out as an e-mail attatchment. mutt has a nice command line interface which allows me to do the query and the mail in a shell script which gets run by the cron


cheers

graham

malman

2,258 posts

260 months

Monday 17th July 2006
quotequote all
Haven't done a lot with sendmail. For most of the simple stuff I generally just edit the sendmail.cf file to make it do what I want.


Should be section in sendmail config for SMTP relay/smarthost set that to your destination server.

There should also be a your domain and your host setting at the begining this can be set automatically using th macros but you might want to set it. I think there is a msaquerade setting too further down the config.

There are a number of web config tools etc if you don't want to get dirty. There is also a really good O'reily book (your library might have it if you don't do much sendmail - I borrowed a copy)

Just had quick look through a config file and these stand out as minimal setting to get it sending
DS = Smart host /relay (format = smtp:host.domain eg smtp:mail.domain.co.uk)
DR = Mail relay (you probably want this set to null or leave it commented)
DM = who you masquerade as


Edited by malman on Monday 17th July 15:17

aldi

9,243 posts

238 months

Monday 17th July 2006
quotequote all
What distro are you using? Most will go through the basic setup of the package when you install it, in terms of hostnames and how/where to fire off the mails to. If it's allready installed and configured but you want to reconfigure it then in debian it's

dpkg-reconfigure sendmail-cf

For redhat/fedora the command may possibly involve 'yum'.

Graham

Original Poster:

16,368 posts

285 months

Monday 17th July 2006
quotequote all
its on red hat It was installed as part of the install when the box was built a few years ago, but its never been used to actually send mail out, just the internal system mail...

aldi

9,243 posts

238 months

Monday 17th July 2006
quotequote all
Sorry I've only got debian to play with here, but if you do yum --help it might tell you what to do to reconfigure a package. Might be easier to do it that way than manually changing the config files if they aren't making any sense?

Edit: Oh yeah, back up the old config before nuking it

Edited by aldi on Monday 17th July 16:30

zumbruk

7,848 posts

261 months

Monday 17th July 2006
quotequote all
Frankly, I wouldn't use sendmail for relaying. In fact, I wouldn't use sendmail at all. It appears to be a loose collection of bugs and security exploits with a configuration file written by a madman on speed.

Postfix is easy to set up, reliable, well supported & much more secure than sendmail. Snd setting it up to relay is considerably safer than sendmail. And it's Open Source, so probably came with your Deadrat distro.

I'd give you the URL of the support site, but Google is apparently up the swanny.