Virtual ftp/mail/web users setup

Hi everyone,

I was hoping to get some help on setting up my mail server. Here is the thing, I can not log into the server using IMAP or POP to check mail (I get the Maildir not found) error… and SMTP does not auth me. HOWEVER, when I send an e-mail from the “Read User Mail” section it is received on the other end, and also when I send an email to a virtual account I get it.

Also, about the Maildir thing, I have read on the forum that I should just create a Maildir… but where? for example, lets assume my virtual domain is I have the myvdomain user, and test.myvdomain user setup. There is a home folder for the myvdomain in /home but there is not home for the test.myvdomain user. So where can i create this?

Also, how come I can send and get e-mail from the “Read User Mail” area under “Servers” but I can’t login via a IMAP/POP client and I can’t send e-mail via an SMTP client? Is there a simple tutorial I can read to learn how to set up the mail server properly?

I urgently need to move all my e-mail and domains from my existing host “Startlogic” to a VPS, as Startlogic sucks. My VPS is a Debian 5 x86_64. What would be the best order to setup this box for e-mail and web hosting? I have several domains so I want to host all of them myself on the VPS as virtual domains?

Any help is greatly appreciated!! Thanks in advance!

P.S. Also, my virtual users can not log into FTP either… not sure why, but they are not gettng authed

EDIT: Just a note, I can only receive emails on the main account if I use the address … (and that is only through the webmin interface) … otherwise all the virtual accounts use the main server’s real hostname such as,


Typically, on a system setup using the script, anytime an email comes for a user, it would be automatically placed in the Maildir directory. And if that directory doesn’t exist, it would be created for you.

If you’re seeing problems with things not working, or people unable to log in, you may want to take a look at the various logfiles involved; /var/log/mail.log and /var/log/auth.log would be good places to start.


Hi Eric,

Thanks for the reply. I did check the logs, basically for every login attempt I get this:

Mar 4 06:36:04 testhost1 imapd: Connection, ip=[::ffff:]
Mar 4 06:36:05 testhost1 imapd: chdir Maildir: No such file or directory


And thats it. I get that in the mail.log file. Note that I changed the IP address to for privacy.

Exact same error for POP3, only difference is that its the pop3d instead of imapd.

What should I do to fix this?

Thanks in advance!

P.S. Virtualmin is installed as a webmin module, not from the Would the script solve this? Can webmin and Virtualmin coexist independantly? Thanks!

Well, the issue you’re seeing is that you do have Virtualmin installed – but that simply provides a mechanism to manage your machine.

Installing Virtualmin directly, using the Webmin module, implies that you plan to fully configure the machine yourself :slight_smile:

Virtualmin is always a Webmin module – but the difference in using the script to perform the installation is that the installer fully configures your system. All the Apache stuff, Email stuff, spam and virus scanning, DNS, databases – that all is configured for you to work out of the box.

So, if your server isn’t live (and that’s a big if!), I’d highly recommend starting from scratch, and using the script to handle the installation for you… it’ll probably save quite a bit of time :slight_smile:


Eric, all I can say is: Thank you Thank you Thank you!!!

Yes, I did a fresh install and then ran the I can now receive e-mails from the domain, works beautifully!

I had to configure the IMAP to use SSL for it to work since plain text auth is not allowed by default, but still trying to figure out how to get SMTP working. I keep getting “connection refused” and “no route to host” errors from the mail client on my computer. Everything else seems great so far!

Thanks again!!


Hmm, “no route to host” is odd, that sounds like it could be a DNS issue – ie, the hostname your entering in your desktop client isn’t resolving correctly.

If you try a different hostname… or perhaps even the IP address of your server, does it work correctly then?

Also, you may want to peek at the error logs, in /var/log/mail.log. That can be a useful tool for troubleshooting. If the mail server is generating errors, they’d show up in there. But also, if your client is hitting your server, you’d likely see it in there somewhere.


Hi again Eric!

First of all, thanks so much for the help, I appreciate it.

Well, there is nothing on the server logs. I did a port scan from my end, and I don’t see port 25 open for SMTP on the server. Is it a different port on the Virtualmin default installation by any chance? I guess a closed port explains the “no route to host” and “connection refused” errors. I even tried using the IP address itself, but to no avail.

So this should have been configured automatically though right? I wonder what went wrong.

NOTE: Ok, I did something else. I cleared my log file and then restarted the server. It looks like smtpd did not get invoked at all. Usually when smtpd starts at boot time, it writes a log entry right? well in this case there is no such log entry and in addition I don’t see the smtpd process running. This explains why there is nothing listening on port 25.

Hmm, typically Postfix would start on bootup, that’s odd.

But, you can always try manually starting it… try running this:

/etc/init.d/postfix restart

Does that help?

However, some ISP’s block port 25… is it possible the ISP your desktop client is using isn’t allowed to communicate on port 25? If that’s the case, you may just need to look into configuring your client to use 465 or 587, which allow SSL authentication.


Thanks Eric!

It appears that postfix is running, just not the stmpd daemon. But I think I got to the bottom of the problem, so let me describe it a bit (especially if someone else has this same issue in the future, it could save them some time)

Well, I am using a VPS host and sure that all ports are open and not blocked. Also, SMTP before worked at one point earlier before this recent fresh install.

Ok, so postfix is running, but I in the postfix page on the webmin panel, I clicked on “Server Processes” and I see that SMTP is enabled and SMTPS is disabled. So, first thing I did was enabled SMTPS and did what you recommended Eric. Port 465 is running and my client was able to send e-mails just fine, so that great!! Thanks again. However, SMTP still does not work, only SMTPS. I don’t really need it to work now, but just out of curiosity I invesitgated a bit and it seems that to start SMTP, the following command is executed

smtpd -o smtpd_sasl_auth_enable=yes

So I tried to run this manually, and I get a command not found error. So now I am confused how SMTPS is working in the first place without smtpd. Is smtpd a builtin command of postfix? also how come SMTP does not work but SMTPS works. So far my problems is solved, but I am not sure how …

Thanks again for the help Eric. If you know what is going on, please do let me know as well.

However, SMTP still does not work, only SMTPS. I don’t really need it to work now, but just out of curiosity I invesitgated a bit and it seems that to start SMTP, the following command is executed

What do you see if you run this command:

netstat -an | grep :25

So I tried to run this manually, and I get a command not found error.

Those programs are internal to Postfix, and aren’t meant to be run manually. You can see them here:

ls /usr/lib/postfix/

Thanks Eric,

Ah, I should have tried the netstat earlier!! …i feel stupid now haha. looks port 25 is listening. I guess the problem is on my end perhaps, or a firewall is blocking it.

Appreciate the help! :slight_smile: