LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 06-09-2012, 01:25 PM   #1
Jonathan_Frias
LQ Newbie
 
Registered: Jun 2012
Posts: 6

Rep: Reputation: Disabled
Postfix User lookup is bad - MailServer


I'm setting up a mail server following the directions at: http://flurdy.com/docs/postfix/


Currently I can send messages through squirrelmail, but I cannot recieve messages. If I message myself I receive this error:


Code:
This is the mail system at host server.example.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

<jonathan@xxx.com>: unknown user: "jonathan"

Final-Recipient: rfc822; jonathan@xxx.com
Original-Recipient: rfc822;jonathan@xxx.com
Action: failed
Status: 5.1.1
Diagnostic-Code: X-Postfix; unknown user: "jonathan"
I checked mysql and there is a record for my 'jonathan@xxx.com'

Here is my mysql output for the user.
Code:
+----------------------+----------+------+------+-------------------------+-----------+---------+-----------------+----------+---------------+-------+------------+----------------+
| id                   | name     | uid  | gid  | home                    | maildir   | enabled | change_password | clear    | crypt         | quota | procmailrc | spamassassinrc |
+----------------------+----------+------+------+-------------------------+-----------+---------+-----------------+----------+---------------+-------+------------+----------------+
| jonathan@xxx.com     | jonathan | 5000 | 5000 | /var/spool/mail/virtual | jonathan/ |       1 |               1 | ChangeMe | encrypted-password. |       |            |                |
+----------------------+----------+------+------+-------------------------+-----------+---------+-----------------+----------+---------------+-------+------------+----------------+
 
Old 06-10-2012, 07:17 AM   #2
Noway2
Senior Member
 
Registered: Jul 2007
Distribution: Gentoo
Posts: 2,125

Rep: Reputation: 781Reputation: 781Reputation: 781Reputation: 781Reputation: 781Reputation: 781Reputation: 781
This looks like an issue with your mysql_mailbox.cf. Note that your id is @jonathan@xxx.com, consisting of the username at domain. The flurdy howto, however, lists the where field as id. This will result in queries like (this is just an example, I am not sure what query Postfix runs):
Code:
usemaildb;
select * from users where id = '<data to look for>';
If the query doesn't match, you will get an unknown user. In your case, jonathan is not matching jonathan@xxx.com.

My setup is slightly different than yours.
Code:
| username    | password           | name       | maildir          | quota | domain      
 me@mydomain  | hashed password    | my name    | username@domain/ |     0 | my domain
and my wherefield is the username, which will match the user@domain.

If your problem is LIMITED to just squirrelmail, then I would suggest you look in the squirrelmail configuration and see if there is a setting for this. It has been too long since I set this up and can't remember. It may be that squirrelmail simply relies on your POP/IMAP, so you may need to adjust or look at the select fields in your POP/IMAP configuration.
 
1 members found this post helpful.
Old 06-10-2012, 07:50 AM   #3
Jonathan_Frias
LQ Newbie
 
Registered: Jun 2012
Posts: 6

Original Poster
Rep: Reputation: Disabled
Contents of /etc/postfix/mysql_mailbox.cf:

Code:
user=mail
password=mysql-password
dbname=maildb
table=users
select_field=maildir
where_field=id
hosts=127.0.0.1
additional_conditions = and enabled = 1
I can login with the above information to mysql. All of this looks correct to me.

Is there a way that I can try specifying the a raw query like you suggested?

Update, I wanted to upload this telnet log.
Code:
$ telnet localhost 25
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
220 xxx.com ESMTP Postfix
ehlo xxx.com
250-xxx.com
250-PIPELINING
250-SIZE 10240000
250-ETRN
250-STARTTLS
250-ENHANCEDSTATUSCODES
250-8BITMIME
250 DSN
mail from: test@xxx.com
250 2.1.0 Ok
rcpt to: jonathan@xxx.com
250 2.1.5 Ok
data
354 End data with <CR><LF>.<CR><LF>
sadf
sd
f
sdf
sdf
.
250 2.0.0 Ok: queued as A1676204E7
quit
221 2.0.0 Bye
Connection closed by foreign host.

Last edited by Jonathan_Frias; 06-10-2012 at 08:02 AM. Reason: added telnet information
 
Old 06-11-2012, 04:23 AM   #4
Noway2
Senior Member
 
Registered: Jul 2007
Distribution: Gentoo
Posts: 2,125

Rep: Reputation: 781Reputation: 781Reputation: 781Reputation: 781Reputation: 781Reputation: 781Reputation: 781
Interesting. So Postfix performs the proper lookup, but if you try to send via squirrelmail it bounces. In all honesty, I should have thought of this yesterday, but what is the error message that is showing up in your email log file? Lets confirm what is happening as it looks like squirelmail is dropping the domain part which is required. I also remembered that when I configured Squirrelmail on my system, I had to play around with the settings (run conf.pl) for a while before it worked and I think I ended up using the "sendmail" option which uses Postfix's built in sendmail compatibility.
 
Old 06-13-2012, 08:23 AM   #5
Jonathan_Frias
LQ Newbie
 
Registered: Jun 2012
Posts: 6

Original Poster
Rep: Reputation: Disabled
The issue was receiving messages. I can send just fine.

However ultimately I scrapped the server with a fresh install and followed these instructions. It seems they are a little more geared towards what I'm working with:
http://www.howtoforge.com/perfect-se...ot-ispconfig-3

Sending/receiving is working now, which I am very happy about.

This is what I'm facing now, if you're still interested:
http://www.linuxquestions.org/questi...al-4175411084/
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
postfix mailserver (sometimes) blocked Kropotkin Linux - Server 8 01-24-2010 04:18 PM
Postfix: cant send email from my Windows pc using my postfix mailserver elvisious Linux - Software 8 08-01-2008 07:01 PM
Apache: How do I use Postfix if I'm not a mailserver? tethysgods Linux - Software 1 09-07-2004 07:50 PM
Problem with postfix mailserver..!?! knuzzen Linux - Networking 0 09-01-2004 05:41 AM
need help with Postfix mailserver Lleb_KCir Linux - Software 1 03-31-2004 11:11 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 02:08 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration