Email with Postfix, Dovecot, and MySQL problems

Hi

I set up a new mail server using the guide:

https://www.linode.com/docs/email/postf … -and-mysql">https://www.linode.com/docs/email/postfix/email-with-postfix-dovecot-and-mysql

I'm getting a number of errors and would appreciate any help.

In testing from various email clients I can't seem to authenticate the email account.

Here is the error from the mail log:

dovecot: imap-login: Aborted login (auth failed, 1 attempts in 6 secs): user=<info@domain.com>, method=LOGIN, rip=(my IP), lip=(Linode IP), TLS: Disconnected, session= and from the dovecot.log:

doveconf: Warning: Configuration file /etc/dovecot/conf.d/10-master.conf line 1: Ambiguous '#' character in line, treating it as comment. Add a space before it to remove this warning.

doveconf: Fatal: Error in configuration file /etc/dovecot/conf.d/10-master.conf line 1: Expecting '='

which is odd because the first two lines never changed in the file:

defaultprocesslimit = 100

defaultclientlimit = 1000

maybe related to authentication error is the sql statement in the guide for creating a new email in the virtual_users table doesn't seem to work:

INSERT INTO mailserver.virtual_users

(domain_id, password , email)

VALUES

('5', ENCRYPT('newpassword', CONCAT('$6/gd1nnpeekaaxxidx>, SUBSTRING(SHA(RAND()), -16))) , 'email3@newdomain.com');

I was able to tweak it to get it to work:

INSERT INTO mailserver.virtual_users (id, domain_id, password, email) VALUES ('1', '1', ENCRYPT('password, CONCAT(`$6<gd1nnpeekaaxxidx, SUBSTRING(SHA(RAND()), -16))'), 'email@domain.com');

Any help would be appreciated.

4 Replies

@denpub:

doveconf: Warning: Configuration file /etc/dovecot/conf.d/10-master.conf line 1: Ambiguous '#' character in line, treating it as comment. Add a space before it to remove this warning.

doveconf: Fatal: Error in configuration file /etc/dovecot/conf.d/10-master.conf line 1: Expecting '='

This can happen if the password has a # character in it.

See http://unix.stackexchange.com/questions … -in-config">http://unix.stackexchange.com/questions/121465/dovecot-mysql-connection-error-because-of-special-charater-in-config

Thanks for the info, but it wasn't the problem. I did have an @ symbol in the password but changed to a simpler password and it still didn't work. My gut feeling is it has something to do with the ENCRYPT function of the SQL statement used to add new emails:

ENCRYPT(password, CONCAT(`$6

Update:

I was able to resolve the authentication errors. There seemed to be some malformed code in the sql statement to add addresses in the tutorial.

I was able to find the same statement somewhere else that worked without giving SQL errors:

INSERT INTO mailserver.virtual_users

(id, domain_id, password , email)

VALUES

(1, 1, ENCRYPT(‘password1, CONCAT($6<r, SUBSTRING(SHA(RAND()), -16))),email1@domain.com`),

(2, 1, ENCRYPT(‘password2’, CONCAT($6<r, SUBSTRING(SHA(RAND()), -16))), ‘<email email="email2@domain.com">email2@domain.com</email>);

I am now able to connect to the server with a mail client but emails to the address get bounced back with the following error:

–------------------------------------

Mail Delivery System <MAILER-DAEMON@mail.domain.com>

7:10 PM (8 minutes ago)

to me

This is the mail system at host mail.domain.com.

I'm sorry to have to inform you that your message could not

be delivered to one or more recipients. It's attached below.

For further assistance, please send mail to postmaster.

If you do so, please include this problem report. You can

delete your own text from the attached returned message.

The mail system

<1@mail.domain.com> (expanded from <info@domain.com>): mail

for mail.domain.com loops back to myself

Final-Recipient: rfc822; 1@mail.domain.com

Original-Recipient: rfc822;info@domain.com

Action: failed

Status: 5.4.6

Diagnostic-Code: X-Postfix; mail for mail.beneteauguitars.com loops back to

myself

---------- Forwarded message ----------

From: Dennis <me@gmail.com>

To: info@domain.com

Cc:

Date: Mon, 31 Aug 2015 19:10:13 -0400

Subject: test


Can anyone help, please?

Update again:

so I resolved the loopback issue by changing in the postfix/main.cf:

mydestination = localhost

to

mydestination = localhost.$mydomain, localhost, mail.domain.com

Now I'm getting the following bounce back error:

–-------------------------------------------------------------------

<1@mail.domain.com> (expanded from <info@domain.com>):

unknown user: "1"

Reporting-MTA: dns; mail.domain.com

X-Postfix-Queue-ID: D7B102007D

X-Postfix-Sender: rfc822; me@gmail.com

Arrival-Date: Mon, 31 Aug 2015 22:41:39 -0400 (EDT)

Final-Recipient: rfc822; 1@mail.domain.com

Original-Recipient: rfc822;info@domain.com

Action: failed

Status: 5.1.1

Diagnostic-Code: X-Postfix; unknown user: "1"


where is the user "1" coming from? Is it because info@domain.com is domian_id 1 in the db?

Does it have something to do with the dns settings:

MX Records

Mail Server Preference Subdomain TTL Options

mail.domain.com 10 Default Edit | Remove

A/AAAA Records

Hostname IP Address TTL Options

my.linode.ip Default Edit | Remove

mail my.linode.ip Default Edit | Remove

www my.linode.ip Default Edit | Remove

my:IPv6 Default Edit | Remove

mail my:IPv6 Default Edit | Remove

www my:IPv6 Default Edit | Remove

Do I need to start a new thread?

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct