Qmailadmin
 27/04/2007
 Christian CALECA 
Liste des cours

Accueil ] [ Daemontools et ucspi-tcp ] [ Qmail & co. ] [ Vpopmail ] [ Essais divers ] [ courier-imap ] [ POP3 ] [ outils admin ] [ Ezmlm-idx ] [ qmailadmin ] [ Filtrage des mails ] [ Livraison locale ] [ Conclusions ]


Autorespond

Il paraît à priori hors sujet de traiter autorespond ici, mais qmailadmin prend en charge ce répondeur automatique et la simplicité de son installation ne nécessite pas une page dédiée. Si vous n'en voulez pas, ne l'installez pas et pensez à désactiver sa gestion dans la compilation de qmailadmin.

Si vous souhaitez l'installer, il est lui aussi dans nos commissions :

cd /usr/local/src/tar
wget http://www.inter7.com/devel/autorespond-2.0.5.tar.gz
cd ..
tar -xzf tar/autorespond-2.0.5.tar.gz
cd autorespond-2.0.5
make
make install

qmailadmin

Qmailadmin est un script cgi à l'usage non seulement du postmaster, qui peut l'utiliser pour gérer les comptes, les listes et quasiment tout ce qu'il y a à gérer sur notre système, mais aussi à l'usage de tout possesseur d'un compte de messagerie. Bien entendu, dans ce cas, l'utilisateur n'aura accès qu'aux paramètres de son compte.

cd /usr/local/src/tar
wget http://downloads.sourceforge.net/qmailadmin/qmailadmin-1.2.9.tar.gz
cd ..
tar -xzf tar/qmailadmin-1.2.9.tar.gz
cd qmailadmin-1.2.9

Il y a de nombreuses options de configuration sur qmailadmin :

./configure --help
`configure' configures this package to adapt to many kinds of systems.

Usage: ./configure [OPTION]... [VAR=VALUE]...

To assign environment variables (e.g., CC, CFLAGS...), specify them as
VAR=VALUE.  See below for descriptions of some of the useful variables.

Defaults for the options are specified in brackets.

Configuration:
  -h, --help              display this help and exit
      --help=short        display options specific to this package
      --help=recursive    display the short help of all the included packages
  -V, --version           display version information and exit
  -q, --quiet, --silent   do not print `checking...' messages
      --cache-file=FILE   cache test results in FILE [disabled]
  -C, --config-cache      alias for `--cache-file=config.cache'
  -n, --no-create         do not create output files
      --srcdir=DIR        find the sources in DIR [configure dir or `..']

Installation directories:
  --prefix=PREFIX         install architecture-independent files in PREFIX
                          [/usr/local]
  --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
                          [PREFIX]

By default, `make install' will install all the files in
`/usr/local/bin', `/usr/local/lib' etc.  You can specify
an installation prefix other than `/usr/local' using `--prefix',
for instance `--prefix=$HOME'.

For better control, use the options below.

Fine tuning of the installation directories:
  --bindir=DIR           user executables [EPREFIX/bin]
  --sbindir=DIR          system admin executables [EPREFIX/sbin]
  --libexecdir=DIR       program executables [EPREFIX/libexec]
  --datadir=DIR          read-only architecture-independent data [PREFIX/share]
  --sysconfdir=DIR       read-only single-machine data [PREFIX/etc]
  --sharedstatedir=DIR   modifiable architecture-independent data [PREFIX/com]
  --localstatedir=DIR    modifiable single-machine data [PREFIX/var]
  --libdir=DIR           object code libraries [EPREFIX/lib]
  --includedir=DIR       C header files [PREFIX/include]
  --oldincludedir=DIR    C header files for non-gcc [/usr/include]
  --infodir=DIR          info documentation [PREFIX/info]
  --mandir=DIR           man documentation [PREFIX/man]

Program names:
  --program-prefix=PREFIX            prepend PREFIX to installed program names
  --program-suffix=SUFFIX            append SUFFIX to installed program names
  --program-transform-name=PROGRAM   run sed PROGRAM on installed program names

System types:
  --build=BUILD     configure for building on BUILD [guessed]
  --host=HOST       cross-compile to build programs to run on HOST [BUILD]

Optional Features:
  --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
  --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
  --disable-dependency-tracking Speeds up one-time builds
  --enable-dependency-tracking  Do not reject slow dependency extractors
  --enable-vpopmaildir=DIR  Home directory of vpopmail.
  --enable-htmldir=DIR      HTTP server's base html dir.
  --enable-cgibindir=DIR    HTTP server's cgi-bin directory.
  --enable-imageurl=URL     URL to image files /images/qmailadmin.
  --enable-imagedir=DIR     Where to put the image files DocumentRoot/images/qmailadmin.
  --enable-htmllibdir=DIR   qmailadmin HTML library directory.
  --enable-qmaildir=DIR     directory where qmail is installed.
  --enable-ezmlmdir=PATH    Path to ezmlm binaries or =n to disable.
  --enable-cgipath=PATH     URL path for cgi /cgi-bin/qmailadmin.
  --enable-autoresponder-path=PATH   Path to autoresponder directory.
  --enable-vpopuser=USER        User vpopmail was installed as vpopmail.
  --enable-vpopgroup=GROUP      Group vpopmail was installed as vchkpw.
  --disable-ezmlm-mysql         Disable MySQL options for mailing lists.
  --enable-maxusersperpage=#    Number of users to display on a page [15].
  --enable-maxaliasesperpage=#  Number of aliases to display on a page [25].
  --enable-no-cache   Prohibit caching via http headers.
  --disable-ipauth    Disable IP address checks (NAT/proxy systems may not use the same IP for the whole session).
  --disable-user-index   Don't display user index on show users page.
  --enable-modify-quota  Allow domain admin (postmaster) to modify user quotas.
  --enable-domain-autofill  Autofill the domain on login page based on the hostname that accesses qmailadmin.
  --enable-modify-spam  Allow users to enable/disable spam checking.
  --enable-spam-command=CMD     Remember to use '|preline' at the beginning, 
                                |preline /usr/local/bin/maildrop /etc/mailfilter.
  --enable-help  Display help links on login page.

Some influential environment variables:
  CC          C compiler command
  CFLAGS      C compiler flags
  LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
              nonstandard directory <lib dir>
  CPPFLAGS    C/C++ preprocessor flags, e.g. -I<include dir> if you have
              headers in a nonstandard directory <include dir>
  CPP         C preprocessor

Use these variables to override the choices made by `configure' or to help
it to find libraries and programs with nonstandard names/locations.

Nous allons configurer qmailadmin comme ceci :

./configure \
--enable-help \
--enable-cgibindir=/usr/lib/cgi-bin \
--enable-htmldir=/var/www \
--enable-maxusersperpage=25 \
--enable-modify-quota \
--disable-ezmlm-mysql

Ou, avec la possibilité d'aiguiller sur le tri antispam :

./configure \
--enable-help \
--enable-cgibindir=/usr/lib/cgi-bin \
--enable-htmldir=/var/www \
--enable-maxusersperpage=25 \
--enable-modify-quota \
--disable-ezmlm-mysql \
--enable-modify-spam \
--enable-spam-command="| /usr/bin/maildrop ../mailfilter"

Ceci nous permettra, comme nous le verrons plus loin, d'activer ou non un tri des messages en fonction du marquage opéré par spamassassin. Les options surlignées permettront d'ajouter à l'interface une case à cocher qui permettra de créer ou non un fichier .qmail dans le répertoire virtuel de l'utilisateur.

Ce qui nous donne en fin de configuration, un résumé comme celui-ci :

            qmailadmin 1.2.9
            Current settings
---------------------------------------
       cgi-bin dir = /usr/lib/cgi-bin
          html dir = /var/www
         image dir = /var/www/images/qmailadmin
         image URL = /images/qmailadmin
      template dir = /usr/local/share/qmailadmin
         qmail dir = /var/qmail
      vpopmail dir = /home/vpopmail
   autorespond dir = /usr/bin
         ezmlm dir = /usr/local/bin/ezmlm
         ezmlm idx = yes
   mysql for ezmlm = no
              help = yes
      modify quota = yes
   domain autofill = no
 modify spam check = no

Ou encore, avec antispam :

            qmailadmin 1.2.9
            Current settings
---------------------------------------
       cgi-bin dir = /usr/lib/cgi-bin
          html dir = /var/www
         image dir = /var/www/images/qmailadmin
         image URL = /images/qmailadmin
      template dir = /usr/local/share/qmailadmin
         qmail dir = /var/qmail
      vpopmail dir = /home/vpopmail
   autorespond dir = /usr/bin
         ezmlm dir = /usr/local/bin/ezmlm
         ezmlm idx = yes
   mysql for ezmlm = no
              help = yes
      modify quota = yes
   domain autofill = no
 modify spam check = yes
      spam command = | /usr/bin/maildrop ../mailfilter

Il ne reste plus qu'à compiler et à installer :

make
make install-strip

Et nous devrions avoir un qmailadmin en état de fonctionner :

qmailadmin

 

qmailadmin

Nous pouvons ici, très simplement, voir les comptes existants, en créer, en supprimer, gérer les redirections, etc.

Le formulaire de création d'une liste de diffusion est suffisamment complet pour répondre à la plupart des cas de figure. Pour pouvoir en faire une copie d'écran complète, j'ai du adopter une police vraiment petite :

qmailadmin

Si vous n'êtes pas familier avec les options des listes de diffusion, prenez le temps nécessaire pour bien comprendre les diverses options proposées.

Nous allons créer une liste "demo" :

qmailadmin

Notez que le responsable de la liste a été inscrit :

qmailadmin

Il est bien sûr possible de revenir sur le paramétrage de cette liste. Toute personne désireuse de s'abonner peut le faire par le simple envoi d'un message vide à demo-subscribe@maison.mrs. La liste est paramétrée de façon à ce qu'une confirmation soit demandée au nouvel arrivant, ceci afin d'éviter que n'importe qui inscrive n'importe quelle adresse. Faisons-le pour un compte quelconque, créé pour la circonstance  : prof@maison.mrs par exemple. Immédiatement, prof reçoit le message suivant :

Return-Path: <demo-return-@maison.mrs>
Delivered-To: prof@maison.mrs
Received: (qmail 6014 invoked by uid 89); 18 Mar 2006 17:14:34 -0000
Mailing-List: contact demo-help@maison.mrs; run by ezmlm
List-Help: <mailto:demo-help@maison.mrs>
List-Post: <mailto:demo@maison.mrs>
List-Subscribe: <mailto:demo-subscribe@maison.mrs>
Date: 18 Mar 2006 17:14:34 -0000
Message-ID: <1142702074.6013.ezmlm@maison.mrs>
From: demo-help@maison.mrs
To: prof@maison.mrs
Delivered-To: responder for demo@maison.mrs
Received: (qmail 6009 invoked by uid 89); 18 Mar 2006 17:14:34 -0000
Received: from unknown (HELO localhost.localdomain) (192.168.0.15)
  by 0 with SMTP; 18 Mar 2006 17:14:34 -0000
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Reply-To: demo-sc.1142702074.klgmfilccjnlimkpofjk-prof=maison.mrs@maison.mrs
Subject: confirm subscribe to demo@maison.mrs

Hi! This is the ezmlm program. I'm managing the
demo@maison.mrs mailing list.

I'm working for my owner, who can be reached
at demo-owner@maison.mrs.

To confirm that you would like

   prof@maison.mrs

added to the demo mailing list, please send
an empty reply to this address:

   demo-sc.1142702074.klgmfilccjnlimkpofjk-prof=maison.mrs@maison.mrs

Usually, this happens when you just hit the "reply" button.
If this does not work, simply copy the address and paste it into
the "To:" field of a new message.

This confirmation serves two purposes. First, it verifies that I am able
to get mail through to you. Second, it protects you in case someone
forges a subscription request in your name.

Some mail programs are broken and cannot handle long addresses. If you
cannot reply to this request, instead send a message to
<demo-request@maison.mrs> and put the
entire address listed above into the "Subject:" line.


--- Administrative commands for the demo list ---

I can handle administrative requests automatically. Please
do not send them to the list address! Instead, send
your message to the correct command address:

For help and a description of available commands, send a message to:
   <demo-help@maison.mrs>

To subscribe to the list, send a message to:
   <demo-subscribe@maison.mrs>

To remove your address from the list, just send a message to
the address in the ``List-Unsubscribe'' header of any list
message. If you haven't changed addresses since subscribing,
you can also send a message to:
   <demo-unsubscribe@maison.mrs>

For addition or removal of addresses, I'll send a confirmation
message to that address. When you receive it, simply reply to it
to complete the transaction.

If you need to get in touch with the human owner of this list,
please send a message to:

    <demo-owner@maison.mrs>

Please include a FORWARDED list message with ALL HEADERS intact
to make it easier to help you.

--- Enclosed is a copy of the request I received.

Return-Path: <prof@maison.mrs>
Received: (qmail 6009 invoked by uid 89); 18 Mar 2006 17:14:34 -0000
Received: from unknown (HELO localhost.localdomain) (192.168.0.15)
  by 0 with SMTP; 18 Mar 2006 17:14:34 -0000
Date: Sat, 18 Mar 2006 18:14:34 +0100
From: Prof <prof@maison.mrs>
To: demo-subscribe@maison.mrs
Message-ID: <20060318181434.4f24e211@localhost.localdomain>
X-Mailer: Sylpheed-Claws 1.9.14 (GTK+ 2.8.6; i486-pc-linux-gnu)
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit

Si Prof répond à ce message, il sera immédiatement inscrit sur la liste :

qmailadmin

 

Les révocations se font de façon analogue, en envoyant un message à demo-unsubscribe@maison.mrs.

Bien sûr, postmaster peut faire tout ce qu'il veut depuis qmailadmin.


Précédente ] [ Accueil ] [ Suivante ]