LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
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 08-03-2003, 02:15 PM   #1
JelloMaster
LQ Newbie
 
Registered: Aug 2003
Posts: 6

Rep: Reputation: 0
mail forwarding problem with sendmail


here is what i did:
add the domain to local-host-names and restarted sendmail.
after that i made user webmaster and
in /home/webmaster made a .forward file with the email address i want the mail forwarded.
i made sure to chown the .forward file to webmaster and set the permissions to 644 ...
can u guys let me know what i'm doing wrong? or what i missed? i only want mail for webmaster@domain.com to be forwarded to another account.
 
Old 08-03-2003, 02:27 PM   #2
Corin
Member
 
Registered: Jul 2003
Location: Jette, Brussels Hoofstedelijk Gewest
Distribution: Debian sid, RedHat 9, Suse 8.2
Posts: 446

Rep: Reputation: 30
Did you edit the sendmail.cf or sendmail.mc.

If the latter, then you need to remake the sendmail.cf

# cd /etc/mail
# make clean
# make

To see what is actually happening

$ sendmail -v webmaster@domain.com
this is a test
.
^ period at beginning of line followed by <CR>

Instead of using the clunky .forward method, why do you not add an alias
to /etc/aliases

webmaster: othersuser

for same machine

or

webmaster: otheruser@othermachine.domain.com

for a different host.

And do not forget to run the command

# newaliases

after adding entries to /etc/aliases.

Again, if you do this, test with the sendmail -v method above.

Last edited by Corin; 08-03-2003 at 02:31 PM.
 
Old 08-03-2003, 04:58 PM   #3
hrc
Member
 
Registered: Jun 2003
Location: Ohio
Posts: 54

Rep: Reputation: 15
Corin -
You solution worked like a charm - I like editing the aliases file instead of the .forward file.
Thanks a million!!!!
Mark
 
Old 08-03-2003, 05:00 PM   #4
hrc
Member
 
Registered: Jun 2003
Location: Ohio
Posts: 54

Rep: Reputation: 15
Corin - Now that I am thinking about it...can you add in two people in the alias file? For example - can you edit it so thisguy@testdomain.com is forwarded to me@test.com and you@test.com? Just separate them with a comma?
 
Old 08-03-2003, 05:04 PM   #5
hrc
Member
 
Registered: Jun 2003
Location: Ohio
Posts: 54

Rep: Reputation: 15
Corin - I got it - I just added multiple addresses seperated by a comma.
Thanks again!
Mark
 
Old 08-03-2003, 07:00 PM   #6
Corin
Member
 
Registered: Jul 2003
Location: Jette, Brussels Hoofstedelijk Gewest
Distribution: Debian sid, RedHat 9, Suse 8.2
Posts: 446

Rep: Reputation: 30
You solved it yourself, without giving me a chance to reply!

You are obviously getting the hang of things! :+)
 
Old 08-04-2003, 08:09 AM   #7
hrc
Member
 
Registered: Jun 2003
Location: Ohio
Posts: 54

Rep: Reputation: 15
Corin - laughing - I figured that I would give it a shot - presuming that the worst thing that could happen was it wouldn't work - I have another question for you though regarding virtual hosts and sendmail - let me gather my info with some screen shot and then I will post it - thanks again.
Mark
 
Old 08-04-2003, 08:23 AM   #8
Corin
Member
 
Registered: Jul 2003
Location: Jette, Brussels Hoofstedelijk Gewest
Distribution: Debian sid, RedHat 9, Suse 8.2
Posts: 446

Rep: Reputation: 30
Quote:
I figured that I would give it a shot - presuming that the worst thing that could happen was it wouldn't work
That is usually the best way to learn how to do things!

Try it, see if it works, if not try something a little different.

And sometimes with some software packages, the documentation is either non-existent, incomplete, or so incomprehensible that the only things one can do is to keep trying different things.

Only ever change one thing at a time, making a note of what you change, or more correctly, a backup of the unchanged file, and check the results carefully, and remember that a change can do one of three things

1) make things worse
2) make no difference
3) make things better

Awaiting your other question in due course ...
 
Old 08-04-2003, 09:37 AM   #9
hrc
Member
 
Registered: Jun 2003
Location: Ohio
Posts: 54

Rep: Reputation: 15
Corin - here is my other question -

OK - I am running RHL9 as a web server with a handful of web sites (virtual hosts). Now here is my question - when someone ssh's to my box, opens up pine and sends an email it sends as the main domain of the box, not necessarily the domain that they are associated with. For example the name of my box is car.com (not real) but I also host a web site apple.com (joe q public owns apple.com). Now when joe q public sends an email from my machine (car.com) the email is joe@car.com not joe@apple.com. How do I associate certian users with certain domains? Does that make sense?
Thanks again

Mark
 
Old 08-04-2003, 04:12 PM   #10
Corin
Member
 
Registered: Jul 2003
Location: Jette, Brussels Hoofstedelijk Gewest
Distribution: Debian sid, RedHat 9, Suse 8.2
Posts: 446

Rep: Reputation: 30
For the record, and those searching the archive, this question has been answered in

http://www.linuxquestions.org/questi...threadid=78866
 
Old 08-06-2003, 09:13 PM   #11
JelloMaster
LQ Newbie
 
Registered: Aug 2003
Posts: 6

Original Poster
Rep: Reputation: 0
to corin

corin.

i followed your advice and the sendmail -v way works good now. but when i send an email to webmaster@domainname.com i dont receive the email.
 
Old 08-06-2003, 10:18 PM   #12
Corin
Member
 
Registered: Jul 2003
Location: Jette, Brussels Hoofstedelijk Gewest
Distribution: Debian sid, RedHat 9, Suse 8.2
Posts: 446

Rep: Reputation: 30
JelloMaster

Please post the output of the

sendmail -v webmaster@domainname.com

test here, so that we can see what is happening.
 
Old 08-07-2003, 04:48 PM   #13
JelloMaster
LQ Newbie
 
Registered: Aug 2003
Posts: 6

Original Poster
Rep: Reputation: 0
220 plain.domain.com ESMTP Sendmail 8.12.8/8.12.8; Thu, 7 Aug 2003 16:45:59 -0500
>>> EHLO plain.domain.com
250-plain.domain.com Hello localhost.localdomain [127.0.0.1], pleased to meet you
250-ENHANCEDSTATUSCODES
250-PIPELINING
250-8BITMIME
250-SIZE
250-DSN
250-ETRN
250-DELIVERBY
250 HELP
>>> MAIL From:<admin@plain.domain.com> SIZE=5
250 2.1.0 <admin@plain.domain.com>... Sender ok
>>> RCPT To:<webmaster@domain.com>
>>> DATA
250 2.1.5 <webmaster@domain.com>... Recipient ok
354 Enter mail, end with "." on a line by itself
>>> .
250 2.0.0 h77LjxbL024869 Message accepted for delivery
webmaster@domain.com... Sent (h77LjxbL024869 Message accepted for delivery)
Closing connection to [127.0.0.1]
>>> QUIT
221 2.0.0 plain.domain closing connection
 
Old 08-07-2003, 04:56 PM   #14
JelloMaster
LQ Newbie
 
Registered: Aug 2003
Posts: 6

Original Poster
Rep: Reputation: 0
here are the coresponding lines from /var/log/maillog

Aug 7 16:45:59 plain sendmail[24489]: h77LjtDT024489: from=admin, size=5, class=0, nrcpts=1, msgid=<200308072145.h77LjtDT024489@plain.domain.com>, relay=root@localhost
Aug 7 16:45:59 plain sendmail[24869]: h77LjxbL024869: from=<admin@domain.com>, size=292, class=0, nrcpts=1, msgid=<200308072145.h77LjtDT024489@domain.com>, proto=ESMTP, daemon=MTA, relay=localhost.localdomain [127.0.0.1]
Aug 7 16:45:59 plain sendmail[24489]: h77LjtDT024489: to=webmaster@domain.com, ctladdr=admin (500/500), delay=00:00:04, xdelay=00:00:00, mailer=relay, pri=30005, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (h77LjxbL024869 Message accepted for delivery)
Aug 7 16:45:59 plain sendmail[24870]: h77LjxbL024869: to=forward@domain2.com, ctladdr=<admin@plain.domain.com> (500/500), delay=00:00:00, xdelay=00:00:00, mailer=esmtp, pri=30504, relay=mail.domain2.com. [xx.xx.xx.x], dsn=2.0.0, stat=Sent (ok 1060294555 qp 18285)
 
Old 08-08-2003, 12:09 AM   #15
Corin
Member
 
Registered: Jul 2003
Location: Jette, Brussels Hoofstedelijk Gewest
Distribution: Debian sid, RedHat 9, Suse 8.2
Posts: 446

Rep: Reputation: 30
So the mail is being sent from the machine from where you are
sending it.

If you are not receiving it on the other machine, it means that there
must be a problem with the configuration on the other machine.

Is mail for admin redirected to another user on that machine?
 
  


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
PHP Mail() Problem w/ Sendmail jusme Linux - Software 6 08-18-2012 03:35 PM
Mail Forwarding in postfix/maildrop/redhat (like yahoo mail forwarding) topcat Linux - Software 1 08-31-2007 01:10 PM
postfix forwarding mail problem smurfix Linux - Software 2 11-08-2004 09:57 PM
Sendmail second server/mail forwarding? WorldBuilder Linux - Networking 4 03-11-2004 07:10 PM
mail relay problem with sendmail ilovebytes Linux - Networking 5 11-16-2003 08:56 AM


All times are GMT -5. The time now is 04:31 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration