LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 07-12-2007, 02:45 AM   #1
namgayp
LQ Newbie
 
Registered: Jan 2007
Posts: 11

Rep: Reputation: 0
qmail- smtp problem?


I am really new to linux and so am i new to qmail. I have been following this tutorial to bring up a mail server in qmail.

The problem is that i tried to connect to the mail server trough a mail client( thunderbird ) but i get an alert message as follows:

" Sending of message failed

The message could not be sent because connection to SMTP server mail.xx.xxx failed. The server may be unavailable or is refusing SMTP connection. Please verify that your SMTP server setting is correct and try again, or else contact the network admin."


I checked if the qmail server was running:

[root@mail bin]# ps -ax | grep -i mail
Warning: bad syntax, perhaps a bogus '-'? See /usr/share/doc/procps-3.2.5/FAQ
2585 ? S 0:00 supervise qmail-send
2587 ? S 0:00 supervise qmail-smtpd
10029 ? S 0:00 qmail-send
10030 ? S 0:00 /usr/local/bin/multilog t /var/log/qmail/smtpd
10033 ? S 0:00 qmail-lspawn ./Maildir/
10034 ? S 0:00 qmail-rspawn
10035 ? S 0:00 qmail-clean
10036 ? S 0:00 /usr/local/bin/multilog t /var/log/qmail
13469 pts/2 S+ 0:00 tail -f /var/log/qmail/current
1336 pts/3 S+ 0:00 grep -i mail


The qmail processes seems to be up and running but then i checked if anything is running on port 25 just to find out that it had nothing running on port 25. when i run the command

netstat -vatn

i dont see anything running on the port 25.

Could anyone help me out with what i could have possible done wrong.

Thanking you
 
Old 07-13-2007, 06:34 AM   #2
ravinandans
LQ Newbie
 
Registered: Jul 2007
Posts: 7

Rep: Reputation: 0
try this command..

telnet localhost 25

should connect to smtp service if it is running..

if not check the logs..some time qmail-smtpd run file might be mis-configured or might not be configured at all....

Ravinandan
 
Old 07-13-2007, 06:42 AM   #3
activeq
Member
 
Registered: Jul 2006
Location: Balen, Belgium
Distribution: Suse 10, Centos, Open Solaris
Posts: 76

Rep: Reputation: 15
Try also command:

qmailctl stat and check if service smtpd is up
 
Old 07-15-2007, 10:47 PM   #4
namgayp
LQ Newbie
 
Registered: Jan 2007
Posts: 11

Original Poster
Rep: Reputation: 0
Thank you very much for your replies.

when i try to telnet localhost 25 I get the following reply:

[root@mail ~]# telnet localhost 25
Trying 127.0.0.1...
telnet: connect to address 127.0.0.1: Connection refused
telnet: Unable to connect to remote host: Connection refused


while it seems to be working fine on some other port number.

and i have the qmail-smtpd run file configured. The following is my qmail-smtpd run file:

#!/bin/sh

QMAILDUID=`id -u qmaild`
NOFILESGID=`id -g qmaild`
MAXSMTPD=`cat /var/qmail/control/concurrencyincoming`
LOCAL=`head -1 /var/qmail/control/me`

if [ -z "$QMAILDUID" -o -z "$NOFILESGID" -o -z
"$MAXSMTPD" -o -z "$LOCAL" ]; then
echo QMAILDUID, NOFILESGID, MAXSMTPD, or LOCAL is
unset in
echo /var/qmail/supervise/qmail-smtpd/run
exit 1
fi

if [ ! -f /var/qmail/control/rcpthosts ]; then
echo "No /var/qmail/control/rcpthosts!"
echo "Refusing to start SMTP listener because it'll create an open relay"
exit 1
fi

exec /usr/local/bin/softlimit -m 4000000 \
/usr/local/bin/tcpserver -v -R -l "$LOCAL" -x /etc/tcp.smtp.cdb -c "$MAXSMTPD" \ -u "$QMAILDUID" -g "$NOFILESGID" 0 smtp
/var/qmail/bin/qmail-smtpd 2>&1


The is what i get while running the qmailctl stat:

[root@mail qmail-smtpd]# qmailctl stat
/service/qmail-send: up (pid 29202) 234666 seconds
/service/qmail-send/log: up (pid 29201) 234666 seconds
/service/qmail-smtpd: up (pid 15211) 1 seconds
/service/qmail-smtpd/log: up (pid 29208) 234666 seconds
messages in queue: 0
messages in queue but not yet preprocessed: 0



well, looking at the stat it seems that the smtpd is up but what actually happens is that the time it is supposed to be up and running is way below the other daemons(the time since i started the qmail server). Everytime i look at the stat I see that the time for smtpd never increases from 1 second.I checked the PID for the smtpd and it changes after ever second.

your replies would be highly appreciated.
Thanking you
 
Old 07-15-2007, 11:41 PM   #5
ravinandans
LQ Newbie
 
Registered: Jul 2007
Posts: 7

Rep: Reputation: 0
Check what does
"id -u qmaild" & "id -g qmaild" give out and make sure the user and group name exist in your passwd file.

Also check the logs.
It may be in "/var/log/qmail/qmail-smtpd/current" or in "/service/qmail-smtpd/log/main/current".
 
Old 07-16-2007, 12:20 AM   #6
namgayp
LQ Newbie
 
Registered: Jan 2007
Posts: 11

Original Poster
Rep: Reputation: 0
Thanks for the reply.

The user smtpd exist and belongs to the group nofiles:

[root@mail qmail-smtpd]# grep -i qmaild /etc/passwd
qmaild:x:505:502::/var/qmail:/bin/bash
[root@mail qmail-smtpd]# grep -i 502 /etc/group
nofiles:x:502:


The smtpd log file seems to be empty:

[root@mail smtpd]# cat /var/log//qmail/smtpd/current
[root@mail smtpd]#


Hoping for more replies.
 
Old 07-16-2007, 11:30 PM   #7
ravinandans
LQ Newbie
 
Registered: Jul 2007
Posts: 7

Rep: Reputation: 0
I just hope it's a typo error...you have two slashes after "log"
>cat /var/log//qmail/smtpd/current

It's very rare that even log file for qmail services is mis-configured.
So you have to double check the log files.
Check where does the soft link for "/service/qmail-smtpd/log" lead to.
Check the log run file "/service/qmail-smtpd/log/run" and make sure the user/group used by the log exist.

Also check if the log file "current" exist in "/service/qmail-smtpd/log/main" directory.(don't worry if doesn't exist)

Make sure you have stopped/uninstalled.. sendmail or postfix or exim in your system.(Just to be on safer side)

Here are some of the reasons I have encountered because of which qmail-smtpd did not start up.

Owner/permission issue for qmail-smtpd
Exim running on port 25
Owner/permission issue for log file
"/etc/tcp.smtp.cdb" does not exist

You will get a concrete idea of what's going wrong only when you check the logs. So you have to make sure at least the logs are running fine.

Ravinandan
 
Old 07-17-2007, 01:43 AM   #8
namgayp
LQ Newbie
 
Registered: Jan 2007
Posts: 11

Original Poster
Rep: Reputation: 0
Hey thanks for you reply. You are right it was just a silly typo error...but even without the double slash the log file still is empty.

The qmail-send and qmail-smtpd folders in the service folder is symbolically liked to the /var/qmail/supervise/qmail-send and /var/qmail/supervise/qmail-smtpd respectively. The permissions seems to be right. Or should it be something else?

[root@mail service]# ls -l
total 8
lrwxrwxrwx 1 root root 31 Jul 3 17:33 qmail-send -> /var/qmail/supervise/qmail-send
lrwxrwxrwx 1 root root 32 Jul 3 17:33 qmail-smtpd -> /var/qmail/supervise/qmail-smtpd


And the qmail-send and qmail-smtpd folders in the /var/qmail/supervise/ seems to be having the following permissions. Should the permission be changed?

[root@mail supervise]# ls -l
total 16
drwxr-xr-x 4 root root 4096 Jul 3 17:33 qmail-send
drwxr-xr-x 4 root root 4096 Jul 16 15:24 qmail-smtpd


One thing i noticed was that i tried to start up qmail-smtpd directly from the run file in the folder /var/qmail/supervise/qmail-smtpd and i get some tcpserver error:

[root@mail qmail-smtpd]# ./run
tcpserver: fatal: no IP address for -u


I have a feeling that this could be the main cause of the problem. I tried looking for the error on web but I just seem to miss it all the time.
 
Old 07-17-2007, 05:53 AM   #9
ravinandans
LQ Newbie
 
Registered: Jul 2007
Posts: 7

Rep: Reputation: 0
Try putting actual IP address instead of "0" in qmail-smtpd run file.

/usr/local/bin/tcpserver -v -R -l "$LOCAL" -x /etc/tcp.smtp.cdb -c "$MAXSMTPD" \ -u "$QMAILDUID" -g "$NOFILESGID" 1.2.3.4 smtp

"0" actually means that smtp service will run on all the interfaces that you have on your system.

Using specific IP will make smtp service run only on that interface.
I suggest you to refer http://qmail.jms1.net.
Setting up and configuring SMTP services is explained in detail.
Be sure to use firefox/opera..cos the site won't open in IE

Ravinandan

Last edited by ravinandans; 07-17-2007 at 06:14 AM.
 
Old 07-18-2007, 02:21 AM   #10
namgayp
LQ Newbie
 
Registered: Jan 2007
Posts: 11

Original Poster
Rep: Reputation: 0
Ravinandan, thank you very much for your support. I later found out that the problem with the tcpserver was that i had a typo error with my qmail-smtpd run file. I am sorry to have wasted your time. But i must admit that had it not been for you i would not have seen the typo error...thank you.
 
Old 10-22-2012, 07:04 AM   #11
Leoprince
LQ Newbie
 
Registered: Oct 2012
Posts: 14

Rep: Reputation: Disabled
hi namgayp i hope you will help me

i got the same problems that you discussed above.
can you plz share what was your typo error with the qmail-smtpd run file






thanks in advance

here is my run file

#!/bin/sh
QMAILDUID=`id -u qmaild`
NOFILESGID=`id -g qmaild`
MAXSMTPD=`cat /var/qmail/control/concurrencyincoming`
LOCAL=`head -1 /var/qmail/control/me`
if [ -z "$QMAILDUID" -o -z "$NOFILESGID" -o -z "$MAXSMTPD" -o -z "$LOCAL" ]; then
echo QMAILDUID, NOFILESGID, MAXSMTPD, or LOCAL is unset in
echo /var/qmail/supervise/qmail-smtpd/run
exit 1
fi
if [ ! -f /var/qmail/control/rcpthosts ]; then
echo "No /var/qmail/control/rcpthosts!"
echo "Refusing to start SMTP listener because it'll create an open relay"
exit 1
fi
exec /usr/local/bin/softlimit -m 2000000 \
/usr/local/bin/tcpserver -v -R -l "$LOCAL" -x /etc/tcp.smtp.cdb -c "$MAXSMT
-u "$QMAILDUID" -g "$NOFILESGID" smtp 0 /var/qmail/bin/qmail-smtpd 2>&1


plz do reply

thankx in advance
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
qmail external smtp problem 3333 Linux - Software 5 03-20-2006 09:38 AM
SMTP port problem QMAIL FC4 3333 Linux - Networking 0 03-19-2006 10:08 PM
qmail +qmail-qfilter + qmail-scanner-queue+qmail-user-masq.pl problem countcobolt Linux - Networking 0 07-08-2004 11:29 AM
qmail smtp relay problem ka_alucard Linux - Networking 2 05-28-2003 03:34 AM
Qmail SMTP problem deepak_v Linux - Networking 1 04-07-2003 08:21 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 12:04 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration