Email routing assp.local domain to destination host

Discussion in 'Installation/Configuration' started by simonit, Jun 14, 2024.

  1. pyte

    pyte Well-Known Member HowtoForge Supporter

    I just set up a test in ISPConfig. And when sending a mail from the mailserver directly i get:
    Check if the entry in the ISPConfig Database is correct:
    Code:
    mysql -u root -p -h 127.0.0.1 -D dbispconfig -e "SELECT transport FROM mail_transport WHERE domain='assp-nospam.org';"
    This should return:

     
  2. simonit

    simonit New Member

    Looks correct:

    Code:
    mysql -u root -p -h 127.0.0.1 -D dbispconfig -e "SELECT transport FROM mail_transport WHERE domain='assp-nospam.org';"
    Enter password:
    +-------------------------+
    | transport               |
    +-------------------------+
    | smtp:[10.10.10.111]:225 |
    +-------------------------+
    
    
    root@host:~# telnet 10.10.10.111 225
    Trying 10.10.10.111...
    Connected to 10.10.10.111.
    Escape character is '^]'.
    220 mx.XXXX.fi is ready - using ASSP 2.8.1(23131)
    
    
     
  3. pyte

    pyte Well-Known Member HowtoForge Supporter

    Then do some debugging. Send a mail from the server itself with:
    Code:
    echo "Test email" | mail -s "Test" [email protected]
    Check the maillog and see what it does.
     
  4. simonit

    simonit New Member

    Hi, actually need make that work before investigating the original issue. Will let you know latter if that fixes also the original isuue.
     
  5. simonit

    simonit New Member

    locally with:
    echo "Test email" | mail -s "Test" -a "From: [email protected]" [email protected]

    works and mail flows to [10.10.10.111]:225

    postfix/smtp[1578787]: E628960095: to=<[email protected]>, relay=10.10.10.111[10.10.10.111]:225, delay=2.7, delays=0.01/0.05/0.38/2.3, dsn=2.0.0, status=sent (250 2.0.0 Ok)
    postfix/qmgr[1578609]: E628960095: removed

    But when using ispaccount and outlook, it still does not deliver to [10.10.10.111]:225

    postfix/smtps/smtpd[1579084]: NOQUEUE: reject: RCPT from xxx.fi[xxxx]: 450 4.1.2 <[email protected]>: Recipient address rejected: Domain not found; from=<[email protected]> to=<[email protected]> proto=ESMTP helo=<XXX>
     
  6. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    Domain is registered:
    Code:
    $ whois assp-nospam.org
    Domain Name: assp-nospam.org
    Registry Domain ID: 1e1274b6e29f4a26b2c2b5d280e1dd55-LROR
    Registrar WHOIS Server: http://whois.registrar.eu
    Registrar URL: http://www.openprovider.com
    Updated Date: 2024-03-23T12:18:28Z
    Creation Date: 2018-02-07T12:18:07Z
    
    But is not found from Name Service:
    Code:
    $ host assp-nospam.org
    Host assp-nospam.org not found: 2(SERVFAIL)
    
    and the error message also says "Domain not found;".
    I think I wrote previously postfix checks name service to find out where to send the message. Is this domain local to the machine where you tested? Is the domain visible in ISPConfig Panel Email tab in Domain listing?
     
  7. pyte

    pyte Well-Known Member HowtoForge Supporter

    I've created the entry for transport under "E-Mail Routing" as follows:
    Code:
    test.de smtp:[10.10.20.20]:2525
    Then i've added "test.de" under E-Mail -> Relay Domains and "@test.de" under E-Mail -> Relay Recipients. After that i've checked from an external host with netcat:
    Code:
    220 mail01.xxxx.com ESMTP Postfix
    HELO mail.pyte.dev
    250 mail01.xxxx.com
    MAIL FROM:<[email protected]>
    250 2.1.0 Ok
    RCPT TO:<[email protected]>
    250 2.1.5 Ok
    This seems to work just fine. Using a mailbox that is local to the mail01 server that should route test.de i've tested it with Roundcube:

    Code:
    Jul  8 08:27:28 mail01 postfix/smtp[1973364]: 2A54BDFB64: to=<[email protected]>, relay=none, delay=30, delays=0.23/0/30/0, dsn=4.4.1, status=deferred (connect to 10.10.20.20[10.10.20.20]:2525: Connection timed out)
    Which works fine too. So someting with your entries or setup is wrong.
     
  8. simonit

    simonit New Member

    Hello,
    I did add the domain (assp-nospam.org) in hosts file pointing to ASSP (10.10.10.111). I did try to add it also as email domain (ISPConfig Panel Email tab in Domain listing), but after that the error changed to "user not found" or something else, as it seems postfix stars then looking the mailbox for email, and it does not exists.

    There is also assp.local domain that could be used for this. I also think on ASSP we could use the real local domains and send mail to [email protected], but is there way to relay all mails assp-spam@* to smart host (ASSP)?
     
  9. pyte

    pyte Well-Known Member HowtoForge Supporter

    Is the Domain assp-spam.org listed under "E-Mail Domains" in ISPConfig by chance?
     
  10. simonit

    simonit New Member

    No is is not, and if I add it, the error changes to user not found or something.
    Its only listed on email relay domains.
     
  11. pyte

    pyte Well-Known Member HowtoForge Supporter

    That's what should happen then. I just wanted to make sure, as you can either use it as local mail domain OR transport, if the domain is listed in both postfix will try to deliver the mail to a local mailbox.

    You only need E-Mail Routing, Relay Domain and Relay Recipient to be set. The mail should then be transported to the relay host you've set.
     
    ahrasis likes this.
  12. simonit

    simonit New Member

    You mean like this: Imgur: The magic of the Internet ? Is there any way determinate why it is still complaining this:

    Code:
    postfix/smtps/smtpd[1579084]: NOQUEUE: reject: RCPT from xxx.fi[xxxx]: 450 4.1.2 <[email protected]>: Recipient address rejected: Domain not found; from=<[email protected]> to=<[email protected]> proto=ESMTP helo=<XXX>
     
  13. pyte

    pyte Well-Known Member HowtoForge Supporter

    Well this is strange but i found your problem.
    My test worked as test.de is a valid domain with an MX record. Using "thisdomaindoesnotexists.de" results in the same error:
    So the only option would be to fake the record in your local dns resolver (unbound) or disable dns lookups in postifx, but that will cause more issues.

    Some docs: https://www.postfix.org/postconf.5.html#smtp_dns_support_level
     
    Last edited: Jul 8, 2024
    till likes this.

Share This Page