El 2014-10-29 1:06 pm, Alberto José García Fumero escribió:
El mié, 29-10-2014 a las 09:08 -0400, Jessy Vidal escribió:
Lista Quiero implementar ponerle a todos los correos que salgan de mi
server una firma para todos los usuarios algo como lo que tienen en
infomed y en otros servidores, hace un tiempo me dieron una solución
pero nada no pude implementarla por falta de time ahora retomo la misma
tarea si pudieran ayudarme con esto.
saludos

--
Jessy Hernandez Vidal
Jefe de Grupo de Informatización
Archivo Nacional de Cuba(ARNAC)
Compostela # 906 Esq. San Isidro.
Habana Vieja, Cuba.
Telefono:8612512
email: je...@arnac.cu
jabber: jessys...@jabber.arnac.cu
       **** Linux Mint 17 Qiana****
Evite los virus. Use Linux o Hierva el ordenador antes de usar.

______________________________________________________________________
Lista de correos del Grupo de Usuarios de Tecnologías Libres de Cuba.
Gutl-l@jovenclub.cu
https://listas.jovenclub.cu/cgi-bin/mailman/listinfo/gutl-l

¿Puedes consultar los archivos de la lista? el tema se ha debatido
bastante.

En cualquier caso, te repito un mensaje que envié hace ya un tiempo.


El vie, 20-06-2014 a las 12:48 -0400, Pedro V. Navarrete Alejo escribió:
Me interesa este hilo. Existe alguna documentacion al respecto? el man
esta muy escueto y el html le sigue los pasos.

Copio esta solución que mandé a la lista hace mucho.
Por supuesto, no lo inventé yo.

En su momento lo tuve funcionando en el Postfix.

Solución con altermime

Last edited 12/20/2007

This tutorial shows how to install and use alterMIME. alterMIME is a
tool that can automatically add a disclaimer to emails. In this article
I will explain how to install it as a Postfix filter on Debian Etch.

I do not issue any guarantee that this will work for you!


1 Preliminary Note

I'm assuming that Postfix is already installed and fully functional - I
will not explain how to set up Postfix and configure email accounts in
this tutorial.


2 Installing alterMIME

alterMIME can be installed as follows:

apt-get install altermime

Next we create the user filter with the home directory /var/spool/filter
filter - alterMIME will be run as that user:

useradd -r -c "Postfix Filters" -d /var/spool/filter filter
mkdir /var/spool/filter
chown filter:filter /var/spool/filter
chmod 750 /var/spool/filter

Afterwards we create the script /etc/postfix/disclaimer which executes
alterMIME. Debian's alterMIME package comes with a sample script that we
can simply copy to /etc/postfix/disclaimer:

cp /usr/share/doc/altermime/examples/postfix_filter.sh /etc/postfix/disclaimer
chgrp filter /etc/postfix/disclaimer
chmod 750 /etc/postfix/disclaimer

Now the problem with this script is that it doesn't distinguish between
incoming and outgoing emails - it simply adds a disclaimer to all mails.
Typically you want disclaimers only for outgoing emails, and even then
not for all sender addresses. Therefore I've modified
the /etc/postfix/disclaimer script a little bit - we'll come to that in
a minute.

Right now, we create the file /etc/postfix/disclaimer_addresses which
holds all sender email addresses (one per line) for which alterMIME
should add a disclaimer:

vi /etc/postfix/disclaimer_addressesfa...@example.com
j...@example.org
t...@example.net


Now we open /etc/postfix/disclaimer and modify it as follows (I have
marked the parts that I've changed):

vi /etc/postfix/disclaimer#!/bin/sh
# Localize these.
INSPECT_DIR=/var/spool/filter
SENDMAIL=/usr/sbin/sendmail

####### Changed From Original Script #######
DISCLAIMER_ADDRESSES=/etc/postfix/disclaimer_addresses
####### Changed From Original Script END #######

# Exit codes from <sysexits.h>
EX_TEMPFAIL=75
EX_UNAVAILABLE=69

# Clean up when done or when aborting.
trap "rm -f in.$$" 0 1 2 3 15

# Start processing.
cd $INSPECT_DIR || { echo $INSPECT_DIR does not exist; exit
$EX_TEMPFAIL; }

cat >in.$$ || { echo Cannot save mail to file; exit $EX_TEMPFAIL; }

####### Changed From Original Script #######
# obtain From address
from_address=`grep -m 1 "From:" in.$$ | cut -d "<" -f 2 | cut -d ">" -f
1`

if [ `grep -wi ^${from_address}$ ${DISCLAIMER_ADDRESSES}` ]; then
  /usr/bin/altermime --input=in.$$ \
                   --disclaimer=/etc/postfix/disclaimer.txt \
                   --disclaimer-html=/etc/postfix/disclaimer.txt \
                   --xheader="X-Copyrighted-Material: Please visit
http://www.company.com/privacy.htm"; || \
                    { echo Message content rejected; exit
$EX_UNAVAILABLE; }
fi
####### Changed From Original Script END #######

$SENDMAIL "$@" <in.$$

exit $?


Next we need the text file /etc/postfix/disclaimer.txt which holds our
disclaimer text. Debian's alterMIME package comes with a sample text
that we can use for now (of course, you can modify it if you like):

cp /usr/share/doc/altermime/examples/disclaimer.txt /etc/postfix/disclaimer.txt

Finally we have to tell Postfix that it should use
the /etc/postfix/disclaimer script to add disclaimers to outgoing
emails. Open /etc/postfix/master.cf and add -o content_filter=dfilt: to
the smtp line:

vi /etc/postfix/master.cf#
# Postfix master process configuration file.  For details on the format
# of the file, see the master(5) manual page (command: "man 5 master").
#
#
==========================================================================
# service type  private unpriv  chroot  wakeup  maxproc command + args
#               (yes)   (yes)   (yes)   (never) (100)
#
==========================================================================
smtp      inet  n       -       -       -       -       smtpd
   -o content_filter=dfilt:
[...]


At the end of the same file, add the following two lines:[...]
dfilt     unix    -       n       n       -       -       pipe
    flags=Rq user=filter argv=/etc/postfix/disclaimer -f ${sender} --
${recipient}


Restart Postfix afterwards:

/etc/init.d/postfix restart

That's it! Now a disclaimer should be added to outgoing emails sent from
the addresses listed in /etc/postfix/disclaimer_addresses.


--
M.Sc. Alberto García Fumero
Usuario Linux 97 138, registrado 10/12/1998
Las autoridades sanitarias advierten:
El uso prolongado de Windows puede provocar dependencia.


--
Este mensaje ha sido analizado por MailScanner
en busca de virus y otros contenidos peligrosos,
y se considera que est limpio.
--
M.Sc. Alberto García Fumero
Usuario Linux 97 138, registrado 10/12/1998
Las autoridades sanitarias advierten:
El uso prolongado de Windows puede provocar dependencia.


______________________________________________________________________
Lista de correos del Grupo de Usuarios de Tecnologías Libres de Cuba.
Gutl-l@jovenclub.cu
https://listas.jovenclub.cu/cgi-bin/mailman/listinfo/gutl-l
Gracias por la ayuda me voy a poner a ello ahora


---
Jessy Hernandez Vidal
Jefe de Grupo de Informatización
Archivo Nacional de Cuba(ARNAC)
Compostela # 906 Esq. San Isidro.
Habana Vieja, Cuba.
Telefono:8612512
email: je...@arnac.cu
jabber: jessys...@jabber.arnac.cu
      **** Linux Mint 17 Qiana****
Evite los virus. Use Linux o Hierva el ordenador antes de usar.

--
Este mensaje ha sido analizado por MailScanner
en busca de virus y otros contenidos peligrosos,
y se considera que est� limpio.

______________________________________________________________________
Lista de correos del Grupo de Usuarios de Tecnologías Libres de Cuba.
Gutl-l@jovenclub.cu
https://listas.jovenclub.cu/cgi-bin/mailman/listinfo/gutl-l

Responder a