| Montar de servidor de correo (Postfix) |
|
|
|
| Escrito por Osmell Gutierrez | ||||||||||||||||
| miércoles, 28 de enero de 2009 | ||||||||||||||||
Introducción |
||||||||||||||||
HARDWARE | Mínimo | Recomendado |
| Procesador | Pentium 100 MHz | Pentium II 266 Mhz |
| Memoria | 128 MB | 256 MB |
| CD Rom | Necesario (4x) | Necesario (24x) |
| Tarjeta Gráfica | 16 MB (VGA) | 24 MB (SVGA) |
Es necesario también un MTA, existen varios como lo son: Sendmail, Squirremail,
postfix, fetchmail, etc. En este manual usaremos postfix.
Y por ultimo una red local de trabajo. En este punto el sistema operativo no importa,
ya que nuestro servidor se configurar para que cualquier usuario conectado
a la red donde se encuentre el servidor pueda interactuar con cualquier otro usuario
en la misma red.
Software
Configuración de software
Primero configuramos nuestro fichero /etc/hosts
[root@localhost ~]# kwrite /etc/hosts
Y lo dejamos así
127.0.0.1 localhost.localdomain localhost 192.168.0.1 sor.uni sor.uni
Ahora configuramos el nombre de nuestro PC
[root@localhost ~]#echo sor.uni > /etc/hostname [root@localhost ~]#/bin/hostname -F
/etc/hostname Y el nombre de nuestra pc sera ahora sor.uni
[root@localhost ~]# hostname
sor.uni
Postfix
Como se había mencionado el software MTA que utilice es el postfix.
A continuación los pasos para instalar postfix:
[root@localhost ~]# urpmi postfix
Para satisfacer las dependencias, se instalarán los paquetes siguientes:
libpostfix1-2.2.5-7mdk.i586
postfix-2.2.5-7mdk.i586
¿Está todo bien? (S/n) s
...........................................
Terminando el registro del núcleo: [ OK ]
Terminando el registro del sistema: [ OK ]
Iniciando el registro del sistema: [ OK ]
Iniciando el registro del núcleo: [ OK ]
Lo ponemos en marcha y nos aseguraremos que todo vaya bien:
[root@localhost ~]# /etc/init.d/postfix start
Iniciando postfix: [OK]
Nos aseguraremos que los puertos están abiertos:
[root@localhost ~]# netstat -puta
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 web:10026 *:* LISTEN 19274/master
tcp 0 0 web:smtp *:* LISTEN 19274/master
Vemos que master (postfix) está escuchando en el puerto smtp (25) del servidor.
Veamos los archivos y directorios importantes de postfix:
/etc/postfix/main.cf, que es el fundamental de configuración de postfix
/etc/postfix/master.cf, el segundo fundamental y complejo (mejor no toquetearlo)
/etc/postfix/aliases, que es el archivo para crear alias (redirecciones de correo).
Por ejemplo, el correo dirigido a root debería leerlo un usuario del sistema,
como puede ser pepito./var/spool/postix/ es el directorio donde trabaja enjaulado Postfix.
Observa cómo ha copiado hasta los archivos básicos de /etc que necesita
para funcionar.
Configuración Postfix
A continuación la parte mas interesante de todo este proyecto es la
configuración del servido. El archivo que configuraremos es el main.cf
(“/etc/postfix/main.cf”), este es el archivo modificable:
# Please be sure to read the /usr/share/doc/postfix/README.MDK file
# to learn about differences from stock postfix to Mandriva package.
# This file contains only the parameters changed from a default install
# see /etc/postfix/main.cf.dist for a commented, fuller version of this file.
# These are changed by postfix install script
readme_directory = /usr/share/doc/postfix/README_FILES
html_directory = /usr/share/doc/postfix/html
sendmail_path = /usr/sbin/sendmail.postfix
setgid_group = postdrop
command_directory = /usr/sbin
manpage_directory = /usr/share/man
daemon_directory = /usr/lib/postfix
newaliases_path = /usr/bin/newaliases
mailq_path = /usr/bin/mailq
queue_directory = /var/spool/postfix
mail_owner = postfix
# User configurable parameters
inet_interfaces = all
mynetworks_style = host
delay_warning_time = 4h
smtpd_banner = $myhostname ESMTP $mail_name ($mail_version)
(Servidor de correo sistema operativo y redes)
unknown_local_recipient_reject_code = 450
smtp-filter_destination_concurrency_limit = 2
lmtp-filter_destination_concurrency_limit = 2
data_directory = /var/lib/postfix
# Asigno el nombre del HOST y Dominio
myhostname = mail.sor.uni
mydomian = sor.uni
# El origen del correo
myorigin = $myhostname #$myhostname esta definido arriba como mail.sor.uni
inet_interface = 192.168.0.1
# Permitir a los usuarios de la red que puedan enviar y recibir correo
mynetworks = 192.168.0.0/24, 127.0.0.0/8
mydestination = $myhostname, localhost.$myhostname, localhost.$mydomain, $mydomain
sendmail_path = /usr/bin/sendmail.postfix
# Configuraciones del buzon de correo
home_mailbox = Maildir/
mail_spool_directory = /var/spool/mail
mailbox_command = /usr/bin/procmail -Y -a $DOMAIN
mailq_path = /usr/bin/mailq.postfix
# mapa de usuarios
alias_map = hash:/etc/postfix/aliases
Habiendo modificado nuestro archivo main.cf de postfix, iremos a agregar
a los usuarios que estarán en nuestra red para que pueda mandar correo y recibirlo.
El archivo a modificar es aliases (“/etc/postfix/aliases”):
# Default aliases file for postfix
#
# this file should be in /etc or in /etc/postfix but if you want it in
# /etc/postfix you'll have to adjust your /etc/postfix/main.cf file accordingly
#
# Aliases in this file will NOT be expanded in the header from
# mail, but WILL be visible over networks or from /bin/mail.
#
# Following alias is required by the mail protocol, RFC 822 (and by RFC2142)
# Set it to the address of a HUMAN who deals with this system's mail problems.
#
# For various security reasons, postfix WILL NOT deliver mail as root, so
# ensure that the root alias is aliased to a HUMAN user, as otherwise
# mail may get delivered to the $default_privs user (nobody).
postmaster: root
# Many mailers use this address to represent the empty SMTP return
# path
MAILER-DAEMON: postmaster
name: osmell, sor
# Common aliases for system accounts.
bin: root
daemon: root
games: root
ingres: root
nobody: root
system: root
toor: root
foo: root
falken: root
# Well-known aliases.
admin: root
manager: root
dumper: root
operator: root
# traps to catch security attacks
decode: root
moof: root
moog: root
# The following aliases are required by RFC 2142
info: staff
marketing: staff
sales: staff
support: staff
# Standard aliases also defined by RFC 2142
abuse: postmaster
# reports of network infrastructure difficulties
noc: root
# address to report secuirty problems
security: root
# DNS administrator (DNS soa records should use this)
hostmaster: root
# Usenet news service administrator
news: usenet
usenet: root
# http/web service administrator
www: webmaster
webmaster: root
# UUCP service administrator
uucp: root
# FTP administrator (especially anonymouse FTP)
ftp: root
# Commonly used group aliases:
#
staff: postmaster
office: postmaster
all: postmaster
tech: postmaster
ops: postmaster
# Person who should get root's mail. This alias
# must exist.
# CHANGE THIS LINE to an account of a HUMAN
root: osmell
user: sor
# Account to receive redirected spamm and hammails
spam: root
ham: root
# Note to the user: You must create the alias above!
# The root alias *must* exist under postfix because
# postfix runs as a non-privileged user and cannot
# touch a spool file which is UID/GID root
# The mapping to the postfix user is to ensure that root's mail
# doesn't get lost on a system installed out of the box.
Después de haber configurado el aliasses debemos tener en cuenta que
hay que agregar a los nuevos usuarios de la red, para eso ejecutaremos:
[root@localhost ~]# newaliase
El nos agregará a los usuario que agregamos en las lineas:
user: sor
Podemos anexar mas usuario de la siguiente manera:
user: sor, darell, pepito
También hay que considerar que el usuario administrador del servidor de correo
por defecto es postfix, pero bien `puede cambiarlo por el nombre de cualquier usuario:
root: osmell
O incluso puede agregar mas de un administrador:
root: osmell, jose, maria
Luego de haber agregado a los usuarios deseado reiniciaremos postfix para
que corra de manera completa y aceptando todos los cambios:
[root@localhost ~]# /etc/init.d/postfix restart
Ya solo nos toca realizar las pruebas de nuestro servidor de correo.
Esto lo realizaremos por medio de cualquier gestor de correo que el usuario
asi lo desee; como lo son thunderbird, outlook, kmail, kontact, etc.
| < Anterior | Siguiente > |
|---|

























