Setup an email account

17 posts / 0 new
Last post
#1 Mon, 08/12/2013 - 08:53
csoft

Setup an email account

Hello! I am in (big) troubles trying to set up an email account with VM. The goal is simple: provide email accounts to the virtual servers served by VM.

  • I have got postfix and it is working. (at least I can easily send emails via PHP's mail() function).
  • I have installed dovecot and it is running.
  • I have pointed a MX record to the IP of my webserver. IE. mail.mydomain.com. -> ip.ip.ip.ip
  • I have opened those ports (and restarted the firewall): 143, 993 and 25.

The steps I did to create the user were those:

  • VM -> Edit users -> Add a user to this server. -> email address = myname@mydomain.com -> create

But seems that nothing is working. I've read a lot of discussione here, and all over the internet, and I am trying to configure thunderbird as follow:

Username: myname.mydomain Password: thePassword Incoming server: IMAP mail.mydomain.com Outgoing server: mail.mydomain.com Security (try #1): STARTTLS / Normal password Security (try #2): SSLTTLS/ Normal password

but thunderbird refuses to connect to the server. I am literally stuck on it and I'd be very happy if someone could help me!

Thanks :)

Mon, 08/12/2013 - 09:11
Locutus

This issue can have any number of reasons... too many to go through all of them by "remote-guessing". :) I'd like to provide some notes about things that struck me, and if those don't help, I can offer to take a look at your system myself, either through root login, or Teamviewer+instant messenger/voicechat, for a moderate fee. :)

So, you say you have Postfix and Dovecot installed. This sounds to me like you installed them manually? Did you use the Virtualmin installer script? That will install and configure all required packages automatically, and it's highly recommended to use that.

Then, MX records need to point to hostnames not IP addresses. So you'd have MX for "mydomain.com" point to "mail.mydomain.com" which is an A record for your IP address.

You might want to take a look at your logfiles in /var/log at the time of connection attempt, and/or configure Thunderbird manually with the proper data, with or without SSL.

Mon, 08/12/2013 - 10:05 (Reply to #2)
csoft

Then, MX records need to point to hostnames not IP addresses. So you'd have MX for "mydomain.com" point to "mail.mydomain.com" which is an A record for your IP address.

Thank you for your reply. It was a typo because the MX correctly points to the hostname, sorry for that. HOSTNAME: @ MAILSERVER HOST NAME: mail.mydomain.com. (dot added) MAIL TYPE: MX

So, you say you have Postfix and Dovecot installed. This sounds to me like you installed them manually? Did you use the Virtualmin installer script? That will install and configure all required packages automatically, and it's highly recommended to use that.

I have had to installed dovecot manually and, as far as I can remember, even postfix because the standard sendmail was too slow to use with php. Do you know if a automatic installer exitst?

Mon, 08/12/2013 - 10:56
Locutus

Yes, there is an installation script for Virtualmin that you can download using the "Download" button on top of the page. It's meant to be used on a freshly installed OS, without any hosting software packages, and will fully automate the installation process.

Mon, 08/12/2013 - 11:12 (Reply to #4)
csoft

Thanks for your reply.

Yes, there is an installation script for Virtualmin that you can download using the "Download" button on top of the page

Are we talking about installing virtualmin or installing and configuring dovecot? I am using the latest version of virtualmin, at the time I am writing this.

Thanks

Mon, 08/12/2013 - 13:59
Locutus

Oh sorry, I misunderstood. I was talking about the Virtualmin installer script. Which you probably didn't use, because it would have installed Postfix and Dovecot along the way. :) But especially for newbies (considering you're posting in this section ;) ) it's quite recommended to use the installer script.

Mon, 08/12/2013 - 14:17
csoft

I used the installer for virtualmin :) But it doesn't installed Dovecot.

This morning I installed dovecot via

yum install dovecot

Now a flow of errors are making me crazy. :(

Mon, 08/12/2013 - 14:20
Locutus

Well it certainly should have installed Dovecot... It does so for me on Ubuntu, Debian and CentOS. Which installer did you use on which distribution?

Mon, 08/12/2013 - 14:54
csoft

I used the webmin version, months ago, as far as I can remember. Howewer I am stuck on this point, trying to debug if dovecot works:

telnet localhost 143
telent mail.mydomain.com 143

both works fine. But, going further:

telent mail.mydomain.com 143
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
* OK [CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE IDLE STARTTLS AUTH=PLAIN] Dovecot ready.
a login "username.mydomain" "PASSWORD"
a BAD Error in IMAP command received by server.

tail /var/log/maillog/
*empty*

Mon, 08/12/2013 - 15:16
andreychek

Howdy,

Hmm, what output do you receive if you run this command:

rpm -qa | grep dovecot

Mon, 08/12/2013 - 19:25
csoft

Hi andreychek,

Hmm, what output do you receive if you run this command:

dovecot-2.0.9-5.el6.x86_64

I've updated the directory where postfix stores the emails and, at the same time, I also updated the the main_location of dovecot. That was the error that was reported by dovecot.

I am trying to debug dovecot, using the instructions provived with this link: http://wiki2.dovecot.org/TestInstallation and everything works (SSL too) both with localhost and mail.mydomain.tld , but I cannot login from thunderbird / outlook.

I need to figure out what blocks the connection.

Mon, 08/12/2013 - 21:04
andreychek

Howdy,

Well, it's unusual that you're not seeing any logs in /var/log/maillog. But it's difficult to say whether that's an issue with Dovecot, or an issue with syslog :-)

Anytime there's any sort of incoming connection into Dovecot, there should be a log in the maillog showing that (whether the login fails or not).

What about connecting to port 110 (POP), do you see the same issue?

-Eric

Tue, 08/13/2013 - 02:43
csoft

Eric, yes connecting with 110 (pop) has the same issue.

Tue, 08/13/2013 - 08:36
csoft

I don't give up. :)

I think that the server is well configured. I tried this with another server I have:

telnet mail.mydomain.tld 143
Trying [IP]...
telnet: Unable to connect to remote host: No route to host

Rechecked the firewall and it allows incoming connection on port 143, with TCP protocol.

Getting crazy :(

EDIT
Stopped the firewall with

service iptables stop

it is working, but only with "unsecure connection"! That's a great day :)

Now I've to check two more things:
- Enabling encrypted password.
- Configuring firewall properly!

Tue, 08/13/2013 - 07:35
andreychek

Super, glad you got that part working!

If you're having trouble with secured connections, let us know what issue you're seeing and we can talk about what might cause that.

-Eric

Tue, 08/13/2013 - 09:30
csoft

I talked to early, I think.

Thunderbird and other clients are connecting well to my server (not with secure connection, but I can look at this in the spare time), but looks like the emails are not downloaded! I sent two test email, from my gmail account, to the username@mydomain.tld and thunderbird doesn't download them. Now I think it's a problem of "directory", and I am confused about fetchmail and dovecot.

Somewhere I read that "configuring a mailserver manually is a hard task to accomplish even for trained people", i do agree! :)

Tue, 08/13/2013 - 09:51
Locutus

In general, running a safe-and-sound email server is not for the faint-hearted, that's right.

But when using the regular Virtualmin installer script (which downloads and configures Postfix, Dovecot, Postgrey, Procmail, SpamAssassin and ClamAV), and using Virtualmin to manage email users, it's actually quite easy, because the complex stuff is done under the hood. :)

Topic locked