You are not logged in.

#1 2011-10-04 20:10:42

JHeaton
Member
From: United Kingdom
Registered: 2009-05-16
Posts: 158

Trouble connecting to SMTP server

Hi folks, me again.

I've just gone through this guide to set up a mail server on my Arch VPS and hit a stumbling block. SMTP on the server seems to work okay; I can send emails from the PostfixAdmin interface to my Googlemail inbox without a problem. I can also get to the point where my desktop and mobile clients accept my IMAP settings, but can't authenticate when it comes to adding in the SMTP settings. I've checked and double-checked everything in my config files against the guide (and had to add port 993 to the courier-imap config file) and everything now seems to be okay, but still it fails. Roundcube just gives me a 'Login failed' message (whereas before it was unable to connect to the IMAP server) and clients just tell me that they're unable to connect. If I set the port on one of these clients to 25, I get messages along the lines of 'TLS required but not supported by the server' - I'm sure that this shouldn't be a problem, though, considering the configuration options shown in the guide.

If I comment out smtpd_tls_auth_only = yes in /etc/postfix/main.cf, then try to connect on port 25, I get an incorrect username/password error; surely the SMTP credentials are the ones set in the database and the same ones used for IMAP authentication? All of the details in the four files referenced by /etc/postfix/main.cf are correct and the queries match those that the author has placed on the wiki page.

I was told that I could use testsaslauthd to check the credentials. I'm not sure if that is correct, however, when doing so this is what I end up with:

joel [~]
> testsaslauthd -u test@domain.tld -p test -s smtp
0: NO "authentication failed"

Now I'll admit, I'm very inexperienced when it comes to mail servers, postfix etc. (I only really know MS Exchange, heh) so I definitely find myself lost here. Could anyone point me in the direction of some extra tests I could run to help narrow down the problem, or options that I should check to make sure users are able to log in? I'd very much appreciate any pointers that anyone can give as right now I haven't got a clue where I've gone wrong. hmm

Last edited by JHeaton (2011-10-05 10:50:22)

Offline

#2 2011-10-05 09:08:58

JHeaton
Member
From: United Kingdom
Registered: 2009-05-16
Posts: 158

Re: Trouble connecting to SMTP server

Just an update on this, in case anyone is able to help. I had to edit /etc/pam.d/smtp and change passwdcolumn to passwordcolumn and I think I've made progress. I now get the following error shown in /var/log/auth.log.

Oct  5 09:31:51 localhost saslauthd[23430]: pam_mysql - MySQL error(You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'FROM mailbox WHERE username = 'test@domain.tld'' at line 1)

Now, the syntax in /etc/postfix/virtual_mailbox_maps.cf is as follows:

query       = SELECT maildir FROM mailbox WHERE username='%s'

I'm not sure what the error with this is, though, because if I manually run the query it returns exactly what I would expect.

mysql> SELECT maildir FROM mailbox WHERE username='test@domain.tld';

+---------------------+
| maildir             |
+---------------------+
| test@domain.tld/ |
+---------------------+
1 row in set (0.00 sec)

The maildir for the user exists under /home/vmail, so I don't see it as being a problem there, but the query looks correct. I've compared this with the same query from other guides and it's the same, so it should work, shouldn't it? Again, any help would be appreciated. I've searched around for others experiencing the problem but not come up with anything. I've checked the table and all the columns are there.

Offline

Board footer

Powered by FluxBB