OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
 
Postfix/Maildrop/Mysql Integration - SQL query with VERY stange characters : username = "X^D ^H ^G ^H ' ^H ^G ^H ^G ^H^C"

From: Cyril Drouin - Bysoft (cyril.drouinbysoft.fr)
Date: Mon May 03 2004 - 11:45:12 CDT


Hi,
 
I have an issue with Maildrop and I can't figure out where it comes from at
all :-(
I am using postix mysql and maildop with mysql support.
 
I logged my Mysql query and I got a very strange query. The username is not
correctly parsed by postfix ?
 
SELECT username, '504', '505', concat('/var/spool/postfix/virtual',maildir),
concat('/var/spool/postfix/virtual',maildir), quota FROM mailbox WHERE
username = "X^D ^H ^G ^H ' ^H ^G ^H ^G ^H^C"
 
How come I got this strange string as username ?
 
here is my maildropsql.config :
_________________________________________
# hostname - host name of your ldap server
hostname localhost
port 3306
socket /var/lib/mysql/mysql.sock
database mailsystem
dbuser postfix
dbpw bez7791
dbtable mailbox
 
#not used now
#timeout 5
 
# default_uid - default uid (number only) to use incase uidnumber attribute
not
# found in users mysql entry
default_uidnumber 504
 
# default_gid - default gid (number only) to use incase gidnumber attribute
not
# found in users ldap entry
default_gidnumber 505
 
# MySQL Field definitions
#
# This section allows you to specify the actual attributes you
# use in your Mysql record
#
# The example attribute mapping shown below is also the default
# mapping used by maildrop in the case that any are missing
 
# UID_FIELD - MySQL attribute which contains the users name (w or w/o
domain)
uid_field username
# UIDNUMBER_FIELD - MySQL attribute which contains the system uid to deliver
# mail as
uidnumber_field '504'
 
# GIDNUMBER_FIELD - MySQL attribute which contains the system gid to deliver
# mail as
gidnumber_field '505'
  
# MAILDIR_FIELD - MySQL attribute which contains the path to the users
# custom maildir
maildir_field concat('/var/spool/postfix/virtual',maildir)
 
# HOMEDIRECTORY_FIELD - MySQL attribute which contains the path to the users
# home directory
homedirectory_field concat('/var/spool/postfix/virtual',maildir)
 
# QUOTA_FIELD - MySQL attribute which contains the users quota
quota_field quota

# MYSQL_DEFAULT_STATUS_FIELD - MySQL attribute which could be created in the
# MySQL entry to set whether or not the user is allowed to receive email on
# this box..
# -- looks unused for now; but must be valid column !
(2001-11-03)
#mailstatus_field vmailstatus
 
# MYSQL_DEFAULT_WHERE_CLAUSE - This is optional !
# It can be set to any fixed string starting with keyword 'AND'.
# It will then be appended to the WHERE clause of our query.
# where_clause AND postfix="y"
 
logfile "/var/log/maidrop.log"
________________________________________________________
 
Here is the postconf -n :
 
alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
append_dot_mydomain = no
biff = no
command_directory = /usr/sbin
config_directory = /etc/postfix
content_filter = smtp-amavis:[127.0.0.1]:10024
daemon_directory = /usr/libexec/postfix
debug_peer_level = 2
debug_peer_list = 127.0.0.1
local_recipient_maps = $virtual_mailbox_maps $virtual_maps
proxy:unix:passwd.byname
mail_owner = postfix
mailq_path = /usr/bin/mailq
manpage_directory = /usr/local/man
mydestination = $myhostname, localhost.$mydomain
mydomain = bysoft.fr
myhostname = bisrvmail.bysoft.fr
mynetworks = 127.0.0.0/8, 192.168.2.0/28
myorigin = $mydomain
newaliases_path = /usr/bin/newaliases
queue_directory = /var/spool/postfix
readme_directory = no
recipient_delimiter = +
relay_domains = $virtual_mailbox_domains
sample_directory = /etc/postfix
sendmail_path = /usr/sbin/sendmail
setgid_group = postdrop
smtpd_banner = $myhostname ESMTP $mail_name
transport_maps = static:maildrop
unknown_local_recipient_reject_code = 550
virtual_gid_maps = static:505
virtual_mailbox_base = /var/spool/postfix/virtual/
virtual_mailbox_domains = mysql:/etc/postfix/mysql-virtual-domains.cf
virtual_mailbox_maps = mysql:/etc/postfix/mysql-virtual-maps.cf
virtual_transport = maildrop -w 80
virtual_uid_maps = static:504
_________________________________________________
 
The maillog error related to postfix :
 
May 3 18:46:04 bisrvmail postfix/pipe[7786]: CE1AF81C0DE:
to=<fturpinnumerique-plus.com>, relay=maildrop, delay=2254, status=deferred
(temporary failure. Command output: maildrop: signal 0x0B )

Any hint to look for my mystake will be welcome.
 
 
Thanks,
 
Cyril