Bienvenido! Aquí usted puede subir sus pastes (códigos) para posteriormente compartirlos, inclusive puede protegerlos con password. Siéntase libre de explorar :)

Subido por parian el March Thu 24th 8:31 PM - Nunca expira
Descargar | Nuevo Paste

  1. apt-get install postfix postfix-pcre
  2.         sin configuracion
  3.  
  4. dpkg-reconfigure postfix
  5.         Internet Site
  6.         domain.tld
  7.         -------
  8.         domain.tld, server.domain.tld, localhost.domain.tld, localhost
  9.         No
  10.         127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
  11.         0
  12.         +
  13.         all
  14.  
  15. mkdir -p /var/spool/mail/domain.tld
  16.  
  17. groupadd -g 5000 virtual
  18.  
  19. useradd -g virtual -u 5000 virtual
  20.  
  21. chown -R virtual:virtual /var/spool/mail
  22.  
  23. nano /etc/postfix/main.cf
  24.         smtpd_banner = correo de domain.tld
  25.         biff = no
  26.         append_dot_mydomain = no
  27.        
  28.         queue_directory = /var/spool/postfix
  29.  
  30.         smtp_tls_security_level = may
  31.         smtp_tls_note_starttls_offer = yes
  32.         smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
  33.         smtpd_tls_security_level = may
  34.         smtpd_tls_loglevel = 1
  35.         smtpd_tls_received_header = yes
  36.         smtpd_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
  37.         smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
  38.         smtpd_use_tls=yes
  39.         smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
  40.  
  41.         myhostname = server.domain.tld
  42.         alias_maps =
  43.         myorigin = domain.tld
  44.         mydestination = localhost
  45.        
  46.         virtual_mailbox_domains = domain.tld
  47.         virtual_mailbox_base = /var/spool/mail/
  48.         virtual_alias_maps = hash:/etc/postfix/virtual
  49.         virtual_mailbox_maps = hash:/etc/postfix/vmailbox
  50.         virtual_minimum_uid = 100
  51.         virtual_uid_maps = static:5000
  52.         virtual_gid_maps = static:5000
  53.        
  54.         relayhost =
  55.         mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
  56.         mailbox_size_limit = 0
  57.         recipient_delimiter = +
  58.         inet_interfaces = all
  59.         inet_protocols = all
  60.         home_mailbox = Maildir/
  61.  
  62.         smtpd_sasl_auth_enable = yes
  63.         smtpd_sasl_type = dovecot
  64.         smtpd_sasl_path = private/auth
  65.         smtpd_sasl_security_options = noanonymous
  66.         broken_sasl_auth_clients = yes
  67.  
  68.         mime_header_checks = pcre:/etc/postfix/mail_adjunto
  69.         smtpd_recipient_limit = 1
  70.         message_size_limit = 3145723
  71.         disable_vrfy_command = yes
  72.         smtpd_error_sleep_time = 1s
  73.         smtpd_soft_error_limit = 10
  74.         smtpd_hard_error_limit = 20
  75.         smtpd_delay_reject = yes
  76.         smtpd_helo_required = yes
  77.         smtpd_helo_restrictions =
  78.                 permit_sasl_authenticated,
  79.                 permit_mynetworks,
  80.                 reject_invalid_hostname,
  81.                 reject_non_fqdn_hostname,
  82.         smtpd_data_restrictions =
  83.                 reject_unauth_pipelining
  84.         smtpd_sender_restrictions =
  85.                 reject_non_fqdn_sender,
  86.                 reject_unknown_sender_domain,
  87.                 check_recipient_access hash:/etc/postfix/mail_international,
  88.                 check_sender_access hash:/etc/postfix/mail_international,
  89.                 check_recipient_access regexp:/etc/postfix/mail_national,
  90.                 check_sender_access regexp:/etc/postfix/mail_national
  91.         smtpd_recipient_restrictions =
  92.                 permit_sasl_authenticated,
  93.                 permit_mynetworks,
  94.                 check_helo_access hash:/etc/postfix/helo.list,
  95.                 check_sender_access hash:/etc/postfix/ext_sender,
  96.                 reject_unauth_pipelining,
  97.                 reject_unauth_destination,
  98.                 reject_unknown_hostname,
  99.                 reject_unknown_sender_domain,
  100.                 reject_unknown_recipient_domain,
  101.                 reject_non_fqdn_hostname,
  102.                 reject_non_fqdn_sender,
  103.                 reject_non_fqdn_recipient,
  104.                 reject_invalid_hostname
  105.         smtpd_relay_restrictions =
  106.                 permit_sasl_authenticated,
  107.                 permit_mynetworks,
  108.                 defer_unauth_destination
  109.  
  110. nano /etc/postfix/master.cf (uncommend)
  111.         submission inet n       -       -       -       -       smtpd
  112.           -o syslog_name=postfix/submission
  113.           -o smtpd_tls_security_level=encrypt
  114.           -o smtpd_sasl_auth_enable=yes
  115.           -o smtpd_relay_restrictions=permit_sasl_authenticated,reject
  116.           -o milter_macro_daemon_name=ORIGINATING
  117.         smtps     inet  n       -       n       -       -       smtpd (modified)
  118.           -o syslog_name=postfix/smtps
  119.           -o smtpd_tls_wrappermode=yes
  120.           -o smtpd_sasl_auth_enable=yes
  121.           -o smtpd_relay_restrictions=permit_sasl_authenticated,reject
  122.           -o milter_macro_daemon_name=ORIGINATING
  123.  
  124. nano /etc/postfix/vmailbox
  125.         [email protected] domain.tld/user/
  126. postmap /etc/postfix/vmailbox
  127.  
  128. nano /etc/postfix/virtual
  129.         [email protected]   [email protected]
  130. postmap /etc/postfix/virtual
  131.  
  132. nano /etc/postfix/mail_adjunto
  133.         /filename=.*\.(rar|tar.gz|zip)/ OK
  134.         /filename=.*\.(pdf)/ OK
  135.         /filename=.*\.*/ REJECT Solo se aceptan archivos adjuntos en formato pdf o compactados con extencion rar, zip, tar.gz
  136.  
  137. nano /etc/postfix/mail_national
  138.         /\@*\.cu/       RELAY
  139.         /\@*/           REJECT  "554 (Usted no esta autorizado a enviar correo Internacional)"
  140.  
  141. postmap /etc/postfix/mail_national
  142.  
  143. nano /etc/postfix/mail_international
  144.         [email protected] ok
  145.  
  146. postmap /etc/postfix/mail_international
  147.  
  148. nano /etc/postfix/ext_sender
  149.         domain.tld      550 Do not use this domain in your envelope sender
  150. postmap /etc/postfix/ext_sender
  151.  
  152. nano /etc/postfix/helo.list
  153.         domain.tld      550 Do not use my hostname
  154. postmap /etc/postfix/helo.list
  155.  
  156. mkdir /var/spool/mail/domain.tld/user
  157.  
  158. chown virtual:virtual /var/spool/mail/domain.tld/user/
  159.  
  160. apt-get install dovecot-imapd dovecot-pop3d
  161. nano /etc/dovecot/conf.d/10-master.conf (modified line 95)
  162.         # Postfix smtp-auth
  163.         unix_listener /var/spool/postfix/private/auth {
  164.                 mode = 0660
  165.                 user = postfix
  166.                 group = postfix
  167.         }
  168.  
  169. nano /etc/dovecot/conf.d/10-auth.conf
  170.         disable_plaintext_auth = yes (uncomment and modified line 10)
  171.         auth_mechanisms = plain login digest-md5 (modified line 100)
  172.         #!include auth-system.conf.ext
  173.         !include auth-passwdfile.conf.ext
  174.  
  175. nano /etc/dovecot/conf.d/auth-passwdfile.conf.ext
  176.         passdb {
  177.                 driver = passwd-file
  178.                 args = scheme=PLAIN username_format=%u /etc/dovecot/users
  179.         }
  180.         userdb {
  181.                 driver = passwd-file
  182.                 args = username_format=%u /etc/dovecot/users
  183.         }
  184.  
  185. nano /etc/dovecot/conf.d/10-mail.conf (modified line 30)
  186.         mail_location = maildir:/var/spool/mail/%d/%n/
  187.         mail_uid = 5000
  188.         mail_gid = 5000
  189.         mail_privileged_group = virtual
  190.         valid_chroot_dirs = /var/spool/mail/
  191.  
  192. nano /etc/dovecot/conf.d/20-pop3.conf (uncomment)
  193.         pop3_uidl_format = %08Xu%08Xv
  194.  
  195. nano /etc/dovecot/conf.d/10-ssl.conf (uncomment)
  196.         ssl = yes
  197.  
  198. nano /etc/dovecot/users
  199.         [email protected]:{PLAIN}user:5000:5000::/var/spool/mail/domain.tld/:/bin/false::
Lenguaje:
Para seńalar algunas líneas en particular, al inicio de cada línea pon: @@





© 2017 - Powered by PASTE 1.0. Traducido al ESP y modificado por DesdeLinux.net