how do I receive internet mail on my local box using sendmail and no-ip.com?

jdini76

Platinum Member
Mar 16, 2001
2,468
0
0
Ok,

I can send but can't receive. I am using RH 7.2 and have a dsl connection through verizon. It is a dynamic IP but I am able to resolve it buy using the website www.no-ip.com. If you aren't familiar with this site its pretty cool. They give you a program to install that sends your current IP to the website so it is like having a static ip. it will resolve it to a hostname. anyway I use this service and it allows me to run my own webserver on my machine, but it will not allow me to receive mail. I don"t know if it is a setting i have or if it is this setup that is not allowing me to do. I think i have the correct ports enabled on my router and Sendmail came installed on redhat so i know its running. Could sombody give me a step by step procedure to get it up and running so i can receive mail from the internet?


Any help would be appreciated!

Thanks
 

stirling

Member
Oct 29, 2001
127
0
0
The short answer is sendmail doesn't receive mail, it transfers it.
What are you trying to do, exactly. If you just want to get your mail from your ISP via POP or IMAP, have a look at fetchmail, mutt, pine or any number of other MUAs.
If you want to be the MX for a FQDN, then that's more than I care to get into, but I'm sure there are plenty of how-to's.

[edit:] I see that I can get into it after all. It's basically dependent on the no-ip service, whether or not they make an MX record to point to your IP.
 

jdini76

Platinum Member
Mar 16, 2001
2,468
0
0
When I said any help would be appreciated I guess I was wrong, because that sucked!

I see that I can get into it after all. It's basically dependent on the no-ip service, whether or not they make an MX record to point to your IP.

They can't do that because my IP is dynamic. But There has to be a way to configure this so i can use my home server to be my main form of e-mail. Anybody? Anybody?
 

jdini76

Platinum Member
Mar 16, 2001
2,468
0
0
I would get a static IP, if at all possible, for starters!

I don't believe that is necessary. For one, if you have the IP addrees resolving to a hostname, the ip can change when ever it wants. for instance I want to send an e-mail to me@mydomain.com. mydomain.com is going to resolve to a dns server. Within that dns server the domain resolves to an ip address, then the mail gets sent to that IP address. that IP address can change everyday as long as the domain can resolve it to a hostname.

Correct me if I am wrong.

I know this is an unusual situation. That is why I am posting here. I know there are a lot of smart people that can help me figure this out.


 

thornc

Golden Member
Nov 29, 2000
1,011
0
0
From the Fetchmail man page


<< fetchmail is a mail-retrieval and forwarding utility; it fetches mail from remote mailservers and forwards it to
your local (client) machine's delivery system.
>>



So sterling give you the answer you needed....
 

stirling

Member
Oct 29, 2001
127
0
0


<< When I said any help would be appreciated I guess I was wrong, because that sucked! >>



And I've tried so hard to play nice...
Don't blame me, blame the DNS system.
Better yet, blame yourself for not understanding it.
 

EmperorRob

Senior member
Mar 12, 2001
968
0
0
Why are you worried about a dynamic IP?

If it bothers you so much you can use an awk or sed script to grab it from the output of ifconfig on startup.
 

jdini76

Platinum Member
Mar 16, 2001
2,468
0
0
And I've tried so hard to play nice...
Don't blame me, blame the DNS system.
Better yet, blame yourself for not understanding it.

Stirling, I have to apologize for my little outburst. I was frustrated. As a matter of fact I do blame myself for not understanding. I went to the no-ip website to see if they had any DNS options and...what do you know...they do. now its a matter of figuring them out. but i am now confident that i can do it.


<< fetchmail is a mail-retrieval and forwarding utility; it fetches mail from remote mailservers and forwards it to
your local (client) machine's delivery system. >>


What id your machine is the "remote mail server"? and want to receive mail?
 

FUBAR

Senior member
Oct 11, 1999
618
0
0
Dude... ignore all that other crap, from their answers I doubt they understand your question. If you're trying to do what I think you are (which is what I am doing), this is what you need to do... and btw, sendmail does receive mail.

What I do is have a whatevr.dyndns.org name and then be able to receive mail for whoever@whatever.dyndns.org. Sendmail is configured by default to reject mail coming from anyone else than your local host (which is useful for a standalone box so you can get mail to root and local users from teh system) so you have to disable that security feature.

Go into the /etc/mail/sendmail.mc file and find the line that looks like so:
DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')

put a "dnl" at the beginning of it, no quotes, like the comments above it.

you may also want to uncomment the line that says
FEATURE(`accept_unresolvable_domains')

Save the file and copy the command line in the header:
m4 /etc/mail/sendmail.mc > /etc/sendmail.cf
and run that. then restart sendmail:
/etc/init.d/sendmail restart
or do a stop and start

It's all good to go. there's other stuff like making sure that your host/domain is correct so outgoing mail will come back to you, but I'm guessing you have that correct. If you're worried about creating an open relay, there's an access file that says who you're accepting mail from to go to anyone but localhost. Default is denied unless you have it otherwise specified.

Good luck, and have fun
 

jdini76

Platinum Member
Mar 16, 2001
2,468
0
0
You the man FUBAR!

Thanks I will try that setup. If I have any other questions can I PM you?
 

BIGGDOG

Golden Member
Apr 4, 2000
1,400
0
71
jdini76
Wht PM him when others might want to learn this as well. I would love to see how this works and what problems arise from this.

If ofcousre you do not mind.
 

jdini76

Platinum Member
Mar 16, 2001
2,468
0
0
Of Course I don't mind. and I will always post here first. But I can't be possitive that he will continue to check this thread. So, I was just asking him if I could PM him if I don't hear anything in the thread.
 

FUBAR

Senior member
Oct 11, 1999
618
0
0
ACtually... I would be all up for taht but this weekend I am going to be out in BFE... so this is the way to go.. Actually... I may not be in at all tomorrow... but we'll see...

Give er a go and see what happens. Get yourself a hotmail or a yahoo or use your ISP mail and send yourself some tests... best way to check it. I'm sure somebody else here can pick it up if I don't respond, I am by no means the expert here... n0c? Nothin? anybody?...

I'll do what I can tho... post your results, cuz YMMV
 

FUBAR

Senior member
Oct 11, 1999
618
0
0
Oh yeah, I don't know if it matters, but I think it does... make sure your hostname is whatever where your FQDN is whatever.noip.com and that your domain is noip.com... assuming that those names are appropriate.

Reason relates to the open relay, if your FQDN is butt.monkey.com your box will only accept mail for user@butt.monkey.com and reject mail to all others.
 

Netopia

Diamond Member
Oct 9, 1999
4,793
4
81


<< this weekend I am going to be out in BFE... >>



LOL... there's a term I haven't heard in a while. Been in the military or perhaps active?

Joe
 

FUBAR

Senior member
Oct 11, 1999
618
0
0
Nope, just that's where come from originally... you hear it a lot when you live there...
 

jdini76

Platinum Member
Mar 16, 2001
2,468
0
0
The Saga continues...

FUBAR I did what you suggested with the sendmail.mc. and all looks good so far. but, I have managed to totaly confuse myself when it comes to hostnames and FQDN.

currently my mailserver/webserver is named Optimus

I have registered my own domainname, it is joe-shmoe.com. I have it resolving to DNS NS1.MYDOMAIN.COM NS2, NS#,NS4 at www.mydomain.com (this is a real website not an example). At mydomain.com i have it redirecting to joe-shmoe.no-ip.com, and from there it goes to the ip address to my router. and from there to the server. (WOW what a setup)

At no-ip.com in order to have mail sent to your mailserver you have to Specify a mail server that will handle mail for this hostname or domain. but i am confused on what to put in there. they allow three servers. right now i have:

optimus.joe-shmoe.com
joe-shmoe.com
joe-shmoe.no-ip.com

I am assuming these are not the correct names i am supposed to be putting there because i am not receiving any mail.

What am I missing..Anybody?

thanks
 

jdini76

Platinum Member
Mar 16, 2001
2,468
0
0
Ok guys, I am chiseling away at it. I sent an e-mail to no-ip.com and got a very quick response. They said I would need to use "joe-shmoe.no-ip.com" as my hostname to put in the external mail exchanger area (duh, makes sense).

He also gave me another bit of information that is usefull. He said that verizon is known to block server ports. I kind of new this because I had to change the port my web server listens to in order to host my web page. If it is true that they block SMTP ports, I wonder if it would be possible to tell the server to listen on a different SMTP port. I would need to know all the files I would have to edit on my server in order to get my server to listen for SMTP on a different port. I have an idea on how to get it to send to that port just need to make sure my server is listening.

bottem line...can anybody let me know which files contain port info on my box?


By the way when sending test messages i am now receiving mnessages in response read below for the message.

Message from yahoo.com.
Unable to deliver message to the following address(es).

<joe@joe-shmoe.com>:
216.148.213.135 does not like recipient.
Remote host said: 550 <joe@joe-shmoe.com>: User unknown
Giving up on 216.148.213.135.

i don't know if that ip address is the verizon gateway or no-ip.com's gateway. I know its not my current Ip address (or a past IP) so its not reaching my server. has anybody else seen this message and know what it means?
:)
 

stirling

Member
Oct 29, 2001
127
0
0
To post or not to post...
Apology accepted....................[OK]
Resuming nice mode..................[OK]

1. Of course sendmail receives mail. But it doesn't fetch it from your ISP, which is what I meant by "receive"
2. So you've added an MX record at no-ip.com. What a great idea. (It's in their faq, btw)
3. "that ip address" is a dns server for mydomain.com
4. As far as I can tell, you should be able to email joe@joe-schmoe.no-ip.com (if you've created local user joe and you've set up sendmail to accept for joe-schmoe.no-ip.com) Anyway, try this first before delving into domain redirection.
5. Delve into domain redirection. Add an MX record at mydomain.com that points to joe-schmoe.no-ip.com.
(IN MX 10 joe-schmoe.no-ip.com)
6. Configure sendmail to accept for joe-schmoe.com and fire off a test email to joe@joe-schmoe.com

Of course, all this hinges on whether or not I I spew crap that should be ignored.
 

EmperorRob

Senior member
Mar 12, 2001
968
0
0


<< currently my mailserver/webserver is named Optimus >>

You can not name your server Optimus, b/c I have already named MY Machine Optimus. That will break the internet and it will be your fault.
 

FUBAR

Senior member
Oct 11, 1999
618
0
0
I think your box is mainly fine, with one exception, I don't think that your machine will accept mail for anyone but optimus.localdomain assuming that you have not reset your domainname. You should probaby set your machine to be <something>.no-ip.com and then add aliases for optimus or vice versa.

There seems to be something hosed up with your dns resolution as well... check this, and yes, the tabs will suck

[pgienger@phoebus ~]$ dig joe-shmoe.com mx

; <<>> DiG 9.1.3 <<>> joe-shmoe.com mx
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 44130
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 4, ADDITIONAL: 6

;; QUESTION SECTION:
;joe-shmoe.com. IN MX

;; ANSWER SECTION:
joe-shmoe.com. 300 IN MX 0 m.dnsix.com.
joe-shmoe.com. 300 IN MX 0 m1.dnsix.com.

;; AUTHORITY SECTION:
joe-shmoe.com. 3600 IN NS ns1.mydomain.com.
joe-shmoe.com. 3600 IN NS ns2.mydomain.com.
joe-shmoe.com. 3600 IN NS ns3.mydomain.com.
joe-shmoe.com. 3600 IN NS ns4.mydomain.com.

;; ADDITIONAL SECTION:
m.dnsix.com. 300 IN A 216.148.213.135
m1.dnsix.com. 300 IN A 216.148.213.135
ns1.mydomain.com. 300 IN A 216.148.213.141
ns2.mydomain.com. 300 IN A 216.148.221.142
ns3.mydomain.com. 300 IN A 216.148.213.143
ns4.mydomain.com. 300 IN A 216.148.221.144

;; Query time: 227 msec
;; SERVER: 24.116.0.81#53(24.116.0.81)
;; WHEN: Sun Mar 3 20:54:30 2002
;; MSG SIZE rcvd: 251

>> --- END --- <<
This is the output from a dig on your domain, asking who does the mail for it. Your dns info is clearly saying here that this m and m1.dnsix.com are going to accept the mail for your domain, and one of those 2 boxes is what that IP you listed resolves to. Clear that up before you worry about ports.

On changing the ports tho, I dont know if that's going to work that well. Mail servers around the world are set up to send mail to port 25, there's no way (AFAIK) to advertise that you will now be accepting mail on some other port. Kind of like your browser looks at port 80 by default. Any other ports have to be specified to your browser.

Work on the dns and we'll go from there...

EmperorRob, I hope you're laying it on thick there...
 

jdini76

Platinum Member
Mar 16, 2001
2,468
0
0
SUCCESS!!!!

Thanks for the info Fubar. With the help of you and Stirling I am now able to host my own mailserver. Stirling you were right. the mail was getting stuck at mydomain.com and I had to set up the mail forwarding to go to no-ip.com. and at no-ip.com I had to put joe-shmoe.no-ip.com as the hostname to send mail to. And of couse edit the sendmail.mc but i did that already. Anyway it was a doozie but we did it and i thank all that helped.

Now all I have to do is make sure my internet stays connected. but now if it goes down i know how to redirect the mail. hehe