LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Quick sendmail question (https://www.linuxquestions.org/questions/linux-networking-3/quick-sendmail-question-182385/)

TheRealDeal 05-17-2004 06:51 AM

Quick sendmail question
 
Hello.

I was wondering if it is possible to setup sendmail to forward / send it's mails to an existing mail server on the network?

The company I work for has a Domino / Notes mail system. One of our servers which acts as a spam filter is setup to send various emails to certain admins. All I want it to do is forward those mails to the mail server so they reach the users specified?

Thanks alot.

Craig

chort 05-17-2004 11:19 AM

You should be able to accomplish that by modifying the /etc/aliases file and redirecting those accounts, such as:

admin: jdoe@yourdomain

You'll need to run the newaliases command when you're done.

TheRealDeal 05-17-2004 06:07 PM

Hi chort,

Thanks alot for that. I'll give it a go.

Just one question if you don't mind. How does the server know what machine to send the email out to though? For example, if the company mail server is called say "mailserv" and the IP is 10.10.10.10 is there anywhere that I should be putting this information?

Thanks alot!

Regs
Craig

olddog55 05-17-2004 06:32 PM

If all your mail is/can be forwarded through one central SMTP mail gateway, you'll probably want to set up sendmail on your server to use a 'smarthost' configuration.

About line 57 [YMMV] in the sendmail.cf file, you should be able set the DS parameter to the IP or DNS name of the mail gateway:
57 # "Smart" relay host (may be null)
58 ##DS
Add: [ without the quotes :-) ]
"DS10.10.10.10"

Good Luck !

TheRealDeal 05-17-2004 06:35 PM

That's great!!! Thanks olddog.

Thanks alot for all of your help, both of you!!! :)

Regards,
Craig :)

chort 05-18-2004 01:28 AM

Whoooooa there, don't go hacking your .cf file, that's dangerous and pretty much unsupported. The correct way is to modify the .mc file and run m4 again.

In sendmail.mc
Code:

define(`SMART_HOST', `10.10.10.10')dnl
Then do the whole deal of regenerating your sendmail.cf by running m4. I don't have the procedure right here in front of me, but it only takes a minute with Google to locate the sendmail m4 sendmail.mc to sendmail.cf steps.

TheRealDeal 05-18-2004 06:31 AM

Hi chort.

Thanks for clearing that up for me. I haven't done it in a while but from memory it is something like m4 sendmail.mc > sendmail.cf. I'll double check before doing it :)

Thanks again though. You have all been a great help!!!

Best Regards,
Craig

adm1329 05-18-2004 11:36 AM

in the top of your sendmail.mc file it gives directions
Code:

make -C /etc/mail

olddog55 05-18-2004 10:28 PM

Chort sez:
>Whoooooa there, don't go hacking your .cf file, that's dangerous
>and pretty much unsupported. The correct way is to modify the .mc
>file and run m4 again.

Well... The sendmail guru's are split on the subject. And I don't consider it terribly dangerous. (You do keep backup copies of your important configs don't you?) In general, the m4 solution makes maintenance easier for people who don't understand the sendmail.cf options, tokens, re-write rules, or after they've been away from it for a while...

I just find it much easier to hack up the sendmail.cf file. But thats why we all have personal preferances. :-)

/od


All times are GMT -5. The time now is 09:53 PM.