trouble connecting to mail server

Hi,

just finished setting up postfix for use with virtual servers (and virtual min), but
i just cant connect to the mail server (no mail is sent or recieved) and i get a "could not connect to host" error from kmail when trying.

I couldnt connect before i set it up for virtual servers either so i dont think that's whats causing the problem :)

Since i'm not getting any clear error message, i'm having trouble locating the problem..

any ideas?

Thanks!
11odsAsked:
Who is Participating?
 
GnsConnect With a Mentor Commented:
Ah!
See this
> Aug 18 15:13:10 debian postfix/smtpd[24627]: fatal: open database /etc/postfix/virtual.dir: No such file or directory
bites you...
Do a
postconf | grep virtual.dir
to get the config in question (maptype etc), then ... create it (probably rather easy:-)...

-- Glenn
0
 
GnsCommented:
Stupid first suggestion... Is the process(es) even started? On a redhatish system you sould do
service postfix status
... and if not running
service postfix start

If you run some other distro, please tell which (and version) and we'll see about checking there:-).
Of course, the command(s)
ps -ef | grep postfix | grep -v grep
will work on any distro (on a commandline prompt:-).

-- Glenn
0
 
11odsAuthor Commented:
Hey Glenn,

you should know better than me what distro i'm running !
(http://www.experts-exchange.com/Operating_Systems/Linux/Q_21093955.html)

but for the record, its a "knoppixy debian" :)

yup postfix is running ....

ps -ef|grep postfix|grep -v grep gives me:

root       511     1  0 10:15 ?        00:00:00 /us
postfix   9150   511  0 11:23 ?        00:00:00 qmg
postfix  15936   511  0 13:03 ?        00:00:00 pic
postfix  16237   511  0 13:08 ?        00:00:00 pro
0
Cloud Class® Course: Ruby Fundamentals

This course will introduce you to Ruby, as well as teach you about classes, methods, variables, data structures, loops, enumerable methods, and finishing touches.

 
GnsCommented:
> you should know better than me what distro i'm running !
Realised it the nano-second after hitting "submit":-). Don't always read from whom a question is;)

> yup postfix is running ....
Ok, looking good...

Can you do
telnet localhost 25
...? (expected is something like "220 your.mail.server ESMTP Postfix ...")

Do you have a firewall on it? check with "iptables -L" etc that you actually allow SMTP at all;-).

-- Glenn
0
 
11odsAuthor Commented:
root@debian:~# telnet localhost 25
Trying 127.0.0.1...
Connected to debian.
Escape character is '^]'.


then it just hangs...


but then again the only option in webmin is "stop postfix" .... so i assume it is running...

hmm
0
 
GnsCommented:
... Ok, when you do the telnet... try doing some SMTP conversation like
oot@debian:~# telnet localhost 25
...
EHLO localhost
<responses (hopefully) from server>
QUIT
... and you should be back to the prompt.
Do you get anything useful in the logs? Look at /var/log/mail/* or perhaps /var/log/mail.* ...

-- Glenn
0
 
GnsCommented:
Oh, and how about the netfilter firewall? Have you enabled any restrictive rules?

-- Glenn
0
 
11odsAuthor Commented:
ok.

talking to postfix on telnet didnt get any response...
just .. hangs.

However,
/var/log/mail/mail.log
is filled with this:

Aug 18 15:12:10 debian postfix/master[511]: warning: /usr/lib/postfix/smtpd: bad command startup -- throttling
Aug 18 15:13:10 debian postfix/smtpd[24627]: warning: dict_nis_init: NIS domain name not set - NIS lookups disabled
Aug 18 15:13:10 debian postfix/smtpd[24627]: fatal: open database /etc/postfix/virtual.dir: No such file or directory
Aug 18 15:13:11 debian postfix/master[511]: warning: process /usr/lib/postfix/smtpd pid 24627 exit status 1
Aug 18 15:13:11 debian postfix/master[511]: warning: /usr/lib/postfix/smtpd: bad command startup -- throttling

no firewall rules ..
0
 
11odsAuthor Commented:
ok fixed that by changing dbm:/etc/postfix/virtual to hash:/etc/postfix/virtual

went back a few steps to telnet and i manged to get a few commands accross and recieve replies..

I think that postfix is able recieving mail from outside domains but something goes wrong in routing them to the correct users.

looking into that now..

0
 
GnsCommented:
> ok fixed that by changing dbm:/etc/postfix/virtual to hash:/etc/postfix/virtual
Ok, you could have kept it as "dbm:etc/postfix/virtual"... I assume you have the plaintext file, in which case you'd just need run
postmap dbm:etc/postfix/virtual
to create the dbm file(s)...
Good thing is that it really speeds up lookups, especialy in larger maps. Bad thing is that you eed run the postmap command whenever you've changed the plaintext file.

-- Glenn
0
 
11odsAuthor Commented:
ok. firstly thanks for all the help again Glenn !
 
turns out it wasnt changing it to hash that fixed the problem afterall,
it was adding a directory labeled the same as the virtualserver i am trying to configure
(in /etc/postfix/mydomain.net)
should anything be in the directory i created?

also, i dont exactly know what plaintext file you're refering too, so I assume i dont have it..

lastly,

root@debian:~# postmap dbm:etc/postfix/virtual
postmap: fatal: open etc/postfix/virtual: No such file or directory

Thanks !
0
 
GnsCommented:
Ok.... That file is usually your "virtual alias file"... If your install didn't contain/create it, you can create it yourself (in an install near me it is actually the documentation for the virtual alias map-file ... all commented out...:-).
Try
man 5 virtual
for docs on the file format (and use) of the file.... (this is usually also availabe in the file ".../html/virtual.5.html" where the "..." depend a bit on the install method etc).

About the directory... Mind you, I don't use virtualmin (or for that matter much virtual domains:-), but... This would perhaps be where you'd create either the virtual mailbox map(s) and (shudder) the virtual mailbox? It all depends on what you have in your config. Look through
postconf | grep virtual
(or just page through it with less:-)

-- Glenn
0
 
11odsAuthor Commented:
Ok Glenn,

thanks for all the help!!
finally got everything working !
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.