Contenu | Rechercher | Menus

Annonce

Si vous avez des soucis pour rester connecté, déconnectez-vous puis reconnectez-vous depuis ce lien en cochant la case
Me connecter automatiquement lors de mes prochaines visites.

À propos de l'équipe du forum.

#1 Le 10/11/2006, à 22:48

n0delO

[Serveur mail] Problème avec postfix et mysql

Bonjour/Bonsoir,

Mon précédent topic étant mal expliquer j'en crèe un mieu :

Voila, j'ai installer sur mon ubuntu 6.10 :
   - postfix et postfix-mysql
   - courier-imap
   - courier-pop
   - courier-authdaemon
   - courier-authlib-mysql

Et bien sur un serveur apache php mysql ...

Mon problème est que je n'arrive pas à faire marcher le serveur de mail avec l'auth par mysql.

Voici ce qu'il me mes dans mon /var/log/mail.log quand j'envoie un mail a partir de gmail :

...
Nov 10 22:29:18 nodeloUBUNTU postfix/trivial-rewrite[8538]: warning: do not list domain DOMAIN.COM in BOTH mydestination and virtual_mailbox_domains
Nov 10 22:29:18 nodeloUBUNTU postfix/local[8571]: D37BB76934: to=<user1@DOMAIN.COM>, relay=local, delay=0.51, delays=0.31/0.11/0/0.09, dsn=5.1.1, status=bounced (unknown user: "user1")
Nov 10 22:29:18 nodeloUBUNTU postfix/cleanup[8570]: 3A31476936: message-id=<20061110212918.3A31476936@DOMAIN.COM>
...

Voici mon main.cf de postfix :

# See /usr/share/postfix/main.cf.dist for a commented, more complete version


# Debian specific:  Specifying a file name will cause the first
# line of that file to be used as the name.  The Debian default
# is /etc/mailname.
#myorigin = /etc/mailname

smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
biff = no

# appending .domain is the MUA's job.
append_dot_mydomain = no

# Uncomment the next line to generate "delayed mail" warnings
#delay_warning_time = 4h

# TLS parameters
smtpd_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
smtpd_use_tls=yes
smtpd_tls_session_cache_database = btree:${queue_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${queue_directory}/smtp_scache

# See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for
# information on enabling SSL in the smtp client.

myhostname = DOMAIN.COM
mydomain = DOMAIN.COM
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = mail.DOMAIN.COM, nodeloUBUNTU, DOMAIN.COM, localhost.DOMAIN.COM, localhost
relayhost = 
mynetworks = 127.0.0.0/8 192.168.0.0/24
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all

smtpd_sender_login_maps = mysql:/etc/postfix/mysql-virtual_sender.cf

virtual_alias_maps = mysql:/etc/postfix/mysql-virtual_aliases.cf
virtual_mailbox_domains = mysql:/etc/postfix/mysql-virtual_domains.cf
virtual_mailbox_maps = mysql:/etc/postfix/mysql-virtual_mailboxes.cf
virtual_mailbox_base = /var/spool/vmail/
virtual_uid_maps = static:5000
virtual_gid_maps = static:5000

virtual_create_maildirsize = yes
virtual_mailbox_extended = yes
virtual_mailbox_limit_maps = mysql:/etc/postfix/mysql-virtual_mailbox_limit_maps.cf
virtual_mailbox_limit_override = yes
virtual_maildir_limit_message = "Desole, la boite email de l'utilisateur est pleine, essayez plus tard."
virtual_overquota_bounce = yes

Voici mon /etc/postfix/mysql-virtual_sender.cf :

user = postfix
password = pass
hosts = 127.0.0.1
dbname = postfix
table = mail_mailbox
select_field = username
where_field = username

Voici mon /etc/postfix/mysql-virtual_aliases.cf :

user = postfix
password = pass
hosts = 127.0.0.1
dbname = postfix
table = mail_alias
select_field = goto
where_field = address

Voici mon /etc/postfix/mysql-virtual_domains.cf :

user = postfix
password = pass
hosts = 127.0.0.1
dbname = postfix
table = mail_domain
select_field = description
where_field = domains

Voici mon /etc/postfix/mysql-virtual_mailboxes.cf:

user = postfix
password = pass
hosts = 127.0.0.1
dbname = postfix
table = mail_mailbox
select_field = maildir
where_field = username

Voici mon /etc/postfix/mysql-virtual_mailbox_limit_maps.cf:

user = postfix
password = pass
hosts = 127.0.0.1
dbname = postfix
table = mail_mailbox
select_field = quota
where_field = usernamee

Voici mon shéma SQL dans la BDD 'postfix' :

CREATE TABLE mail_alias (
  address varchar(255) NOT NULL default '',
  goto text NOT NULL,
  domain varchar(255) NOT NULL default '',
  PRIMARY KEY  (address),
  KEY address (address)
);

CREATE TABLE mail_domain (
  domain varchar(255) NOT NULL default '',
  description varchar(255) NOT NULL default '',
  transport varchar(255) default 'virtual',
  PRIMARY KEY  (domain),
  KEY domain (domain)
);

CREATE TABLE mail_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 '',
  PRIMARY KEY  (username),
  KEY username (username)
);

Et voici ce que j'ai inséré dans ses tables :

INSERT INTO mail_domain (domain, description, transport) VALUES ('DOMAIN.COM', 'DOMAIN.COM', 'virtual');
INSERT INTO mail_alias (address, goto, domain) VALUES ('user1@DOMAIN.COM', 'user1@DOMAIN.COM', 'domaine.com');
INSERT INTO mail_mailbox (username, password, maildir, quota, domain) VALUES ('user1@DOMAIN.COM', 'MOT DE PASSE', 'user1@DOMAIN.COM/', '2000', 'user1@DOMAIN.COM');

Voici mon /etc/courier/authdaemonrc :

##VERSION: $Id: authdaemonrc.in,v 1.13 2005/10/05 00:07:32 mrsam Exp $
#
# Copyright 2000-2005 Double Precision, Inc.  See COPYING for
# distribution information.
#
# authdaemonrc created from authdaemonrc.dist by sysconftool
#
# Do not alter lines that begin with ##, they are used when upgrading
# this configuration.
#
# This file configures authdaemond, the resident authentication daemon.
#
# Comments in this file are ignored.  Although this file is intended to
# be sourced as a shell script, authdaemond parses it manually, so
# the acceptable syntax is a bit limited.  Multiline variable contents,
# with the \ continuation character, are not allowed.  Everything must
# fit on one line.  Do not use any additional whitespace for indentation,
# or anything else.

##NAME: authmodulelist:2
#
# The authentication modules that are linked into authdaemond.  The
# default list is installed.  You may selectively disable modules simply
# by removing them from the following list.  The available modules you
# can use are: authuserdb authpam authpgsql authldap authmysql authcustom authpipe

authmodulelist="authmysql"

##NAME: authmodulelistorig:3
#
# This setting is used by Courier's webadmin module, and should be left
# alone

authmodulelistorig="authmysql"

##NAME: daemons:0
#
# The number of daemon processes that are started.  authdaemon is typically
# installed where authentication modules are relatively expensive: such
# as authldap, or authmysql, so it's better to have a number of them running.
# PLEASE NOTE:  Some platforms may experience a problem if there's more than
# one daemon.  Specifically, SystemV derived platforms that use TLI with
# socket emulation.  I'm suspicious of TLI's ability to handle multiple
# processes accepting connections on the same filesystem domain socket.
#
# You may need to increase daemons if as your system load increases.  Symptoms
# include sporadic authentication failures.  If you start getting
# authentication failures, increase daemons.  However, the default of 5
# SHOULD be sufficient.  Bumping up daemon count is only a short-term
# solution.  The permanent solution is to add more resources: RAM, faster
# disks, faster CPUs...

daemons=5

##NAME: authdaemonvar:2
#
# authdaemonvar is here, but is not used directly by authdaemond.  It's
# used by various configuration and build scripts, so don't touch it!

authdaemonvar=/var/run/courier/authdaemon

##NAME: DEBUG_LOGIN:0
#
# Dump additional diagnostics to syslog
#
# DEBUG_LOGIN=0   - turn off debugging
# DEBUG_LOGIN=1   - turn on debugging
# DEBUG_LOGIN=2   - turn on debugging + log passwords too
#
# ** YES ** - DEBUG_LOGIN=2 places passwords into syslog.
#
# Note that most information is sent to syslog at level 'debug', so
# you may need to modify your /etc/syslog.conf to be able to see it.

DEBUG_LOGIN=0

##NAME: DEFAULTOPTIONS:0
#
# A comma-separated list of option=value pairs. Each option is applied
# to an account if the account does not have its own specific value for
# that option. So for example, you can set
#   DEFAULTOPTIONS="disablewebmail=1,disableimap=1"
# and then enable webmail and/or imap on individual accounts by setting
# disablewebmail=0 and/or disableimap=0 on the account.

DEFAULTOPTIONS=""

##NAME: LOGGEROPTS:0
#
# courierlogger(1) options, e.g. to set syslog facility
#

LOGGEROPTS=""

##NAME: LDAP_TLS_OPTIONS:0
#
# Options documented in ldap.conf(5) can be set here, prefixed with 'LDAP'.
# Examples:
#
#LDAPTLS_CACERT=/path/to/cacert.pem
#LDAPTLS_REQCERT=demand
#LDAPTLS_CERT=/path/to/clientcert.pem
#LDAPTLS_KEY=/path/to/clientkey.pem

Voici mon /etc/courier/authmysqlrc :

MYSQL_SERVER            localhost
MYSQL_USERNAME          postfix
MYSQL_PASSWORD          pass
MYSQL_DATABASE          postfix
MYSQL_USER_TABLE        mailbox

MYSQL_CRYPT_PWFIELD     password
# MYSQL_CLEAR_PWFIELD    clear

MYSQL_UID_FIELD         5000
MYSQL_GID_FIELD         5000

MYSQL_LOGIN_FIELD       email

MYSQL_HOME_FIELD        "/var/spool/vmail/"

MYSQL_MAILDIR_FIELD CONCAT(SUBSTRING_INDEX(email,'@',-1),'/',SUBSTRING_INDEX(email,'@',1),'/')

#Ligne à commenter 
# MYSQL_NAME_FIELD       name

MYSQL_QUOTA_FIELD       quota

J'espere vous avoir donner assez d'infos ^^

Merci !

#2 Le 13/11/2006, à 01:26

Uggy

Re : [Serveur mail] Problème avec postfix et mysql

et a propos de la 1ere ligne d'erreur dans les logs... :

warning: do not list domain DOMAIN.COM in BOTH mydestination and virtual_mailbox_domains

PS: Un "postconf -n" est mieux que le main.cf

Hors ligne

#3 Le 15/12/2006, à 19:12

Vell

Re : [Serveur mail] Problème avec postfix et mysql

Bonjour,

Dans le main.cf, changer ceci :

mydestination = mail.DOMAIN.COM, nodeloUBUNTU, DOMAIN.COM, localhost.DOMAIN.COM, localhost

Par ceci :

mydestination = $myhostname ,localhost , localhost.dedibox.fr

(vu que tu es sur une dedibox)


Ubuntu 7.10 - AMD 64 x2 4600+ EE - 2Gb - GF 8600 GT

Hors ligne

#4 Le 16/12/2006, à 01:04

Uggy

Re : [Serveur mail] Problème avec postfix et mysql

Vell a écrit :
mydestination = $myhostname ,localhost , localhost.dedibox.fr

(vu que tu es sur une dedibox)

Je ne vois pas le rapport...

Hors ligne

#5 Le 17/12/2006, à 18:55

Vell

Re : [Serveur mail] Problème avec postfix et mysql

Le rapport c'est juste pour le localhost.dedibox.fr , vu qu'il est sur une dedibox.


Ubuntu 7.10 - AMD 64 x2 4600+ EE - 2Gb - GF 8600 GT

Hors ligne

#6 Le 23/12/2006, à 18:20

Tchewy

Re : [Serveur mail] Problème avec postfix et mysql

J'ai essayé de resoudre mon probleme comme indique (mon cas ete similaire) cependant toujours pas de mieux ... sad

#7 Le 23/12/2006, à 19:42

handman007

Re : [Serveur mail] Problème avec postfix et mysql

essaie de desinstaller posfix depuis synaptic

puis réinstalles le. mais l'option internet a la 2° question lors de l'install je marque handman.fr et cela fonctionne  nature sans rien changer.

handman

http://handman.fr