Difference between revisions of "Instalation Null Client in Debian"

From Supercomputación y Cálculo Científico UIS
 
(6 intermediate revisions by one other user not shown)
Line 1: Line 1:
Back to [[Mail server]]
+
__NOTOC__
  
'''Cliente Sendmail (Debian)'''
+
<div class="thumbnail img-thumbnail">http://wiki.sc3.uis.edu.co/images/a/a8/Logo_sc33.png</div>
 +
<p><div class="btn btn-primary"><i class="fa  fa-long-arrow-left"></i> [[Mail server]]</div></p>
  
== Instalaci&oacute;n ==
+
<div class="col-md-14">
 +
    <div class="panel panel-darker-white-border">
 +
        <div class="panel-heading">
 +
            <h3 class="panel-title">Instalation Null Client in Debian</h3>
 +
        </div>
 +
        <div class="panel-body">
 +
            <p><b>Sendmail Null Client (Debian)</b></p>
 +
            <p>
  
aptitude install sendmail
+
== Installation ==
 +
{{Command|<nowiki>aptitude install sendmail</nowiki>}}
 +
== Setting-up ==
 +
1. Replace ${ADMIN_EMAIL}, ${HOSTNAME}, ${DNS_DOMAIN}, ${IP_ADDR} for the adequate values.
  
== Configuraci&oacute;n ==
+
2. Redirect messages from root, postmaster, admin, etc, to the administrator.
  
''Sustituir ${ADMIN_EMAIL}, ${HOSTNAME}, ${DNS_DOMAIN}, ${IP_ADDR} por los valores
+
Edit /etc/mail/aliases
adecuados''<br>
+
{{File|/etc/mail/aliases|<pre><nowiki>
 
+
...
Redirigir los mensajes de root, postmaster, admin, etc., al administrador del equipo<br>
+
operator: root
Editar /etc/mail/aliases
+
admin: root
 
+
root: ${ADMIN_EMAIL}
(...)
+
...
operator: root
+
</pre></nowiki>}}
admin: root
+
Update the aliases database:
root: ${ADMIN_EMAIL}
+
{{Command|<nowiki>/usr/sbin/newaliases</nowiki>}}
 
+
4. Verify that sendmail knows about the different names that the client can have.
Actualizar base de datos de aliases:
 
 
 
/usr/sbin/newaliases
 
 
 
Verificar que el sendmail conoce los distintos nombres que puede tener el cliente<br>
 
 
 
 
 
Editar /etc/mail/local-host-names
 
  
 +
Edit /etc/mail/local-host-names
 +
{{File|/etc/mail/local-host-names|<pre><nowiki>
 +
...
 
  localhost
 
  localhost
 
  localhost.localdomain
 
  localhost.localdomain
 
  ${HOSTNAME}
 
  ${HOSTNAME}
 
  ${HOSTNAME}.${DNS_DOMAIN}
 
  ${HOSTNAME}.${DNS_DOMAIN}
 +
...
 +
</pre></nowiki>}}
 +
Verify that the host appears in /etc/hosts
 +
{{File|/etc/hosts|<pre><nowiki>
 +
...
 +
${IP_ADDR}  ${HOSTNAME}.${DNS_DOMAIN}  ${HOSTNAME}
 +
...</nowiki></pre>}}
 +
Edit /etc/mail/sendmail.mc
 +
{{File|/etc/mail/sendmail.mc|<pre><nowiki>
 +
...
 +
dnl #
 +
dnl # Masquerading options
 +
FEATURE(`always_add_domain')dnl
 +
MASQUERADE_AS(`${HOSTNAME}.${DNS_DOMAIN}')dnl
 +
FEATURE(`allmasquerade')dnl
 +
FEATURE(`masquerade_envelope')dnl
 +
dnl #
 +
dnl # Default Mailer setup
 +
MAILER_DEFINITIONS
 +
MAILER(`local')dnl
 +
MAILER(`smtp')dnl
 +
...</nowiki></pre>}}
 +
5. Activate the new configuration
 +
{{Command|<nowiki>yes | sendmailconfig</nowiki>}}
 +
== Security ==
 +
By default Debian installs sendmail enabled only for localhost.<br>
 +
If tcp-wrappers are used, a line similar to the following should be added to /etc/hosts.allow
 +
{{File|/etc/hosts.allow|<pre><nowiki>
 +
...
 +
sendmail: 127.0.0.1
 +
</nowiki></pre>}}
 +
If different filters are used, it's necessary to allow the access to the port localhost:25/tcp from localhost:1025/tcp
 +
== Cleaning-up (optional)==
 +
Remove ssmtp
 +
{{Command|<nowiki>aptitude remove ssmtp</nowiki>}}
 +
If the DNS setup isn't defined in /etc/network/interfaces, remove resolvconf
 +
{{Command|<nowiki>aptitude remove resolvconf</nowiki>}}
  
Verificar que el host aparece en /etc/hosts
+
            </p>
 
+
        </div>
${IP_ADDR}  ${HOSTNAME}.${DNS_DOMAIN}  ${HOSTNAME}
+
    </div>
 
+
</div>
Editar /etc/mail/sendmail.mc
 
 
 
(...)
 
dnl #
 
dnl # Masquerading options
 
FEATURE(`always_add_domain')dnl
 
MASQUERADE_AS(`${HOSTNAME}.${DNS_DOMAIN}')dnl
 
FEATURE(`allmasquerade')dnl
 
FEATURE(`masquerade_envelope')dnl
 
dnl #
 
dnl # Default Mailer setup
 
MAILER_DEFINITIONS
 
MAILER(`local')dnl
 
MAILER(`smtp')dnl
 
 
 
Activar la nueva configuración
 
 
 
yes | sendmailconfig
 
 
 
== Seguridad ==
 
Por omisi&oacute;n Debian instala sendmail habilitado solo para localhost<br>
 
Si se usan tcp-wrappers, se debe agregar una l&iacute;nea similar a la siguiente en
 
/etc/hosts.allow
 
 
 
sendmail: 127.0.0.1
 
 
 
Si se usan otros filtros se debe permitir el acceso al puerto localhost:25/tcp desde localhost:>1025/tcp
 
 
 
== Limpieza (opcional)==
 
Eliminar el ssmtp
 
 
 
aptitude remove ssmtp
 
 
 
Si la configuración DNS no está definida en /etc/network/interfaces, eliminar el resolvconf
 
aptitude remove resolvconf
 

Latest revision as of 20:12, 9 April 2015


Logo_sc33.png

Instalation Null Client in Debian

Sendmail Null Client (Debian)

Installation

aptitude install sendmail

Setting-up

1. Replace ${ADMIN_EMAIL}, ${HOSTNAME}, ${DNS_DOMAIN}, ${IP_ADDR} for the adequate values.

2. Redirect messages from root, postmaster, admin, etc, to the administrator.

Edit /etc/mail/aliases

File: /etc/mail/aliases
<nowiki>
...
operator: root
admin: root
root: ${ADMIN_EMAIL}
...
</nowiki>

Update the aliases database:

/usr/sbin/newaliases

4. Verify that sendmail knows about the different names that the client can have.

Edit /etc/mail/local-host-names

File: /etc/mail/local-host-names
<nowiki>
...
 localhost
 localhost.localdomain
 ${HOSTNAME}
 ${HOSTNAME}.${DNS_DOMAIN}
...
</nowiki>

Verify that the host appears in /etc/hosts

File: /etc/hosts
...
${IP_ADDR}  ${HOSTNAME}.${DNS_DOMAIN}  ${HOSTNAME}
...

Edit /etc/mail/sendmail.mc

File: /etc/mail/sendmail.mc
...
dnl #
dnl # Masquerading options
FEATURE(`always_add_domain')dnl
MASQUERADE_AS(`${HOSTNAME}.${DNS_DOMAIN}')dnl
FEATURE(`allmasquerade')dnl
FEATURE(`masquerade_envelope')dnl
dnl #
dnl # Default Mailer setup
MAILER_DEFINITIONS
MAILER(`local')dnl
MAILER(`smtp')dnl
...

5. Activate the new configuration

yes | sendmailconfig

Security

By default Debian installs sendmail enabled only for localhost.
If tcp-wrappers are used, a line similar to the following should be added to /etc/hosts.allow

File: /etc/hosts.allow
...
sendmail: 127.0.0.1

If different filters are used, it's necessary to allow the access to the port localhost:25/tcp from localhost:1025/tcp

Cleaning-up (optional)

Remove ssmtp

aptitude remove ssmtp

If the DNS setup isn't defined in /etc/network/interfaces, remove resolvconf

aptitude remove resolvconf