{"id":1182,"date":"2019-09-06T10:09:47","date_gmt":"2019-09-06T16:09:47","guid":{"rendered":"https:\/\/ugit.siua.ac.cr\/?p=1182"},"modified":"2021-02-01T14:13:01","modified_gmt":"2021-02-01T20:13:01","slug":"proxmox-6-configuracion-de-postfix-gmail","status":"publish","type":"post","link":"https:\/\/sada.services\/?p=1182","title":{"rendered":"PROXMOX 6: Configuraci\u00f3n de postfix &#8211; gmail"},"content":{"rendered":"\n<ul class=\"wp-block-list\"><li>Instalamos<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>apt-get install openssl ssl-cert postfix mailutils openssl ssl-cert mailutils libsasl2-2 ca-certificates libsasl2-modules -y<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\"><li>Modificamos el siguiente archivo:<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>nano \/etc\/postfix\/main.cf<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\"><li>Lo editamos como sigue, primero eliminamos o comentamos la linea <strong>\u00abrelayhost =\u00bb<\/strong><\/li><\/ul>\n\n\n\n<figure class=\"wp-block-image\"><img fetchpriority=\"high\" decoding=\"async\" width=\"725\" height=\"415\" src=\"\/wp-content\/uploads\/2019\/09\/Selecci\u00f3n_033.png\" alt=\"\" class=\"wp-image-1183\" srcset=\"https:\/\/sada.services\/wp-content\/uploads\/2019\/09\/Selecci\u00f3n_033.png 725w, https:\/\/sada.services\/wp-content\/uploads\/2019\/09\/Selecci\u00f3n_033-300x172.png 300w\" sizes=\"(max-width: 725px) 100vw, 725px\" \/><\/figure>\n\n\n\n<ul class=\"wp-block-list\"><li>Luego agregamos lo siguiente al final del archivo<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code># SMTP relayhost\nrelayhost = &#91;smtp.gmail.com]:587\n## TLS Settings\nsmtp_tls_loglevel = 1\nsmtp_tls_CAfile = \/etc\/postfix\/certs\/CAcert.pem\nsmtp_tls_cert_file = \/etc\/postfix\/certs\/mycert.pem\nsmtp_tls_key_file = \/etc\/postfix\/certs\/mykey.pem\nsmtp_use_tls = yes\nsmtpd_tls_CAfile = \/etc\/postfix\/certs\/CAcert.pem\nsmtpd_tls_cert_file = \/etc\/postfix\/certs\/mycert.pem\nsmtpd_tls_key_file = \/etc\/postfix\/certs\/mykey.pem\nsmtpd_tls_received_header = yes\nsmtpd_use_tls = yes\n# configuracao tls\nsmtp_use_tls = yes\nsmtp_sasl_auth_enable = yes\nsmtp_sasl_password_maps = hash:\/etc\/postfix\/sasl_passwd\nsmtp_sasl_security_options = noanonymous\nsmtp_sasl_tls_security_options = noanonymous\n# alias de mapeamento interno para externo\nsmtp_generic_maps = hash:\/etc\/postfix\/generic<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\"><li>El archivo debe quedar como sigue<\/li><\/ul>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" width=\"700\" height=\"787\" src=\"\/wp-content\/uploads\/2019\/09\/Selecci\u00f3n_034.png\" alt=\"\" class=\"wp-image-1184\" srcset=\"https:\/\/sada.services\/wp-content\/uploads\/2019\/09\/Selecci\u00f3n_034.png 700w, https:\/\/sada.services\/wp-content\/uploads\/2019\/09\/Selecci\u00f3n_034-267x300.png 267w\" sizes=\"(max-width: 700px) 100vw, 700px\" \/><\/figure>\n\n\n\n<ul class=\"wp-block-list\"><li>Creamos un archivo<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>nano \/etc\/postfix\/sasl_passwd<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\"><li>Agregamos lo siguiente<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>&#91;smtp.gmail.com]:587    interuniversitariadealajuela@gmail.com:AC2<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\"><li>Creamos otro archivo<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>nano \/etc\/postfix\/generic<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\"><li>Agregamos lo siguiente<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>root@localhost.localdomain\tinteruniversitariadealajuela@gmail.com<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\"><li>Otorgar permisos y generar archivos .db<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>chmod 600 \/etc\/postfix\/sasl_passwd <br>chmod 600 \/etc\/postfix\/generic <br>postmap \/etc\/postfix\/sasl_passwd <br>postmap \/etc\/postfix\/generic<br><br>#Debian 10<br><code>\/usr\/sbin\/postmap \/etc\/postfix\/sasl_passwd<\/code><br>\/usr\/sbin\/postmap \/etc\/postfix\/generic<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\"><li>Creamos los certificados en <strong>\/etc\/postfix\/certs\/<\/strong><\/li><\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>mkdir \/etc\/postfix\/certs\/\ncd \/etc\/postfix\/certs\/\nopenssl dsaparam -out dsaparam.pem 2048\nopenssl req -x509 -nodes -days 3650 -newkey dsa:dsaparam.pem -out mycert.pem -keyout mykey.pem<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\"><li>RESULTADO:<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>CGenerating a 2048 bit DSA private key\nwriting new private key to 'mykey.pem'\n-----\nYou are about to be asked to enter information that will be incorporated\ninto your certificate request.\nWhat you are about to enter is what is called a Distinguished Name or a DN.\nThere are quite a few fields but you can leave some blank\nFor some fields there will be a default value,\nIf you enter '.', the field will be left blank.\n-----\nCountry Name (2 letter code) &#91;AU]:CR\nState or Province Name (full name) &#91;Some-State]:Alajuela\nLocality Name (eg, city) &#91;]:Alajuela\nOrganization Name (eg, company) &#91;Internet Widgits Pty Ltd]:SIUA\nOrganizational Unit Name (eg, section) &#91;]:UGIT\nCommon Name (e.g. server FQDN or YOUR name) &#91;]:UGIT\nEmail Address &#91;]:interuniversitariadealajuela@gmail.com<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\"><li>Continuamos<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>ln -s mycert.pem CAcert.pem\nopenssl req -x509 -new -days 3650 -key \/etc\/postfix\/certs\/mykey.pem -out \/etc\/postfix\/certs\/mycert.pem<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\"><li>RESULTADO:<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>You are about to be asked to enter information that will be incorporated\ninto your certificate request.\nWhat you are about to enter is what is called a Distinguished Name or a DN.\nThere are quite a few fields but you can leave some blank\nFor some fields there will be a default value,\nIf you enter '.', the field will be left blank.\n-----\nCountry Name (2 letter code) &#91;AU]:CR\nState or Province Name (full name) &#91;Some-State]:Alajuela\nLocality Name (eg, city) &#91;]:Alajuela\nOrganization Name (eg, company) &#91;Internet Widgits Pty Ltd]:SIUA\nOrganizational Unit Name (eg, section) &#91;]:UGIT\nCommon Name (e.g. server FQDN or YOUR name) &#91;]:UGIT\nEmail Address &#91;]:interuniversitariadealajuela@gmail.com<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\"><li>Eliminamos el certificado:<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>rm dsaparam.pem<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\"><li>Reiniciamos el postfix<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>\/etc\/init.d\/postfix reload<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\"><li>Comprobar el envi\u00f3<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>echo \"esta es la prueba de envio de correo\" | mail -s \"este es mi asunto\" gustavo.matamoros@gmail.com<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>PROXMOX 6: Configuraci\u00f3n de postfix &#8211; gmail<\/p>\n","protected":false},"author":1,"featured_media":2001,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[69,68,67,12],"class_list":["post-1182","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-proxmox","tag-correo","tag-gmail","tag-postfix","tag-proxmox"],"blocksy_meta":{"styles_descriptor":{"styles":{"desktop":"","tablet":"","mobile":""},"google_fonts":[],"version":6}},"_links":{"self":[{"href":"https:\/\/sada.services\/index.php?rest_route=\/wp\/v2\/posts\/1182","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sada.services\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sada.services\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sada.services\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/sada.services\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1182"}],"version-history":[{"count":4,"href":"https:\/\/sada.services\/index.php?rest_route=\/wp\/v2\/posts\/1182\/revisions"}],"predecessor-version":[{"id":4437,"href":"https:\/\/sada.services\/index.php?rest_route=\/wp\/v2\/posts\/1182\/revisions\/4437"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/sada.services\/index.php?rest_route=\/wp\/v2\/media\/2001"}],"wp:attachment":[{"href":"https:\/\/sada.services\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1182"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sada.services\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1182"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sada.services\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1182"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}