LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   amavis service is running but no port 10024 and 10026 (https://www.linuxquestions.org/questions/linux-server-73/amavis-service-is-running-but-no-port-10024-and-10026-a-4175681871/)

k_oudom 09-10-2020 06:20 AM

amavis service is running but no port 10024 and 10026
 
My web server can't send email out. amavis is running but no ports 10024 and 10025 instead ports 10023,10025,10027 are open.
Code:

root@web911:/etc/amavis/conf.d# netstat -tap | grep 100
tcp        0      0 localhost:10023        0.0.0.0:*              LISTEN      1186/postgrey --pid
tcp        0      0 localhost:10025        0.0.0.0:*              LISTEN      1404/master
tcp        0      0 localhost:10027        0.0.0.0:*              LISTEN      1404/master

I run service amavis status there is a line as below.
Code:

(!)Net::Server: 2020/09/10-17:42:22 Can't connect to TCP port 10026 on ::1 [Cannot assign requested address]\n  at line 64 in file /usr/share/perl5/Net/Server/Proto/TCP.pm
What could be the problem?

On the other hand, I did a lot of search, all of them mention about amavisd service but my ubuntu-18-04.5 has amavis service only.

tshikose 09-11-2020 02:57 PM

Hi,

It might SE Linux that prevents Amavis to bind to ports others than 10024 and 10025.
Confirm this with
Code:

# semanage port -l | grep amavis
amavisd_recv_port_t            tcp      10024
amavisd_send_port_t            tcp      10025

The port 10026 is normally assigned to SpamAssassin
Confirm this with
Code:

# semanage port -l | grep 10026
spamd_port_t                  tcp      783, 10026, 10027

You can modify that assignation with
Code:

# semanage port -m -t amavisd_recv_port_t -p tcp 10026
And then verify with
Code:

# semanage port -l | grep 10026
amavisd_recv_port_t            tcp      10026, 10024
spamd_port_t                  tcp      783, 10026, 10027

After those, try to restart Amavis and watch out the log files.

k_oudom 09-12-2020 01:20 AM

When I run
Code:

#semanage
. it asks to install policycoreutils-python-utils. After apt install policycoreutils-python-utils and run
Code:

#semanage port -l | grep amavis
it show:
Code:

Traceback (most recent call last):
  File "/usr/sbin/semanage", line 28, in <module>
    import seobject
  File "/usr/lib/python3/dist-packages/seobject.py", line 1039, in <module>
    class portRecords(semanageRecords):
  File "/usr/lib/python3/dist-packages/seobject.py", line 1041, in portRecords
    valid_types = list(list(sepolicy.info(sepolicy.ATTRIBUTE, "port_type"))[0]["types"])
  File "/usr/lib/python3/dist-packages/sepolicy/__init__.py", line 196, in <genexpr>
    return ({
  File "/usr/lib/python3/dist-packages/setools/typeattrquery.py", line 65, in results
    for attr in self.policy.typeattributes():
AttributeError: 'NoneType' object has no attribute 'typeattributes'


bathory 09-12-2020 12:44 PM

@tshikose
Quote:

It might SE Linux that prevents Amavis to bind to ports others than 10024 and 10025.
OP runs ubuntu-18-04.5, so I don't think it's a SELinux problem


@OP
Quote:

(!)Net::Server: 2020/09/10-17:42:22 Can't connect to TCP port 10026 on ::1 [Cannot assign requested address]\n at line 64 in file /usr/share/perl5/Net/Server/Proto/TCP.pm
Doh, maybe your box does not support IPV6.
Try to restart amavis and watch the logs to see what happens.

k_oudom 09-12-2020 03:59 PM

I disabled ipv6

bathory 09-13-2020 10:38 AM

Quote:

Originally Posted by k_oudom (Post 6165222)
I disabled ipv6

And?
Please restart amavis, check the logs and post back.

k_oudom 09-14-2020 01:27 AM

Thank you everyone. I fixed it by adding a line to 50-user config file
Code:

$inet_socket_bind = '127.0.0.1';
It's like Magic!

bathory 09-14-2020 02:06 AM

Quote:

Originally Posted by k_oudom (Post 6165568)
Thank you everyone. I fixed it by adding a line to 50-user config file
Code:

$inet_socket_bind = '127.0.0.1';
It's like Magic!

As I thought. Your server didn't understand the ::1 (the localhost IPv6 address), so it now binds just on 12.0.0.1
Anyway, glad it worked. You may mark the thread "Solved" from the thread tools on top of the page

Cheers

k_oudom 09-14-2020 02:18 AM

Hope this thread can help somebody who have suffered from amavis. Amavis has suffered me for a couple of week. Now I changed to Rspamd. It has nice web gui.


All times are GMT -5. The time now is 11:45 AM.