LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (http://www.linuxquestions.org/questions/linux-server-73/)
-   -   how to forward mail of one user to other in sendmail server ? (http://www.linuxquestions.org/questions/linux-server-73/how-to-forward-mail-of-one-user-to-other-in-sendmail-server-854323/)

piyusharora420 01-05-2011 05:47 AM

how to forward mail of one user to other in sendmail server ?
 
hi everybody,
i have configured sendmail server in my lan and it is working fine for me.but there is one little problem for me.
i want mails send sunita should be received by vinita.sunita and vinita both are normal users on same pc.

for this i made entry in
Code:

/etc/aliases  sunita:  vinita
please tell me where m i wrong?

bathory 01-05-2011 06:31 AM

Did you run:
Code:

newaliases
after editing /etc/aliases?

piyusharora420 01-05-2011 07:56 AM

yea that was missing.thanx for your help.now i have one other problem i got error
Quote:

Starting sendmail: 554 5.0.0 /etc/mail/sendmail.cf: line 39: unknown configuration line "
when i restart sendmail service.

i have done the following edits
Quote:

MASQUERADE_AS('example.com')dnl
Quote:

define('SMART_HOST','smtp.abc.com')
is there any mistake?

bathory 01-05-2011 08:51 AM

Maybe it's because of the single quote instead of the backtick in front of smtp.abc.com in the SMART_HOST definitio
Better have a look at line 39 of /etc/mail/sendmail.cf

GrapefruiTgirl 01-05-2011 09:06 AM

piyusharora420,

I have merged your two duplicate threads, and removed any posts that were made redundant by the merge. Please take care to post your question in only one location in the future.

Kind regards, & good luck with this issue!

Sasha

piyusharora420 01-05-2011 11:07 PM

ya problem is at SMART_HOST line.beacause when i comment this line out the error disappeared.but what is the problem?i have not found yet.i have used front tick at front of SMART_HOST also but still same error

bathory 01-06-2011 03:19 AM

Hi,

You need to replace the opening single quotes with a backtick. Adding a dnl at the end is also good.
So the macro should look like:
Code:

define(`SMART_HOST',`smtp.abc.com')dnl
If this still doesn't work, you can edit directly /etc/mail/sendmail.cf (in general not recommended) and use:
Code:

DSsmtp.abc.com
Regards

piyusharora420 01-06-2011 07:04 AM

thanx for your reply.i am trying to make a system (without internet connection) in my lan as a sendmail server.will it work?i just want to use it in lan.i have rhel5,centos,in my lan.please guide me i have never used sendmail server

bathory 01-06-2011 07:53 AM

If you want to want to use sendmail inside a lan, you don't need a smarthost.

piyusharora420 01-06-2011 08:05 AM

actually i was trying to solve a rhce question.so i tried alot.ok it is not needed in lan but can't we use it in lan?is it showing error because i am using it in lan?

bathory 01-06-2011 08:34 AM

The error is because of the wrong arguments the SMART_HOST definition in the sendmail.mc
If you use:
Code:

define(`SMART_HOST',`smtp.abc.com')dnl
and rebuild sendmail.cf, it should go away

Sure you can use smarthost in a lan, but it's an overkill. Read this to see what it does and why you don't need it in a lan

piyusharora420 01-07-2011 12:45 AM

thanx for ur reply, but i have already tried what have you said.now i elaborate my problem.
i have three pc's in my lan- 1.centos 2.rhel 3.rhel and i want to make centos as mail server.should i need to configure client side for SMART_HOST only?means mails will be forwarded to my mail server.please guide me with full explanation.i know it will be time consuming for you.please help me out

bathory 01-07-2011 02:34 AM

Look I cannot answer the question in a way suited for rhce, cause I don't know what they want and I also can't do your homework.
I can only tell you that in theory you can setup sendmail on each client and configure it to use the centos box as a smarthost, but it's superfluous, as you will have as many sendmail servers as your clients. In this case you have to configure applications running on clients to use localhost as smtp server.

In practice you configure sendmail only on centos (and you add a smarthost to it, only if it's needed to send mail to the internet). In this case applications running on clients should be configured to use the centos box as smtp server.

piyusharora420 01-07-2011 03:20 AM

means only clients are needed to configured for smtp or i can say for SMART_HOST option?
suppose my server name is server.example.com then it should be
Quote:

define(`SMART_HOST',`smtp.server.example.com')dnl
or it should contain any user account ?

bathory 01-07-2011 04:09 AM

Quote:

suppose my server name is server.example.com then it should be
Quote:
define(`SMART_HOST',`smtp.server.example.com')dnl
If your server name is server.example.com, you should use this name (without the smtp in front). No user accounts or anything else.
Code:

define(`SMART_HOST',`server.example.com')dnl
If you mean that the client sendmail needs to authenticate to the sendmail acting as a smarthost, then I suggest you to read this howto.
It describes, how to setup sendmail with smtp auth either as a server as well as a client to another smtp server (smarthost)


All times are GMT -5. The time now is 04:13 AM.