Solved

trouble connecting to mail server

Posted on 2004-08-18
13
350 Views
Last Modified: 2012-06-22
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!
0
Comment
Question by:11ods
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 7
  • 6
13 Comments
 
LVL 20

Expert Comment

by:Gns
ID: 11829408
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
 

Author Comment

by:11ods
ID: 11829748
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
 
LVL 20

Expert Comment

by:Gns
ID: 11829816
> 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
Containers and Docker for Everyone

Containers are an incredibly powerful technology that can provide you and/or your engineering team with huge productivity gains. Using containers, you can deploy, back up, replicate, and move apps and their dependencies quickly and easily.

 

Author Comment

by:11ods
ID: 11829842
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
 
LVL 20

Expert Comment

by:Gns
ID: 11830039
... 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
 
LVL 20

Expert Comment

by:Gns
ID: 11830043
Oh, and how about the netfilter firewall? Have you enabled any restrictive rules?

-- Glenn
0
 

Author Comment

by:11ods
ID: 11830158
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
 
LVL 20

Accepted Solution

by:
Gns earned 350 total points
ID: 11830433
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
 

Author Comment

by:11ods
ID: 11830739
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
 
LVL 20

Expert Comment

by:Gns
ID: 11831015
> 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
 

Author Comment

by:11ods
ID: 11831689
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
 
LVL 20

Expert Comment

by:Gns
ID: 11839032
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
 

Author Comment

by:11ods
ID: 11842138
Ok Glenn,

thanks for all the help!!
finally got everything working !
0

Featured Post

Learn by Doing. Anytime. Anywhere.

Do you like to learn by doing?
Our labs and exercises give you the chance to do just that: Learn by performing actions on real environments.

Hands-on, scenario-based labs give you experience on real environments provided by us so you don't have to worry about breaking anything.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

How many times have you wanted to quickly do the same thing to a list but found yourself typing it again and again? I first figured out a small time saver with the up arrow to recall the last command but that can only get you so far if you have a bi…
Over the last ten+ years I have seen Linux configuration tools come and go. In the early days there was the tried-and-true, all-powerful linuxconf that many thought would remain the one and only Linux configuration tool until the end of times. Well,…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question