archlinux: postfix +gmail

Aupa oingutan archlinux-eko postfix-e konfigurekue gmail-egaz ibiltzeko, debian-elez idxe bardiƱe da baie gauze batzuk kanbidxe bidiez :)

$ su
# pacman -S postfix openssl
# mv /etc/postfix/main.cf /etc/postfix/main.cf.bak

/etc/postfix/main.cf

# SMTP relayhost
relayhost = [smtp.gmail.com]:587

## TLS Settings
smtp_tls_loglevel = 1
smtp_tls_CAfile = /etc/postfix/certs/CAcert.pem
smtp_tls_cert_file = /etc/postfix/certs/mycert.pem
smtp_tls_key_file = /etc/postfix/certs/mykey.pem
smtp_use_tls = yes
smtpd_tls_CAfile = /etc/postfix/certs/CAcert.pem
smtpd_tls_cert_file = /etc/postfix/certs/mycert.pem
smtpd_tls_key_file = /etc/postfix/certs/mykey.pem
smtpd_tls_received_header = yes
smtpd_use_tls = yes

# configuracao tls
smtp_use_tls = yes
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_sasl_security_options = noanonymous
smtp_sasl_tls_security_options = noanonymous

# alias de mapeamento interno para externo
smtp_generic_maps = hash:/etc/postfix/generic

/etc/postfix/sasl_passwd

[smtp.gmail.com]:587    user@gmail.com:passwd
# mv /etc/postfix/generic /etc/postfix/generic.bak

/etc/postfix/generic

user@gmail.com user@gmail.com
# chmod 600 /etc/postfix/sasl_passwd
# chmod 600 /etc/postfix/generic

# postmap /etc/postfix/sasl_passwd
# postmap /etc/postfix/generic

# mkdir /etc/postfix/certs/
# cd /etc/postfix/certs/

# openssl dsaparam 1024 -out dsa1024.pem
# openssl req -x509 -nodes -days 3650 -newkey dsa:dsa1024.pem -out mycert.pem -keyout mykey.pem

# ln -s mycert.pem CAcert.pem

# openssl req -x509 -new -days 3650 -key /etc/postfix/certs/mykey.pem -out /etc/postfix/certs/mycert.pem

# rm dsa1024.pem
# /etc/rc.d/postfix start
:: Starting Postfix [FAIL] 
# /etc/rc.d/postfix stop

LOGS:

# tail /var/log/mail.log
Jan 30 12:21:51 arch postfix[5641]: fatal: chdir(/usr/libexec/postfix): No such file or directory
# mkdir /usr/libexec
# ln -s /usr/lib/postfix /usr/libexec/postfix
# /etc/rc.d/postfix start
:: Starting Postfix [DONE] 
# exit
$ echo "content" | mail -s "subject" user@mail.com

Leave a Reply

Your email address will not be published. Required fields are marked *