[SOLVED] mail server help

Installing, Configuring, Troubleshooting server daemons such as Web and Mail
lohmeyer
Posts: 7
Joined: 2011/04/01 10:46:20

[SOLVED] mail server help

Post by lohmeyer » 2011/04/01 11:03:07

Hello! I'm a newbie in linux but I manage to setup my server just fine by following this tutorial:
http://www.howtoforge.com/perfect-server-centos-5.5-x86_64-ispconfig-2
(although i changed some settings)

anyway, my problem concerns about my mail server (im using POSTFIX and DOVECOT)
I can send emails from mail server ex. from mymail@mydomain.com to mymail@gmail.com...
but i cant seem to receive from the outside email ex. from mymail@gmail.com to mymail@mydomain.com

what seems to be the problem?
i dont really know where to get the log files so i cant put anymore info here...sorry im still a newbie at linux

thx

User avatar
TrevorH
Forum Moderator
Posts: 23204
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

[SOLVED] mail server help

Post by TrevorH » 2011/04/01 11:22:15

If you run

[code]
dig mx mydomain.com
[/code]

does it correctly display the MX records for your domain pointing to the addresses of your SMTP server?

lohmeyer
Posts: 7
Joined: 2011/04/01 10:46:20

Re: mail server help

Post by lohmeyer » 2011/04/01 11:52:56

here it goes... i used xname for my ns btw... i dont quite know yet how to properly set by own dns server
i noticed the third line on the bottom has a local server ip.. is that ok?

dig mx mydomain.com

; > DiG 9.3.6-P1-RedHat-9.3.6-4.P1.el5_5.3 > mx mydomain.com
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 3698
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 3, ADDITIONAL: 2

;; QUESTION SECTION:
;mydomain.com. IN MX

;; ANSWER SECTION:
mydomain.com. 86400 IN MX 10 mydomain.com.

;; AUTHORITY SECTION:
mydomain.com. 63134 IN NS ns1.xname.org.
mydomain.com. 63134 IN NS ns2.xname.org.
mydomain.com. 63134 IN NS ns0.xname.org.

;; ADDITIONAL SECTION:
mydomain.com. 11208 IN A 999.999.999.999
ns1.xname.org. 395 IN A 87.98.164.164

;; Query time: 355 msec
;; SERVER: 192.168.254.254#53(192.168.254.254)
;; WHEN: Sat Apr 2 03:38:14 2011
;; MSG SIZE rcvd: 148

User avatar
TrevorH
Forum Moderator
Posts: 23204
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: mail server help

Post by TrevorH » 2011/04/01 12:20:21

Can you use telnet to get to port 25 from outside? e.g.

[code]
telnet mydomain.com 25
[/code]

lohmeyer
Posts: 7
Joined: 2011/04/01 10:46:20

Re: mail server help

Post by lohmeyer » 2011/04/04 02:07:41

sorry late reply... weekend..

anwyay..heres it is..
# telnet mydomain.com 25
Trying 999.999.999.999...
Connected to mydomain.com (999.999.999.999).
Escape character is '^]'.
220 localhost.localdomain ESMTP Postfix
421 4.4.2 localhost.localdomain Error: timeout exceeded
Connection closed by foreign host.

mhh... it says localhost.. is that the problem?
i also noticed in the "Security Level and Firewall", under the "Trusted Services" that Telnet was not checked, not trusted.. is that ok?

User avatar
TrevorH
Forum Moderator
Posts: 23204
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: mail server help

Post by TrevorH » 2011/04/04 11:48:11

[code]
i also noticed in the "Security Level and Firewall", under the "Trusted Services" that Telnet was not checked, not trusted.. is that ok?
[/code]

Yes, you do not want to enable that. Although that experiment used telnet, it was using port 25 to test SMTP connectivity not using the telnet port (23) to gain remote access.

Do you have any error messages in your mail logs - /var/log/maillog?

lohmeyer
Posts: 7
Joined: 2011/04/01 10:46:20

Re: mail server help

Post by lohmeyer » 2011/04/05 02:06:59

well there was quite a few.. theres maillog, maillog.1, maillog.2, maillog.3 and maillog.4..
and each has quite a few errors already.. although i dont really know how the errors would really look like.. i just used find and looked for "error"

Apr 4 22:35:53 localhost postfix/smtp[20992]: 4C3652020083: host m.mx.mail.yahoo.com[66.94.238.147] refused to talk to me: 421 4.7.0 [GL01] Message from (999.999.999.999) temporarily deferred - 4.16.50. Please refer to http://postmaster.yahoo.com/errors/postmaster-21.html

well i can privately send you the maillogs if you like.. so you can see for yourself

edit: btw.. i have webmin installed too.. could there be any configuration there that might cause conflicts?

hansolo
Posts: 231
Joined: 2010/01/13 11:17:42
Location: SI

Re: mail server help

Post by hansolo » 2011/04/05 16:12:30

Hi,

since you are using Postfix and Dovecot I don't know exactly the solution, but
Postfix MUST NOT have [b]localhost.localdomain[/b] set in [b]/etc/postfix/main.cf[/b]
there's a line, which makes your system identify:
[code]
myhostname = servername.domain.net

mydomain = domain.net[/code]

which must be set like it's in the '/etc/sysconfig/network'
HOSTNAME="plain.domainname.com"

[url=http://www.cyberciti.biz/faq/linux-setting-hostname-and-domain-name-of-my-server/]Change Linux Hostname[/url]

good luck.

User avatar
TrevorH
Forum Moderator
Posts: 23204
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: mail server help

Post by TrevorH » 2011/04/05 17:54:39

The error you posted there is to do with an outbound mail that's being rejected by yahoo's servers because they think you are spamming them.

lohmeyer
Posts: 7
Joined: 2011/04/01 10:46:20

Re: mail server help

Post by lohmeyer » 2011/04/06 02:11:50

[quote]
hansolo wrote:
Hi,

since you are using Postfix and Dovecot I don't know exactly the solution, but
Postfix MUST NOT have [b]localhost.localdomain[/b] set in [b]/etc/postfix/main.cf[/b]
there's a line, which makes your system identify:
[code]
myhostname = servername.domain.net

mydomain = domain.net[/code]

which must be set like it's in the '/etc/sysconfig/network'
HOSTNAME="plain.domainname.com"

[url=http://www.cyberciti.biz/faq/linux-setting-hostname-and-domain-name-of-my-server/]Change Linux Hostname[/url]

good luck.[/quote]

if my domain is 'abc.com'

then in [b]/etc/postfix/main.cf[/b] i should put
myhostname = servername.abc.com (btw what do i put in the 'servername'? i think i set it on localhost during installation)
mydomain = abc.com

and then in '/etc/sysconfig/network'
HOSTNAME="servername.abc.com" (im assuming that 'plain' = 'servername', is that correct?)

thanks

Post Reply