LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 06-30-2011, 08:28 AM   #1
guna_pmk
Member
 
Registered: Sep 2008
Posts: 220

Rep: Reputation: 5
QMail routing outgoing mails


Hello,

I have configured qmail on my CentOS5.5 server. I am planning to divert all the mails sent to one domain to be diverted to another domain.

For example, I wish mails sent to user@my.external.domain.com to be seamlessly diverted to user@my.internal.domain.com. I tried
Code:
my.external.domain.com:my.internal.domain.com
in the smtproutes file. It did not work .

Also how can I have the reply to address different from the one I sent. Again, I wish, if I send emails from user@my.internal.domain.com I would like the replies through user@my.external.domain.com.

Please let me know if the above is not clear.

Thanks
 
Old 07-01-2011, 02:37 AM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Hi,
Quote:
For example, I wish mails sent to user@my.external.domain.com to be seamlessly diverted to user@my.internal.domain.com. I tried
Code:

my.external.domain.com:my.internal.domain.com

in the smtproutes file. It did not work
How didn't it work? Could you post some logs?

Quote:
Also how can I have the reply to address different from the one I sent. Again, I wish, if I send emails from user@my.internal.domain.com I would like the replies through user@my.external.domain.com.
You should configure a "reply-to" address in your client program.

Regards
 
Old 07-01-2011, 08:54 AM   #3
guna_pmk
Member
 
Registered: Sep 2008
Posts: 220

Original Poster
Rep: Reputation: 5
Hi Bathory,

Thanks for your response.

Where can I find the logs for this?

To clarify my.internal.domain.com is a virtual domain in my smtp server. my.external.domain.com is something we have hosted in an external server. So, should it still work?

The idea is to divert all the outgoing mails addressed to people in-house to the internal mail server. So, am I doing the right thing here?

Thanks
 
Old 07-01-2011, 06:00 PM   #4
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Hi,

The logs are under /var/log/qmail. The logfile is called current and there are a couple of them under the various subdirectories (this depends on the way you've installed qmail)

Quote:
To clarify my.internal.domain.com is a virtual domain in my smtp server. my.external.domain.com is something we have hosted in an external server. So, should it still work?

The idea is to divert all the outgoing mails addressed to people in-house to the internal mail server. So, am I doing the right thing here?
Huh, don't get what exactly you want to do.
If you want mail for my.internal.domain.com delivered locally to my.external.domain.com, you need to use setup the usual .qmail files for the virtual domain
 
Old 07-04-2011, 05:18 AM   #5
guna_pmk
Member
 
Registered: Sep 2008
Posts: 220

Original Poster
Rep: Reputation: 5
Hi Bathory,

Thanks for that link. It clarifies things. But the virtual domain applies to all the incoming mails.

Quote:
Huh, don't get what exactly you want to do.
I shall try to explain that better here. We have an email system hosted on a third party server, say external.com. I have just created this internal email system, say internal.com, which is not available outside the intranet. What I am doing here is when I send an email to my colleague who is also in the intranet, it should not go through the internet. For example if an email from myself@internal.com is sent to mycolleague@externel.com, mycolleague@external.com should automatically be converted to mycolleague@internal.com and delivered to the virtual domain in our local email server.

I already have found a way to perform this - by creating an alias in my smtp server. ie creating external.com as an alias for internal.com. This way, anything that is sent to external.com through the local smtp server will automatically be diverted to internal.com.
 
Old 07-04-2011, 07:44 AM   #6
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
So it's working now.
You could do the same by adding external.com in /var/qmail/control/rcpthosts, so mail for external.com would be delivered locally.

Regards
 
Old 07-04-2011, 08:58 AM   #7
guna_pmk
Member
 
Registered: Sep 2008
Posts: 220

Original Poster
Rep: Reputation: 5
My understanding of rcpthosts is to restrict the domains to send emails through the concerned smtp server. So if I have listed internal.com in the rcpthosts only people from internal.com can send emails through that smtp server. Is that (I mean my understanding) not correct?
 
Old 07-04-2011, 09:13 AM   #8
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
No, it's a list of domains that qmail accepts mail for. So if external.com is listed there, the mail will be delivered locally.
See this about the various config files.

Regards
 
Old 07-05-2011, 09:55 AM   #9
guna_pmk
Member
 
Registered: Sep 2008
Posts: 220

Original Poster
Rep: Reputation: 5
Yes your are correct. That's my misunderstanding. But in this particular case, if I include external.com, but it does not exist in the server, will it still be delivered?

In actual fact I have only one (virtual)domain in my mail server - with internal.com. As I have mentioned in one of the previous posts, the external.com is living outside our network. I guess, I should create an internal domain called 'external.com' and then add it to the rcpthosts for the server to deliver it locally. Am I correct?

Thanks
 
Old 07-06-2011, 08:41 AM   #10
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Hi,

You said in post #5 above, that you found a way to do your job. So there is no need to mess further with qmail config files.

Regards
 
Old 07-07-2011, 04:51 AM   #11
guna_pmk
Member
 
Registered: Sep 2008
Posts: 220

Original Poster
Rep: Reputation: 5
Hi bathory,

You are right. It is not advisable to mess up with the live system. But I am just trying to understand the concept to have a better visibility of the system.

Anyway, I mark this thread as solved for now and open a new thread if I have questions in this regard.

Thanks for your participation in this thread.
 
  


Reply



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
Count Outgoing mails sushantchawla2005 Linux - Server 3 10-15-2009 09:50 PM
LXer: Sniff outgoing and incoming mails in Qmail LXer Syndicated Linux News 0 07-07-2009 11:10 AM
Which qmail log file details outgoing mail? (have huge outgoing mail volume) hilljockey Linux - Server 2 12-08-2008 04:26 PM
No outgoing mails (Hacking ???) bittus Linux - Newbie 8 03-21-2008 08:48 AM
backing going up of outgoing mails in our mailserver??? nics Linux - Server 3 04-19-2007 11:48 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

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

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