Forward mail to another server

Discuss installation of Scalix software

Moderators: ScalixSupport, admin

Breezers
Posts: 10
Joined: Wed Jan 04, 2006 3:30 pm

Forward mail to another server

Postby Breezers » Thu Jan 12, 2006 10:56 am

I have made a test setup with the Scalix software. I installed it on mailtest.domain.com, our real mail server is mail.domain.com. On mail.domain.com I made a .forward for several users so that every mail is forwarded to user1@mailtest.domain.com.

This works fine for testing, I can receive my mails and reply to them. But whenever I want to send an e-mail to user2@domain.nl the mail gets delivered on the test system and never arrives on mail.domain.com. I suppose I have to specify somewhere that only mail directly to mailtest.domain.com is accepted and not for domain.com.

I hope I painted a clear picture. Could anyone give me some directions?

Breezers
Posts: 10
Joined: Wed Jan 04, 2006 3:30 pm

Postby Breezers » Thu Jan 12, 2006 10:59 am

Excuse me, I mean user@domain.com of course.

Breezers
Posts: 10
Joined: Wed Jan 04, 2006 3:30 pm

Postby Breezers » Thu Jan 12, 2006 11:00 am

Breezers wrote:Excuse me, I mean use2r@domain.com of course.

ScalixSupport
Scalix
Scalix
Posts: 5503
Joined: Thu Mar 25, 2004 8:15 pm

Postby ScalixSupport » Fri Jan 13, 2006 2:02 pm

Hi. I'm still not clear on what you're trying to do. I can see that the forwarded mail works fine. Are you having problems sending from the Scalix server to the legacy server or are you having problems sending mail from Scalix to the Internet in general?

Thanks,
Rachel

SidebandSamurai
Posts: 236
Joined: Sun Jan 08, 2006 10:57 pm

"dot forward" mail file format

Postby SidebandSamurai » Fri Jan 13, 2006 9:33 pm

Hello,

I think I know what you are asking. You have a test scalix mail server and its host name is "mailtest.domain.com" you have a user account on that scalix server called "user1". So the full e-mail address for this user on the test scalix mail server is "user1@mailtest.domain.com".

Since you are in the middle of migration, you also have another mail server which is in production we will call it "mailprod.domain.com". On it you also have a "user1" so the fully qualified e-mail address for this user on the production mail server is "user1@mailprod.domain.com" User1 is the same identical user on both the production and test systems.

You have placed a .forward file in the users home directory on the production mail (mailprod.domain.com) server which reads as follows:

Code: Select all

user1@mailtest.domain.com


In this example you are literly forwarding a copy of the message to user1@mailprod.domain.com. The backslash "\" instructs sendmail to not expand

Currently when mail is received by the production mail server, it is also sent to the test mail server, and it appers in the test mail servers inbox for user1. You are happy!

Next you send an e-mail to anyone@anywere.com, when that person replies, it will appear on the test system but not on the production, and are wondering what happend to the e-mail that was originally destined for the production mail server.

Your solution is very simple Everything is working as you instructed the production mail server. It is recieving mail destined to user1@mailprod.domain.com and forwarding to user1@mailtest.domain.com.

Notice I said "FORWARD" I have purposely emphisized that because that is what you are doing. nowhere do you see in the configuraiton of your file "Please leave a copy on the production server". So what happens is the message originally destined for user1@mailprod.domain.com is automatically sent to user1@mailtest.domain.com. This message NEVER touches the inbox of the production mail server. Sendmail simply re-directs the message to the approporiate server.

Now the question is asked, How do I get to keep a copy on the production mail server?

The answer is below:

Code: Select all

\user1, user1@mailtest.domain.com


the backslash tells sendmail not to process or expand the .forward file for this perticular account. in effect the backslash prevents an infinate loop of forwarding copies of messages to yourself. Instead it drops a copy in the inbox on the production server does not process the .forward file for this delevery, then drops a copy in the inbox of user1 on the test mail server and stops processing the .forward file.

There are many other uses for the .forward file. issue the comamnd

Code: Select all

man .forward
at the comamand line for a detailed explenation of the .forward file.

Breezers
Posts: 10
Joined: Wed Jan 04, 2006 3:30 pm

Re: "dot forward" mail file format

Postby Breezers » Sun Jan 15, 2006 3:56 am

The normal e-mail adres within our system looks like firstname@domain.com. In the DNS is specified that this domain should be sent to mail.domain.com. And in this case I put a line in .forward to sent the mail also to mailtest.domain.com.

In the scalix configuration I specify firstname@domain.com and firstname@mailtest.domain.com as e-mail adrsesses. Where firstname@domain.com is the reply adres. So if I send a message to someone@somewhere.com and this person replies the message will be delivered to mail.domain.com and forwarded to mailtest.domain.com. No problem.

But, when I send an e-mail to a collegeau from the scalix server, let's say user2@domain.com, the mail is directly delivered on the scalix server to that user. But what I really want is that that mail is send to mail.domain.com and from then forwarded back to mailtest.domain.com.

audiotron2002
Posts: 87
Joined: Tue Nov 22, 2005 12:41 pm

Postby audiotron2002 » Mon Jan 16, 2006 1:36 am

I had the same quesiton. And I learned that you CANNOT forward local mail to a different server. I needed to do this for postfix processing for local mail.

If the scalix server sees the local address, then it will deliver it

SidebandSamurai
Posts: 236
Joined: Sun Jan 08, 2006 10:57 pm

Postby SidebandSamurai » Tue Feb 14, 2006 10:42 pm

Actually that is not true, as I am doing that right now.

There is another problem as to why e-mail will not forward.

I had a couple of accounts that would not forward e-mail. The problem came from the fact that I had these accounts linked to another partition on the server because their home directory was to large to accomidate my small home directory partition.

So I moved their home directories to /var/home/<username> (I have 20 GIGS here) and palced a link in /home with the following command

Code: Select all

ln -s /var/home/<username> <username>


and everything was fine. The problem is when you place a .forward (notice the peroid in front of forward) and set it up with the following information

Sincerely,

Sideband Samurai

Code: Select all

firstname.lastname@mailserver.domain.com


then placed this file in the linked home directory, the loggs would show an error similar to the following:

Code: Select all

World writable .forward file bla bla bla


My message would then end up not on the new e-mail server but the old one. What I am trying to say is examine the logs and send some test messages to observe what is happening.

I solved my problem my deleting the link, and re-creating the home directory careful to make sure file security was set correctly, copyied the basic dot files (.imaprc, .forward etc) to the newly created home directory, then Linked the Mail Directory (this was the acutal source of why the home directory was so large) and tested the e-mail again, with success.

Also with Redhat 8.0, and sendmail, you must modify your aliases file to accept the new e-mail address (if you are migrating to a new e-mail address that is) Otherwise the old e-mail server should accept the mail and automatically forward to the new e-mail server.


Return to “Installation”



Who is online

Users browsing this forum: No registered users and 5 guests