Results 1 to 2 of 2

Thread: local network - postfix - MUA - mailx

  1. #1
    Join Date
    Jun 2008
    Location
    South-West France
    Posts
    1,069

    Default local network - postfix - MUA - mailx

    I am testing postfix on a local network with sasl and tls.
    In the last step the mail server would send mail outside.
    Actually I don't want to send mail outside.
    During my test with sasl, I succeed to send a mail outside but I was expecting that my mail was rejected.
    Currently I have put a dummy address in the relayhost parameter
    Code:
    relayhost = [192.168.130.250]
    I would like to know if there is any parameter that I can set to be sure that no mails can go out.
    I shall remove this parameter ( or change the value ) when I will be ready to send mail outside.

    Any help is welcome.
    Thanks for helping. JCD
    __________
    server leap 15.0 -- ASUS g75vw KDE leap 15.0 -- ASUS g750JZ Optimus KDE leap 15.1 -- acer aspire s13 win 10 home -- HP Omen win 10 home - scan EPSON V500 - Brother HL2250DN - Samsung CLP-325W

  2. #2
    Join Date
    Jun 2008
    Location
    South-West France
    Posts
    1,069

    Default Re: local network - postfix - MUA - mailx

    After googleing I have found this workaround.

    Sasl configuration :

    Code:
    #
    smtpd_sasl_auth_enable = yes
    #
    smtpd_sasl_security_options = noanonymous
    #
    smtpd_sasl_local_domain = $mydomain
    #
    # Authorize relay for authenticated users
    smtpd_recipient_restrictions = permit_sasl_authenticated,  permit_mynetworks, reject_unauth_destination
    Changing
    Code:
    smtpd_recipient_restrictions = permit_sasl_authenticated,  permit_mynetworks, reject_unauth_destination
    to
    Code:
    smtpd_recipient_restrictions =
      check_recipient_access hash:/etc/postfix/recipient_access,  reject_unauth_destination
    Solve my problem :
    If /etc/postfix/recipient_access is empty then recipent address is rejected :
    Code:
    NOQUEUE: reject: RCPT from hostname.mydomain.com[192.168.130.100]: 554 5.7.1 <someuser@anotherdomain.com>: Relay access denied; from=<user_install@mydomain.com> to=<someuser@anotherdomain.com> proto=ESMTP helo=<hostname.mydomain.com>
    If /etc/postfix/recipient_access is fill with :
    Code:
    # for relaying domain
    # user@domain.com OK
    
    non_existent_user@somedomain.com      REJECT
    good_existent_user@somedomain.com    OK
    somedomain.com                                   REJECT
    Then the mail is sent.

    Nota : mydomain.com does not exists. It is local.
    The mx record is set by the router using dnsmasq config.
    I have found a site where you got an arbitrary email address wher to send mails.
    Mails are destroyed 60 mn later.
    This way I can test if outbound mails are delivred or not.

    I want to be sure during my tests that no mail goes outside until I use a isp as relay.

    Any comments are welcome.
    Thanks for helping. JCD
    __________
    server leap 15.0 -- ASUS g75vw KDE leap 15.0 -- ASUS g750JZ Optimus KDE leap 15.1 -- acer aspire s13 win 10 home -- HP Omen win 10 home - scan EPSON V500 - Brother HL2250DN - Samsung CLP-325W

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •