Solved

trouble connecting to mail server

Posted on 2004-08-18
13
345 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
  • 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
 

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
Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

 

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Daily system administration tasks often require administrators to connect remote systems. But allowing these remote systems to accept passwords makes these systems vulnerable to the risk of brute-force password guessing attacks. Furthermore there ar…
Introduction We as admins face situation where we need to redirect websites to another. This may be required as a part of an upgrade keeping the old URL but website should be served from new URL. This document would brief you on different ways ca…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
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…

911 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now