smtp_bind_address

Discussion in 'Installation/Configuration' started by mbunal, Oct 16, 2009.

  1. mbunal

    mbunal New Member

    when i use smtp_bind_address there are some error on mail log:

    Oct 16 22:26:20 server postfix/smtp[31904]: 9AC3B1343FF: to=<[email protected]>, relay=127.0.0.1[127.0.0.1]:10024, delay=40, delays=40/0/0/0, dsn=4.4.2, status=deferred (lost connection with 127.0.0.1[127.0.0.1] while receiving the initial server greeting)

    how can i solve that?
    ________
    BrilliantMia live
     
    Last edited: Sep 8, 2011
  2. falko

    falko Super Moderator ISPConfig Developer

    Without smtp_bind_address, there are no such errors?
    What's the output of
    Code:
    netstat -tap
    ?
     
  3. mbunal

    mbunal New Member

    there is no error without smtp_bind_address.

    Active Internet connections (servers and established)
    Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
    tcp 0 0 localhost:10024 *:* LISTEN 19931/amavisd (ch7-
    tcp 0 0 localhost:10025 *:* LISTEN 480/master
    tcp 0 0 localhost:mysql *:* LISTEN 30370/mysqld
    tcp 0 0 localhost:spamd *:* LISTEN 2274/spamd.pid
    tcp 0 0 *:sunrpc *:* LISTEN 1850/portmap
    tcp 0 0 *:ssmtp *:* LISTEN 480/master
    tcp 0 0 localhost:884 *:* LISTEN 2828/famd
    tcp 0 0 *:33044 *:* LISTEN 1861/rpc.statd
    tcp 0 0 ns1.server:domain *:* LISTEN 31391/mydns
    tcp 0 0 ns.local.c:domain *:* LISTEN 31391/mydns
    tcp 0 0 ns2.server:domain *:* LISTEN 31391/mydns
    tcp 0 0 localhost:domain *:* LISTEN 31391/mydns
    tcp 0 0 *:ftp *:* LISTEN 31385/pure-ftpd (SE
    tcp 0 0 *:ssh *:* LISTEN 2099/sshd
    tcp 0 0 *:smtp *:* LISTEN 480/master
    tcp 0 0 localhost:35545 localhost:mysql ESTABLISHED 19931/amavisd (ch7-
    tcp 0 0 localhost:mysql localhost:53208 TIME_WAIT -
    tcp 0 0 localhost:53207 localhost:mysql TIME_WAIT -
    tcp 0 0 localhost:53206 localhost:mysql TIME_WAIT -
    tcp 0 0 localhost:mysql localhost:53205 TIME_WAIT -
    tcp 0 0 localhost:mysql localhost:35545 ESTABLISHED 30370/mysqld
    tcp 0 0 localhost:53204 localhost:mysql TIME_WAIT -
    tcp 0 0 localhost:53203 localhost:mysql TIME_WAIT -
    tcp 0 0 localhost:mysql localhost:59875 ESTABLISHED 30370/mysqld
    tcp 0 0 localhost:59875 localhost:mysql ESTABLISHED 20020/amavisd (ch5-
    tcp6 0 0 [::]:imaps [::]:* LISTEN 31308/couriertcpd
    tcp6 0 0 [::]:pop3s [::]:* LISTEN 31336/couriertcpd
    tcp6 0 0 [::]:pop3 [::]:* LISTEN 31319/couriertcpd
    tcp6 0 0 [::]:imap2 [::]:* LISTEN 31290/couriertcpd
    tcp6 0 0 [::]:http-alt [::]:* LISTEN 31368/apache2
    tcp6 0 0 [::]:www [::]:* LISTEN 31368/apache2
    tcp6 0 0 localhost:domain [::]:* LISTEN 31391/mydns
    tcp6 0 0 [::]:ftp [::]:* LISTEN 31385/pure-ftpd (SE
    tcp6 0 0 [::]:ssh [::]:* LISTEN 2099/sshd
    tcp6 0 0 [::]:https [::]:* LISTEN 31368/apache2

    ________
    Washington dispensaries
     
    Last edited: Sep 8, 2011
  4. falko

    falko Super Moderator ISPConfig Developer

    Postfix is listening on all interfaces.
    Can you post your main.cf?
     
  5. mbunal

    mbunal New Member

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

    # 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

    readme_directory = /usr/share/doc/postfix

    # TLS parameters
    smtpd_tls_cert_file = /etc/postfix/smtpd.cert
    smtpd_tls_key_file = /etc/postfix/smtpd.key
    smtpd_use_tls = yes
    smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
    smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache

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

    myhostname = server1.domain.com
    alias_maps = hash:/etc/aliases
    alias_database = hash:/etc/aliases
    myorigin = /etc/mailname
    mydestination = server1.domain.com, localhost, localhost.localdomain
    relayhost =
    mynetworks = 127.0.0.0/8 [::1]/128 xx.xx.xx.xx
    mailbox_command = procmail -a "$EXTENSION"
    mailbox_size_limit = 0
    recipient_delimiter = +
    inet_interfaces = all
    html_directory = /usr/share/doc/postfix/html
    virtual_alias_domains =
    virtual_alias_maps = proxy:mysql:/etc/postfix/mysql-virtual_forwardings.cf, mysql:/etc/postfix/mysql-virtual_email2email.cf
    virtual_mailbox_domains = proxy:mysql:/etc/postfix/mysql-virtual_domains.cf
    virtual_mailbox_maps = proxy:mysql:/etc/postfix/mysql-virtual_mailboxes.cf
    virtual_mailbox_base = /var/vmail
    virtual_uid_maps = static:5000
    virtual_gid_maps = static:5000
    smtpd_sasl_auth_enable = yes
    broken_sasl_auth_clients = yes
    smtpd_sasl_authenticated_header = yes
    smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, check_recipient_access mysql:/etc/postfix/mysql-virtual_recipient.cf, reject_unauth_destination
    smtpd_tls_security_level = may
    transport_maps = proxy:mysql:/etc/postfix/mysql-virtual_transports.cf
    relay_domains = mysql:/etc/postfix/mysql-virtual_relaydomains.cf
    virtual_create_maildirsize = yes
    virtual_maildir_extended = yes
    virtual_mailbox_limit_maps = proxy:mysql:/etc/postfix/mysql-virtual_mailbox_limit_maps.cf
    virtual_mailbox_limit_override = yes
    virtual_maildir_limit_message = "The user you are trying to reach is over quota."
    virtual_overquota_bounce = yes
    proxy_read_maps = $local_recipient_maps $mydestination $virtual_alias_maps $virtual_alias_domains $virtual_mailbox_maps $virtual_mailbox_domains $relay_recipient_maps $relay_domains $canonical_maps $sender_canonical_maps $recipient_canonical_maps $relocated_maps $transport_maps $mynetworks $virtual_mailbox_limit_maps
    smtpd_sender_restrictions = check_sender_access mysql:/etc/postfix/mysql-virtual_sender.cf
    smtpd_client_restrictions = check_client_access mysql:/etc/postfix/mysql-virtual_client.cf
    maildrop_destination_concurrency_limit = 1
    maildrop_destination_recipient_limit = 1
    virtual_transport = maildrop
    header_checks = regexp:/etc/postfix/header_checks
    mime_header_checks = regexp:/etc/postfix/mime_header_checks
    nested_header_checks = regexp:/etc/postfix/nested_header_checks
    body_checks = regexp:/etc/postfix/body_checks
    content_filter = amavis:[127.0.0.1]:10024
    receive_override_options = no_address_mappings

    ________
    PROBLEMS WITH PRILOSEC
     
    Last edited: Sep 8, 2011
  6. falko

    falko Super Moderator ISPConfig Developer

    But the smtp_bind_address line is commented out... :confused:
     
  7. mbunal

    mbunal New Member

    becouse it is not working without comment. and this is produciton server. it must be run.
    ________
    How To Make A Bong
     
    Last edited: Sep 8, 2011
  8. till

    till Super Moderator Staff Member ISPConfig Developer

    Instead of smtp_bind_address, you can try:

    inet_interfaces = 192.168.1.2, 127.0.0.1

    where you have to replace 192.168.1.2 with your external address.
     
  9. mbunal

    mbunal New Member

    i tried that. but that setting only change listening ip's.

    i want to change outgoing ip address.

    i have 2 ip address. one them(a) is in blacklist, other(b) not. also i use ip masquerade via a. i want to isolate outgoing mail (via b) and internet traffic (via a).
    ________
    Stickywetcouple
     
    Last edited: Sep 8, 2011
  10. till

    till Super Moderator Staff Member ISPConfig Developer

    If you add just the outgoing IP and 127.0.0.1, then there is no other IP address to send for postfix and it should use the outgoing IP.
     
  11. mbunal

    mbunal New Member

    no sir it didnt work again. i tried this. only added listenin ip address. but outgoing ip address did not changed.
    ________
    Live Sex
     
    Last edited: Sep 8, 2011
  12. mbunal

    mbunal New Member

    Last edited: Sep 8, 2011
  13. richi

    richi New Member HowtoForge Supporter

    I was having the same issue when trying to bind outgoing mails to one interface, which usually worked with the smtp_bind_address without Amavis being involved.

    With Amavis you also have to add this interface to the Amavis config, because per default Amavis accepts only connections via the Loopback interface.

    For my Debian based systems i added

    @inet_acl = qw( 127.0.0.1 [::1] IP/MASK );

    to the 50-user file in /etc/amavis/conf.d
     
  14. Ovidiu

    Ovidiu Active Member

    What is the current solution for this with ISPCFG3? I am having the same issue but this thread is from 2010...
     
  15. till

    till Super Moderator Staff Member ISPConfig Developer

    See Post #13 in this thread.
     
  16. Ovidiu

    Ovidiu Active Member

    Thanks but will I have to edit /etc/amavis/conf.d again after I update ISPCFG3 and select to reconfigure services?
     
  17. Ovidiu

    Ovidiu Active Member

    seeing that I had no answer to this question, here are some more:

    is this correct:

    add smtp_bind_address=outgoing_IP to my postfix configuration
    then add @inet_acl = qw( 127.0.0.1 [::1] IP/MASK ); to the 50-user file in /etc/amavis/conf.d
    restart postfix and amavis, all set?

    so what about the the 50-user file in /etc/amavis/conf.d ?
    will I have to update it after every ISPCFG3 update?

    This is my first time checking out this amavis config file and I am wondering about those settings:

    i.e. $sa_tag_level_deflt = 20.0; - does this or the settings defined in ISPCFG3 have precedence?
     
  18. till

    till Super Moderator Staff Member ISPConfig Developer

    Dont edit the 50-user file. Create you own file for custom settings which get included after the 50-udser like "60-custom" and add your changes there.

    The settings in ispconfig, otherwise it would not make much sense to offer settings in ispcobnfig at all ;)
     
  19. Ovidiu

    Ovidiu Active Member

    creating my own file i.e. 60-custom is enough? it will be automatically picked up by amavis if it exists?

    one more error with above solution:

    amavis doesn't start and my logs say:
     
  20. till

    till Super Moderator Staff Member ISPConfig Developer

    yes.

    IP/MASK is a placeholder, you have to replace it with the Ip and netmask that you want to allow connections to amavisd. If you wamt to add only one IP, then you have to set the IP without mask.
     

Share This Page