Removed. Somebody else already posted my suggestion...
|
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.
|
what does cat /etc/mail/access display
need to add your public ip as a relay |
Quote:
# 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? |
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 |
Quote:
Quote:
Quote:
NETWORKING=yes HOSTNAME=BELVEDERE Quote:
# Do not remove the following line, or various programs # that require network functionality will fail. 127.0.0.1 BELVEDERE localhost localhost.localdomain Quote:
order hosts,bind |
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:
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. |
Quote:
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. |
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 |
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 |
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 |
Contents /etc/resolv.conf file.
Quote:
|
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 |
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!
|
All times are GMT -5. The time now is 10:47 PM. |