tech.gate.io blog

Freebsd sendmail via Exchangeserver

Installed Nagios but Nagios was quit voiceless, so I want to send notifications via sendmail. Sendmail is installed by default with Freebsd and as I don’t wanted to build a hole mail server from scratch I want to use our MS Exchange server.

First of all check the DNS Setting of your Domain and make sure your FreeBSD machine got a DNS (A) Record.

To make sure it works you should get this response:

>hostname
nagios.domain.at
>host nagios.domain.at
nagios.doman.at has address 100.100.111.111

 
If you don’t get this, have a look at DNS table.

Now allow SMTP connection from you BSD host to the exchange server as seen in the screener below .

smtp accesse

After that you have to tell the Freebsdhost to use an alternative agent

> vi /etc/mail/freebsd.submit.mc

change the line

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

To

FEATURE(`msp', `[Ip of the Exchange server]')dnl

Or use instead of IP the FQDN (not tested by me)

Now install the submit.cf

>cd /etc/mail && make install-submit-cf

 
If everything worked fine, you should see an output like this:

cp freebsd.submit.mc [hostname].[domain].submit.mc
/usr/bin/m4 -D_CF_DIR_=/usr/share/sendmail/cf/   /usr/share/sendmail/cf/m4/cf.m4 [hostname].[domain].submit.mc > [hostname].[domain].submit.cf
install -m 444 [hostname].[domain].submit.cf /etc/mail/submit.cf

 
Now test the mailsending via with ‘mail’

>mail –v [exchangeuser@domain]

 
Now you should see a lot of lines starting with

[exchangeuser@domain]... Connecting to [100.100.111.111] via relay...
220 EXCHANGE.doman.dc Microsoft ESMTP MAIL Service, Version: 6.0.3790.3959 ready

Now check your Mail client, there should be a mail sent from your logged in user

32 comments


private message
I'll try to put this to good use imdmeaitley.


private message
Free info like this is an apple from the tree of knwoldege. Sinful?




private message
You cuodln't pay me to ignore these posts!



Page: 1/6  [Next]
1  2  3  4  5  6 

Post new comment

Anti-Bot verification code image
Try another code

Last blog post comments

  1. xymon netapp vfiler quota monitoring: rvksjfq sjmgafs 01:26 CEST
  2. Use Windows as router / NAT traffic: vnvrfihp muygzxbi Sat 19 of May, 2012 16:18 CEST
  3. mount nfs v3 share under Solaris 10: kdvwtux xqowacnm Sat 19 of May, 2012 04:21 CEST
  4. Unix Color Terminal: cbeusw ejbpsnr Sat 19 of May, 2012 01:29 CEST
  5. AIX: Get PVID directly from hdisk using od: buy penis enlargement penis_enlargement Fri 18 of May, 2012 15:14 CEST
  6. AIX: Get PVID directly from hdisk using od: risperdal risperdal Fri 18 of May, 2012 13:00 CEST
  7. AIX: Get PVID directly from hdisk using od: cheap phen375 phen375 Wed 16 of May, 2012 18:30 CEST
  8. AIX: Get PVID directly from hdisk using od: Good info Pharmk935 Mon 14 of May, 2012 23:06 CEST
  9. Unix Color Terminal: Good info Pharmd119 Sun 13 of May, 2012 15:49 CEST
  10. Test network throughput without disk or cpu distortion: Good info Pharmd585 Sun 13 of May, 2012 06:01 CEST

Feeds List