1. Please take a little time for this simple survey! Thank you for participating!
    Dismiss Notice
  2. Dear Pleskians, please read this carefully! New attachments and other rules Thank you!
    Dismiss Notice
  3. Dear Pleskians, I really hope that you will share your opinion in this Special topic for chatter about Plesk in the Clouds. Thank you!
    Dismiss Notice

I need to reconfigure qmail-smtp so that it only listens on one IP address.

Discussion in 'Plesk for Linux - 8.x and Older' started by nedry, May 10, 2006.

  1. nedry

    nedry Guest

    0
     
    I currently have three IP addresses assigned to my VPS, QMail's smtp defaults to listening on all three of the addresses. Without going into a deep explaination of why I need to do make QMail to listen on only one IP address, does any one have any suggestions on configuring QMail for a single IP address? Or more specifically qmail-smtp?

    Thanks in advance,
    Nedry
     
  2. jspilon

    jspilon Guest

    0
     
    iptables...
     
  3. nedry

    nedry Guest

    0
     
    IPTables won't solve my problem. i don't want to block any port 25 connections.

    To restate my problem, I need to have qmail listen to port 25 on one and only IP address freeing up port 25 on my other IP addresses for use by a different application.

    Thanks,
    Nedry
     
  4. jspilon

    jspilon Guest

    0
     
    check out

    /etc/xinetd.d/smtp_psa

    looks like it is controlled by xinetd

    its worth taking a look at xinetd documentation for setting up which ip/interface it listens on
     
  5. nedry

    nedry Guest

    0
     
    Yes, it does look like qmail-smtpd is controlled by xinetd but after studying the xinetd and tcp-env man pages and a lot of googling, I don't see how to tell qmail-smtpd to listen on only one IP address. Anyone know who to do this?

    Or if there is another suggestions, I would love to hear it!

    Thanks everyone!

    Nedry
     
  6. jspilon

    jspilon Guest

    0
     
    with xinetd qmail isnt running waiting for connections, xinetd receives the connections and then calls the server...

    here is a good example ;) and i think the bind instruction would achieve what you want...

    try it out and then use nmap from another machine and scan each interfaces ;) 25 shouldnt be listening on the other ones

    service telnet
    {
    flags = REUSE
    socket_type = stream
    wait = no
    user = root
    server = /usr/sbin/in.telnetd
    bind = 192.168.1.11
    log_on_failure += USERID
    }
     
  7. nedry

    nedry Guest

    0
     
    Yes, adding bind does the trick but also causes a couple of problems.

    First of all it breaks webmail (and probably other services as well) as webmail is expecting to find smtp services at localhost:25.

    The second problem I noticed is that when I made a change in the Plesk interface, it changed the smtp_psa file back to its original state.

    So it seems that I need to be able have qmail-smtp listen on two IP addresses, the address of my primary MX and localhost.

    Any other ideas?

    nedry
     
  8. jspilon

    jspilon Guest

    0
     
    1.

    bind 65.11.45.122 127.0.0.1
    you can put multiple value...

    http://www.die.net/doc/linux/man/man5/xinetd.conf.5.html

    2. you mean it resets the xinetd config for smtp_psa ?
    was it when you modified mail related settings in plesk ?

    if its the case you could write an event handler with the event manager....
     
  9. nedry

    nedry Guest

    0
     
    I've tried using multiple values but it doesn't work. But I did find a good xinted article that was very helpful:
    http://www.linuxfocus.org/English/November2000/article175.shtml

    Here is what my smtp_psa file looks like now:
    PHP:
    service smtp
    {
            
    id              smtp-localhost
            socket_type     
    stream
            protocol        
    tcp
            wait            
    no
            disable         
    no
            user            
    root
            instances       
    UNLIMITED
            bind            
    localhost
            server          
    = /var/qmail/bin/tcp-env
            server_args     
    = /var/qmail/bin/relaylock /var/qmail/bin/qmail-smtpd /var/qmail/bin/smtp_auth /var/qmail/bin/true /var/qmail/bin/cmd5checkpw /var/qmail/bin/true
    }

    service smtp
    {
            
    id              smtp-qmail
            socket_type     
    stream
            protocol        
    tcp
            wait            
    no
            disable         
    no
            user            
    root
            instances       
    UNLIMITED
            bind            
    xxx.xxx.xxx.xxx
            server          
    = /var/qmail/bin/tcp-env
            server_args     
    = /var/qmail/bin/relaylock /var/qmail/bin/qmail-smtpd /var/qmail/bin/smtp_auth /var/qmail/bin/true /var/qmail/bin/cmd5checkpw /var/qmail/bin/true
    }
    While this seems to work, I am open to other suggestions, especially if they are simpler. :)

    Yes. And Yes.

    Okay, sounds like it might work. But I don't yet know anything about the Event Manager. Can you point me to a couple of good starting points?

    Thanks for all of your help!

    Nedry
     
Loading...