Criando o
Sendmail.conf (o S é em maiúsculo):
# echo "pwcheck_method: saslauthd" >> /usr/lib/sasl2/Sendmail.conf
# echo "mech_list: getpwent LOGIN PLAIN" >> /usr/lib/sasl2/Sendmail.conf
Executando o saslauthd:
# chmod +x /etc/rc.d/rc.saslauthd
# /etc/rc.d/rc.saslauthd start
Se não ocorrer nenhum erro é porque seu sistema esta funcionando perfeitamente.
Qpopper
Adquirindo e instalando o pacote (qpopper-4.0.8-i386-P1.tgz):
# cd /pkg
# wget http://ftp.yz.yamagata-u.ac.jp/pub/linux/plamo/Plamo-4.2/\
plamo/n/qpopper-4.0.8-i386-P1.tgz
# installpkg qpopper-4.0.8-i386-P1.tgz
Criando o
qpopper.config:
# mkdir /etc/mail/pop
# echo "set tls-support = alternate-port" >> /etc/mail/pop/qpopper.config
# echo "set tls-server-cert-file = /etc/mail/certs/pop.cert.pem" >> /etc/mail/pop/qpopper.config
# echo "set tls-private-key-file = /etc/mail/certs/privatekey.pem" >> /etc/mail/pop/qpopper.config
# chmod 600 /etc/mail/pop -R
Criando os certificados SSL. Estou utilizando como padrão o meu domínio jpfaria.com, é muito importante que utilize o seu domínio.
# mkdir /etc/mail/certs
# cd /etc/mail/certs
# openssl genrsa -des3 -out CA.pop.key 1024
Generating RSA private key, 1024 bit long modulus
...++++++
...............................................++++++
e is 65537 (0x10001)
Enter pass phrase for CA.pop.key:1234
Verifying - Enter pass phrase for CA.pop.key:
1234
# openssl req -new -x509 -days 365 -key CA.pop.key -out CA.pop.crt
Enter pass phrase for CA.pop.key:1234
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [AU]:
BR
State or Province Name (full name) [Some-State]:
rio-de-janeiro
Locality Name (eg, city) []:
niteroi
Organization Name (eg, company) [Internet Widgits Pty Ltd]:
solar
Organizational Unit Name (eg, section) []:
tec
Common Name (eg, YOUR name) []:
jpfaria.com
Email Address []:
jpfaria@jpfaria.com
# openssl req -new -nodes -key CA.pop.key -out pop.req.pem -keyout pop.cert.pem
Enter pass phrase for CA.pop.key:
1234
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [AU]:BR
State or Province Name (full name) [Some-State]:
rio-de-janeiro
Locality Name (eg, city) []:
niteroi
Organization Name (eg, company) [Internet Widgits Pty Ltd]:
solar
Organizational Unit Name (eg, section) []:
tec
Common Name (eg, YOUR name) []:
jpfaria.com
Email Address []:
jpfaria@jpfaria.com
Please enter the following 'extra' attributes
to be sent with your certificate request
A challenge password []:1234
An optional company name []:
solar
# openssl x509 -req -CA CA.pop.crt -CAkey CA.pop.key -days 3650 -in pop.req.pem -out pop.cert.pem -CAcreateserial
serial
Signature ok
subject=/C=BR/ST=rio-de-janeiro/L=niteroi/O=solar/OU=tec/CN=joao/ emailAddress=joaopaulo@deoliveira.com.br
Getting CA Private Key
Enter pass phrase for CA.pop.key:
1234
# openssl rsa -in CA.pop.key -out privatekey.pem
Enter pass phrase for CA.pop.key:
1234
writing RSA key
# chmod 600 /etc/mail/certs -R
Abaixo estão algumas linhas de teste, se não houver nenhuma mensagem de erro é que os certificados foram gerados com sucesso.
# openssl x509 -noout -modulus -in pop.cert.pem | openssl md5
56e98cf020dfc80f909618717cf1dd15
# openssl rsa -noout -modulus -in CA.pop.key | openssl md5
Enter pass phrase for CA.pop.key:
1234
56e98cf020dfc80f909618717cf1dd15
# openssl rsa -noout -modulus -in privatekey.pem | openssl md5
56e98cf020dfc80f909618717cf1dd15
Repare que os três comandos geraram o mesmo código.
Para que o
qpopper funcione você precisa do
Linux-PAM, se você executar o seguinte comando:
# popper -s -f /etc/mail/pop/qpopper.config
e retornar a seguinte mensagem:
popper: error while loading shared libraries: libpam.so.0: cannot open shared object file: No such file or directory
Então você precisa instalar a lib Linux-PAM. Você pode achar em:
Vou utilizar a versão 0.99.3.0.
# cd /pkg
# wget http://opensys.linuxpackages.net/Slackware-10.2/Library/\
Linux-PAM/Linux-PAM-0.99.3.0-i486-1cjm.tgz
# installpkg Linux-PAM-0.99.3.0-i486-1cjm.tgz
Habilitando o
spop3 (porta 995). Para habilitar o spop3, edite o arquivo
/etc/inetd.conf e coloque a linha abaixo no final do arquivo.
spop3 stream tcp nowait root /usr/sbin/tcpd popper -s -f /etc/mail/pop/qpopper.config