Page précédente
Table des matières
Page suivante

8. Annexes

8.1 Ce que l'avenir nous réserve

Après un mail dans la liste d'aide de sendmail à propos voici ce qu'il m'a été répondu concernant la modification via /etc/revaliases (FEATURE genericstable) des entêtes pour les messages sortant et la non modification des entêtes pour les messages locaux :

From: Claus Assmann <sendmail+ca@sendmail.org>
To: Thomas Nemeth <tnemeth@free.fr>
Cc: sendmail-questions@sendmail.org
Subject: Re: Specific Mail-Hub
On Fri, Aug 11, 2000, Thomas Nemeth wrote:

>       I find it nice to see user@machine.domain.tld in the From:
>       header instead of login@isp.tld :) I'd love to have an option
>       to only use genericstable for outgoing mails...

The next version (8.12) will probably have what you want:
FEATURE(`local_no_masquerade') to avoid masquerading for
the local mailer.

Il est à noter que la Debian (potato) dispose déjà d'une telle option : FEATURE(dont_masquerade_local).

8.2 Le script pour fetchmail

---8<--- COUPER ICI ----------------------------------------------------
#!/bin/sh
#
# Script permettant de récupérer les messages de tous les utilisateurs d'un
# système via fetchmail à partir du compte root et utilisant cron.
#
# Copyright (C) 2000 Thomas Nemeth
#
for UTILISATEUR in `ls /home -I lost+found`; do
    if [ -f /home/$UTILISATEUR/.fetchmailrc ]; then
        su - $UTILISATEUR -c "fetchmail -s"
    fi
done
---8<--- COUPER ICI ----------------------------------------------------

8.3 Le programme gethost.c

---8<--- COUPER ICI ----------------------------------------------------
/* 
    gethost.c, récupère le nom canonique d'une machine 
               à partir de son adresse IP.

    Copyright © 04/1998 Jean Charles Delépine
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.
*/

#include <stdio.h>
#include <netdb.h> 
#include <arpa/inet.h>
#include <string.h>

int main(argc,argv)
char argc;
char *argv[];
{
  struct hostent *host;
  struct in_addr ia;

  if (argc < 2) {
    fprintf(stderr,"Usage : %s addr\n",argv[0]);
    exit(1);
  }
  if (!inet_aton (argv[1],&ia)) {
      fprintf(stderr,"Erreur: adresse invalide\n");
      exit(1);
  } 
      
  host=gethostbyaddr((char *) &ia, sizeof(ia), AF_INET);

  if (!host) {
    fprintf(stderr,"Erreur: adresse non trouvée ou pas de DNS\n");
    exit(1);
  }
  printf("%s\n",host->h_name);
  exit(0);
}
---8<--- COUPER ICI ----------------------------------------------------


Page précédente
Table des matières
Page suivante

Page mise à jour le 13 août 2000.
Thomas Nemeth