Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- TUTORIAL: http://freelinuxtutorials.com/quick-tips-and-tricks/configure-postfix-to-use-gmail-in-rhelcentos/
- usuario@wicope:~$ ssh root@192.168.1.121
- Last login: Thu Jul 23 10:17:09 2015 from 192.168.1.110
- [root@a3ee360fa35a ~]# vi /etc/postfix/main.cf
- [root@a3ee360fa35a ~]# service postfix restart
- Shutting down postfix: [FAILED]
- Starting postfix: [ OK ]
- [root@a3ee360fa35a ~]# yum install cyrus-sasl-plain
- Failed to set locale, defaulting to C
- Complementos cargados:fastestmirror
- Configurando el proceso de instalaci?n
- Loading mirror speeds from cached hostfile
- epel/metalink | 24 kB 00:00
- * base: mirror.trueinter.net
- * epel: mirror1.babylon.network
- * extras: mirror.trueinter.net
- * updates: mirror.trueinter.net
- Tuleap | 2.9 kB 00:00
- base | 3.7 kB 00:00
- epel | 4.4 kB 00:00
- epel/primary_db | 6.7 MB 00:02
- extras | 3.4 kB 00:00
- updates | 3.4 kB 00:00
- Resolviendo dependencias
- --> Ejecutando prueba de transacci?n
- ---> Package cyrus-sasl-plain.x86_64 0:2.1.23-15.el6_6.2 will be instalado
- --> Resoluci?n de dependencias finalizada
- Dependencias resueltas
- =========================================================================================================
- Paquete Arquitectura Versi?n Repositorio Tama?o
- =========================================================================================================
- Instalando:
- cyrus-sasl-plain x86_64 2.1.23-15.el6_6.2 updates 31 k
- Resumen de la transacci?n
- =========================================================================================================
- Instalar 1 Paquete(s)
- Tama?o total de la descarga: 31 k
- Tama?o instalado: 37 k
- Est? de acuerdo [s/N]:s
- Descargando paquetes:
- cyrus-sasl-plain-2.1.23-15.el6_6.2.x86_64.rpm | 31 kB 00:00
- Ejecutando el rpm_check_debug
- Ejecutando prueba de transacci?n
- La prueba de transacci?n ha sido exitosa
- Ejecutando transacci?n
- Instalando : cyrus-sasl-plain-2.1.23-15.el6_6.2.x86_64 1/1
- Verifying : cyrus-sasl-plain-2.1.23-15.el6_6.2.x86_64 1/1
- Instalado:
- cyrus-sasl-plain.x86_64 0:2.1.23-15.el6_6.2
- ?Listo!
- [root@a3ee360fa35a ~]# vi /etc/postfix/main.cf
- [root@a3ee360fa35a ~]# mkdir /etc/postfix/sasl
- [root@a3ee360fa35a ~]# vi /etc/postfix/sasl/passwd
- [root@a3ee360fa35a ~]# chmod 600 /etc/postfix/sasl/passwd
- [root@a3ee360fa35a ~]# postmap /etc/postfix/sasl/passwd
- [root@a3ee360fa35a ~]#
- [root@a3ee360fa35a ~]# cd /etc/pki/tls/certs
- [root@a3ee360fa35a certs]# make hostname.pem
- locale: Cannot set LC_CTYPE to default locale: No such file or directory
- locale: Cannot set LC_MESSAGES to default locale: No such file or directory
- locale: Cannot set LC_ALL to default locale: No such file or directory
- umask 77 ; \
- PEM1=`/bin/mktemp /tmp/openssl.XXXXXX` ; \
- PEM2=`/bin/mktemp /tmp/openssl.XXXXXX` ; \
- /usr/bin/openssl req -newkey rsa:2048 -keyout $PEM1 -nodes -x509 -days 365 -out $PEM2 -set_serial 0 ; \
- cat $PEM1 > hostname.pem ; \
- echo "" >> hostname.pem ; \
- cat $PEM2 >> hostname.pem ; \
- rm -f $PEM1 $PEM2
- Generating a 2048 bit RSA private key
- .........................+++
- ......+++
- writing new private key to '/tmp/openssl.xYIt1F'
- -----
- 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.
- -----
- ......data
- [root@a3ee360fa35a certs]# cp /etc/pki/tls/certs/hostname.pem /etc/postfix/cacert.pem
- [root@a3ee360fa35a certs]#
- [root@a3ee360fa35a certs]# # Borrar log
- [root@a3ee360fa35a certs]# echo "" > /var/log/maillog
- [root@a3ee360fa35a certs]# echo "" > /var/spool/mail/root
- [root@a3ee360fa35a certs]# # Borrar cola de email
- [root@a3ee360fa35a certs]# postsuper -d ALL
- [root@a3ee360fa35a certs]# # Enviar email
- [root@a3ee360fa35a certs]# #echo "Body" | mail -s "Title NO SPAM" "alfreditospowerspam@gmail.com"
- [root@a3ee360fa35a certs]# echo "Body" | mail -s "Title NO SPAM" "alfreditospower@gmail.com"
- [root@a3ee360fa35a certs]# sleep 3
- [root@a3ee360fa35a certs]# cat /var/log/maillog
- [root@a3ee360fa35a certs]# cat /var/spool/mail/root
- [root@a3ee360fa35a certs]# # Ver configuración de /etc/postfix/main.cf:
- [root@a3ee360fa35a certs]# postconf -n
- alias_database = hash:/etc/aliases,hash:/etc/aliases.codendi,hash:/etc/aliases.codendi,hash:/etc/aliases.codendi
- alias_maps = hash:/etc/aliases,hash:/etc/aliases.codendi,hash:/etc/aliases.codendi,hash:/etc/aliases.codendi
- command_directory = /usr/sbin
- config_directory = /etc/postfix
- daemon_directory = /usr/libexec/postfix
- data_directory = /var/lib/postfix
- debug_peer_level = 2
- html_directory = no
- inet_interfaces = localhost
- inet_protocols = all
- mail_owner = postfix
- mailq_path = /usr/bin/mailq.postfix
- manpage_directory = /usr/share/man
- mydestination = $myhostname, localhost.$mydomain, localhost
- myhostname = localhost
- newaliases_path = /usr/bin/newaliases.postfix
- queue_directory = /var/spool/postfix
- readme_directory = /usr/share/doc/postfix-2.6.6/README_FILES
- relayhost = [smtp.gmail.com]:587
- sample_directory = /usr/share/doc/postfix-2.6.6/samples
- sendmail_path = /usr/sbin/sendmail.postfix
- setgid_group = postdrop
- smtp_sasl_auth_enable = yes
- smtp_sasl_password_maps = hash:/etc/postfix/sasl/passwd
- smtp_sasl_security_options = noanonymous
- smtp_tls_CAfile = /etc/postfix/cacert.pem
- smtp_use_tls = yes
- unknown_local_recipient_reject_code = 550
- [root@a3ee360fa35a certs]# # To list the mail queue:
- [root@a3ee360fa35a certs]# mailq
- Mail queue is empty
- [root@a3ee360fa35a certs]#
- BEFORE...
- # Go to gmail:
- https://www.google.com/settings/security/lesssecureapps
- Acceso de aplicaciones menos seguras: Activar <--------- (ACTIVE)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement