• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

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

N

nedry

Guest
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
 
Originally posted by jspilon
iptables...

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
 
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
 
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
 
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
}
 
Originally posted by jspilon
here is a good example ;) and i think the bind instruction would achieve what you want...

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
 
Originally posted by nedry
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

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....
 
Originally posted by jspilon
1.

bind 65.11.45.122 127.0.0.1
you can put multiple value...

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. :)

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

Yes. And Yes.

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

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
 
Back
Top