OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
 
"unknown user" on local delivery with mysql

bozackslimdizzy.com
Date: Mon Feb 27 2006 - 19:46:25 CST


hi all,

I've been looking into this for a few days and i'm stumped ... when i
telnet in locally and try to send mail to and from two users who are both
in my users table in mysql i get an unknown user bounce. (the system
isn't live yet, so my first test is to try and get email delivered from a
local send).

here is the tutorial i've been following
"http://workaround.org/articles/ispmail-sarge/" and I am using Ubuntu
5.10.

my /home/vmail dir doesn't contain the "blism.com" domain (or anything)
... i was under the impression that it would create the domain and then
the users, then the maildir(s) when mail is delivered ... is that correct?

i've provided the output of postfix -n as well as a verbose log of a
failed delivery. my mysql-*.cf files are right at the end. i'm hoping
someone out there can give me a clue. if i need to post more information,
please let me know and i'll fire it off.

thanks in advance!!

postfix -n:
================================================
append_dot_mydomain = no
biff = no
broken_sasl_auth_clients = yes
config_directory = /etc/postfix
delay_warning_time = 4h
inet_interfaces = all
mydestination = localhost
mydomain = blism.com
myhostname = mail2.blism.com
mynetworks = 127.0.0.0/8, 192.168.1.0/24
smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
smtpd_recipient_restrictions = permit_mynetworks,
permit_sasl_authenticated, reject_unauth_destination
smtpd_sasl_auth_enable = yes
smtpd_tls_cert_file = /etc/postfix/smtpd.cert
smtpd_tls_key_file = /etc/postfix/smtpd.key
smtpd_use_tls = yes
virtual_alias_domains =
virtual_alias_maps = mysql:/etc/postfix/mysql-virtual_forwardings.cf
mysql:/etc/postfix/mysql-virtual_email2email.cf
virtual_gid_maps = static:5000
virtual_mailbox_base = /home/vmail
virtual_mailbox_domains = mysql:/etc/postfix/mysql-virtual_domains.cf
virtual_uid_maps = static:5000

debug info from logs
=============================================================
this is what happens when i telnet in locally and try to send to and from
two users who are both in my users table in mysql
=============================================================
Feb 25 16:55:00 localhost postfix/smtpd[20704]: < slimDEV[192.168.1.33]:
mail from:<bozackblism.com>
Feb 25 16:55:00 localhost postfix/smtpd[20704]: extract_addr: input:
<bozackblism.com>
Feb 25 16:55:00 localhost postfix/smtpd[20704]: smtpd_check_addr:
addr=bozackblism.com
Feb 25 16:55:00 localhost postfix/smtpd[20704]: ctable_locate: move
existing entry key bozackblism.com
Feb 25 16:55:00 localhost postfix/smtpd[20704]: extract_addr: result:
bozackblism.com
Feb 25 16:55:00 localhost postfix/smtpd[20704]: fsspace: .: block size
4096, blocks free 7317108
Feb 25 16:55:00 localhost postfix/smtpd[20704]: smtpd_check_size: blocks
4096 avail 7317108 min_free 0 msg_size_limit 10240000
Feb 25 16:55:00 localhost postfix/smtpd[20704]: > slimDEV[192.168.1.33]:
250 Ok

Feb 25 16:55:20 localhost postfix/smtpd[20704]: < slimDEV[192.168.1.33]:
mail to:<jayblism.com>
Feb 25 16:55:20 localhost postfix/smtpd[20704]: > slimDEV[192.168.1.33]:
503 Error: nested MAIL command
Feb 25 16:55:29 localhost postfix/smtpd[20704]: < slimDEV[192.168.1.33]:
rcpt to:<jayblism.com>
Feb 25 16:55:29 localhost postfix/smtpd[20704]: extract_addr: input:
<jayblism.com>
Feb 25 16:55:29 localhost postfix/smtpd[20704]: smtpd_check_addr:
addr=jayblism.com
Feb 25 16:55:29 localhost postfix/smtpd[20704]: ctable_locate: move
existing entry key jayblism.com
Feb 25 16:55:29 localhost postfix/smtpd[20704]: extract_addr: result:
jayblism.com
Feb 25 16:55:29 localhost postfix/smtpd[20704]: >>> START Recipient
address RESTRICTIONS <<<
Feb 25 16:55:29 localhost postfix/smtpd[20704]: generic_checks:
name=permit_mynetworks
Feb 25 16:55:29 localhost postfix/smtpd[20704]: permit_mynetworks: slimDEV
192.168.1.33
Feb 25 16:55:29 localhost postfix/smtpd[20704]: match_hostname: slimDEV ~?
127.0.0.0/8
Feb 25 16:55:29 localhost postfix/smtpd[20704]: match_hostaddr:
192.168.1.33 ~? 127.0.0.0/8
Feb 25 16:55:29 localhost postfix/smtpd[20704]: match_hostname: slimDEV ~?
192.168.1.0/24
Feb 25 16:55:29 localhost postfix/smtpd[20704]: match_hostaddr:
192.168.1.33 ~? 192.168.1.0/24
Feb 25 16:55:29 localhost postfix/smtpd[20704]: generic_checks:
name=permit_mynetworks status=1
Feb 25 16:55:29 localhost postfix/smtpd[20704]: >>> CHECKING RECIPIENT
MAPS <<<
Feb 25 16:55:29 localhost postfix/smtpd[20704]: ctable_locate: leave
existing entry key jayblism.com
Feb 25 16:55:29 localhost postfix/smtpd[20704]: maps_find:
recipient_canonical_maps: jayblism.com: not found
Feb 25 16:55:29 localhost postfix/smtpd[20704]: match_string: blism.com ~?
localhost
Feb 25 16:55:29 localhost postfix/smtpd[20704]: match_list_match:
blism.com: no match
Feb 25 16:55:29 localhost postfix/smtpd[20704]: maps_find:
recipient_canonical_maps: blism.com: not found
Feb 25 16:55:29 localhost postfix/smtpd[20704]: mail_addr_find:
jayblism.com -> (not found)
Feb 25 16:55:29 localhost postfix/smtpd[20704]: maps_find: canonical_maps:
jayblism.com: not found
Feb 25 16:55:29 localhost postfix/smtpd[20704]: match_string: blism.com ~?
localhost
Feb 25 16:55:29 localhost postfix/smtpd[20704]: match_list_match:
blism.com: no match
Feb 25 16:55:29 localhost postfix/smtpd[20704]: maps_find: canonical_maps:
blism.com: not found
Feb 25 16:55:29 localhost postfix/smtpd[20704]: mail_addr_find:
jayblism.com -> (not found)
Feb 25 16:55:29 localhost postfix/smtpd[20704]: dict_mysql_get_active:
found active connection to host 127.0.0.1
Feb 25 16:55:29 localhost postfix/smtpd[20704]: dict_mysql: successful
query from host 127.0.0.1
Feb 25 16:55:29 localhost postfix/smtpd[20704]: dict_mysql_lookup:
retrieved 0 rows
Feb 25 16:55:29 localhost postfix/smtpd[20704]: dict_mysql_get_active:
found active connection to host 127.0.0.1
Feb 25 16:55:29 localhost postfix/smtpd[20704]: dict_mysql: successful
query from host 127.0.0.1
Feb 25 16:55:29 localhost postfix/smtpd[20704]: dict_mysql_lookup:
retrieved 1 rows
Feb 25 16:55:29 localhost postfix/smtpd[20704]: maps_find:
virtual_alias_maps:
mysql:/etc/postfix/mysql-virtual_email2email.cf(0,100): jayblism.com =
jayblism.com
Feb 25 16:55:29 localhost postfix/smtpd[20704]: mail_addr_find:
jayblism.com -> jayblism.com
Feb 25 16:55:29 localhost postfix/smtpd[20704]: smtpd_check_rewrite:
trying: permit_inet_interfaces
Feb 25 16:55:29 localhost postfix/smtpd[20704]: permit_inet_interfaces:
slimDEV 192.168.1.33
Feb 25 16:55:29 localhost postfix/smtpd[20704]: before
input_transp_cleanup: cleanup flags = enable_header_body_filter
enable_automatic_bcc enable_address_mapping
Feb 25 16:55:29 localhost postfix/smtpd[20704]: after
input_transp_cleanup: cleanup flags = enable_header_body_filter
enable_automatic_bcc enable_address_mapping
Feb 25 16:55:29 localhost postfix/smtpd[20704]: connect to subsystem
public/cleanup
Feb 25 16:55:29 localhost postfix/smtpd[20704]: public/cleanup socket:
wanted attribute: queue_id
Feb 25 16:55:29 localhost postfix/smtpd[20704]: input attribute name:
queue_id
Feb 25 16:55:29 localhost postfix/smtpd[20704]: input attribute value:
6CE402C0432
Feb 25 16:55:29 localhost postfix/smtpd[20704]: public/cleanup socket:
wanted attribute: (list terminator)
Feb 25 16:55:29 localhost postfix/smtpd[20704]: input attribute name: (end)
Feb 25 16:55:29 localhost postfix/smtpd[20704]: send attr flags = 50
Feb 25 16:55:29 localhost postfix/smtpd[20704]: 6CE402C0432:
client=slimDEV[192.168.1.33]
Feb 25 16:55:29 localhost postfix/smtpd[20704]: > slimDEV[192.168.1.33]:
250 Ok
Feb 25 16:55:31 localhost postfix/smtpd[20704]: < slimDEV[192.168.1.33]: data
Feb 25 16:55:31 localhost postfix/smtpd[20704]: > slimDEV[192.168.1.33]:
354 End data with <CR><LF>.<CR><LF>
Feb 25 16:55:35 localhost postfix/smtpd[20704]: public/cleanup socket:
wanted attribute: status
Feb 25 16:55:35 localhost postfix/cleanup[20711]: 6CE402C0432:
message-id=<20060225215500.6CE402C0432mail2.blism.com>
Feb 25 16:55:35 localhost postfix/smtpd[20704]: input attribute name: status
Feb 25 16:55:35 localhost postfix/smtpd[20704]: input attribute value: 0
Feb 25 16:55:35 localhost postfix/smtpd[20704]: public/cleanup socket:
wanted attribute: reason
Feb 25 16:55:35 localhost postfix/smtpd[20704]: input attribute name: reason
Feb 25 16:55:35 localhost postfix/smtpd[20704]: input attribute value: (end)
Feb 25 16:55:35 localhost postfix/smtpd[20704]: public/cleanup socket:
wanted attribute: (list terminator)
Feb 25 16:55:35 localhost postfix/smtpd[20704]: input attribute name: (end)
Feb 25 16:55:35 localhost postfix/smtpd[20704]: > slimDEV[192.168.1.33]:
250 Ok: queued as 6CE402C0432
Feb 25 16:55:35 localhost postfix/qmgr[20702]: 6CE402C0432:
from=<bozackblism.com>, size=364, nrcpt=1 (queue active)
Feb 25 16:55:35 localhost postfix/virtual[20715]: 6CE402C0432:
to=<jayblism.com>, relay=virtual, delay=35, status=bounced (unknown user:
"jayblism.com")
Feb 25 16:55:35 localhost postfix/cleanup[20711]: 24D6D2C0436:
message-id=<20060225215535.24D6D2C0436mail2.blism.com>
Feb 25 16:55:35 localhost postfix/qmgr[20702]: 24D6D2C0436: from=<>,
size=2055, nrcpt=1 (queue active)
Feb 25 16:55:35 localhost postfix/qmgr[20702]: 6CE402C0432: removed
Feb 25 16:55:35 localhost postfix/virtual[20715]: 24D6D2C0436:
to=<bozackblism.com>, relay=virtual, delay=0, status=bounced (unknown
user: "bozackblism.com")
Feb 25 16:55:35 localhost postfix/qmgr[20702]: 24D6D2C0436: removed

=======================================
mysql-*.cf
=======================================

mysql-virtual_domains.cf
=======================================
user = email_admin
password = ean3twork
dbname = email
table = domains
select_field = 'virtual'
where_field = domain
hosts = 127.0.0.1

mysql-virtual_email2email.cf
=======================================
user = email_admin
password = ean3twork
dbname = email
table = users
select_field = email
where_field = email
hosts = 127.0.0.1

mysql-virtual_forwardings.cf
=======================================
user = email_admin
password = ean3twork
dbname = email
table = forwardings
select_field = destination
where_field = source
hosts = 127.0.0.1

mysql-virtual_mailboxes.cf
=======================================
user = email_admin
password = ean3twork
dbname = email
table = users
select_field =
CONCAT(SUBSTRING_INDEX(email,'',-1),'/',SUBSTRING_INDEX(email,'',1),'/')
where_field = email
hosts = 127.0.0.1