Страница 1 из 1

postfixadmin не создает ящики

Добавлено: 2008-09-18 18:01:42
Cancer
Доброго времени суток!
вот возник вопросик

связка

Код: Выделить всё

mysql-client-5.1.26 Multithreaded SQL database (client)
mysql-server-5.1.26 Multithreaded SQL database (server)
dovecot-1.1.3       Secure and compact IMAP and POP3 servers
exim-4.69           High performance MTA for Unix systems on the Internet
apache-1.3.37_1     The extremely popular Apache http server. Very fast,
postfixadmin-2.2.1.1 PHP web-based management tool for Postfix virtual
Вот создаю домен в постфиксадмине смотрю в БД создался,а создаю почтовый ящик пишет Неверное имя!
искал по форуму покка нет решения

Код: Выделить всё

<?php
/**
 * Postfix Admin
 *
 * LICENSE
 * This source file is subject to the GPL license that is bundled with
 * this package in the file LICENSE.TXT.
 *
 * Further details on the project are available at :
 *     http://www.postfixadmin.com or http://postfixadmin.sf.net
 *
 * @version $Id: config.inc.php 408 2008-07-21 21:43:06Z GingerDog $
 * @license GNU GPL v2 or later.
 *
 * File: config.inc.php
 * Contains configuration options.
 */

if (ereg ("config.inc.php", $_SERVER['PHP_SELF']))
{
   header ("Location: login.php");
   exit;
}

/*****************************************************************
 *  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 * The following line needs commenting out or removing before the
 * application will run!
 * Doing this implies you have changed this file as required.
 */
//$CONF['configured'] = false;


// Postfix Admin Path
// Set the location of your Postfix Admin installation here.
// YOU MUST ENTER THE COMPLETE URL e.g. http://domain.tld/postfixadmin
$CONF['postfix_admin_url'] = 'http://mail.domain.local/postfixadmin/';

// shouldn't need changing.
$CONF['postfix_admin_path'] = '/usr/local/www/postfixadmin/';

// Language config
// Language files are located in './languages', change as required..
$CONF['default_language'] = 'ru';

// Database Config
// mysql = MySQL 3.23 and 4.0
// mysqli = MySQL 4.1
// pgsql = PostgreSQL
$CONF['database_type'] = 'mysql';
$CONF['database_host'] = 'localhost';
$CONF['database_user'] = 'exim';
$CONF['database_password'] = 'exim';
$CONF['database_name'] = 'exim';
$CONF['database_prefix'] = '';

// Here, if you need, you can customize table names.
$CONF['database_prefix'] = '';
$CONF['database_tables'] = array (
    'admin' => 'admin',
    'alias' => 'alias',
//    'alias_domain' => 'alias_domain',
    'config' => 'config',
    'domain' => 'domain',
    'domain_admins' => 'domain_admins',
    'fetchmail' => 'fetchmail',
    'log' => 'log',
    'mailbox' => 'mailbox',
    'vacation' => 'vacation',
    'vacation_notification' => 'vacation_notification',
);

// Site Admin
// Define the Site Admins email address below.
// This will be used to send emails from to create mailboxes.
$CONF['admin_email'] = 'postmaster@test.ru';

// Mail Server
// Hostname (FQDN) of your mail server.
// This is used to send email to Postfix in order to create mailboxes.
$CONF['smtp_server'] = 'localhost';
$CONF['smtp_port'] = '25';

// Encrypt
// In what way do you want the passwords to be crypted?
// md5crypt = internal postfix admin md5
// md5 = md5 sum of the password
// system = whatever you have set as your PHP system default
// cleartext = clear text passwords (ouch!)
$CONF['encrypt'] = 'cleartext';

// Minimum length required for passwords. Postfixadmin will not
// allow users to set passwords which are shorter than this value.
$CONF['min_password_length'] = 5;

// Generate Password
// Generate a random password for a mailbox or admin and display it.
// If you want to automagically generate paswords set this to 'YES'.
$CONF['generate_password'] = 'NO';

// Show Password
// Always show password after adding a mailbox or admin.
// If you want to always see what password was set set this to 'YES'.
$CONF['show_password'] = 'NO';

// Page Size
// Set the number of entries that you would like to see
// in one page.
$CONF['page_size'] = '10';

// Default Aliases
// The default aliases that need to be created for all domains.
$CONF['default_aliases'] = array (
    'abuse' => 'abuse@test.ru.local',
    'hostmaster' => 'hostmaster@test.ru',
    'postmaster' => 'postmaster@test.ru',
    'webmaster' => 'webmaster@test.ru'
);

// Mailboxes
// If you want to store the mailboxes per domain set this to 'YES'.
// Examples:
//   YES: /usr/local/virtual/domain.tld/username@domain.tld
//   NO:  /usr/local/virtual/username@domain.tld
$CONF['domain_path'] = 'YES';
// If you don't want to have the domain in your mailbox set this to 'NO'.
// Examples:
//   YES: /usr/local/virtual/domain.tld/username@domain.tld
//   NO:  /usr/local/virtual/domain.tld/username
// Note: If $CONF['domain_path'] is set to NO, this setting will be forced to YES.
$CONF['domain_in_mailbox'] = 'NO';

// Default Domain Values
// Specify your default values below. Quota in MB.
$CONF['aliases'] = '0';
$CONF['mailboxes'] = '0';
$CONF['maxquota'] = '0';

// Quota
// When you want to enforce quota for your mailbox users set this to 'YES'.
$CONF['quota'] = 'YES';
// You can either use '1024000' or '1048576'
$CONF['quota_multiplier'] = '1024000';

// Transport
// If you want to define additional transport options for a domain set this to 'YES'.
// Read the transport file of the Postfix documentation.
$CONF['transport'] = 'NO';
// Transport options
// If you want to define additional transport options put them in array below.
$CONF['transport_options'] = array (
    'virtual',  // for virtual accounts
    'local',    // for system accounts
    'relay'     // for backup mx
);
// Transport default
// You should define default transport. It must be in array above.
$CONF['transport_default'] = 'virtual';

// Virtual Vacation
// If you want to use virtual vacation for you mailbox users set this to 'YES'.
// NOTE: Make sure that you install the vacation module. http://high5.net/postfixadmin/
$CONF['vacation'] = 'NO';
// This is the autoreply domain that you will need to set in your Postfix
// transport maps to handle virtual vacations. It does not need to be a
// real domain (i.e. you don't need to setup DNS for it).
$CONF['vacation_domain'] = 'autoreply.domain.local';

// Vacation Control
// If you want users to take control of vacation set this to 'YES'.
$CONF['vacation_control'] ='YES';

// Vacation Control for admins
// Set to 'YES' if your domain admins should be able to edit user vacation.
$CONF['vacation_control_admin'] = 'YES';

// Alias Control
// Postfix Admin inserts an alias in the alias table for every mailbox it creates.
// The reason for this is that when you want catch-all and normal mailboxes
// to work you need to have the mailbox replicated in the alias table.
// If you want to take control of these aliases as well set this to 'YES'.
$CONF['alias_control'] = 'YES';

// Alias Control for admins
// Set to 'NO' if your domain admins shouldn't be able to edit user aliases.
$CONF['alias_control_admin'] = 'YES';

// Special Alias Control
// Set to 'NO' if your domain admins shouldn't be able to edit default aliases.
$CONF['special_alias_control'] = 'YES';

// Alias Goto Field Limit
// Set the max number of entries that you would like to see
// in one 'goto' field in overview, the rest will be hidden and "[and X more...]" will be added.
// '0' means no limits.
$CONF['alias_goto_limit'] = '0';

// Backup
// If you don't want backup tab set this to 'NO';
$CONF['backup'] = 'NO';

// Send Mail
// If you don't want sendmail tab set this to 'NO';
$CONF['sendmail'] = 'NO';

// Logging
// If you don't want logging set this to 'NO';
$CONF['logging'] = 'YES';

// Fetchmail
// If you don't want fetchmail tab set this to 'NO';
$CONF['fetchmail'] = 'YES';

// fetchmail_extra_options allows users to specify any fetchmail options and any MDA
// (it will even accept 'rm -rf /' as MDA!)
// This should be set to NO, except if you *really* trust *all* your users.
$CONF['fetchmail_extra_options'] = 'NO';

// Header
$CONF['show_header_text'] = 'NO';
$CONF['header_text'] = ':: Postfix Admin ::';

// link to display under 'Main' menu when logged in as a user.
$CONF['user_footer_link'] = "http://mail.domain.local/main";

// Footer
// Below information will be on all pages.
// If you don't want the footer information to appear set this to 'NO'.
$CONF['show_footer_text'] = 'YES';
$CONF['footer_text'] = 'Return to HOME';
$CONF['footer_link'] = 'http://mail.domain.local/postfixadmin/';

// Welcome Message
// This message is send to every newly created mailbox.
// Change the text between EOM.
$CONF['welcome_text'] = <<<EOM
Hi,

Welcome to your new account.
EOM;

// When creating mailboxes or aliases, check that the domain-part of the
// address is legal by performing a name server look-up.
$CONF['emailcheck_resolve_domain']='YES';


// Optional:
// Analyze alias gotos and display a colored block in the first column
// indicating if an alias or mailbox appears to deliver to a non-existent
// account.  Also, display indications, for POP/IMAP mailboxes and
// for custom destinations (such as mailboxes that forward to a UNIX shell
// account or mail that is sent to a MS exchange server, or any other
// domain or subdomain you use)
// See http://www.w3schools.com/html/html_colornames.asp for a list of
// color names available on most browsers

//set to YES to enable this feature
$CONF['show_status']='NO';
//display a guide to what these colors mean
$CONF['show_status_key']='NO';
// 'show_status_text' will be displayed with the background colors
// associated with each status, you can customize it here
$CONF['show_status_text']='&nbsp;&nbsp;';
// show_undeliverable is useful if most accounts are delivered to this
// postfix system.  If many aliases and mailboxes are forwarded
// elsewhere, you will probably want to disable this.
$CONF['show_undeliverable']='NO';
$CONF['show_undeliverable_color']='tomato';
$CONF['show_undeliverable_exceptions']=array("unixmail.domain.ext","exchangeserver.domain.ext","gmail.com");
$CONF['show_popimap']='NO';
$CONF['show_popimap_color']='darkgrey';
// set 'show_custom_count' to 0 to disable custom indicators
$CONF['show_custom_count']=2;
$CONF['show_custom_domains']=array("subdomain.domain.ext","domain2.ext");
$CONF['show_custom_colors']=array("lightgreen","lightblue");


// Optional:
// Script to run after creation of mailboxes.
// Note that this may fail if PHP is run in "safe mode", or if
// operating system features (such as SELinux) or limitations
// prevent the web-server from executing external scripts.
// $CONF['mailbox_postcreation_script']='sudo -u courier /usr/local/bin/postfixadmin-mailbox-postcreation.sh';

// Optional:
// Script to run after alteration of mailboxes.
// Note that this may fail if PHP is run in "safe mode", or if
// operating system features (such as SELinux) or limitations
// prevent the web-server from executing external scripts.
// $CONF['mailbox_postedit_script']='sudo -u courier /usr/local/bin/postfixadmin-mailbox-postedit.sh';

// Optional:
// Script to run after deletion of mailboxes.
// Note that this may fail if PHP is run in "safe mode", or if
// operating system features (such as SELinux) or limitations
// prevent the web-server from executing external scripts.
// $CONF['mailbox_postdeletion_script']='sudo -u courier /usr/local/bin/postfixadmin-mailbox-postdeletion.sh';

// Optional:
// Script to run after deletion of domains.
// Note that this may fail if PHP is run in "safe mode", or if
// operating system features (such as SELinux) or limitations
// prevent the web-server from executing external scripts.
// $CONF['domain_postdeletion_script']='sudo -u courier /usr/local/bin/postfixadmin-domain-postdeletion.sh';

// Optional:
// Sub-folders which should automatically be created for new users.
// The sub-folders will also be subscribed to automatically.
// Will only work with IMAP server which implement sub-folders.
// Will not work with POP3.
// If you define create_mailbox_subdirs, then the
// create_mailbox_subdirs_host must also be defined.
//
// $CONF['create_mailbox_subdirs']=array('Spam');
// $CONF['create_mailbox_subdirs_host']='localhost';
//
// Normally, the TCP port number does not have to be specified.
// $CONF['create_mailbox_subdirs_hostport']=143;
//
// If you have trouble connecting to the IMAP-server, then specify
// a value for $CONF['create_mailbox_subdirs_hostoptions']. These
// are some examples to experiment with:
// $CONF['create_mailbox_subdirs_hostoptions']=array('notls');
// $CONF['create_mailbox_subdirs_hostoptions']=array('novalidate-cert','norsh');
// See also the "Optional flags for names" table at
// http://www.php.net/manual/en/function.imap-open.php


// Theme Config
// Specify your own logo and CSS file
$CONF['theme_logo'] = 'images/logo-default.png';
$CONF['theme_css'] = 'css/default.css';

// If you want to keep most settings at default values and/or want to ensure
// that future updates work without problems, you can use a separate config
// file (config.local.php) instead of editing this file and override some
// settings there.
if (file_exists(dirname(__FILE__) . '/config.local.php')) { # for /
    include(dirname(__FILE__) . '/config.local.php');
}

//
// END OF CONFIG FILE
//
/* vim: set expandtab softtabstop=4 tabstop=4 shiftwidth=4: */

Re: postfixadmin не создает ящики

Добавлено: 2008-09-18 20:37:52
Morty
логи полистай - может там что есть....
возможно php5-imap модуль нужен, он там вроде касаеться этого вопроса

Re: postfixadmin не создает ящики

Добавлено: 2008-09-18 21:05:17
Cancer
Morty писал(а):логи полистай - может там что есть....
возможно php5-imap модуль нужен, он там вроде касаеться этого вопроса

стоит php-imap
в логах /var/log/maillog
ничего нет токо то что работает экзим и довекот и не более

С правами все норм

Код: Выделить всё

/var/spool/>ls -l
total 14
drwxrwx---  2 smmsp     smmsp   512 17 сен 20:33 clientmqueue
drwxr-x---  5 mailnull  mail    512 18 сен 03:04 exim
drwxrwxr-x  2 uucp      dialer  512 18 сен 01:08 lock
drwxr-xr-x  2 root      daemon  512 12 янв  2007 lpd
drwxr-xr-x  2 root      daemon  512 17 сен 03:04 mqueue
drwx------  2 root      daemon  512 12 янв  2007 opielocks
drwxr-xr-x  3 root      daemon  512  5 сен 11:04 output

логи мускуля

Код: Выделить всё

080918 22:09:49 2928 Connect    exim@localhost on
                 2928 Query     SET CHARACTER SET utf8
                 2928 Query     SET COLLATION_CONNECTION='utf8_general_ci'
                 2928 Init DB   exim
                 2928 Query     SELECT domain FROM domain WHERE domain!='ALL' ORDER BY domain
                 2928 Query     SET CHARACTER SET utf8
                 2928 Query     SET COLLATION_CONNECTION='utf8_general_ci'
                 2928 Init DB   exim
                 2928 Query     SET CHARACTER SET utf8
                 2928 Query     SET COLLATION_CONNECTION='utf8_general_ci'
                 2928 Init DB   exim
                 2928 Query     SET CHARACTER SET utf8
                 2928 Query     SET COLLATION_CONNECTION='utf8_general_ci'
                 2928 Init DB   exim
                 2928 Query     SET CHARACTER SET utf8
                 2928 Query     SET COLLATION_CONNECTION='utf8_general_ci'
                 2928 Init DB   exim
                 2928 Query     SELECT 1 FROM domain_admins WHERE username='admin@domain.local' AND (domain='test.ru' OR doma
                 2928 Query     SELECT COUNT(*) FROM alias WHERE domain='test.ru'
                 2928 Query     SELECT COUNT(*) FROM mailbox WHERE domain='test.ru'
                 2928 Query     SELECT SUM(quota) FROM mailbox WHERE domain='test.ru'
                 2928 Query     SELECT * FROM domain WHERE domain='test.ru'
                 2928 Query     SELECT COUNT(*) FROM alias WHERE domain='test.ru'
                 2928 Query     SELECT COUNT(*) FROM mailbox WHERE domain='test.ru'
                 2928 Query     SELECT SUM(quota) FROM mailbox WHERE domain='test.ru'
                 2928 Query     SELECT * FROM domain WHERE domain='test.ru'
                 2928 Query     SELECT * FROM alias WHERE address='1212@test.ru'

Re: postfixadmin не создает ящики

Добавлено: 2008-09-18 21:53:35
Cancer
Может структура таблиц поменялись ?


Создавал вот так

Код: Выделить всё

############# БД: `exim`
 
  
USE mysql;
INSERT INTO `user` (`Host`, `User`, `Password`)
VALUES ('localhost','exim',password('exim'));
INSERT INTO `db` (`Host`, `Db`, `User`, `Select_priv`)
VALUES ('localhost','exim','exim','Y');
FLUSH PRIVILEGES;
GRANT USAGE ON exim.* TO exim@localhost;
GRANT SELECT, INSERT, DELETE, UPDATE ON exim.* TO exim@localhost;
CREATE DATABASE `exim`;
USE `exim`;



 
#############Структура таблицы `admin`
 

CREATE TABLE `admin` (
  `username` varchar(255) NOT NULL default '',
  `password` varchar(255) NOT NULL default '',
  `created` datetime NOT NULL default '0000-00-00 00:00:00',
  `modified` datetime NOT NULL default '0000-00-00 00:00:00',
  `active` tinyint(1) NOT NULL default '1',
  PRIMARY KEY  (`username`),
  KEY `username` (`username`)
) TYPE=MyISAM COMMENT='Exim and dovecot Admin - Virtual Admins';



 
#############Структура таблицы `alias`


CREATE TABLE `alias` (
  `address` varchar(255) NOT NULL default '',
  `goto` text NOT NULL,
  `domain` varchar(255) NOT NULL default '',
  `created` datetime NOT NULL default '0000-00-00 00:00:00',
  `modified` datetime NOT NULL default '0000-00-00 00:00:00',
  `active` tinyint(1) NOT NULL default '1',
  PRIMARY KEY  (`address`),
  KEY `address` (`address`)
) TYPE=MyISAM COMMENT='Exim and dovecot Admin - Virtual Aliases';




#############Структура таблицы `domain`


CREATE TABLE `domain` (
  `domain` varchar(255) NOT NULL default '',
  `description` varchar(255) NOT NULL default '',
  `aliases` int(10) NOT NULL default '0',
  `mailboxes` int(10) NOT NULL default '0',
  `maxquota` int(10) NOT NULL default '0',
  `transport` varchar(255) default NULL,
  `backupmx` tinyint(1) NOT NULL default '0',
  `created` datetime NOT NULL default '0000-00-00 00:00:00',
  `modified` datetime NOT NULL default '0000-00-00 00:00:00',
  `active` tinyint(1) NOT NULL default '1',
  PRIMARY KEY  (`domain`),
  KEY `domain` (`domain`)
) TYPE=MyISAM COMMENT='Exim and dovecot Admin - Virtual Domains';



 
#############Структура таблицы `domain_admins`
 

CREATE TABLE `domain_admins` (
  `username` varchar(255) NOT NULL default '',
  `domain` varchar(255) NOT NULL default '',
  `created` datetime NOT NULL default '0000-00-00 00:00:00',
  `active` tinyint(1) NOT NULL default '1',
  KEY `username` (`username`)
) TYPE=MyISAM COMMENT='Exim and dovecot Admin - Domain Admins';



 
#############Структура таблицы `log`
 

CREATE TABLE `log` (
  `timestamp` datetime NOT NULL default '0000-00-00 00:00:00',
  `username` varchar(255) NOT NULL default '',
  `domain` varchar(255) NOT NULL default '',
  `action` varchar(255) NOT NULL default '',
  `data` varchar(255) NOT NULL default '',
  KEY `timestamp` (`timestamp`)
) TYPE=MyISAM COMMENT='Exim and dovecot Admin - Log';




#############Структура таблицы `mailbox`
 

CREATE TABLE `mailbox` (
  `username` varchar(255) NOT NULL default '',
  `password` varchar(255) NOT NULL default '',
  `name` varchar(255) NOT NULL default '',
  `maildir` varchar(255) NOT NULL default '',
  `quota` int(10) NOT NULL default '0',
  `domain` varchar(255) NOT NULL default '',
  `created` datetime NOT NULL default '0000-00-00 00:00:00',
  `modified` datetime NOT NULL default '0000-00-00 00:00:00',
  `active` tinyint(1) NOT NULL default '1',
  PRIMARY KEY  (`username`),
  KEY `username` (`username`)
) TYPE=MyISAM COMMENT='Exim and dovecot Admin - Virtual Mailboxes';



 
#############Структура таблицы `vacation`



CREATE TABLE `vacation` (
  `email` varchar(255) NOT NULL default '',
  `subject` varchar(255) NOT NULL default '',
  `body` text NOT NULL,
  `cache` text NOT NULL,
  `domain` varchar(255) NOT NULL default '',
  `created` datetime NOT NULL default '0000-00-00 00:00:00',
  `active` tinyint(1) NOT NULL default '1',
  PRIMARY KEY  (`email`),
  KEY `email` (`email`)
) TYPE=MyISAM COMMENT='Exim and dovecot Admin - Virtual Vacation';

Re: postfixadmin не создает ящики

Добавлено: 2008-09-19 22:55:46
Alex_hha
Исправь $CONF['emailcheck_resolve_domain']='YES'; на $CONF['emailcheck_resolve_domain']='NO';

Re: postfixadmin не создает ящики

Добавлено: 2008-09-19 23:19:56
Cancer
Alex_hha писал(а):Исправь $CONF['emailcheck_resolve_domain']='YES'; на $CONF['emailcheck_resolve_domain']='NO';

УРЯ получилось ))))) спасибо )) :drinks:

Re: postfixadmin не создает ящики

Добавлено: 2008-09-20 16:26:26
Cancer
Никто не встречал такой фигни

Перенес базу со старого мускуля CHARSET=cp1251(старого почтового сервака mysql-server 4.1) с почтовыми ящиками итд, скопировал на новый (сервак mysql-server 5.1)ну я пересобрал на новом серваке мускуль с ср1251 но при просмотре почтовых ящиков (точнее при нажатии на кнопку Обзор) выдает (да и еще я перед всем этим создал суперпользователя)
и после этого перестал работать Обзор ))

Код: Выделить всё

DEBUG INFORMATION:
Invalid query: Illegal mix of collations (cp1251_general_ci,IMPLICIT) and (latin1_swedish_ci,IMPLICIT) for operation '=' 

Please check the documentation and website for more information.

Re: postfixadmin не создает ящики

Добавлено: 2008-09-20 16:34:41
f_andrey
Cancer писал(а):Перенес базу со старого мускуля CHARSET=cp1251(старого почтового сервака mysql-server 4.1) с почтовыми ящиками итд, скопировал на новый (сервак mysql-server 5.1)ну я пересобрал на новом серваке мускуль с ср1251
помнится когда пятерку только внедряли было много проблем с кодировками, погугли там были какие то косяки, и методы их решений именно при переносе с 4 на 5ку, сам не вспомню давно MySQL не юзал

Re: postfixadmin не создает ящики

Добавлено: 2008-09-23 13:29:18
Arc
Базы надо в utf8 создавать...

Re: postfixadmin не создает ящики

Добавлено: 2008-09-23 13:43:28
Cancer
Arc писал(а):Базы надо в utf8 создавать...

да я так думаю что лучше забить ) и создать заного БД с утф8