qmail users

I setup qmail on a fedora server. I’m pretty sure qmail is up and ready to receive emails, because when I run qmailctl stat I get the following
/service/qmail-send: up (pid 2085) 338534 seconds
/service/qmail-send/log: up (pid 2086) 338534 seconds
/service/qmail-smtpd: up (pid 25589) 1 seconds
/service/qmail-smtpd/log: up (pid 2083) 338534 seconds
Messages in queue: 0
Messages in queue but not yet preprocessed: 0
I setup the qmail server by following the instructions on a website called lifewithqmail. I must have missed something, because I can’t find how to add qmail users. Somewhere in the instructions there is a way to send a test email, which worked. Then I added a user on the fedora machine using adduser. Next I used a windows xp machine and setup outlook express with the user I created on the fedora machine. In outlook expresses setup, I used the ip address of the qmail server to avoid any dns problems, and when I click on the send/receive button in outlook I get the following error
Your server has unexpectedly terminated the connection. Possible causes for this include server problems, network problems, or a long period of inactivity.
So is there a different way to add a user to qmail, or is my assumption that it’s an add user problem incorrect?
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Is the firewall and SElinux running?
Check if the firwall and the Security-enhanced Linux  (SELinux) is on
JeffBeallAuthor Commented:
the firewall isn't running and selinux is disabled.
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

Can you scan the IP of the server and see ports 110 and 25 open?
Also can you telnet to port 110 and 25?
JeffBeallAuthor Commented:
I did an nmap -A squid ( squid is the fedora machine name, it's also my squid proxy server ) it came up with the following
not shown: 1676 closed ports
port          state                    service            version
22/tpc      open                   ssh                  openssh 4.3
111/tpc    open                   rpcbind            2
915/tpc    open                   status               1
3128/tcp  open                   http-proxy          squid webproxy 2.6.stable13
then a whole bunch of tcp/ip fingerprinting info
I don't get why port 110 or 25 isn't open if qmailctl is showing everything is up.
Also, I'm sorry but I'm not sure how to telnet to a specific port. I, of course, telnet to my old unix machine, but I don't have to include a specific port. Would it be something like
telnet  ?
JeffBeallAuthor Commented:
i found how to telnet to a specific port, i run
telnet 25
telnet 110
and i get
Could not open connection to the host, on port 25: connection failed.
obviously my qmail server isn't listening to those ports, but qmailctl shows
/service/qmail-send: up (pid 2085) 338534 seconds
/service/qmail-send/log: up (pid 2086) 338534 seconds
/service/qmail-smtpd: up (pid 25589) 1 seconds
/service/qmail-smtpd/log: up (pid 2083) 338534 seconds
i don't get what I'm missing.
Double check the firewall.
JeffBeallAuthor Commented:
i run the following
service iptables status
and it returnes
firewall is stopped.
i'm pretty sure i haven't added any other firewalls
from within the terminal enter the command setup and see what it says there.
JeffBeallAuthor Commented:
if i enter setup there is a list of things, one of them is firewall configuration. i select that and it says.
firewall configuration
security level: ( ) enabled (*) disabled
so disabled is selected. I get the feeling that qmail isn't actually running somehow. Would there be some other way to check qmail? like I said if I run /usr/bin/qmailctl stat it shows
/service/qmail-send: up (pid 2085) 338534 seconds
/service/qmail-send/log: up (pid 2086) 338534 seconds
/service/qmail-smtpd: up (pid 25589) 1 seconds
/service/qmail-smtpd/log: up (pid 2083) 338534 seconds
Messages in queue: 0
Messages in queue but not yet preprocessed: 0
does it make sense that this doesn't mean qmail is all the way up?
can you telnet to 110 or 25 from the qmail box itself?
JeffBeallAuthor Commented:
Good thinking, I tried and I get
telnet: connect to address connection refused
I also tried telneting to which is it's ip address and get
telnet: connect to address connection refused
Obviously qmail isn't "up", I guess I'll go through the steps AGAIN! I feel like I've read the instructions a million times.
Are you running a DNS server on the box your qmail install is on?  
If you are not using the qmail box as a DNS server having a localhost/ could
prevent qmail from running correctly or not even starting.

If you do not use your qmail box as a DNS server then try this.

Comment out the line that has in your /etc/resolv.conf file and make sure that there is an entry to a valid DNS server.
Restart Qmail.  
JeffBeallAuthor Commented:
i am not running the DNS from the qmail box, i checked /etc/resolv.conf and it doesn't have i do have my DNS server listed in /etc/resolv.conf ( it's a windows box so i wouldn't be surprised if it just doesn't want to play with my fedora box ) but i think i found something, one of the qmail scripts i have to make is in /var/qmail/supervise/qmail-smtp and the script is simply named run. if i go to that directory and run the script ( ./run ) it has the following error
tcpserver: fatal: unable to figure out port number for -x
i tried running all the other scripts i was suppose to make for qmail, and this is the only one with an error. just to be on the safe side, i re-typed the entire script and still get this error. is there some way to check the tcpserver to see if it's note setup correctly?
Is that the exact error?  It looks like you are calling port -x.  check your script again and try replacing -x with 25 (smtp port).
JeffBeallAuthor Commented:
the exact error is
tcpserver: fatal: unable to figure out port number for -x
i tried putting 25 in the run script located in /var/qmail/supervise/qmail-smtp, but i keep getting the same error. i guess i need to keep messing with this run script until it's happy.
Try this
1.  change the -x to "smtp" instead of 25
2. edit /etc/services and make an entry that says smtp = 25/tcp.  (you will see the proper way to do this in that file just follow the example of the other ones.)  

Make sure that you locate any and all -x references.  
JeffBeallAuthor Commented:
OMG!!!!! that worked!!! I guess I changed the wrong part of the script when I first messed with it. Nothing is ever easy though, because when i run qmailctl stat it shows
/service/qmail-send: up (pid 5419) 1499 seconds
/service/qmail-send/log: up (pid 5420) 1499 seconds
/service/smtpd: up (pid 5424) 1499 seconds
/service/smtpd/log: up (pid 5427) 1499 seeconds
this is encouraging because /service/smtpd didn't used to stay up for more than a second.
so i tried to telnet to port 25
telnet 25
and it just sits there a eventually times out and brings me back to the dos prompt.
if i run
netstat -a | grep smtp
i get
tcp      0      0   squid.itw.itw.com:smtp     *:*        LISTEN
i guess something else isn't working now.
try running /etc/init.d/qmail start
JeffBeallAuthor Commented:
if i run
i get
-bash: /etc/init.d/qmail: no such file or directory
i just remembered to try telnet from the qmail machine. i type
telnet 25
and it returns
escape character is '^]'
connection closed by foriegn host
i feel like such an idiot with these scripts because that makes me think of the first problem i had with bad characters in my scripts ( ^m )
maybe i should just type all the scripts directly on the qmail box instead of trying to copy and paste.
Don't mind the error it is just saying you do not have the ability to start it like that. I forgot you use the qmail scripts to start things.  

Yeah when you are copying and pasting sometimes we forget to change the places and things we need to change.  Also it is a very good way to learn how a script is constructed.  Look on the bright side the next time you install this you will be a pro.
JeffBeallAuthor Commented:
ok, so i manually type all the scripts last night and it still doesn't work because of the inevitable typo's. So this morning, instead of using putty to console into the qmail box, i go into the server room and get the scripts from a browser ON the qmail machine directly. NOW every thing seems fine. I can telnet from a windows machine, run that ehlo thing and stuff like that. there is just one last thing i'm confused about. How do you add a qmail user? I swear I didn't see anything about this on the lifewithqmail web page. I tried outlook express on a windows machine and i get an error. could outlook not be working because qmail isn't a pop3 server?
CONGRATULATIONS!  Reward yourself.  I will work together a solution to adding users for you within the next hour.  Now try instaling something like Squirell Mail or Neo Mail. Those make it really easy to configure new accounts and they do connect to Outlook.
Sorry about the delay.  I have been tied up in meetings most of the day.  Anyway use the following tutorial to further build your qmail system.  I use vpopmail to set up many different domain on my qmail server.  Install it and you should be ok


Gabriel OrozcoSolution ArchitectCommented:
As fas as I remember, Life With Qmail document uses the standard way, which is:
== any user account in the system is an email account.==

this said, when you create a user there should be created a ~/Maildir directory under it. if not, in the howto dianthonym posted there is a reference:

a simple way to create a Maildir for a current user, is that user run
maildirmake ~/Maildir
or root:
maildirmake /home/username/Maildir
chown -R username:users /home/username/Maildir

there should have been a step for add the default Maildir directory to the creation /etc/skel directory. just give it a double check. if it's there and your user had the ~/Maildir, then you will be able to receive emails.

now to read those you need your pop3/imap server... either one.

JeffBeallAuthor Commented:
I feel like such an idiot. I am having a hard time following the instructions  at
Mostly, I'm confused because I still don't get how you add a qmail user.  I check ./qmailctl stat and it's up and happy. I even managed to send something because when I run ./qmailctl stat messages in queue = 1. It stinks getting this far and having qmail stare blankly at me waiting for something to do.
Gabriel OrozcoSolution ArchitectCommented:
let's see

any user of the system is a qmail user.
it just need to have a Maildir directory created in his/her home directory. for that, as root
su - username
maildirmake ~/Maildir

and you are done.
then send an internal email to that user using the tests you read on Life With Qmail document and you should receive that email.

to see what happened with smtp communication, try to
tail /var/log/maillog
JeffBeallAuthor Commented:
Is there a different command for Fedora? when i do
maildirmake ~/Maildir
i get
-bash: maildirmake: command not found
I tried it as root and the user.
Gabriel OrozcoSolution ArchitectCommented:
it is simply not in your path... try adding the qmail binaries path:
JeffBeallAuthor Commented:
OMG!!!, I really am an idiot!! Sure enough it's where you said it would be. I just ran that command without a problem. I'll try sending mail with my account.
JeffBeallAuthor Commented:
ok, I've gone over Life with Qmail, and even tried install instructions from QmailRocks. Qmailctl keeps showing everything up. I can even telnet in
telnet 110
i put in the user name
user username@qmailserver.com
but no matter what i try for the password IT DOESNT WORK!!!!!!!!!!!!!!!!!!!!!
pass password
-ERR authorization failed
Connection closed by foregn host
i added my user in fedora
adduser myname
i gave a pass word to the user
passwd myname
AND I STILL CAN'T USE QMAIL!!!!!!!!!!!!!!!!
In all these setup guides there is NOTHING about adding a user!!!!!!!!!!!!!!!!!!! this is THE most frustrating thing!!!! my stupid qmail server is up and run, but just sits there not being used. Is there something in a /bin folder somewhere that adds a qmail user?  I even tried the VQAdmin web interface from QmailRocks, and of course, I can't login to the web interface.
Gabriel OrozcoSolution ArchitectCommented:
well, there is a problem if you patched with vqadmin since your users will be virtual if you did that.

if you didn't applied the vqadmin patches, then everything should be working *if* your startup scripts are correct...

and please take into account an email server is comprised of at least two different components:
the smtp and the pop3/imap server which is the one that interacts with the user.

first you need to check if emails are going and are received. if so, then SMTP *is working*
now you only need to troubleshoot your pop3/imap software.

did you tested sending an email to the user you created his/her Maildir? is there in a file in ~/Maildir/new ?

*then* test the other part. you will be pretty frustrated thinking the whole email server is bad/wrong/doomed when in reality you can have a finger error somewhere and you are not trying to identify where is the actual error.

my 0.02
JeffBeallAuthor Commented:
I've been plowing through the man pages and noticed something that I am hoping is significant. My users don't have a .qmail file in their home directories. I haven't come across something that mentions how to make a .qmail file, so I'm not even sure if this means anything. By the way, I can send emails using telnet . But I can't figure out if it will receive since authorization fails on any user I try. I'm pretty sure email is being sent because now there is 3 messages in the queue, and when I first setup qmail there was nothing in the queue.
Gabriel OrozcoSolution ArchitectCommented:
first, you do not need a .qmail file. you can use it, but it is not needed. it is for preprocessing of emails, like add a vacation message, an autoresponder, a forward to another acount, to copy emails to some other account/directory, etc.

but the problem is this:
1- you should not have emails in the queue. these must clear after sent.
2- if you sent an email to an internal user, the email goes to the queue, then its delivered to the user's home account in his Maildir directory.
can you verify that? then you can continue with other steps
JeffBeallAuthor Commented:
I think if I were any more ignorant, I should do us all a favor and shoot myself. I'm about as ignorant as it gets when it comes to qmail. I swear earlier today there was nothing in the Maildir directory of my test user. I should have paid more attention to any changes I made as I read man pages on qmail, because now there is mail in /home/user/Maildir/new. I sent mail to another test user, and discovered that user doesn't have a Maildir directory, so I created one using /var/qmail/bin/maildirmake. I was trying to find if there is a way to force mail sitting in the queue to attempt delivery again to see if my other test user would get it's mail. Next I discovered /var/qmail/bin/qmail-showctl. When I ran that, at the end it says
clientcert.pem: I have no idea what this file does
servercert.pem: I have no idea what this file does
defaultdelivery: I have no idea what this file does
concurrencyincoming: I have no idea what this file does
what concerns me the most is defaultdelivery. It seems like it should have a default delivery. Being an idiot though means I don't know if defaultdelivery matters. Somehow in my bumblings it appears that qmail is able to deliver mail. However, I still get authorization errors when I telnet to port 110 to get my mail. I got the test qmail script from the Qmailrocks website and it says everything is ok. One last thing to round off my ignorance feast, in the /var/log/qmail/smtp directory I looked at the current file and there are a lot of entries referencing squid.itw.itw.com, but when I run qmail-showctl it refers to itself as squid.itw.com. Could I have a DNS problem?
p.s. Sorry for the long post.
Gabriel OrozcoSolution ArchitectCommented:
Hi Jeff
First, you don't know how it was for me to learn qmail... really you are experiencing some of the same as I. but the problem here is you are not following the howto to the letter. and in qmail it matters...

the good thing is you are able to send email internally. this is, qmail smtp engine is working.

server.pem and client.pem are certificates. you can make these if you go to the qmail source directory and issue "make cert" then qmail will make a certificate for you to be able to use ssl (secure protocols are smtps and pop3s and imaps). you do not need it right now.

for the dns problem, the name of the server will appear in your sent/received emails. it is important you include these on your locals file.

please tell me the url of the howto you were following in order to check the steps and be able to help you faster

JeffBeallAuthor Commented:
I just realized today the benefits I'm getting from going through this ordeal. I had some problem with my exchange server and realized I needed to change my helo response. I caught and understood the problem due to my experience with qmail. So I guess the thing about Microsoft is maybe they make it too easy. I setup exchange without a good knowledge of what is going on under the covers.
I started with
then got frustrated and tried
You have been too kind to stick with me this long. Thank you very much. Maybe it would help if I focus on what is broken. Currently, sending seems to work o.k. if I use my first test user. I can send through telnet on a computer on my network. I look in my first test user's /home/user1/Maildir/curr and mail is sitting there for this user. I tried sending with my first test users account to my second test user, but it sits in the queue. I made a third account and used my first test user to send to test user 3, and I don't think it even makes it to the queue. i looked in /var/log/qmail/qmail-send, and the most recent entry is
starting delivery 40: msg 13665097 to testuser2@squid.itw.com
status: local 1/10 remote 0/255
delivery 40: deferral: unable_to_open_./Maildir:_is_a_directory._
I made Maildir for testuser2 by logging in as that user and running /var/qmail/bin/maildirmake. I thought Maildir was suppose to be a directory? Anyhow, I hope this helps, and again, it's VERY nice of you to be patient and help. Thanks.
Gabriel OrozcoSolution ArchitectCommented:
to make that work:
log as the user, and them run
/var/qmail/bin/maildirmake Maildir

you need to specify the name of the directory.
for the queue to restart, just restart qmail =^)

please post here the script you created to start qmail I will need it also
JeffBeallAuthor Commented:
I think this is the start up script ( I could be wrong )

# For Red Hat chkconfig
# chkconfig: - 80 30
# description: the qmail MTA

export PATH

QMAILDUID=`id -u qmaild`
NOFILESGID=`id -g qmaild`

case "$1" in
echo "Starting qmail..."
echo ""
if svok /service/qmail-send ; then
svc -u /service/qmail-send /service/qmail-send/log
echo "Starting qmail-send"
echo "qmail-send supervise not running"
if svok /service/qmail-smtpd ; then
svc -u /service/qmail-smtpd /service/qmail-smtpd/log
echo "Starting qmail-smtpd"
echo "qmail-smtpd supervise not running"
if svok /service/qmail-pop3d ; then
svc -u /service/qmail-pop3d /service/qmail-pop3d/log
echo "Starting qmail-pop3d"
echo "qmail-pop3d supervise not running"
if [ -d /var/lock/subsys ]; then
touch /var/lock/subsys/qmail
echo "Stopping qmail..."
echo ""
echo " qmail-smtpd"
svc -d /service/qmail-smtpd /service/qmail-smtpd/log
echo " qmail-send"
svc -d /service/qmail-send /service/qmail-send/log
echo " qmail-pop3d"
svc -d /service/qmail-pop3d /service/qmail-pop3d/log
if [ -f /var/lock/subsys/qmail ]; then
rm /var/lock/subsys/qmail
svstat /service/qmail-send
svstat /service/qmail-send/log
svstat /service/qmail-smtpd
svstat /service/qmail-smtpd/log
svstat /service/qmail-pop3d
svstat /service/qmail-pop3d/log
echo "Flushing timeout table and sending ALRM signal to qmail-send."
svc -a /service/qmail-send
echo "Sending HUP signal to qmail-send."
svc -h /service/qmail-send
echo "Pausing qmail-send"
svc -p /service/qmail-send
echo "Pausing qmail-smtpd"
svc -p /service/qmail-smtpd
echo "Pausing qmail-pop3d"
svc -p /service/qmail-pop3d
echo "Continuing qmail-send"
svc -c /service/qmail-send
echo "Continuing qmail-smtpd"
svc -c /service/qmail-smtpd
echo "Continuing qmail-pop3d"
svc -c /service/qmail-pop3d
echo "Restarting qmail:"
echo "* Stopping qmail-smtpd."
svc -d /service/qmail-smtpd /service/qmail-smtpd/log
echo "* Sending qmail-send SIGTERM and restarting."
svc -t /service/qmail-send /service/qmail-send/log
echo "* Sending qmail-pop3d SIGTERM and restarting."
svc -t /service/qmail-pop3d /service/qmail-pop3d/log
echo "* Restarting qmail-smtpd."
svc -u /service/qmail-smtpd /service/qmail-smtpd/log
tcprules /etc/tcp.smtp.cdb /etc/tcp.smtp.tmp < /etc/tcp.smtp
chmod 644 /etc/tcp.smtp.cdb
echo "Reloaded /etc/tcp.smtp."
cat <<HELP
stop -- stops mail service (smtp connections refused, nothing goes out)
start -- starts mail service (smtp connection accepted, mail can go out)
pause -- temporarily stops mail service (connections accepted, nothing leaves)
cont -- continues paused mail service
stat -- displays status of mail service
cdb -- rebuild the tcpserver cdb file for smtp
restart -- stops and restarts smtp, sends qmail-send a TERM & restarts it
doqueue -- schedules queued messages for immediate delivery
reload -- sends qmail-send HUP, rereading locals and virtualdomains
queue -- shows status of queue
alrm -- same as doqueue
flush -- same as doqueue
hup -- same as reload
echo "Usage: $0 {start|stop|restart|doqueue|flush|reload|stat|pause|cont|cdb|queue|help}"
exit 1

exit 0

Gabriel OrozcoSolution ArchitectCommented:
I guess the actual startup scripts are at


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
JeffBeallAuthor Commented:
Somehow i managed to regress and now qmail isn't even sending emails with the test user that used to work using telnet on the qmail box. so I'm scraping the whole thing and starting over from scratch. this time I'm only using the "life with qmail" website. Thank you so much for sticking with me so long, I appreciate all the help, but since I'm starting over I guess I should close out this question.
Gabriel OrozcoSolution ArchitectCommented:
ok.. thanks
just be very careful at each step. if you forget some step then you can get weird behavior as this time...

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Linux Distributions

From novice to tech pro — start learning today.