LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 03-03-2006, 10:33 PM   #1
samw5
LQ Newbie
 
Registered: Feb 2006
Posts: 28

Rep: Reputation: 15
Question Sendmail nightmare :(


Hey guys, I've just setup coppermine (php photo album) on my home system and it needs to use sendmail (or SMTP) to send admin messages.

I've got FC4 and the default Sendmail config. I have changed my hostname but no domain have been setup on the system (though I do use dyndns to point to that system).

In any case I'd like to have the mail sent to Sendmail be forwarded to another email and the mail trying to get out of my system actually be sent.

I quickly went thru the Sendmail docs and I must say I feel a bit overwhelmed.

Is there anywhere I should start looking? Coppermine has the option to send via SMTP but somehow this isn't working either (not sure if I need to open the iptables port for SMTP to send messages)...

Any help would be appreciated.

Thanks,
Sam
 
Old 03-04-2006, 12:51 AM   #2
Jerre Cope
Member
 
Registered: Oct 2003
Location: Texas (central)
Distribution: ubuntu,Slackware,knoppix
Posts: 323

Rep: Reputation: 37
The simplest way I've found to configure sendmail is with http://www.webmin.com

Using that, you need to set the "Send outgoing mail via host" to the outside host (such as your web host provider) that you want to use to send the mail. If you have dyndns setup, you should be able to deliver mail directly in many cases.

You may have more trouble if the next mail server requires authentication and authentication wasn't compiled into your sendmail. Depending on your distribution, you can install an rpm with that enabled, or you can compile a new sendmail.
 
Old 03-04-2006, 10:29 AM   #3
astender
LQ Newbie
 
Registered: Nov 2004
Location: Tennessee
Distribution: FC3, SuSE10,RHEL4 & LFS6.0
Posts: 29

Rep: Reputation: 15
Hi Sam,
iptables shouldn't stop any outgoing mail but if you are receiving mail you will have to make a rule to allow port 25 to get in. The default configuration I have on FC3 is able to send mail to my ISP account.

Arnie
 
Old 03-04-2006, 01:02 PM   #4
samw5
LQ Newbie
 
Registered: Feb 2006
Posts: 28

Original Poster
Rep: Reputation: 15
I've already got Webmin installed and was trying that yesterday. I ended up creating a couple virtual users that will forward local mail to my other email accounts but that doesn't seem to work...

Now when you say use the Send outgoing mail via host option (which I clearly see) what host should I put? Domain name, SMTP server or just an email address?

My actually host is using auth on SMTP so I'm not too sure how that's gonna work.
 
Old 03-04-2006, 01:25 PM   #5
samw5
LQ Newbie
 
Registered: Feb 2006
Posts: 28

Original Poster
Rep: Reputation: 15
Ok here is some log:

unable to qualify my own domain name (myRig) -- using short name: 54 Time(s)
My unqualified host name (myRig) unknown; sleeping for retry: 54 Time(s)
restarting /usr/sbin/sendmail due to signal: 2 Time(s)

I would also like all those root message sent to root@myRig to be redirected to my regular email account...

Oh and I noticed a 451 error in on of the message queue: 451 myDomain.com: Name server timeout
 
Old 03-04-2006, 04:54 PM   #6
astender
LQ Newbie
 
Registered: Nov 2004
Location: Tennessee
Distribution: FC3, SuSE10,RHEL4 & LFS6.0
Posts: 29

Rep: Reputation: 15
Sam,
Looks like your basic network configuration is confusing sendmail. I'll make some assumptions and make some suggestions but depending on your network topology you may need to do things differently. First, /etc/sysconfig/network should read something like HOSTNAME=myRig.myDomain.com GATEWAY=(dotted decimal IP address of either your router or your ISP's default gateway). Second, your /etc/nsswitch.conf should have a line that says "hosts: files dns". Third, some may disagree on this but I always add a line to my /etc/hosts that says "my-address my-FQDN my-alias" and my localhost line has no reference to my hostname, only localhost. Yours may look like

127.0.0.1 localhost
192.168.2.1 myRig.myDomain.com myRig

If you are running your own DNS it has to be able to resolve your FQDN properly. That is another whole issue. If this doesn't sound like it fits into the network you have you should ask more questions before implementing what I just gave you. If you do make these changes reboot and watch your startup messages. When sendmail starts it should come right up and not send out the can't figure out my own domain name message.

Arnie
 
Old 03-04-2006, 06:03 PM   #7
samw5
LQ Newbie
 
Registered: Feb 2006
Posts: 28

Original Poster
Rep: Reputation: 15
Arnie;

Thanks a bunch for your patience, I really appreciate it! I must say I'm pretty new to all of this... I have gotten my hands dirty with Linux before but nothing as far as configuring an entire server (or mail stuff for that matter).

I've added a line in the network file for the GATEWAY and changed the HOSTNAME (it was just myRig).

The loopback address also has myRig in the hosts file (I added a line for localhost and one for my local IP myRig.myDomain.com myRig).

The nsswitch file does have the hosts: file dns entry... haven't touched it at all.

Now as far as my network goes, it's a home network, behind a Dlink router/firewall. I've got a Domain registered with a subdomain that points to my home IP (via DYNDNS... oh and that works fine).

I've just tried sending some test emails and the sendmail module in webmin seems to refresh MUCH faster (so I'm assuming that there was something odd before and I'm getting there... slowly).

I've check the mail log and here is what I get:

Mar 4 18:33:43 myRig sendmail[3037]: k24NXhqo003037: from=root@myRig.myDomain.com, size=325, class=0, nrcpts=1, msgid=<1141515223.3009@myRig.myDomain.com>, relay=root@$
Mar 4 18:33:43 myRig sendmail[3037]: k24NXhqo003037: to=myRealEmail@myDomain.com, delay=00:00:00, mailer=esmtp, pri=30325, dsn=4.4.3, stat=queued
Mar 4 18:47:02 myRig sendmail[3516]: k24Nl2Pw003516: from=apache, size=817, class=0, nrcpts=1, msgid=<5dd630fcab89b503d1568786622a5bf0@mysubdomain.myDomain.com>, relay=apache@localh$
Mar 4 18:47:02 myRig sendmail[3516]: k24Nl2Pw003516: to=myRealEmail@myDomain.com, delay=00:00:00, mailer=esmtp, pri=30817, dsn=4.4.3, stat=queued

Messages don't seem to get to destination... haven't waited more than an hour or two but I'm not getting anything so far and nothing in the mail queue which would imply that it actually was "sent" somewhere...

Thanks a million for the much needed assistance,
Sam
 
Old 03-04-2006, 06:08 PM   #8
samw5
LQ Newbie
 
Registered: Feb 2006
Posts: 28

Original Poster
Rep: Reputation: 15
oh and should the FQDN be myRig.mySubdomain.com or myRig.myDomain.com (myDomain.com server is not located on my network).
 
Old 03-04-2006, 07:55 PM   #9
astender
LQ Newbie
 
Registered: Nov 2004
Location: Tennessee
Distribution: FC3, SuSE10,RHEL4 & LFS6.0
Posts: 29

Rep: Reputation: 15
Hi Sam,
Sounds like you are moving it the right direction. The "F" in FQDN stands for "fully" so I think it ought to be myRig.mySubdomain.myDomain.com. The bottom line is you need to do what works. Try the above and see what happens. A typical sendmail start command would use -bd (run as a daemon) and -q30m (run the queue every 30 minutes). As you send the mail it should try to diliver it right away the first time. Are you able to verify the mail is not being sent? The log entry does seem to say it's still in the queue. You may want to define the SmartRelay in the sendmail.cf to your ISP's mail server. You should be able to deliver it yourself but it would be interesting to see if it worked that way. If you do that you need to HUP sendmail or restart it.

Arnie
 
Old 03-04-2006, 10:50 PM   #10
samw5
LQ Newbie
 
Registered: Feb 2006
Posts: 28

Original Poster
Rep: Reputation: 15
ok no matter what FQDN I put down, when I just setup the config as is the mail get queued and waits there.

When I enabled mail forwarding via the virtusertable it does show as being sent but stays in the sendmail mailq (and give the 451 error)... Status shows that: Deferred: Name server: myRig.myDomain.com.: host name lookup failure.

The way I'm trying to forward mail is as follow:
@myRig.mysubdomain.myDomain.com myRealEmail@myDomain.com
@mysudomain.myDomain.com myRealEmail@myDomain.com
@myRig myRealEmail@myDomain.com
@localhost myRealEmail@myDomain.com

Based on that I am assuming one rule is working and trying to forward the mail but gets blocked cause of improper domain... I'll try to keep playing with that... any thoughts in the meantime?

Oh and how about the "Send outgoing mail via host" option? What am I supposed to put there? I look up the documentation but it's somewhat obscure (at least to me)... Do I need a domain name, subdomain, SMTP server, IP address??

Thanks,
Sam
 
Old 03-05-2006, 12:11 AM   #11
samw5
LQ Newbie
 
Registered: Feb 2006
Posts: 28

Original Poster
Rep: Reputation: 15
bingo... got it to work.
I changed hostname of the machine back to localhost and the mail went out! Now how to I change it to something that "looks" pretty when I email people?

Cheers,
Sam

PS: this site rocks! So many good people to help, I just feel like i'm learning so much!
 
Old 03-05-2006, 12:25 AM   #12
samw5
LQ Newbie
 
Registered: Feb 2006
Posts: 28

Original Poster
Rep: Reputation: 15
oh yeah totally forgot.. the virtusertable entry seems to work like a charm... All the mail that is sent to root is now being redirected to my email. Now if I could only make it look a bit better (rather than root@localhost)... that would be great!

Thanks,
Sam
 
Old 03-05-2006, 11:51 AM   #13
astender
LQ Newbie
 
Registered: Nov 2004
Location: Tennessee
Distribution: FC3, SuSE10,RHEL4 & LFS6.0
Posts: 29

Rep: Reputation: 15
sendmail working

Hey Sam,
That's great. Where did you change hostname back to localhost? I had a similar problem of getting my from line in outgoing mail to look like it was coming from my domain rather than node.domain. I defined my domain in sendmail.cf as being simply domain.org. The line starts with Djmydomain.org . I don't know if that is what you are looking for or not. Anyway I'm glad to hear you got it working. Now if i could only get an anwer to my problem. Happy mailing!

Arnie
 
Old 03-05-2006, 12:04 PM   #14
samw5
LQ Newbie
 
Registered: Feb 2006
Posts: 28

Original Poster
Rep: Reputation: 15
I've actually changed the hostname in the /etc/sysconfig/network file.

I tried adding 192.168.1.10 mySubdomain.myDomain.com to the hosts file but it's giving me problems.

Another thing I've noticed was that while configured with the FQDN that I'd like to use mail is delivered locally (which would imply it somewhat works) but it's not going out... It's trying to use smtp.myDomain.com to send mail while it should be mail.myDomain.com (I have no idea where that would be defined in sendmail... I looked at the config file but didn't find anything).

Will take a look at the Djmydomain.com line.

Thanks for the pointers,
Sam
 
Old 03-05-2006, 01:16 PM   #15
sipsipi
Member
 
Registered: Dec 2005
Location: Chicago
Distribution: Fedora and Redhat
Posts: 86

Rep: Reputation: 15
My .02, don't touch the sendmail.cf, only the sendmail.mc
 
  


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
sendmail 8.13.4-2 smtp auth nightmare kz26 Linux - Security 1 10-30-2005 01:57 PM
ndiswrapper nightmare!! extremebfn Linux - Wireless Networking 5 07-11-2004 08:28 AM
Modem nightmare geznotts Linux - Newbie 0 05-11-2003 10:39 AM
ML 8.2 Nightmare! descras Linux - General 2 08-22-2002 04:06 AM
ISDN nightmare mainyeti Linux - Newbie 0 07-25-2001 05:27 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 01:26 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