Solved

trouble connecting to mail server

Posted on 2004-08-18
13
342 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
Comment Utility
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
Comment Utility
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
Comment Utility
> 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
Comment Utility
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
Comment Utility
... 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
Comment Utility
Oh, and how about the netfilter firewall? Have you enabled any restrictive rules?

-- Glenn
0
Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

 

Author Comment

by:11ods
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
> 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
Comment Utility
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
Comment Utility
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
Comment Utility
Ok Glenn,

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

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Currently, there is not an RPM package available under the RHEL/Fedora/CentOS distributions that gives you a quick and easy way to allow PHP to interface with Oracle. As a result, I have included a set of instructions on how to do this with minimal …
Setting up Secure Ubuntu server on VMware 1.      Insert the Ubuntu Server distribution CD or attach the ISO of the CD which is in the “Datastore”. Note that it is important to install the x64 edition on servers, not the X86 editions. 2.      Power on th…
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…

743 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

14 Experts available now in Live!

Get 1:1 Help Now