LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (http://www.linuxquestions.org/questions/linux-software-2/)
-   -   hostname/domainname/postfix setup with dynamic DNS from no-ip (http://www.linuxquestions.org/questions/linux-software-2/hostname-domainname-postfix-setup-with-dynamic-dns-from-no-ip-93270/)

tesauce98 09-16-2003 12:12 AM

hostname/domainname/postfix setup with dynamic DNS from no-ip
 
Hey everyone, I'm generally new to Linux, although I can hold my own pretty well. I'm a little confused as far as hostname and domainname works.
Right now i'm just default localhost with no domain. I do however, have a dynamic DNS from no-ip.com as in (myname.servehttp.com points to my IP address). I have not setup this dynamic DNS on my linux box yet (localhost). I have a web and ftp server running and they work fine. But now i'm trying to get postfix working purely for sending e-mails generated from my web pages through a local SMTP server.
I've done the basic install of that, which works to a degree. I have noticed that I can't send mail to my personal e-mail (through my cable service provider, OptimumOnline), nor AOL accounts.

My info log under /var/log/mail/info states this message when sending to my personal e-mail (optonline):
Sep 15 23:46:27 localhost postfix/smtp[11661]: AA262185E0: to=<myemail@optonline.net>, relay=mx1.optonline.net[167.206.5.6], delay=1, status=bounced (host mx1.optonline.net[167.206.5.6] said: 550 5.1.8 invalid/host-not-in-DNS return address not allowed (in reply to MAIL FROM command))

And my e-mails to AOL accounts say:
Sep 16 00:41:03 localhost postfix/smtp[12167]: connect to mailin-02.mx.aol.com[64.12.136.89]: server refused mail service (port 25)

I can however receive e-mail to my yahoo account. Can anyone help me configure whatever hostname/domainname i need setup on the linux box itself, and what to fix in my main.cf so postfix will send e-mails to any address??

Also, whenever i start or stop postfix, i get this error message:
postfix: warning: My hostname localhost is not a fully qualified name - set myhostname or mydomain in /etc/postfix/main.cf
postsuper: warning: My hostname localhost is not a fully qualified name - set myhostname or mydomain in /etc/postfix/main.cf
postfix/postfix-script: warning: My hostname localhost is not a fully qualified name - set myhostname or mydomain in /etc/postfix/main.cf

which i believe is caused by the fact that i didn't declare $myhostname or $mydomain in main.cf because I wasn't sure what to use.

Thanks in advance.

MasterC 09-16-2003 05:57 PM

For fun, post up either your postfix/main.cf OR the result of typing (as root):
postconf

Afterwards though, go ahead and setup the hostname and domain name variables in the main.cf

To find your system's hostname (if one exists), type:
hostname

The domain name should be the FQDN you have:
tesauce.no-ip.org

So, the:
$myhostname = fastpc.tesauce.no-ip.org

And the:
mydomain = tesauce.no-ip.org

HTH

Cool

tesauce98 09-16-2003 07:22 PM

ok, well i edited /etc/hosts to be:
127.0.0.1 localhost.localdomain localhost
192.168.0.105 venom.tesauce.servehttp.com venom

(tesauce.servehttp.com is my dynamic DNS name from no-ip.com that points to my cable modems IP)
based upon reading another topic. the 192.168 address is my servers IP address that is assigned by my router. after restarting, i noticed my login now says "root@venom" instead of "root@localhost", which i guess is a step in the right direction.

i also changed the myhostname and mydomain in main.cf to be:
mydomain = tesauce.servehttp.com
myhostname = venom.tesauce.servehttp.com
(info taken from postconf -n)

i then restarted everything, and tried resending mail through the SMTP to my optonline, but i never got it and saw the same error message in /var/log/mail/info:

Sep 16 20:04:19 venom postfix/smtp[2709]: 7D42A185F9: to=<thesauce@optonline.net>, relay=mx1.optonline.net[167.206.5.6], delay=0, status=bounced (host mx1.optonline.net[167.206.5.6] said: 550 5.1.8 invalid/host-not-in-DNS return address not allowed (in reply to MAIL FROM command))
Sep 16 20:04:19 venom postfix/cleanup[2708]: E4B92185F8: message-id=<20030917000419.E4B92185F8@venom.thesauce.servehttp.com>
Sep 16 20:04:19 venom postfix/nqmgr[1559]: E4B92185F8: from=<>, size=2459, nrcpt=1 (queue active)
Sep 16 20:04:19 venom postfix/local[2711]: E4B92185F8: to=<apache@venom.thesauce.servehttp.com>, relay=local, delay=0, status=sent ("|/usr/bin/procmail -Y -a $DOMAIN")

i noticed that sender changed from "apache@loaclhost.localdomain" to "apache@venom.tesauce.servehttp.com" I'm not sure where its getting that apache user from (maybe because the e-mail is generated by he php and apache webserver, under user apache).

i seemed to make some leeway, but i'm still not able to send mail to my optonline account. thanks for helpin me out masterc, i've read a lot of ur other posts about postfix and u seem to be the man to talk to.

MasterC 09-16-2003 09:02 PM

You are correct, in your php.ini OR in your httpd.conf file you'll see the settings for adjusting who sends email, depending on where the script is getting it's info.

As for it's rejection notice, send the email to me ( masterc@masterc.no-ip.org ), or check:
http://www.zoneedit.com/smtp.html
And see if there are any problems with the initiating of the messages. If not... I'm afraid to say that you might just be 'SOL' because the server you are trying to communicate with doesn't want to communicate with you for possible reasons outside your control, like:
Your domain is not an "official" domain (not likely);
Your DNS server is your ISP's, they notice the message is looking like it's coming from them, but it's not so they reject it it (for relay rejection, good thing, possible);
Your servehttp.com hasn't become active yet in all DNS's (possibly), and it may never in certain ones (not likely)

But we'll find out a bit more when you try to email me, because then we'll have logs on both sides of the transaction to see what's going on.

Cool

tesauce98 09-16-2003 09:58 PM

well that zoneedit thing won't work because i have port 25 incoming blocked, because when i ran a windows server, i had about 500 spam messages a day passed through and sent by my SMTP server, but thats not the problem, cuz i know the server sends mail when if it can.

i will however try sending an e-mail to you, so u can see about it. i can understand AOL people not getting my e-mail because they're very strict about what mail gets to their users for SPAM sake. but my major problem is sending mail to my optonline account:

Sep 15 23:46:27 localhost postfix/smtp[11661]: AA262185E0: to=<tesauce@optonline.net>, relay=mx1.optonline.net[167.206.5.6], delay=1, status=bounced (host mx1.optonline.net[167.206.5.6] said: 550 5.1.8 invalid/host-not-in-DNS return address not allowed (in reply to MAIL FROM command))

btw, when u get the e-mail, u'll notice that my name is actually thesauce98, i made a typo while registering for this site but for arguments sake, i changed all my entries to tesauce98 :D

MasterC 09-16-2003 10:52 PM

he he he, yeah I got it :)

Which pretty much says "stuff is setup good" on your end.

Code:

Sep 16 20:01:29 [postfix/smtpd] connect from ool-44c628f0.dyn.optonline.net[68.1
98.40.240]
Sep 16 20:01:29 [postfix/smtpd] A53E6C913: client=ool-44c628f0.dyn.optonline.net
[68.198.40.240]
Sep 16 20:01:29 [postfix/cleanup] A53E6C913: message-id=<20030917030111.427D9185
FE@venom.thesauce.servehttp.com>
Sep 16 20:01:29 [postfix/qmgr] A53E6C913: from=<apache@venom.thesauce.servehttp.
com>, size=782, nrcpt=1 (queue active)
Sep 16 20:01:29 [postfix/smtpd] disconnect from ool-44c628f0.dyn.optonline.net[6
8.198.40.240]
Sep 16 20:01:29 [postfix/local] A53E6C913: to=<masterc@masterc.no-ip.org>, relay
=local, delay=0, status=sent (maildir)

As a few other ideas, let's see...
This, doesn't look right:
apache@venom.thesauce.servehttp.com
So, let's check a few settings:
As root type:
hostname
And make sure it matches the above (venom), next, make sure your IP is pointing to:
thesauce.servehttp.com
And not something else, also, setup to use wildcards with that.

What we need to do is get things setup so your ISP will accept the email from you, that's where it's falling short, since obviously you can send mail elsewhere. To do that, we need to make sure you have a valid FQDN, which you should as long as it's been registered properly (which the noip ones seem to be instant with, so that should be done). But, like I said above, maybe you'll need to wait for your ISP to update their DNS servers as well.

Can you post up your full postfix/main.cf as well as masterc.cf so we can take a look at them? Feel free to remove any sensitive info, simply let us know what you removed and what you changed it to (obviously not the actual data :D ).

Cool

tesauce98 09-16-2003 11:43 PM

omg! i received mail to my optonline account!!

i logged into my no-ip account page, and allowed wildcards (like u said). i also noticed a box for MX records, so i added venom.thesauce.servehttp.com under there as priority 5. i don't know which one made it work, but it did.

i still can't send to AOL accounts though, but maybe i'll never be allowed to. i could have sworn that my windows SMTP server was able to send to AOL accounts. so i'm not sure why i wouldn't be able to know. here is the results of postconf -n (main.cf is quite large, and i'm tryin to get some sleep here!)

alias_database = hash:/etc/postfix/aliases
alias_maps = hash:/etc/postfix/aliases
command_directory = /usr/sbin
config_directory = /etc/postfix
daemon_directory = /usr/lib/postfix
debug_peer_level = 2
delay_warning_time = 4
inet_interfaces = localhost
mail_owner = postfix
mail_spool_directory = /var/spool/mail
mailbox_command = /usr/bin/procmail -Y -a $DOMAIN
mailq_path = /usr/bin/mailq.postfix
manpage_directory = /usr/share/man
mydestination = $myhostname, localhost.$mydomain
mydomain = tesauce.servehttp.com
myhostname = venom.tesauce.servehttp.com
myorigin = $myhostname
newaliases_path = /usr/bin/newaliases.postfix
queue_directory = /var/spool/postfix
readme_directory = /usr/share/doc/postfix-2.0.6/README_FILES
sample_directory = /usr/share/doc/postfix-2.0.6/samples
sendmail_path = /usr/sbin/sendmail.postfix
setgid_group = postdrop
smtpd_banner = $myhostname ESMTP $mail_name ($mail_version) (Mandrake Linux)
unknown_local_recipient_reject_code = 450

and here is master.cf:

# ==========================================================================
# service type private unpriv chroot wakeup maxproc command + args
# (yes) (yes) (yes) (never) (100)
# ==========================================================================
smtp inet n - y - - smtpd
#smtps inet n - n - - smtpd
# -o smtpd_tls_wrappermode=yes -o smtpd_sasl_auth_enable=yes
#submission inet n - n - - smtpd
# -o smtpd_enforce_tls=yes -o smtpd_sasl_auth_enable=yes
#628 inet n - n - - qmqpd
pickup fifo n - y 60 1 pickup
cleanup unix n - y - 0 cleanup
#qmgr fifo n - n 300 1 qmgr
qmgr fifo n - y 300 1 nqmgr
#tlsmgr fifo - - n 300 1 tlsmgr
rewrite unix - - y - - trivial-rewrite
bounce unix - - y - 0 bounce
defer unix - - y - 0 bounce
flush unix n - y 1000? 0 flush
proxymap unix - - n - - proxymap
smtp unix - - y - - smtp
relay unix - - y - - smtp
# -o smtp_helo_timeout=5 -o smtp_connect_timeout=5
showq unix n - y - - showq
error unix - - y - - error
local unix - n n - - local
virtual unix - n y - - virtual
lmtp unix - - y - - lmtp
#
# Interfaces to non-Postfix software. Be sure to examine the manual
# pages of the non-Postfix software to find out what options it wants.
#
# maildrop. See the Postfix MAILDROP_README file for details.
#
maildrop unix - n n - - pipe
flags=DRhu user=vmail argv=/usr/local/bin/maildrop -d ${recipient}
#
# The Cyrus deliver program has changed incompatibly, multiple times.
#
old-cyrus unix - n n - - pipe
flags=R user=cyrus argv=/cyrus/bin/deliver -e -m ${extension} ${user}
# Cyrus 2.1.5 (Amos Gouaux)
cyrus unix - n n - - pipe
user=cyrus argv=/cyrus/bin/deliver -e -r ${sender} -m ${extension} ${user}
uucp unix - n n - - pipe
flags=Fqhu user=uucp argv=uux -r -n -z -a$sender - $nexthop!rmail ($recipient)
ifmail unix - n n - - pipe
flags=F user=ftn argv=/usr/lib/ifmail/ifmail -r $nexthop ($recipient)
bsmtp unix - n n - - pipe
flags=Fq. user=foo argv=/usr/local/sbin/bsmtp -f $sender $nexthop $recipient

and just for reference, this is what the AOL error looks like:
Sep 17 00:30:05 venom postfix/smtp[5428]: connect to mailin-03.mx.aol.com[64.12.138.120]: server refused mail service (port 25)
Sep 17 00:30:05 venom postfix/smtp[5428]: C705E185FD: to=<aoluser@aol.com>, relay=none, delay=846, status=deferred (connect to mailin-03.mx.aol.com[64.12.138.120]: server refused mail service)

thanks for making it work to this extent!

MasterC 09-17-2003 12:12 AM

Well, everything there looks good to me, hold out and see if anyone has any other suggestions, but I think you are pretty much 'good to go' on everything but AOL, and I don't think there's anything you can do in your conf's to fix that.

I don't know why you'd have been able to before, but maybe it had something to do with how the server relayed mail. It possibly relayed through your ISP's mail server instead of acting as it's own, making the emails appear to come from your ISP instead of you.

HTH

Cool

tesauce98 09-17-2003 10:45 AM

yea, i can't really remember how i had the windows server setup, maybe i did push the mail through my ISP server instead ... however, lets say i wanted to do that instead, how would i go about doing that? (just in case i decided that i need to send mail to AOL members)

btw, thanks for all your help so far :D

MasterC 09-17-2003 11:32 AM

Since I've never attempted such a beast, I think the route to go is:
relayhost

Where I'd go with something like:
relayhost = 1.2.3.4

Rather than anything else you might think of, to get that, ping your ISP's outgoing mail server (you should have that info to setup your mail client to send email).

That'd my SWAG :D

Scientific Wild Azz Guess. ;)

Cool

tesauce98 09-17-2003 01:01 PM

haha, it seems ur SWAG was right!
i haven't confirmed yet, but i believe my mail to AOL users have gone through.

i added the relayhost = my ISP mail server
then i did a "postfix flush"
and now my mailq seems to be empty!

i assume it worked, but i'll have to get final confirmation from the people it e-mailed and make sure they got the e-mails.

thanks for your help MasterC!! :cool:
if i get anymore problems, i'll reply more


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