Solved

trouble connecting to mail server

Posted on 2004-08-18
13
348 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
Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

 

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

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
wipe a usb using python 5 65
awk file 6 79
I NEED A "BARE" LINUX ... 9 57
Trying to install php56 on CentOS 7 get GPG error 5 31
This is the error message I got (CODE) Error caused by incompatible libmp3lame 3.98-2 with ffmpeg I've googled this error message and found out sometimes it attaches this note "can be treated with downgrade libmp3lame to version 3.97 or 3.98" …
SSH (Secure Shell) - Tips and Tricks As you all know SSH(Secure Shell) is a network protocol, which we use to access/transfer files securely between two networked devices. SSH was actually designed as a replacement for insecure protocols that sen…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

820 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