LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 07-19-2008, 12:53 PM   #1
richbl
LQ Newbie
 
Registered: May 2008
Posts: 7

Rep: Reputation: 0
Outgoing Mail Routing on LAN


Hello all,

I have a mail-related question for what might be a slightly unusual situation:

On my LAN, I have a server (Machine A) running that handles automated backups (via rsync/rsnapshot and a custom script). When it completes its backup, it sends out an email to my gmail account so that I am notified of the success/failure of the backup process (regardless of where I am at the time). Exim(4) is configured on this server as smarthost for this purpose.

Now, I have another machine (Machine B) on my LAN that I'm using for home security, and I'd like to have an email generated on certain security events, but rather than routing directly through my ISP, I want to have the outgoing email routed through the mail server on Machine A. It turns out that the security software I'm using on Machine B doesn't handle authentication correctly.

So, my question is this:

How can I config exim on Machine A to handle my outgoing email on Machine B (or any other machine on my LAN for that matter)?

Keep in mind that I don't care about handling incoming mail: I just need to generate email notifications from within my LAN and send them out to external destinations.

Intuitively, I know that whatever email app I use (e.g. mail) on Machine B needs to somehow understand that it must route to the mail server on Machine A, but I'm at a loss at understanding how this is accomplished.

Thanks much.
 
Old 07-19-2008, 01:28 PM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
well on Machine A there's really nothing to configure, what you want there is a bog standard smtp host, configured to relay for local networks. I can't remember exactly what that option is within exim, but it's one of the few things you'll always configure. The harder bit is to get the email to go to it in the first place. if you run a script to send an email it should connect to the locally running sendmail instance (or sendmail replacement e.g. exim) which will accept the mail, do an MX lookup and send it off to wherever it wants to go. What you'd need to do here is either tell your own client to directly use the other SMTP server or configure that machine to use Machine A as a smart relay or relay host, i.e. don't pay attention to where the mail is going, just blindly give it to this other machine and let it worry about that.
 
Old 07-19-2008, 09:00 PM   #3
richbl
LQ Newbie
 
Registered: May 2008
Posts: 7

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by acid_kewpie View Post
...The harder bit is to get the email to go to it in the first place...
Thanks for the response. Yes, this is exactly the situation that I'm faced at the moment: trying to figure out proper syntax for getting an email generated on one local machine on the LAN to the actual mail server (exim in this case).

For example, I'm used to using mail at the CLI for scripting email messages such as:

mail -s "Backup FAILURE" rich@email_address.com < email_file

However, this outgoing email needs to route to the proper machine on which the mail server is running. How (and/or what) do I configure in order to do this?

Thanks again.
 
Old 07-20-2008, 03:51 AM   #4
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
for exim on the client:

http://www.oreillynet.com/pub/a/orei...exim_0701.html

alternatively you can use a stub replacement like ssmtp / esmtp / bsmtp which are NOT SMTP servers, but provide just the functionality to provide what the mail commands (and others) need to get rid of local mail, with a 5 line config tops...
 
  


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
How to Trap all outgoing mail of all user of my mail server singh_chitranjan Linux - Server 1 07-09-2008 06:15 AM
SMTP Outgoing Routing kngspook Linux - Software 3 04-14-2008 10:10 PM
Routing LAN -> WAN -> LAN with unhelpful router synx13 Linux - Networking 2 06-14-2004 02:35 PM
How to separate Incoming Mail and Outgoing Mail on SENDMAIL LiloAma Linux - Networking 1 03-22-2004 02:24 AM
Routing outgoing mail on a dual external interface system with sendmail Dewar Linux - Networking 5 11-19-2003 03:42 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 01:17 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration