![]() |
Gentoo + Postfix +Gmail |
![]() ![]() ![]() ![]() |
Certbot
Sasl authentication
telnet client.example.com 25
EHLO client.example.com
AUTH PLAIN dGVzdAB0ZXN0AHRlc3RwYXNz
където dGVzdAB0ZXN0AHRlc3RwYXNz =perl -MMIME::Base64 -e 'print encode_base64("test\0test\0testpass");'Генериране на сертификати
Enable IMAP access from your gmail accaunt!
# flaggie mail-mta/postfix +sasl
# emerge -av postfix
cd /etc/ssl/postfix openssl genrsa -des3 -out server.key 2048
chmod 600 server.key openssl req -new -key server.key -out server.csr
openssl x509 -req -days 3650 -in server.csr -signkey server.key -out server.crt
openssl rsa -in server.key -out server.key.nopass
mv server.key.nopass server.key
openssl req -new -x509 -extensions v3_ca -keyout cakey.pem -out cacert.pem -days 3650
Добавяне към: /etc/postfix/main.cf
--------------------------------------------------------------
relayhost = [smtp.gmail.com]:587 smtp_use_tls = yes smtp_tls_CAfile = /etc/ssl/postfix/server.pem smtp_tls_cert_file = /etc/ssl/postfix/server.crt smtp_tls_key_file = /etc/ssl/postfix/server.key btree = /var/lib/postfix/smtp_tls_session_cache smtp_sasl_auth_enable = yes smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd smtp_sasl_security_options = noanonymous
--------------------------------------------------------------# echo "smtp.gmail.com procentibg@gmail.com:[password]" > /etc/postfix/sasl_passwd # chown root:root /etc/postfix/sasl_passwd # chmod 600 /etc/postfix/sasl_passwd # postmap /etc/postfix/sasl_passwd
# newaliases/etc/init.d/postfix restart
Подписване с DKIM
Подписване с DKIM Gentoo
Checker for DNS keys
Multiple domains DKIM
Relay testheader_check# mailq - Показва писмата чакащи в опашката за изпращане
#postfix flush
- Изпраща веднага опашката
# postsuper -d ALL - Изтрива всички писма в опашката.
# newaliases - създава aliasedb # postconf maillog_file=/var/log/mail.log
Антиспам защита
mail-mta/postfix-3.0.0::gentoo USE="berkdb eai mysql pam sasl ssl -cdb -doc -dovecot-sasl -hardened -ldap -ldap-bind -lmdb -mbox -memcached -nis -postgres (-selinux) -sqlite -vda"
mail-filter/maildrop-2.6.0::gentoo USE="authlib berkdb gdbm ldap -debug -fam -mysql -postgres -static-libs -tools -trashquota"
net-mail/courier-imap-4.15-r1::gentoo USE="berkdb fam gdbm -debug -gnutls -ipv6 (-selinux) -trashquota"
/etc/maildroprc
==============================================================#logfile "/var/log/maildrop.log"
#
# Markers for the log file
#
#log "Markers: ---------------------------------------------"
#log " (**) from config file, (II) informational, (WW) warning"
#log "--------------------------------------------------------"
#log ""
#DEFAULT="$HOME/.maildir/"
#MAILBOX = "/var/vmail/$2/$1/.maildir"
MAILBOX = "/var/vmail/$2/$1/"
if( /^Subject:.*\*\*\*SPAM\*\*\*/ )
{
to "${MAILBOX}/.Junk"
}
to $MAILBOXS
===============================================================
/etc/postfix/master.cf
===============================================================
maildrop unix - n n - - pipe
flags=ODRhu user=vmail argv=/usr/bin/maildrop -d ${recipient} ${user}@${domain} ${domain}
===============================================================
/etc/postfix/main.cf
===============================================================
virtual_transport = maildrop
mailbox_transport = maildrop
maildrop_destination_recipient_limit = 1
===============================================================
maildrop -V 4 -d test@cablenet.one.pl < /etc/spamtest.msg
За IMAP-SSL - 993
DH_BITS=2048 mkdhparams