Serviços de E-mail

Description

211.1
Luiz  Eduardo
Mind Map by Luiz Eduardo, updated more than 1 year ago
Luiz  Eduardo
Created by Luiz Eduardo almost 6 years ago
1
0

Resource summary

Serviços de E-mail
  1. Conceitos
    1. SMTP

      Annotations:

      • imple Mail Transfer Protocol
      1. Testes
        1. telnet - nc -ncat - netcat
          1. telnet <smtp-server> 25
            1. mail from: luiz.eduardo@mapa.com

              Annotations:

              • E-mail de:
              1. rcpt to: noexiste@mapa.com

                Annotations:

                • Destino da mensagem
                1. data

                  Annotations:

                  • Processa o conteúdo da mensagem
                  1. .

                    Annotations:

                    • Encerra conexão e envia o e-mail
      2. MTA

        Annotations:

        • MTA, sigla em inglês para agente de transferência de mensagens, é o servidor que recebe a mensagem enviada pelo cliente através do protocolo SMTP.
        1. MDA

          Annotations:

          • MDAs (Mail Delivery Agent)
          1. Portas
            1. SMTP = TCP 25
              1. SMTPS (SSL)= TCP 465
                1. SMTPLS (TLS)= 587
                2. MUA

                  Annotations:

                  • Mail user agent
                  1. servidor de correio que entra
                    1. POP - IMAP
                      1. Portas
                        1. POP3
                          1. 110/TCP
                            1. 995/TCP - SSL
                            2. IMAP4
                              1. 993/TCP - SSL
                                1. 143/TCP,UDP
                        2. Postfix

                          Annotations:

                          • Um dos principais MTAs do mercado O postfix funciona com um processo principal, chamado “master”, que invoca vários sub-processos.
                          1. Processo principal
                            1. master

                              Annotations:

                              • Principal
                              1. pickup
                                1. qmgr
                                  1. tlsmgr
                                2. Logs

                                  Annotations:

                                  • postfix uses the syslog daemon for its logging. 
                                  1. /var/log/mail*

                                    Annotations:

                                    • mail.err  mail.log
                                  2. Configuração
                                    1. /etc/postfix
                                      1. master.cf

                                        Annotations:

                                        • Configuração do processo master
                                        1. main.cf

                                          Annotations:

                                          • Configurações do serviço SMTP Principal arquivo de configuração do postfix
                                          1. Principais parâmetros
                                            1. myorigin

                                              Annotations:

                                              • Define o domínio/hostname que será indicado como origem dos e-mails, quando este não for informado.
                                              1. mynetworks

                                                Annotations:

                                                • IPs/Redes que podem utilizar o servidor para envio de e-mails a domínios externos. Essa permissão e envio de e-mails é também chamada de Relay.
                                                1. relay_domains

                                                  Annotations:

                                                  • Para quais domínios serão liberados o envio de e-mails, mesmo que o IP/Rede não esteja liberado para Relay.
                                                  1. inet_interfaces

                                                    Annotations:

                                                    • Interfaces em que o serviço SMTP estará disponível.
                                                    1. home_mailbox

                                                      Annotations:

                                                      • Define se o SMTP utilizar Mailbox ou Maildir para armazenamento local das mensagens.
                                                      1. mailbox_command

                                                        Annotations:

                                                        • Indica o software responsável pela entrega local das mensagens.
                                                        1. canonical_maps (sender_, canonical_)

                                                          Annotations:

                                                          • Utilizado para alterar o remetente, destinatário ou ambos.
                                                          1. smtpd_use_tls

                                                            Annotations:

                                                            • yes – Habilita o uso do TLS.
                                                            1. smtpd_tls_security_level

                                                              Annotations:

                                                              • (none/encrypt/may) – Define se o servidor irá ou não utilizar TLS. “may” disponibiliza como uma opção, “encrypt” como obrigatório
                                                            2. mydestination

                                                              Annotations:

                                                              • Lista de domínios que o servidor aceita para entrega local de e-mails
                                                              1. relayhost

                                                                Annotations:

                                                                • by default postfix tries to deliver directly to the internet depending on the domain name of the destination address in the mail message. We can specify another use SMTP server as relay
                                                              2. SMTP VRFY

                                                                Annotations:

                                                                • best pratice to use with postfix is disable smtp vrfy command on a publicy accessible mail server, this command can be used by an attacker to enumerate valid users accounts or email addresses.
                                                                1. disable_vrfy_command = yes
                                                                2. virtual_alias_domains

                                                                  Annotations:

                                                                  • generally a postfix server is the final destination for a limited number of domains.but can also be configured to handlle mail for additional domains wich are different from, for exemple, the domain wich the postfix server is located. virtual_alias_domain = exemple.com , snow.nl
                                                                  1. TLS
                                                                    1. smtpd_tls_cert_files=postfixcert.pem
                                                                      1. smtpd_tls_key_file=postfixkey.pem
                                                                        1. smtpd_use_tls=<yes|no>
                                                                  2. Filas internas
                                                                    1. /var/spool/postfix
                                                                    2. Filas de e-mail (Mailbox)
                                                                      1. /var/mail ou /var/spool/mail
                                                                      2. Comandos

                                                                        Annotations:

                                                                        • Ao utilizar o postfix o administrador tem disponível uma série de comandos específicos do postfix, além de alguns utilizados para compatibilidade com o sendmail.
                                                                        1. #qmail

                                                                          Annotations:

                                                                          • verificar a fila de e-mails do sistema. A mesma informação pode ser verificada pelos comandos “sendmail -bp” e “postqueue -p”
                                                                          1. #postfix

                                                                            Annotations:

                                                                            • Operações de gerenciamento do servidor postfix.
                                                                            1. check

                                                                              Annotations:

                                                                              • verifica a sintaxe do arquivo /etc/postfix/main.cf
                                                                              1. <start|stop|reload|flush>
                                                                              2. #postconf

                                                                                Annotations:

                                                                                • Visualização das configurações do postfix
                                                                                1. #postcat

                                                                                  Annotations:

                                                                                  • Visualização das mensagens dentro da fila do postfix (/var/spool/postfix)
                                                                                  1. #postqueue

                                                                                    Annotations:

                                                                                    • Visualização e manipulação das mensagens em fila
                                                                                    1. #mailq
                                                                                      1. #sendmail -bp
                                                                                        1. #postqueue -p
                                                                                    2. Reload daemon and confs
                                                                                      1. #postfix reload

                                                                                        Annotations:

                                                                                        • refresh configurations
                                                                                        1. #systemctl restart postfix

                                                                                          Annotations:

                                                                                          • reload postfix
                                                                                          1. #/etc/init.d/postfix <reload|restart>

                                                                                            Annotations:

                                                                                            • reload postfix
                                                                                        2. Alias
                                                                                          1. /etc/aliases

                                                                                            Annotations:

                                                                                            • O arquivo /etc/aliases pode ser utilizado para relacionar e-mails e usuários. Por exemplo: suporte: luiz.eduardo admin: luiz.eduardo 
                                                                                            1. # newaliases

                                                                                              Annotations:

                                                                                              • Após realizar essa configuração, o comando newaliases deve ser utilizado.
                                                                                          2. Sendmail
                                                                                            1. Configuração

                                                                                              Annotations:

                                                                                              • The sendmail configuration files are processed by m4 facilitate local customization;
                                                                                              1. /etc/mail
                                                                                                1. /etc/mail/sendmail.cf

                                                                                                  Annotations:

                                                                                                  • Arquivo de configuração principal utilizado pelo servidor
                                                                                                  1. # sendmailconfig

                                                                                                    Annotations:

                                                                                                    • Adter changes this file. Running command for update file.
                                                                                                    1. /usr/share/sendmail/update
                                                                                                    2. /etc/mail/*.mc

                                                                                                      Annotations:

                                                                                                      • Arquivos de configuração macro. Usados como origem ao sendmail.cf.
                                                                                                    3. /etc/mail/access

                                                                                                      Annotations:

                                                                                                      • the sendmail access database file can be created to acept or reject mail from selected domains, system and users.
                                                                                                      1. #makemap hash /etc/mail/access.db < /etc/mail/access
                                                                                                        1. actions
                                                                                                          1. OK

                                                                                                            Annotations:

                                                                                                            • accept e-mail even if other rules in the running ruleset would reject it
                                                                                                            1. RELAY

                                                                                                              Annotations:

                                                                                                              • accept mail addressed to the indicated domain or received from the indicated domain for relaying through your smtp server. relay also serves as an implicit OK for the other checks
                                                                                                              1. REJECT

                                                                                                                Annotations:

                                                                                                                • reject sender or recipient with a general purpose message
                                                                                                                1. DISCARD

                                                                                                                  Annotations:

                                                                                                                  • discard the message completely using the $#discard mailer.
                                                                                                                  1. SKIP

                                                                                                                    Annotations:

                                                                                                                    • this can only for host/domain names and IP address/nets. Ir will abort the current search fot this entry without accepting or rejecting it but causing the default action
                                                                                                                  2. WHITELIST

                                                                                                                    Annotations:

                                                                                                                    • FRIEND
                                                                                                                    1. BLACK LIST

                                                                                                                      Annotations:

                                                                                                                      • REJECT
                                                                                                                  3. /etc/mail/local-host-names

                                                                                                                    Annotations:

                                                                                                                    • load local host names can be defined in the local-host-names files. add each domain that should be considered local into mail/local-host-names
                                                                                                                    1. /etc/mail/virtustable

                                                                                                                      Annotations:

                                                                                                                      • used to map incoming email to a local account. with virtustable, messages sent to one account can be distribuited to two users;
                                                                                                                      1. Generate virtustable
                                                                                                                        1. #make hash /etc/mail/virtutable< sourcefile
                                                                                                                      2. /etc/mail/genericsdomain

                                                                                                                        Annotations:

                                                                                                                        • used for outbound mail.can be used to rewrite local usernames so they appear to have originated from a different host or domain
                                                                                                                        1. /etc/mailertable

                                                                                                                          Annotations:

                                                                                                                          • used to route email from remote systems
                                                                                                                          1. /etc/mail/domaintable

                                                                                                                            Annotations:

                                                                                                                            • can be used to transition from an old domain name to a new one
                                                                                                                            1. /etc/mail/aliases

                                                                                                                              Annotations:

                                                                                                                              • used to mail for local recepients. each line of /etc/aliases has the format of alias: user. two systems alias must be present: mailer_daemon: postmaster and postmaster: root. you can use aliases for all kind of daemons , for exemplo use ntp: root.
                                                                                                                              1. # newaliases
                                                                                                                              2. Update configurations files, sendmail reload it's configuration
                                                                                                                                1. #killall -HUP sendmail
                                                                                                                              3. Sendmail test option
                                                                                                                                1. #sendmail -bt
                                                                                                                                2. Sendmail and DNS
                                                                                                                                  1. #dig MX seudominio.com
                                                                                                                                  2. /etc/init.d/sendmail restart
                                                                                                                                    1. systemctl <start|stop|restart> sendmail
                                                                                                                                    2. Exim

                                                                                                                                      Annotations:

                                                                                                                                      • Is a MTA developed at the university of cambridge for use on unix systems. Exim can be installed instead(em vez) of sendmail. The configurations exim is different
                                                                                                                                      1. Configuração
                                                                                                                                        1. /etc/exim/exim.conf ou /etc/exim4/exim4.conf

                                                                                                                                      Media attachments

                                                                                                                                      Show full summary Hide full summary

                                                                                                                                      Similar

                                                                                                                                      Geography Quiz
                                                                                                                                      PatrickNoonan
                                                                                                                                      Rounding to decimal places
                                                                                                                                      Ellen Billingham
                                                                                                                                      Biological Molecules Definitions
                                                                                                                                      siobhan.quirk
                                                                                                                                      Organic Chemistry
                                                                                                                                      Ella Wolf
                                                                                                                                      Plate Tectonics
                                                                                                                                      eimearkelly3
                                                                                                                                      Cell Structure
                                                                                                                                      daniel.praecox
                                                                                                                                      enzymes and the organ system
                                                                                                                                      Nour
                                                                                                                                      A Level: English language and literature techniques = Structure
                                                                                                                                      Jessica 'JessieB
                                                                                                                                      Repaso prueba Revalida Enfermeria 2016 Parte:2
                                                                                                                                      Rodrigo Lopez
                                                                                                                                      1PR101 2.test - Část 2.
                                                                                                                                      Nikola Truong
                                                                                                                                      Unit 1.1 Systems Architecture
                                                                                                                                      Mathew Wheatley