Vous n'êtes pas connecté - 2 Membres connectés
Catégories
Graphisme
Flash (49)
Print (64)
Programmation
PHP (63)
ASP (2)
CSS (24)
Hardware
PC (34)
Mac (14)
Linux (5)
Divers
Blabla (241)
881 Sujets
11882 Réponses
Hardware > Linux > Debian PostFix mal de tête
Debian PostFix mal de tête
salut, j'ai un mal fou (bon premiere pierre dans l'eau) à configurer postfix avec sasl sur ma debian.

voila le contenu de /etc/postfix/main.cf

smtpd_ banner = $myhostname ESMTP $mail_name (Debian/GNU)
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

myhostname = mon-domaine
mydomain = mon-domaine.com
myorigin = $myhostname
mydestination = $myhostname, $mydomain, localhost.$mydomain, localhost
relayhost =
home_mailbox = Maildir/
mailbox_command = /usr/bin/procmail -Y -a $DOMAIN
relay_domain =
alias_maps = hash:/etc/aliases
alias_datab ase = hash:/etc/aliases
setgid_grou p = postdrop
mail_owner = postfix
mailbox_size_limit = 0
mail_spool_directory = /var/spool/mail
smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)
delay_warning_ti me = 4h
recipient_delimiter = +
smtpd_sasl_auth_enable = yeh
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtpd_sasl_security_options = noanonymous, noplaintext

/etc/postfix/sa sl_passwd contient des users sous la forme

mon-domaine username:password

/etc/host s

Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 localhost.mon-domaine.com localhost
88.88.200.99 ( fictive) mon-domaine.mon-domaine.com mon-domaine
# The following lines are desirable for IPv6 capable hosts
#(added automatically by netbase upgrade)
::1 ip6-localhost ip6-loopback
feo0::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts

Dans mon client mail, sur smtp je met smtp.mon-domaine.com (smtp.mon-domaine.com pointe sur le reverse du server)

username:password

Je pige pas pourquoi ca fonctionne pas :/

Si vous avez une solution plus facile pr mettre en place smtp,imap avec acces exterieur filtrer par login je prend avec grand plaisir.
Posté le 18 10 2006 à 12h19
alienmaster - Membre

Réponses - Debian PostFix mal de tête
<< 1 2 >>
 Arg encore un problème je viens me rendre compte que les scripts newdomain.sh et newuser.sh n'ajoute rien du tout à la bdd et la je pige vraiment pas, aucune erreur ne s'affiche mais rien ne sa fait (ni incrémentation ni créer des repertoires)

je remet les scripts concerner


<?
newdomain
.sh 

#!/bin/bash

#CONFIG
MYSQL_USER=postfix
MYSQL_PASS
=votre_password
MYSQL_DB
=maildb

POSTFIX_BASE_DIR
=/var/spool/postfix/virtual/

##########################################
### DO NOT EDIT AFTER THIS            ####
##########################################

echo -"Enter the new domain name : "
read domain

echo -"Enter the transport type ( ex : "virtual:" ) : "
read transport

echo -"Enter the GID of this domain : "
read gid

if [ ! `mysql -u$MYSQL_USER -p$MYSQL_PASS --database=$MYSQL_DB -e"INSERT INTO 
       transport (domain, transport) VALUES ('$domain', '$transport');"
` ]
        
then
                
echo "MySQL INSERT() was successfull"

                
if  ! `mkdir $POSTFIX_BASE_DIR/$domain
                        
then
                                chgrp $gid $POSTFIX_BASE_DIR
/$domain
                                chmod 770 $POSTFIX_BASE_DIR
/$domain
                                
echo "Content Directory created"
                
fi
fi


        

newuser
.sh 

#!/bin/bash

#CONFIG
MYSQL_USER=postfix
MYSQL_PASS
=votre_password
MYSQL_DB
=maildb

#WITH a trailing slash
POSTFIX_BASE_DIR=/var/spool/postfix/virtual/

##########################################
### DO NOT EDIT AFTER THIS            ####
##########################################

echo -"-> Enter the new username ( ex : glibersat) : "
read username

echo -"n-> Enter the domain name ( ex : gnurus.org )... "
echo -"tDetected domains :"

for domains in `ls $POSTFIX_BASE_DIR | sort`
do
        echo -
"t(*) $domains"
done
echo -"domain : "
read domain

echo --"nEnter the password ( clear text ) : "
read password

echo --"nEnter the real name ( ex : Guillaume Libersat ) : "
read realname

#Get domain GroupID
vgid=`ls -l /var/spool/postfix/virtual/ | grep $domain | awk '{ print $}'`

#Get a free UserID
vuid=`mysql -u$MYSQL_USER -p$MYSQL_PASS -D$MYSQL_DB -e"select MAX(uid)  
from users" | tail -n1 | awk '
{ print $}'`
vuid=$

echo -
-"nEnter the GID of this domain (detected $vgid, hit Return to use it) : "
read r_gid
if  $r_gid 
        then
        vgid
=$r_gid
fi

echo --"nEnter the UID of this user (next free uid is $vuid, hit Return to use it) : "
read r_uid
if  $r_uid 
        then
        vuid
=$r_uid
fi

if [ ! `mysql -u$MYSQL_USER -p$MYSQL_PASS -D$MYSQL_DB -e"INSERT INTO users  
(id, address, crypt, clear, name, uid, gid, home, domain, maildir, imapok, bool1, bool2) 
 VALUES ('$username@$domain', '$username@$domain', ENCRYPT('$password'), '', '$realname', '$vuid', 
  '$vgid', '$POSTFIX_BASE_DIR', '$domain', '$POSTFIX_BASE_DIR$domain/$username/Maildir/', '1', '1', '1')"
` ]
        
then
                
echo "MySQL INSERT() was successfull"

                
if  ! `mkdir $POSTFIX_BASE_DIR/$domain/$username
                        
then
                                maildirmake $POSTFIX_BASE_DIR
/$domain/$username/Maildir
                                chown $vuid
:$vgid -R $POSTFIX_BASE_DIR/$domain/$username
                                chmod 770 $POSTFIX_BASE_DIR
/$domain
                                
echo "User Directory created"
                
fi
fi
?>
Posté le 23 10 2006 à 19h56
alienmaster - Membre
heu je me suis pas tapé le script en entier... Les répertoires sont crées ? il y a juste l'insertion en bdd qui merdoie ? Tu veux pas le faire en php ca serait + lisible et + pratique à administrer pour toi ^^
Posté le 23 10 2006 à 22h41
benzor - Administrateur - www
Oui je vais opter pour php ca sera bien plus simple :), sinon j'ai encore ce foutu problème de droit qui est revenu après reboot

Oct 23 18:45:25 mon-domaine postfix/master[27370]: warning: process /usr/lib/postfix/trivial-rewri te pid 18613 exit status 1
Oct 23 18:45:25 mon-domaine postfix/qmgr[10850]: warning: premature end-of-input on private/rewrite socket while reading input attribute name
Oct 23 18:45:25 mon-domaine postfix/qmgr[10850]: warning: problem talking to service rewrite: Success
Oct 23 18:45:25 mon-domaine postfix/smtpd[3229]: warning: premature end-of-input on private/rewrite socket while reading input attribute name
Oct 23 18:45:25 mon-domaine postfix/smtpd[3229]: warning: problem talking to service rewrite: Connection reset by peer
Oct 23 18:45:25 mon-domaine postfix/master[27370]: warning: process /usr/lib/postfix/trivial-rewri te pid 9083 exit status 1
Oct 23 18:45:25 mon-domaine postfix/smtpd[30231]: warning: premature end-of-input on private/rewrite socket while reading input attribute name
Oct 23 18:45:25 mon-domaine postfix/smtpd[30231]: warning: problem talking to service rewrite: Success
Oct 23 18:45:25 mon-domaine postfix/smtpd[4543]: warning: premature end-of-input on private/rewrite socket while reading input attribute name
Oct 23 18:45:25 mon-domaine postfix/smtpd[4543]: warning: problem talking to service rewrite: Connection reset by peer
Oct 23 18:46:25 mon-domaine postfix/trivial-rewrite[24115] : warning: connect to mysql server localhost: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
Oct 23 18:46:25 mon-domaine postfix/trivial-rewrite[24115] : fatal: mysql:/etc/postfix/transport.c f(0,100): table lookup problem
Oct 23 18:46:25 mon-domaine postfix/trivial-rewrite[18183] : warning: connect to mysql server localhost: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

J'ai essayer de refaire un coup de

mkdir -p /var/spool/postfix/var/run/mys qld
chown mysql /var/spool/postfix/var/run/mys qld
ln /var/run/mysqld/mysqld.sock /var/spool/postfix/var/run/mys qld/mysqld.sock

Mais cette fois ca ne semble pas changer grand chose, les erreurs tournent en bouclent.

En tout cas merci pour ton aide ^^
Posté le 24 10 2006 à 08h40
alienmaster - Membre
En fait ton pb, c'est que postfix essais de trouver ta socket MySQL dans /var/run/mysqld/mysqld.sock alors que par défaut sous Debian, la socket MySQL se trouve dans /tmp/mysql.sock, de plus il n'a pas les droits d'y accéder (voir loin).

Voyons la variable hosts= de tes fichiers de conf suivants :

Transport.cf
mysql_virt.cf
uids.cf
gids.cf
virtual.cf

Actuellement tu as "hosts=localhost" donc postfix tente de se connecter directement à la socket MYSQL... Mais c'est impossible car par défaut Postfix est "chrooté" dans son propre répertoire (il ne peut pas accéder à des fichiers hors de don répertoire par défaut). Donc si tu veux absolument réaliser une connexion par socket, il faut dé-chrooter ton postfix dans ton master.cf (voir la doc) et trouver le moyen de changer l'emplacement par défaut de recherche de la socket OU (+ simple) de créer un lien symbolique entre '/var/run/mysqld/mysqld.sock' et '/tmp/mysql.sock'.

Autre solution bcp + simple : tu change ta viariable "hosts=localhost" en "hosts=127.0.0.1" ou "hosts='ip de ton serveur" dans les fichiers sus-cités, du coup postfix va se connecter en TCP et non plus en mode fichier (socket) ce qui va résoudre tes problèmes de connexion instantanément :)

Dernière chose (je suis vraiment le copain linux aujourd'hui) si tu veux, j'ai codé une interface en PHP pour gérer mes domaines/comptes mails avec postfix/MySQL... je peux te filer les sources si tu les garde pour toi :)

Je me demande si il ne serait pas judicieux que je fasse un howto complet dans la rubrique tutos...
Posté le 24 10 2006 à 09h33
benzor - Administrateur - www
Pourtant j'ai bien vérifier mysqld.sock ce trouve bien dans /var/run/mysqld/mysqld.sock et non dans /tmp/ :,(

(malgrer la création du lien symbolique j'ai toujour la mème erreur pourtant j'utilise le mème lien pr avoir accès à la bdd sur vsftpd)

Sinon j'ai essayer la methode ou il faut remplacer hosts=localhost par hosts=127.0.0.1 ca me sort

#Rescue smtpd[23275] connect from localhost.localdomain[127.0.0. 1]

#Rescue postfix/trivial-rewrite[31959] : warning : connect to mysql server 127.0.0.1: Acces denied for user postfix@localhost.localdomain (using password yes)

Dans ma table mysql > user

Host : localhost User : Postfix
Posté le 27 10 2006 à 18h33
alienmaster - Membre
Resolu ^^ merci mille fois benzor.
Posté le 28 10 2006 à 16h24
alienmaster - Membre
<< 1 2 >>
Sujets Linux
Linux et Photoshop
Auteur : caniche
Posté le 31 08 2007 à 17h15
30 Réponses (Nouveau sujet)
Sujet visité 2377 fois
Configuration (...)
Auteur : caniche
Posté le 02 07 2007 à 12h02
2 Réponses (Nouveau sujet)
Sujet visité 539 fois
Gestionnaire de typo
Auteur : gUY
Posté le 19 10 2006 à 11h26
11 Réponses (Nouveau sujet)
Sujet visité 992 fois
Debian PostFix mal (...)
Auteur : alienmaster
Posté le 18 10 2006 à 12h19
16 Réponses (Nouveau sujet)
Sujet visité 2438 fois
[résolu] phpmyadmin
Auteur : veensez
Posté le 11 08 2006 à 20h05
5 Réponses (Nouveau sujet)
Sujet visité 740 fois
Mentions légales   -   Crédits   -   Nous contacter   -   © Benzor 2006