LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 09-10-2020, 06:20 AM   #1
k_oudom
Member
 
Registered: Aug 2009
Posts: 293

Rep: Reputation: 30
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.
 
Old 09-11-2020, 02:57 PM   #2
tshikose
Member
 
Registered: Apr 2010
Location: Kinshasa, Democratic Republic of Congo
Distribution: RHEL, Fedora, CentOS
Posts: 525

Rep: Reputation: 95
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.

Last edited by tshikose; 09-11-2020 at 03:05 PM.
 
Old 09-12-2020, 01:20 AM   #3
k_oudom
Member
 
Registered: Aug 2009
Posts: 293

Original Poster
Rep: Reputation: 30
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'
 
Old 09-12-2020, 12:44 PM   #4
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,165
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
@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.
 
Old 09-12-2020, 03:59 PM   #5
k_oudom
Member
 
Registered: Aug 2009
Posts: 293

Original Poster
Rep: Reputation: 30
I disabled ipv6
 
Old 09-13-2020, 10:38 AM   #6
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,165
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Quote:
Originally Posted by k_oudom View Post
I disabled ipv6
And?
Please restart amavis, check the logs and post back.
 
Old 09-14-2020, 01:27 AM   #7
k_oudom
Member
 
Registered: Aug 2009
Posts: 293

Original Poster
Rep: Reputation: 30
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!
 
Old 09-14-2020, 02:06 AM   #8
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,165
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Quote:
Originally Posted by k_oudom View Post
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
 
Old 09-14-2020, 02:18 AM   #9
k_oudom
Member
 
Registered: Aug 2009
Posts: 293

Original Poster
Rep: Reputation: 30
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.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
connect to 127.0.0.1[127.0.0.1]: Connection refused (port 10024) adamos22 Linux - Newbie 2 07-31-2013 12:40 PM
Postfix Courier Amavis - Can recieve but not send jchambers Linux - Newbie 3 11-24-2010 07:43 PM
amavis-stats issue - not running. cviniciusm Linux - Server 8 05-03-2009 01:42 PM
Amavisd Running - Amavis-milter is Not carlosinfl Linux - Server 2 06-18-2008 10:16 AM
AMaViS not listening on tcp port nutcake Linux - Software 1 09-13-2005 08:44 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 12:14 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration