Postfix Instalatzen

Behar ditugun pakerteak instalatuko ditugu.

    apt-get install postfix postfix-tls libsasl2 sasl2-bin libsasl2-modules

Debianen konfiguratzaileak egingo dizkigun galderak erantzun, defektuzko baloreak onartuz. Gero aldatuko ditugu.

Orain, Piostfix-en hasierako konfigurazioa gauzatuko dugu. Hurrengo aginteak egikarituko ditugu. Kontuz lerro batzuetako aginteekin eta hizki larritan dauden hitzekin. Kasu bakoitzean egokiak direnekin aldatu behar dira. Komando hauek, /etc/postfix/main.cf fitxategiaren konfigurazioa aldatzen dute. Eskuz ere egin dezakegu. Kontutan izan, konfigurazioa hau ez dela posta zerbitzari batentzat. Ezin dezake mezurik metatu. Ez daki erabiltzaileak nortzuk dire. Gauza batzuk falta dira hortarako.

    postconf -e 'smtpd_sasl_local_domain ='
    postconf -e 'smtpd_sasl_auth_enable = yes'
    postconf -e 'smtpd_sasl_security_options = noanonymous'
    postconf -e 'broken_sasl_auth_clients = yes'

    postconf -e 'mail_owner = postfix'
    postconf -e "myhostname = MIMAQUINA.MIDOMINIO"
    postconf -e "mydomain = MIDOMINIO"

    postconf -e 'myorigin = $mydomain'
    postconf -e 'mydestination = $myhostname, localhost, localhost.$mydomain'
    postconf -e "mynetworks = 127.0.0.0/8,REDESINTERNASDELAESCUELA"
    postconf -e 'local_destination_concurrency_limit = 2'
    postconf -e 'default_destination_concurrency_limit = 10'
    postconf -e 'debug_peer_level = 2'
    postconf -e 'mail_spool_directory = /var/mail'
    postconf -e "inet_interfaces = IP_MIMAQUINA, 127.0.0.1"
    postconf -e 'disable_dns_lookups = no'
    postconf -e 'relayhost = '
    postconf -e 'mailbox_command = '
    postconf -e 'mailbox_size_limit = MAXIMOTAMAÑODELBUZON'
    postconf -e 'smtpd_helo_required = no'
    postconf -e 'smtpd_helo_restrictions = '
    postconf -e 'strict_rfc821_envelopes = no'
    postconf -e 'smtpd_recipient_restrictions =  permit_mynetworks,permit_sasl_authenticated,reject_unauth_destination,reject_invalid_hostname,reject_unknown_sender_domain,reject_non_fqdn_sender'
    postconf -e 'smtpd_sender_restrictions =  reject_unknown_sender_domain,hash:/etc/postfix/access'
    postconf -e "message_size_limit = MAXIMOTAMAÑODELMENSAJE"
    postconf -e 'smtpd_timeout = 7m'
    postconf -e 'smtpd_recipient_limit = 100'
    postconf -e "smtpd_banner = MIMAQUINA.MIDOMINIO ESMTP"

sasl-ren konfigurazio fitxategia sortuko dugu.

    echo 'pwcheck_method: saslauthd' >> /etc/postfix/sasl/smtpd.conf
    echo 'mech_list: plain login' >> /etc/postfix/sasl/smtpd.conf

Posta debekatzeko domeinu/zerbitzarien zerrenda sortuko dugu. Erabilgarria izan daiteke baina eskuz mantendu behar dugu.

    touch /etc/postfix/access
    postmap /etc/postfix/access

Orain Exim kenduko dugu.

    update-rc.d -f exim4 remove

Postfiz eta SASL autentifikazioa berrabiarazi.

    /etc/init.d/postfix restart
    /etc/init.d/saslauthd start

Orain esango diogu Postfix-i, posta pasarela bat dela, eta dagokizkion posta mezuak beste zerbitzari batera bidali behar dituela. Beste zerbitzari hontan daude posta kutxak. Esan behar diogu zein den garraio mapen fitxategia. Fitxategi hau /etc/postfix/transport izango da.

    postconf -e "relay_domains = MISDOMINIOS"
    postconf -e 'transport_maps = hash:/etc/postfix/transport'

Garraio fitxategiaren edukia holako zerbait izango da (bi domeinu suposatuaz):

MIDOMINIO1    relay:[SERVIDOR1]
MIDOMINIO2    relay:[SERVIDOR2]

Hash-a sortzen dugu.

    postmap /etc/postfix/transport

/etc/aliases aldatuko dugu clamav, abuse eta postmaster kontuetara bidalitako posta gure domeinuko posta-kutxa batetara bidal dezan. Hortarako, hurrengo lerroak agertu behar dira honela edo antzera:

postmaster: postmaster@MIDOMINIO
abuse: postmaster@MIDOMINIO
clamav: postmaster@MIDOMINIO

Ondoren, datu-basea sortuko dugu.

    postalias /etc/aliases

Postfix berrabiaraziko dugu.

    /etc/init.d/postfix restart

Posta zerbitzarian, postmaster posta kontu bat sertu beharko dugu posta jasotzeko.