On Sat, 12 Oct 2002 17:28:25 +0200
[EMAIL PROTECTED] (Rémi Letot) wrote:

> Benoît Barbier <[EMAIL PROTECTED]> writes:
> 
> > On Fri, 11 Oct 2002 22:23:44 +0200
> > [EMAIL PROTECTED] (Rémi Letot) wrote:
> >
> >> Benoît Barbier <[EMAIL PROTECTED]> writes:
> >> 
> >> > Justement c'est ca qui me tracasse, il n'écris plus dans le fichier que je lui 
>ai indiqué dans :
> >> > /etc/fetchmailrc :
> >> > set logfile "/var/log/fetchmail/fetchmail.log"
> >> 
> >> Alors il écrit dans syslog. Cherche la chaine fetchmail dans les
> >> fichiers de /var/log, tu vas trouver.
> >> 
> >> cd /var/log
> >> grep -r fetchmail *
> >
> >
> > Oct 12 12:02:15 venus fetchmail[307]: open /var/log/fetchmail/fetchmail.log 
>(Permission denied)
> > Bien vu.:-)
> > Ils étaient dans /var/log/mail*
> >
> > Mais les droits ne sont pas plus restrictifs! C'est quoi cette histoire?
> >
> > -rw-r--r--    1 root     root        16160 oct 12 12:02 mail.err
> > -rw-r--r--    1 root     root      9974687 oct 12 13:09 mail.info
> > -rw-r--r--    1 root     root      9974687 oct 12 13:09 mail.log
> > -rw-r--r--    1 root     root        16160 oct 12 12:02 mail.warn
> > -------------------------
> > -rw-rw-r--    1 root     root            1 oct 11 15:20 fetchmail.log
> 
> Quels sont les droits sur le *répertoire* /var/log/fetchmail ?

drwxrwxr-x    2 fetchmai root         4096 oct 12 18:21 fetchmail


> 
> >
> >
> > Donc voici le compte rendu :
> >
> > J'ai donné les droits 666 à fetchmail.log, depuis je n'ai plus (Permission denied) 
>mais il n'y écrit toujours pas.
> >
> > Les log ne disent rien d'intéressant :
> >
> > oct 12 13:37:04 venus fetchmail[1139]: démarrage de fetchmail 5.9.11 en tâche de 
>fond  
> > oct 12 13:37:08 venus fetchmail[1139]: 1 message pour benoit dans 
>pop.monmaileur.net (669 octets). 
> > oct 12 13:37:08 venus fetchmail[1139]: reading message [EMAIL PROTECTED]:1 
>of 1 (669 octets) 
> > oct 12 13:37:09 venus fetchmail[1139]:  non éliminé 
> > oct 12 13:43:16 venus fetchmail[1139]: 1 message (1 vu) pour benoit dans 
>pop.monmaileur.net (669 octets). 
> > oct 12 13:43:16 venus fetchmail[1139]: skipping message 
>[EMAIL PROTECTED]:1 (669 octets) non éliminé 
> >
> >
> > Ça a l'aire tout à fait normale non?
> > mail.err reste muet depuis que j'ai donné tout les droits à fetchmail.log
> >
> > De toute façon il ne fait pas ce que je lui demande dans "/etc/fetchmailrc"
> >
> >
> > \ps aux | grep fetchmail
> > fetchma   1139  0.0  0.4  2416 1224 ?        SN   13:37   0:00 /usr/bin/fetchmail 
>--daemon 360 --syslog -f /etc/fetchmailrc -i /var/mail/.fetchmail-UIDL-cache
> >
> > Dans "/etc/fetchmailrc" je lui indique : "set daemon 60" et pas 360
> >
> > "fetchmail-UIDL-cache" n'existe pas donc il aurais bien difficile de différencier 
>les mails déjà chargé et les autres.
> >
> > ls -a /var/mail/
> > .  ..  benoit
> >
> > Si je crée "/var/mail/.fetchmail-UIDL-cache" fetchmail ne démarre plus.
> >
> > Désolé pour la longueur de ce message, mais encore une fois, je suis largué.
> 
> Effectivement, il semble ne pas tenir compte de ce que tu notes dans
> /etc/fetchmailrc. Tu n'as pas un /etc/defaults/fetchmail qui pourrait
> interférer ? Si c'est une debian, tu en as un, et il prend précédence
> sur /etc/fetchmailrc (c'est noté dans la doc et lors de l'installation
> du package je crois).
> 
> Corrige éventuellement les permissions sur /var/log/fetchmail, et vois
> le /etc/defaults/fetchmail, ensuite ajoute uidl dans /etc/fetchmailrc,
> et vois dans ton log pourquoi il ne redémarre pas.

Les seuls info contenues dans /etc/defaults/fetchmail (qui ne soient pas en 
commentaires sont :
SERVICE=true
CONFFILE=/etc/fetchmailrc
OPTIONS="--daemon 60 --syslog"
RUNASROOT=false

Quand je le fait tourner sous mon login habituel (benoit) tout vas nikel sans l'option 
uidl il écris bien $HOME/.fetchids.

J'ai lancé fetchmail sous le compte fetchamil :
su -c 'fetchmail -f /etc/fetchmailrc  -i /var/log/fetchmail/.UIDL_log_file' fetchmail

Ça marche aussi il écrit bien ".UIDL_log_file".

Le seul fichier qui puisse encore interférer c'est /etc/init.d/fetchmail

ÇA Y EST J'AI TROUVÉ! En lisent ce fichier j'ai vu qu'il y a l'option :
/etc/init.d/fetchmail debug-run

Et zoup, j'ai modifié comme ceci :

# Tries to find a better place for the UIDL 
# cache than root's homedir
[ -d /var/mail ] && UIDL=/var/mail/.fetchmail-UIDL-cache
[ "${UIDL}" != "" ] && OPTIONS="${OPTIONS} -i ${UIDL}"

Par:
# Tries to find a better place for the UIDL 
# cache than root's homedir
[ -d /var/run/fetchmail/ ] && UIDL=/var/run/fetchmail/.fetchids 
   #Là il a les permissions pour écrire 
[ "${UIDL}" != "" ] && OPTIONS="${OPTIONS} -i ${UIDL}"

Encore une question de permission, mais alors quand fetchmail écrit dans :
/var/mail/"utilisateur"
C'est pas avec les droit de fetchmail il ne peut pas.
Il prend la casquette mail ou root alors?

Enfin ça à l'air de marcher.

MERCI RÉMI d'avoir guidé mes recherches.:-)

Avec gratitude,
Benoît
_______________________________________________________
Linux Mailing List - http://www.unixtech.be
Subscribe/Unsubscribe: http://www.unixtech.be/mailman/listinfo/linux
Archives: http://www.mail-archive.com/linux@lists.unixtech.be
IRC: efnet.skynet.be:6667 - #unixtech

Répondre à