LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
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 02-09-2007, 04:06 PM   #31
wpn146
Member
 
Registered: Jan 2005
Distribution: Solaris, Linux Fedora Core 6
Posts: 170

Rep: Reputation: 30

Removed. Somebody else already posted my suggestion...

Last edited by wpn146; 02-09-2007 at 04:19 PM.
 
Old 02-09-2007, 08:05 PM   #32
isuck@linux
Member
 
Registered: Jun 2006
Distribution: messed up debian
Posts: 250

Rep: Reputation: 30
As far as I know the smart host is in case you have a gateway, a computer fully connected and you need to redirect all the email to get out that way. That is the only case where you would use smart host. If this is the case and you need smart host, use the external interface instead of the loopback.
 
Old 03-06-2007, 04:03 PM   #33
recursio
LQ Newbie
 
Registered: Mar 2007
Posts: 6

Rep: Reputation: 0
what does cat /etc/mail/access display

need to add your public ip as a relay
 
Old 03-07-2007, 03:38 PM   #34
JustinK101
Member
 
Registered: Jan 2007
Posts: 55

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by recursio
what does cat /etc/mail/access display

need to add your public ip as a relay
BELVEDERE | root -=-> cat /etc/mail/access
# Check the /usr/share/doc/sendmail/README.cf file for a description
# of the format of this file. (search for access_db in that file)
# The /usr/share/doc/sendmail/README.cf is part of the sendmail-doc
# package.
#
# by default we allow relaying from localhost...
localhost RELAY
127.0.0.1 RELAY
BELVEDERE RELAY

Looks good to me, any other suggestions?
 
Old 03-08-2007, 03:40 PM   #35
recursio
LQ Newbie
 
Registered: Mar 2007
Posts: 6

Rep: Reputation: 0
yes, it is relaying email to its self, localhost and 127.0.0.1 are both non-public names

not sure what the BELVEDERE is resolving to, im guessing that BELVEDERE is the name of your computer, if so then that name should be tied to a public IP address in the /etc/hosts file.

what do these commands display?
cat /etc/sysconfig/network
cat /etc/hosts
cat /etc/host.conf
 
Old 03-09-2007, 01:24 PM   #36
JustinK101
Member
 
Registered: Jan 2007
Posts: 55

Original Poster
Rep: Reputation: 15
Quote:
yes, it is relaying email to its self, localhost and 127.0.0.1 are both non-public names.
Yeah that is what I want though, I only want local applications such as php, and apache to be able to send external mail.

Quote:
not sure what the BELVEDERE is resolving to, im guessing that BELVEDERE is the name of your computer, if so then that name should be tied to a public IP address in the /etc/hosts file.
Yes, BELEVEDE is the computer name, but I am nto running any DNS server such as bind. I wish to simply send email.

Quote:
cat /etc/sysconfig/network
BELVEDERE | root -=-> cat /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=BELVEDERE

Quote:
cat /etc/hosts
BELVEDERE | root -=-> cat /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 BELVEDERE localhost localhost.localdomain

Quote:
cat /etc/host.conf
BELVEDERE | root -=-> cat /etc/host.conf
order hosts,bind
 
Old 03-14-2007, 06:47 PM   #37
recursio
LQ Newbie
 
Registered: Mar 2007
Posts: 6

Rep: Reputation: 0
Post

Okay, BELVEDERE is set to relay. But BELVEDERE is pointing to the internal IP address, thus you are not able to relay messages to the outside world.

There seems to be a problem in the /etc/hosts file, there are four fields when there should only be three.

from "man hosts":
Quote:
For each host a single line should be present with the following information:
IP_address cononical_hostname aliases
It's important to remember that the /etc/hosts file is the first place your computer will look when doing foward and reverse DNS lookups, according to your /etc/host.config file.

Substitute your static (public) IP address for x.x.x.x and change the /etc/hosts to reflect the following:

127.0.0.1 localhost.localdomain localhost
X.X.X.X your_domain.com BELVEDERE

or you could simply list your public IP address in the /etc/mail/access file as the following:
x.x.x.x RELAY

WARNING, once you do this, you will become a target for spammers, so you need to lock down your SMTP server. There are several ways to do that. Perhaps the best way to lock down you SMTP server is to always require authentication before a message is accepted for delivery. What this means is that each time a message is send to the SMTP server for external delivery, the SMTP server then required a valid user name and password before the message is accepted for delivery. However, the SMTP server is also aways listening on the SMTP port for incomming messages, these messages are intended to be delivered to your local users and no authentication is required, as these are messages are from users on other systems.

let me say that again:
Outgoing SMTP messages should require authentication before the message is accepted for delivery. Incomming SMTP messages should not require authentication before being accepted, but sendmail will check to see if the email account is valid on the local system.
 
Old 03-15-2007, 02:56 AM   #38
JustinK101
Member
 
Registered: Jan 2007
Posts: 55

Original Poster
Rep: Reputation: 15
Quote:
Substitute your static (public) IP address for x.x.x.x and change the /etc/hosts to reflect the following:

127.0.0.1 localhost.localdomain localhost
X.X.X.X your_domain.com BELVEDERE
Ok the problem is that, the static (public) IP changes, we are using a DSL connection in the office, and this server resides in the office. All the content served by Apache and the FTP server is only local, which is fine, but I need to be able to send email externally, for obvious reasons. So, locally in the office we simply type: http://192.168.0.200/myfolder/ for Apache/Web Server content, and the same idea for FTP, which works.

So, as a result I have no DNS (domain) configured, BIND is running, but not setup at all.
So, when you say:

127.0.0.1 localhost.localdomain localhost
X.X.X.X your_domain.com BELVEDERE

What do I put in X.X.X.X if my ip changes. Also, what is the meaning of localhost.localdomain? Is that correct? That is probably enough questions for one post.

Thank you greatly for your assistance, I truely appreciate it greatly.
 
Old 03-16-2007, 12:07 AM   #39
recursio
LQ Newbie
 
Registered: Mar 2007
Posts: 6

Rep: Reputation: 0
you can add a range of IP addresses with a single command in the /etc/mail/access file

198.168.0 RELAY

would allow 198.168.0.x to relay, where x is any decimal integer from 0 to 255 inclusive.

This will allow you to send email to your local network, but the question is how to configure sendmail to relay email on DHCP. If you know the possible range of IPs that you could be assigned, then you could add that to the /etc/mail/access file

28 RELAY

would allow 28.x.x.x to relay

Do you have router as a gateway to your dsl connection, and is it configured to DHCP? I would definitely include the 198.168.0.200 in the access relay list, although it may work without it, something to try ...

I would goto a site like http://whatismyipaddress.com/ and determine what you IP is now. Then do a whois lookup to find out the range of ips that your carrier owns, or you might call then and ask for the range that you could be assigned. On a linux box, goto the command line and type whois followed by the ip address and then hit enter, it gives way better results than from most web pages that I've seen.

Once you have your access file setup with the local and external ranges, create a text file in your /root directory called sendstuff and while logged in as root type the following to test your sendmail, first start your sendmail service

/etc/init.d/sendmail start

then type this to send an email from the command line

sendmail -v recursio@gmail.com <sendstuff

the -v is for verbose mode, and will show you the transcript of the message as it is sent, and any error messages that you might be getting.

then don't forget to stop your sendmail service, you need to seriously figure out how to require authentication first before you let it run for hours unattended, otherwise spammers will eventually take advantage of your smtp server ... Your IP will likely stay the same, when it's lease is up the typically reassign the same IP. Your IP will most likely change to a new IP if you reset your DSL connection by cycling the power on your DSL modem.

/etc/init.d/sendmail stop
 
Old 03-19-2007, 12:23 PM   #40
JustinK101
Member
 
Registered: Jan 2007
Posts: 55

Original Poster
Rep: Reputation: 15
Thanks for the help, but still getting the email bounced back to the server. Do you have to have DNS setup on a server to be able to send email? Cant you just send email from an IP address? Also, its interesting that is says the name server is 127.0.0.1, is this normal? Shouldnt it have my ISP's DNS server there, so it can route? Thanks for the help, once again.

The original message was received at Mon, 19 Mar 2007 10:19:27 -0700
from localhost [127.0.0.1]

----- The following addresses had permanent fatal errors -----
<jkeller@myrealdomaingoeshere.com>
(reason: 550 Host unknown)

----- Transcript of session follows -----
550 5.1.2 <jkeller@myrealdomaingoeshere.com>... Host unknown (Name server: 127.0.0.1: host not found)

[-- Attachment #2 --]
[-- Type: message/delivery-status, Encoding: 7bit, Size: 0.3K --]

Reporting-MTA: dns; localhost.localdomain
Received-From-MTA: DNS; localhost
Arrival-Date: Mon, 19 Mar 2007 10:19:27 -0700

Last edited by JustinK101; 03-19-2007 at 12:24 PM.
 
Old 03-20-2007, 01:12 PM   #41
recursio
LQ Newbie
 
Registered: Mar 2007
Posts: 6

Rep: Reputation: 0
Setting up DNS on the server is not required to send email. If all of the lookups are in the hosts file, then DNS is not needed.

When a DNS lookup is required, the /etc/host.conf file shows where to look and the order of DNS searches.

order hosts,bind

hosts is simply the /etc/hosts file.
bind is the name server, if your are running DNS then it looks to your server, else it goes to the name server located in the /etc/resolv.conf file.

change the line in /etc/resolv.conf

nameserver 127.0.0.1

to point the name server's IP provided by your IPS.

also when running your mailq, the messages are stuck in the mailq and will be deleted after four days.

to run the mailq from the command line and keep for twenty days

sendmail -v -q -OQueueTimeout=20d
 
Old 03-21-2007, 11:31 AM   #42
JustinK101
Member
 
Registered: Jan 2007
Posts: 55

Original Poster
Rep: Reputation: 15
Contents /etc/resolv.conf file.

Quote:
nameserver 68.94.156.1
nameserver 68.94.157.1
nameserver 192.168.0.1
The top two ipaddresses are my ISP's dns servers, so that is already configured.
 
Old 03-29-2007, 05:21 PM   #43
wpn146
Member
 
Registered: Jan 2005
Distribution: Solaris, Linux Fedora Core 6
Posts: 170

Rep: Reputation: 30
I have seen at least three correct answers here. What you need is a one-line change in your /etc/mail/sendmail.mc file:
Code:
define(`SMART_HOST',`<YourSmtpProvider.com>')dnl
and follow the instructions given at the top of the file.
 
Old 03-30-2007, 12:21 AM   #44
JustinK101
Member
 
Registered: Jan 2007
Posts: 55

Original Poster
Rep: Reputation: 15
Yeah the smart host was close to the fix, also had to add the SMTP Authen information into a new file, I followed a guide on the internet which walked me through the entire thing. Thanks guys!
 
  


Reply

Tags
email, sendmail, sendmailmc, smarthost, smtp


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
sendmail stopped sending....sitting in queue caykroyd Linux - Server 6 09-01-2006 12:56 PM
problem with sendmail over ppp - message queue stuck julot Slackware 1 07-17-2006 04:44 AM
Sendmail sending dubious messages rotsky Linux - Security 1 05-16-2006 05:52 PM
sendmail: stat=Deferred: Connection timed out with email.mydomain.com intranet_man Linux - Software 1 07-19-2005 11:04 AM
sendmail Deferred: Connection refused by localhost.localdomain. 360 Linux - Software 6 03-31-2003 01:07 PM


All times are GMT -5. The time now is 10:07 AM.

Main Menu
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