+ Responder ao Tópico



  1. #1

    Unhappy Host not found - Problemas ao receber e-mails de um determinado domínio

    Olá a todos.

    Venho através destas mal traçadas linhas expor mais uma dúvida que consome minhas horas de sono e beleza!

    Tenho um servidor postfix, o qual eu configurei, e este está recebendo e-mails do gmail, yahoo, hotmail, etc...
    Dei uma pesquisada na net mas nada tao específico quanto ao meu caso.

    Contudo um usuário não consegue receber e-mails de um determinado dominio:
    Mar 13 15:03:26 labbi postfix/smtpd[8178]: connect from mtomsw5.effem.com[193.38.170.133]
    Mar 13 15:03:27 labbi postfix/smtpd[8178]: NOQUEUE: reject: RCPT from mtomsw5.effem.com[193.38.170.133]: 450 4.7.1 <mtomsw5.mto.na.mars>: Helo command rejected: Host not found; from=<[email protected]> to=<[email protected]> proto=ESMTP helo=<mtomsw5.mto.na.mars>
    Dá o erro "Host not found". Só que eu não sei se erro provem do meu servidor ou do cara que está tentando enviar o e-mail.

    Abaixo a o meu main.cf:

    # See /usr/share/postfix/main.cf.dist for a commented, more complete version


    # Debian specific: Specifying a file name will cause the first
    # line of that file to be used as the name. The Debian default
    # is /etc/mailname.
    #myorigin = /etc/mailname

    smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)
    biff = no

    # appending .domain is the MUA's job.
    append_dot_mydomain = no

    # Uncomment the next line to generate "delayed mail" warnings
    #delay_warning_time = 4h

    # See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for
    # information on enabling SSL in the smtp client.

    myhostname = doido.coringa.br
    alias_maps = hash:/etc/aliases
    alias_database = hash:/etc/aliases
    myorigin = /etc/mailname
    mydestination = $myorigin, localhost.$myorigin, , localhost
    relayhost =
    mynetworks = 127.0.0.0/8
    mailbox_command = procmail -a "$EXTENSION"
    mailbox_size_limit = 0
    recipient_delimiter = +
    inet_interfaces = all

    ##Anti-SPAM##
    #disable_vrfy_command = yes
    #strict_rfc821_envelopes = yes
    #smtpd_hard_error_limit = 1 #acusa erro no relay test
    #bounce_queue_lifetime = 2d
    #maximal_queue_lifetime = 2d
    #smtpd_helo_required = yes

    ##SASL##
    smtpd_sasl_auth_enable = yes
    broken_sasl_auth_clients = yes
    smtpd_sasl_security_options = noanonymous


    ##TLS##
    smtpd_tls_auth_only = no
    smtpd_use_tls = yes
    smtp_tls_note_starttls_offer = yes
    smtpd_tls_key_file = /etc/postfix/ssl/smtpd.key
    smtpd_tls_cert_file = /etc/postfix/ssl/smtpd.crt
    smtpd_tls_CAfile = /etc/postfix/ssl/cacert.pem
    smtpd_tls_loglevel = 1
    smtpd_tls_received_header = yes
    smtpd_tls_session_cache_timeout = 3600s
    tls_random_source = dev:/dev/urandom
    #smtp_use_tls = yes

    ##AMAVIS##
    content_filter=smtp-amavis:[127.0.0.1]:10024

    smtpd_client_restrictions = permit_mynetworks,
    permit_sasl_authenticated,
    reject_unknown_client_hostname


    smtpd_helo_restrictions= permit_mynetworks,
    permit_sasl_authenticated,
    reject_invalid_helo_hostname,
    reject_non_fqdn_helo_hostname,
    reject_unknown_helo_hostname

    smtpd_sender_restrictions = permit_sasl_authenticated,
    reject_non_fqdn_sender,
    reject_unknown_sender_domain,
    reject_unlisted_sender,
    reject_authenticated_sender_login_mismatch,


    smtpd_recipient_restrictions = permit_mynetworks,
    permit_sasl_authenticated,
    reject_unauth_destination,
    reject_non_fqdn_recipient,
    reject_unknown_recipient_domain,
    check_policy_service inet:127.0.0.1:60000
    Eu comentei as diretivas na secão ##Anti-SPAM##, achando que estas diretivas estivessem dificultando demais o recebimento dos e-mails (se bem que a funćão dela. ) Contudo nada mudou...

    Vale ressaltar que eu uso o postgrey, spamassassin e amavis.

    Ab, Duca.
    Última edição por Duca; 17-03-2008 às 18:07.

  2. #2

    Padrão

    Se bem que isso parace mais um probelma de DNS.. sei lá...

  3. #3

    Padrão

    Vamos lá duca.... é simples esse negocio:

    smtpd_helo_restrictions= permit_mynetworks,
    permit_sasl_authenticated,
    reject_invalid_helo_hostname,
    reject_non_fqdn_helo_hostname,
    reject_unknown_helo_hostname

    preste atenção aqui... rejeitando esses "HELO's" voce tem uma protecao maior por ele nao aceitar os hostnames que nao existem (ou seja, os que o DNS nao resolve).

    Então vamos lá... uma simples consulta no DNS e uma extracao da sua linha:

    L:\>nslookup
    > mtomsw5.effem.com

    Não é resposta de autorização:
    Nome = mtomsw5.effem.com
    Address: 193.38.170.133

    > 193.38.170.133

    Nome = mtomsw5.effem.com
    Address: 193.38.170.133

    > mtomsw5.mto.na.mars

    *** não é possível encontrar mtomsw5.mto.na.mars: Non-ex
    istent domain
    >

    Ok galho fraco, moleza hein? o servidor que ele esta enviando a requisição esta ok (parte de DNS), entretanto ele se apresenta errado no ehlo. como pode ser visto em parte da sua citacao:
    helo=<mtomsw5.mto.na.mars>

    neste caso, podemos ver acima que ele nao resolve esse hostname, dai o problema., devido a suas restricoes no postfix ele nao recebe a mensagem mesmo... o meu server também e assim, e eu nao pretendo muda-lo... que esses "profissionais de curso de esquina" que aprendam a configurar um mail server direito.

    E ah, nao acredito que seja problema no seu DNS pois ele resolveu o outro dominio corretamente.

  4. #4

    Padrão

    Excelente explicação do nosso amigo acima, esta coberto de razão, agora fica ao seu criterio tirar a regra referente a essa verificação o que eu não acho aconselhavel.

    Abração

  5. #5

    Arrow

    Obrigado mistymst pela explicacão.
    Contudo, hoje eu dei uma pesquisada melhor sobre o comando HELO e cheguei nessa discussão:

    [MASOCH-L] Duvidas sobre comando HELO

    "On Fri, 15 Jul 2005, Marcelo Coelho wrote:

    > Bloquear o HELO é uma péssima idéia, porque muita gente não respeita a RFC.
    > O hostname pode não bater com o IP do servidor. Em alguns casos, o hostname
    > nem existe. Fora os HELOs "servidor" ou "localhost.localdomain" que você vai
    > receber e rejeitar de servidores "legítimos".

    concordo. além disso na RFC2821 fala: "The argument field contains the
    fully-qualified domain name of the SMTP client if one is available. In
    situations in which the SMTP client system does not have a meaningful
    domain name (e.g., when its address is dynamically allocated and no
    reverse mapping record is available), the client SHOULD send an address
    literal (see section 4.1.3), optionally followed by information that will
    help to identify the client system." Na semântica da 2821,
    3. SHOULD This word, or the adjective "RECOMMENDED", mean that
    there may exist valid reasons in particular circumstances to
    ignore a particular item, but the full implications must be
    understood and carefully weighed before choosing a different
    course.

    isto é, é um comportamento recomendado, mas não obrigatório. portanto, a
    gente pode esperar qualquer besteira depois de um EHLO/HELO."
    Como discutido acima, bloquear através do HELO tem seus pós e contras, é ótimo pois você barra e-mails inválidos, como SPAMs e, servidores mal configurados, contudo estaremos barrando também e-mails legítimos.

    No meu caso, tem um usuários legítimos tentando enviar e-mails para meu servidor e me vejo nesse problema de retirar as restrições via HELO ou não. Bom, eu não gostaria de tirá-la, mas no meu caso rola um pouco de política também (o chefe acha um absurdo ele não poder receber o benditos e-mails, pois é uma vergonha o cara ter que enviar os e-mails para uma outra conta pessoal, tipo é e-mail de trabalho, entende? ). Bom, vou ver se libero somente o acesso para esse cara sem retirar as restrições HELO.
    Contudo expliquei a situação para o chefe.

    Tô vendo que com o tempo isso vai me dar mais dor de cabeça.

    Ab, Duca.
    Última edição por Duca; 14-03-2008 às 12:14.

  6. #6

    Padrão

    Concordo, com o que voce disse.. e afinal, se o cara nao implementou de acordo o problema é DELE, e por causa desse tipo de pessoas que a Internet ainda é muito frágil.

    Quanto a isso voce pode sim criar uma whitelist, mais ou menos assim:

    smtpd_sender_restrictions =
    check_sender_access hash:/etc/postfix/sender_checks,
    reject_non_fqdn_sender,
    reject_unknown_sender_domain,
    permit

    no meu caso isso se aplicar para os senders, no seu caso voce teria de fazer esta whitelist no:

    smtpd_helo_restrictions =
    permit_mynetworks,
    reject_invalid_hostname,
    reject_non_fqdn_hostname,
    reject_unknown_hostname,
    permit

    mas nao me lembro exatamente qual seria a entrada do postfix... de uma olhada na documentacao e ve o que tu consegues... se nao conseguir me avisa ou beepa no gtalk que eu procuro

  7. #7

    Padrão

    Estou vendo como se faz isso estou comendo a documentação do postfix e sites correlatos.
    Cheguei até esse site: Blocking spammers with Postfix HELO controls

    Contudo em vez de colocar REJECT eu coloquei ALLOW e nada , hehe.

    Talvez não seja no helo_restriction como estou pensando se bem estou vendo ainda como resolver. Se alguem souber agradeço qualquer ajuda imediata, sim estou com pressa, hoje é sexta [:P]!!! uhsuahsuahsuas
    To brincando, to pesquisando.

    # cat /etc/postfix/checks/helo_access
    mtomsw5.mto.na.mars ALLOW
    isxmsw2.mtodom01.corp.mars ALLOW

    # postmap checks/helo_access
    ae depois no main.cf:

    smtpd_helo_restrictions= permit_mynetworks,
    permit_sasl_authenticated,
    check_helo_access hash:/etc/postfix/helo_access,
    reject_invalid_helo_hostname,
    reject_non_fqdn_helo_hostname,
    reject_unknown_helo_hostname
    O cara enviou o e-mail e o comando Helo apresentou o mesmo erro.

    Ab, DUca.

  8. #8

    Padrão

    Bom funciona assim:

    mikael:/var/log# cat /etc/postfix/sender_checks
    host.pappapak2.com 550 Spam not allowed.
    educine.org.br 550 Bloqueado pelo administrador sob ordem do secretario.
    earth.dotsi.pt 550 Servidor sendo abusado por spammers.
    [email protected] DISCARD


    Ou voce coloca o "ERRO" especifica e voiola.. funciona que eh uma beleza... DISCARD discarta sem mensagens... e parece que OK aceita... deixa eu procurar aki.

  9. #9

    Padrão

    Aqui o:

    Postfix Configuration - UCE Controls

    dai ele te remete para:

    Postfix manual - access(5)

    ACCEPT ACTIONS
    OK Accept the address etc. that matches the pattern.

    all-numerical
    An all-numerical result is treated as OK. This for-
    mat is generated by address-based relay authoriza-
    tion schemes such as pop-before-smtp.

    REJECT ACTIONS
    Postfix version 2.3 and later support enhanced status
    codes as defined in RFC 3463. When no code is specified
    at the beginning of the text below, Postfix inserts a
    default enhanced status code of "5.7.1" in the case of
    reject actions, and "4.7.1" in the case of defer actions.
    See "ENHANCED STATUS CODES" below.

    4NN text

    5NN text
    Reject the address etc. that matches the pattern,
    and respond with the numerical three-digit code and
    text. 4NN means "try again later", while 5NN means
    "do not try again".

    The reply code "421" causes Postfix to disconnect
    immediately (Postfix version 2.3 and later).

    REJECT optional text...
    Reject the address etc. that matches the pattern.
    Reply with $reject_code optional text... when the
    optional text is specified, otherwise reply with a
    generic error response message.

    DEFER_IF_REJECT optional text...
    Defer the request if some later restriction would
    result in a REJECT action. Reply with "450 4.7.1
    optional text... when the optional text is speci-
    fied, otherwise reply with a generic error response
    message.

    This feature is available in Postfix 2.1 and later.

    DEFER_IF_PERMIT optional text...
    Defer the request if some later restriction would
    result in a an explicit or implicit PERMIT action.
    Reply with "450 4.7.1 optional text... when the
    optional text is specified, otherwise reply with a
    generic error response message.

    This feature is available in Postfix 2.1 and later.

    OTHER ACTIONS
    restriction...
    Apply the named UCE restriction(s) (permit, reject,
    reject_unauth_destination, and so on).

    BCC user@domain
    Send one copy of the message to the specified
    recipient.

    If multiple BCC actions are specified within the
    same SMTP MAIL transaction, only the last action
    will be used.

    This feature is not part of the stable Postfix
    release.

    DISCARD optional text...
    Claim successful delivery and silently discard the
    message. Log the optional text if specified, oth-
    erwise log a generic message.

    Note: this action currently affects all recipients
    of the message. To discard only one recipient
    without discarding the entire message, use the
    transport(5) table to direct mail to the discard(8)
    service.

    This feature is available in Postfix 2.0 and later.

    DUNNO Pretend that the lookup key was not found. This
    prevents Postfix from trying substrings of the
    lookup key (such as a subdomain name, or a network
    address subnetwork).

    This feature is available in Postfix 2.0 and later.

    FILTER transport:destination
    After the message is queued, send the entire mes-
    sage through the specified external content filter.
    The transport:destination syntax is described in
    the transport(5) manual page. More information
    about external content filters is in the Postfix
    FILTER_README file.

    Note: this action overrides the content_filter set-
    ting, and currently affects all recipients of the
    message.

    This feature is available in Postfix 2.0 and later.

    HOLD optional text...
    Place the message on the hold queue, where it will
    sit until someone either deletes it or releases it
    for delivery. Log the optional text if specified,
    otherwise log a generic message.

    Mail that is placed on hold can be examined with
    the postcat(1) command, and can be destroyed or
    released with the postsuper(1) command.

    Note: use "postsuper -r" to release mail that was
    kept on hold for a significant fraction of $maxi-
    mal_queue_lifetime or $bounce_queue_lifetime, or
    longer. Use "postsuper -H" only for mail that will
    not expire within a few delivery attempts.

    Note: this action currently affects all recipients
    of the message.

    This feature is available in Postfix 2.0 and later.

    PREPEND headername: headervalue
    Prepend the specified message header to the mes-
    sage. When more than one PREPEND action executes,
    the first prepended header appears before the sec-
    ond etc. prepended header.

    Note: this action must execute before the message
    content is received; it cannot execute in the con-
    text of smtpd_end_of_data_restrictions.

    This feature is available in Postfix 2.1 and later.

    REDIRECT user@domain
    After the message is queued, send the message to
    the specified address instead of the intended
    recipient(s).

    Note: this action overrides the FILTER action, and
    currently affects all recipients of the message.

    This feature is available in Postfix 2.1 and later.

    WARN optional text...
    Log a warning with the optional text, together with
    client information and if available, with helo,
    sender, recipient and protocol information.

    This feature is available in Postfix 2.1 and later.


    Be cool

  10. #10

    Padrão

    humm.. nisso eu dei uma olhada. E estudarei com mais afinco.

    Eu fiz um teste aqui. Tirei as restrições do helo (comentei as linhas) e a mensagem do cara passou. Isso era esperado. Infelizmente tive que abrir as pernas.
    Contudo preciso arranjar um jeito de nao perder minhas restricoes de HELO e deixar o cara liberado.
    Bom, segundo informacões essa eh um empresa com milhares de usuarios e cada um com seu e-mail...bom e me disseram: "Pô, os caras tem milhares de contatos e só dá erro aqui?!"... bom ai já viu, né?
    Trabalha peão.
    Última edição por Duca; 14-03-2008 às 16:57.

  11. #11

    Padrão

    caramba.. um dia serei bom em configuração de servidor de mail...

    isso que dá aprender um monte de coisa em pouco tempo e não colocar em prática... :/

  12. #12

    Padrão

    Isso é tenso mesmo... isso que da ter milheos de má configuraões e a galera fala "Ah funciona com todos menos com voce... o problema é voce!"

    Aquelas dicas que eu mandei do OK nao funcionou? (ultimo post)

  13. #13

    Arrow

    Irei testar essa semana.
    Eu fiz um teste usando a restrição helo_access, mas sem êxito por enquanto.
    Irei mexer no servidor hoje.
    Valeu mesmo!
    AB, Duca.

  14. #14

    Padrão

    Citação Postado originalmente por lucianogf Ver Post
    caramba.. um dia serei bom em configuração de servidor de mail...

    isso que dá aprender um monte de coisa em pouco tempo e não colocar em prática... :/
    Cara, tem tanta coisa que se pode fazer no servidor de e-mail, hehe.
    E como você disse colocar tudo em prática leva tempo.
    O postfix tem tantos parâmetros que podem ser colocados em seu arquivo de configuração que dá para "afinar" ainda mais o servidor de e-mail.

    Ab, Duca.

  15. #15
    Moderador Avatar de Bruno
    Ingresso
    Nov 2002
    Localização
    Guarapuava-PR
    Posts
    4.181
    Posts de Blog
    1

    Padrão

    a dica do amigo la resolveu seu problema ???

  16. #16

    Post

    Amanhã, hoje foi dia de burocracia.

  17. #17

    Padrão

    ainda tô resolvendo...