LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Fedora (https://www.linuxquestions.org/questions/fedora-35/)
-   -   Can receive email but can't send it (https://www.linuxquestions.org/questions/fedora-35/can-receive-email-but-cant-send-it-327618/)

60s TV Batman 05-27-2005 06:06 AM

Can receive email but can't send it
 
Hi there

I have Fedora 3 with Kernel 2.6.11-1.27_FC3. I've also registered the domain gx7.co.uk, and pointed it at my static IP: 82.153.177.29

I can display a test webpage I set up with http://gx7.co.uk and I can send mail to wayne@gx7.co.uk from one of my other email accounts. I can download this email to Outlook Express on my windows PC. I can also see it by entering mail on my Linux box.

What I can't do is send mail out from my Linux box. For example, if I send mail from wayne@gx7.co.uk to wayne@megaresponse.com, it appears that Outlook has sent it, but the mail never arrives in my inbox.

This is what I see in my maillog file...

[deleted]: to=<wayne@megaresponse.com>, ctladdr=<wayne@gx7.co.uk> (500/500), delay=00:00:20, xdelay=00:00:20, mailer=esmtp, pri=120668, relay=megaresponse.com., dsn=4.0.0, stat=Deferred: Name server: megaresponse.com.: host name lookup failure

NOTE: Despite the log saying "megaresponse.com.: host name lookup failure", I can use this email account to send and receive and dig/dig -x works just fine with megaresponse.com and it's IP. So the problem is with gx7.co.uk and/or Sendmail on my server.

When I try to mail my ISP email address from wayne@gx7.co.uk, I get a two messages in maillog, and a "may be forged" comment about the internal LAN IP address...

[deleted]from=<wayne@gx7.co.uk>, size=471, class=0, nrcpts=1, msgid=<[deleted]>, proto=SMTP, daemon=MTA, relay=gx7.co.uk [192.168.0.3] (may be forged)
[deleted]to=<wayne@starfleet.eclipse.co.uk>, delay=00:00:00, mailer=esmtp, pri=30471, dsn=4.4.3, stat=queued

I've also noticed that a dig gx7.co.uk works just fine, but a reverse DNS with dig -x 82.153.177.29 fails. Should I be concerned about this? And are these two problems related?

Berhanie 05-27-2005 10:30 AM

I don't use Sendmail, so I may be off in my understanding of the logs; but my guess is that you have your SMART_HOST improperly defined. It may be something like
Code:

define(`SMART_HOST', `smtp.response.com')
instead of just
Code:

define(`SMART_HOST', `response.com')

60s TV Batman 05-27-2005 11:31 AM

Hi and thanks for your reply

This didn't make a difference, and I'm not sure this is a smart_host problem anyway. For some reason, my system can't get a resolution on perfectly good domain names. I suspect it's not looking at the outside world...but don't know how to tell it to do this.

Berhanie 05-27-2005 12:13 PM

You might try to ping a machine outside your network using the machine's IP address and, if successful, using its FQDN. If you are successful with the first but not with the second, then you have a name resolution problem.

I don't use Fedora (so, someone who does may give you more Fedora-specific info), but in general, one puts a list of domain name servers (the machines that translate names to ip addresses) in the file /etc/resolv.conf -- either directly or through some distro-specific tool.

snarkout 05-27-2005 12:55 PM

Post your sendmail.mc file. Before people can look at that, everything that is offered will be random stabs in the dark.

Is there a particular reason you're using sendmail? Most people find it confounding if they have no experience setting up mailservers (and many that do have exp find it equally as confounding).

60s TV Batman 05-27-2005 01:06 PM

Quote:

Originally posted by snarkout
Is there a particular reason you're using sendmail? Most people find it confounding if they have no experience setting up mailservers
No specific reason, other than I don't know any better. Setting up a webserver is a project I've been wanting to get my teeth into. I have the Fedora 3 Bible, and that gives instructions for Sendmail.

As it happens, I've just managed to solve the problem by looking more deeply at what /etc/resolv.conf does, instead of relying on the sparse info in Fedora 3 Bible.

In case anyone else has this problem, and happens to read this post, my resolv.conf file contained only one nameserver...my router. Sendmail was obviously attempting to get domains resolved from my el cheapo ADSL router! That clearly wasn't going to work for external domains!

I added my domain register's nameserver IPs to resolv.conf, restarted Sendmail, and voila! A gazillion queued emails were suddenly delivered to my various email addresses.

I shan't be reporting myself for spam :D

Berhanie 05-27-2005 01:16 PM

Good job!

snarkout 05-27-2005 04:01 PM

Good TSing!

60s TV Batman 05-27-2005 04:25 PM

There is still one problem that remains. The changes I made to /etc/resolv.conf are lost when I reboot.

Does anyone know why and/or how to stop this from happening and/or how to get whatever is rewriting the file to rewrite it with the correct info?

snarkout 05-28-2005 12:21 PM

Add the line:

PEERDNS=no

to

/etc/sysconfig/network-scripts/ifcfg-eth0
(assuming you are using eth0 as your network interface - if not, edit the file that corresponds with the correct interface).

This should do the trick.

Edit: FWIW, this problem usually occurs when you are using DHCP, and you should probably not be using DHCP for a mailserver. Just a thought.

jollyjoice 06-26-2005 07:37 AM

thanks guys, that was just what i was looking for!


All times are GMT -5. The time now is 02:08 AM.