LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices

Reply
 
Search this Thread
Old 05-10-2006, 02:38 PM   #1
Finlay
Senior Member
 
Registered: Mar 2003
Location: Seattle
Distribution: Slackware ?-14.1
Posts: 1,029

Rep: Reputation: 47
how to force sendmail to use a specific interface


Currently my sendmail sends mail using the default route.
i have multiple interfaces and want to force sendmail to use one that isn't the default route.

is there a way for me to force sendmail to use a different interface then the default route?

Thanks
 
Old 05-11-2006, 07:49 PM   #2
psychobyte
Member
 
Registered: Sep 2003
Location: Central Coast, California
Posts: 179

Rep: Reputation: 30
by route you mean interface e.g. IP address?

there is a section in your /etc/mail/sendmail.mc file that you can uncomment,edit then 'm4'

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

or edit your /etc/mail/sendmail.cf on this line

O DaemonPortOptions=Port=smtp,Addr=127.0.0.1, Name=MTA


HTH
 
Old 05-11-2006, 07:55 PM   #3
Finlay
Senior Member
 
Registered: Mar 2003
Location: Seattle
Distribution: Slackware ?-14.1
Posts: 1,029

Original Poster
Rep: Reputation: 47
default route meaning if a program doesn't specify the NIC/interface/IP to use to send packets then it will default to a certain one.

I have already done the changes you mentioned above, they only apply to what IP sendmail will LISTEN to not SEND on
 
Old 05-11-2006, 07:59 PM   #4
psychobyte
Member
 
Registered: Sep 2003
Location: Central Coast, California
Posts: 179

Rep: Reputation: 30
you probably want to edit the default route in the routing table...

Read about the route command which can change your routing table. On boot I usually just set the default route w/ a script.

This prints your routing table.

#> route
 
Old 05-13-2006, 06:28 AM   #5
BSchindler
Member
 
Registered: May 2006
Location: Los Angeles, CA USA
Distribution: RHAS3, RHAS4, RHEL4, RH6, RH7.2, FC2-7, Gentoo, DSL
Posts: 49

Rep: Reputation: 15
As you have multiple NICs I assume that for some reason you want ONLY SMTP (outgoing mail) to use a route other than the default (other outgoing connections to services (ports) use the default) ??

If so, you obviously cannot change your route with as suggested by others. I never ran across this exact problem before so even dug out my sendmail book and looked there -- no configuration directive for sendmail.mc (at least that I could find). So, I would look at setting up iptables to route only outgoing port 25 (SMTP) out on a specific interface. That's the only thing I can think of right now that may solve what I think you say is your problem.
 
Old 05-14-2006, 04:13 PM   #6
Finlay
Senior Member
 
Registered: Mar 2003
Location: Seattle
Distribution: Slackware ?-14.1
Posts: 1,029

Original Poster
Rep: Reputation: 47
ok the IPtables is better than changing the default route, i will do that.
thank you all for responding
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Force a USB device to use a specific /dev/ttyUSBX garnser Linux - Software 4 02-10-2006 07:28 AM
force apps in specific virtual desktops gollum26 Linux - Software 2 01-02-2005 08:17 PM
How do I force a TrueMobile 1500 to select a specific access point? ketchers Linux - Wireless Networking 1 08-21-2004 06:35 PM
force apt to install specific version cheech66 Linux - Newbie 5 05-29-2004 12:04 PM
How to force compile for a specific architecture ie Athlon ? hadding Programming 2 11-09-2003 03:08 PM


All times are GMT -5. The time now is 11:34 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration