1

Topic: Always connection refused from Amavis

==== Required information ====
- iRedMail version: 0.8.4
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): MySQL
- Linux/BSD distribution name and version: ubuntu
- Related log if you're reporting an issue:
====

Hello guys,

I just have instellad the last iredmail (0.8.4).
I have a problem with amavis that seems to die every time i try to send an email from roundcube.
This is the log

May  7 18:01:44 mail postfix/smtp[2963]: 6298374ACB19: to=<test@mydomain.net>, relay=none, delay=570, delays=570/0.01/0/0, dsn=4.4.1, status=deferred (connect to 127.0.0.1[127.0.0.1]:10024: Connection refused)

Ok, I thought to restart amavis again, doing /etc/init.d/amavis start

It starts correctly i see it using "netstat" command, but when i try to send an email it dies.

What could i do?
Thank you!

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.

2

Re: Always connection refused from Amavis

claudio.villa1968,
Your ISP maybe blocking port 25, from the Ubuntu box try
telnet mail.youremailserver.com 25 <enter>

where mail.youremailserver.com is put the fully qualified domain name of your server. If the connection times out try
telnet mail.youremailserver.com 587 <enter> and see if you are able to establish a connection.

If you are running the Mail server from your home using a residential service your ISP might block all port 25 traffic. 

Thanks,
-Tim

3

Re: Always connection refused from Amavis

Assuming this is not an issue with ISP port blocking, I also found this

http://www.howtoforge.com/postfix-amavi … on-refused I'm not sure how helpful it might be, but it suggested that you restart both amavis and POSTFIX, the "netstat -tap" does not seem to work on my server.

Best of luck!
tim

4

Re: Always connection refused from Amavis

Hi Tim,
thank you for your replies. Unfortunately It did not solve my problem. I also tried to reboot, then restart amavis and postfix...but no lucky.

I still get error like:

May  8 04:03:37 mail postfix/smtp[7409]: E3A7D74ACB19: to=<test@mydomain.com>, relay=none, delay=2.5, delays=2.5/0.01/0/0, dsn=4.4.1, status=deferred (connect to 127.0.0.1[127.0.0.1]:10024: Connection refused)

doing netstat -tap I do not see amavis, no process is listening to 10024 port.

I really do not understand what the problem should be. I simply have installed iRedMail without touching anything. I have not modified any config files.

I simply extracted iRedMail, in /pkgs I lunched get_all.sh and then iRedMail.sh nothing else. I just followeb your youtube video and the documentation on this website.

What could i try?

Thank you!

5

Re: Always connection refused from Amavis

Tim, regarding the port, I have installed iRedMail on a VPS, there are no problem with ports. My home ISP block 25 connections, but I am sending the emails via roundcube (mydomain.it/mail)... I also get the message back:



This is the mail system at host mail.domain.net.

I'm sorry to have to inform you that your message could not
be delivered to one or more recipients. It's attached below.

For further assistance, please send mail to postmaster.

If you do so, please include this problem report. You can
delete your own text from the attached returned message.

                   The mail system

<test@mydomain.com>: connect to 127.0.0.1[127.0.0.1]:10024: Connection
    refused
Reporting-MTA: dns; mail.domain.net
X-Postfix-Queue-ID: 8161074ACB27
X-Postfix-Sender: rfc822; test@domain.net
Arrival-Date: Tue,  7 May 2013 16:52:23 -0400 (EDT)

Final-Recipient: rfc822; test@mydomain.com
Original-Recipient: rfc822;test@mydomain.com
Action: failed
Status: 4.4.1
Diagnostic-Code: X-Postfix; connect to 127.0.0.1[127.0.0.1]:10024: Connection
    refused
Return-Path: <test@domain.net>
Received: from mail.domain.net (localhost.localdomain [127.0.0.1])
    by mail.domain.net (Postfix) with ESMTPA id 8161074ACB27
    for <test@mydomain.com>; Tue,  7 May 2013 16:52:23 -0400 (EDT)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8;
format=flowed
Content-Transfer-Encoding: 8bit
Date: Tue, 07 May 2013 22:52:22 +0200
From: test@domain.net
To: <test@mydomain.com>
Subject: My Subject
Message-ID: <b3282f6e55050d833fab6f64baa99571@domain.net>
X-Sender: test@domain.net
User-Agent: RoundCube WebMail

Text of the message

6

Re: Always connection refused from Amavis

Hi claudio.villa1968,

*) Please show us related log of full smtp session, not just the line you pasted.
*) Is ClamAV running? Please run "freshclam" manually, after it finished, restart ClamAV and Amavisd services, then try to send testing email again.

7 (edited by claudio.villa1968 2013-05-09 15:18:18)

Re: Always connection refused from Amavis

Hello ZhandHuangbin, thank you for your reply. Something strange happen

root@mail:/var/log# /etc/init.d/amavis start       
Starting amavisd: perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
    LANGUAGE = (unset),
    LC_ALL = (unset),
    LC_TIME = "it_IT.utf8",
    LC_MONETARY = "it_IT.utf8",
    LC_MEASUREMENT = "it_IT.utf8",
    LC_NUMERIC = "it_IT.utf8",
    LANG = "it_IT.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
Killed
(failed).


root@mail:/var/log# /etc/init.d/clamav-daemon restart
* Stopping ClamAV daemon clamd                                                                                                                                                                             [ OK ]
* Starting ClamAV daemon clamd                                                                                                                                                                                    Killed
                                                                                                                                                                                                            [fail]


root@mail:/var/log# /etc/init.d/clamav-freshclam restart
* Stopping ClamAV virus database updater freshclam                                                                                                                                                         [ OK ]
* Starting ClamAV virus database updater freshclam                                                                                                                                                         [ OK ]


this is a complete session:

May  7 17:24:58 mail postfix/smtpd[1683]: connect from localhost.localdomain[127.0.0.1]
May  7 17:24:59 mail postfix/smtpd[1683]: 2027374ACB16: client=localhost.localdomain[127.0.0.1], sasl_method=LOGIN, sasl_username=test@mydomain.net
May  7 17:25:00 mail postfix/cleanup[1700]: 2027374ACB16: message-id=<3b0a32a55b1b373f2ac28e73749317b8@mydomain.net>
May  7 17:25:02 mail postfix/qmgr[1331]: 2027374ACB16: from=<test@mydomain.net>, size=768, nrcpt=1 (queue active)
May  7 17:25:02 mail roundcube: User test@mydomain.net [11.222.333.444]; Message for test@gmail.com; 250: 2.0.0 Ok: queued as 2027374ACB16
May  7 17:25:02 mail postfix/smtp[1705]: connect to 127.0.0.1[127.0.0.1]:10024: Connection refused
May  7 17:25:04 mail postfix/smtp[1705]: 2027374ACB16: to=<test@gmail.com>, relay=none, delay=3.9, delays=3.9/0.01/0.01/0, dsn=4.4.1, status=deferred (connect to 127.0.0.1[127.0.0.1]:10024: Connection refused)
May  7 17:25:06 mail postfix/smtpd[1683]: disconnect from localhost.localdomain[127.0.0.1]

8

Re: Always connection refused from Amavis

i only have 256 MB of Ram, maybe could it be the problem?

9

Re: Always connection refused from Amavis

That's the problem. At least 1GB memory is required for a full-featured iRedMail server.

If you have to use this 256MB RAM VPS, please try to disable spam/virus scanning (Amavisd+SpamAssassin+ClamAV) completely by following this tutorial:
http://iredmail.org/wiki/index.php?titl … amAssassin

Again, disable spam/virus scanning is not recommended for production use.

10

Re: Always connection refused from Amavis

ZhangHuangbin wrote:

That's the problem. At least 1GB memory is required for a full-featured iRedMail server.

If you have to use this 256MB RAM VPS, please try to disable spam/virus scanning (Amavisd+SpamAssassin+ClamAV) completely by following this tutorial:
http://iredmail.org/wiki/index.php?titl … amAssassin

Again, disable spam/virus scanning is not recommended for production use.

Ok, I try to disable all of those.

11

Re: Always connection refused from Amavis

Hi ZhangHuangbin!

Now it works! wow, I only have two questions:

1. Reading the page you gave me (http://iredmail.org/wiki/index.php?titl … amAssassin) I noticed those lines:

# @bypass_virus_checks_maps = (1);  # controls running of anti-virus code
# @bypass_spam_checks_maps  = (1);  # controls running of anti-spam code
# $bypass_decode_parts = 1;         # controls running of decoders&dearchivers

I did not find those exact lines. I have found:

# Enable virus check.
@bypass_virus_checks_maps = (
   \%bypass_virus_checks,
   \@bypass_virus_checks_acl,
   $bypass_virus_checks_re,
   );

# Enable spam check.
@bypass_spam_checks_maps = (
    \%bypass_spam_checks,
    \@bypass_spam_checks_acl,
    $bypass_spam_checks_re,
    );

I only commented those lines and added the follow instead:

@bypass_virus_checks_maps = (1);  # controls running of anti-virus code
@bypass_spam_checks_maps  = (1);  # controls running of anti-spam code
$bypass_decode_parts = 1;         # controls running of decoders&dearchivers

Is this correct?
(Note: I never find the $bypass_decode_parts variable)

2. I tried to send an email to a @gmail account, I received the email but I do not see the DKIM sign, why? I follow the first step of the page "Stop virus/spam scanning, keep DKIM signing/verification and Disclaimer" because I need DKIM signing.

How can I sign my emails?

To send this email I used roundcube. I have noticed that I received a strange email:

Subject: Cron <smmsp@mail> test -x /etc/init.d/sendmail && /usr/share/sendmail/sendmail cron-msp
From: root@mail.mydomain.net

content:
/usr/share/sendmail/sendmail: 899: /usr/share/sendmail/sendmail: /usr/sbin/sendmail-msp: not found

What is this? (during the iRedMail installation I anwser Y to remove sendmail)

Thank you so much for you help! I am really thinking about your PRO service.

12

Re: Always connection refused from Amavis

claudio.villa1968 wrote:

I did not find those exact lines.

You can find them in files under /etc/amavis/conf.d/.

claudio.villa1968 wrote:

Subject: Cron <smmsp@mail> test -x /etc/init.d/sendmail && /usr/share/sendmail/sendmail cron-msp

maybe you should disable this cron job since you don't have Sendmail anymore.

13

Re: Always connection refused from Amavis

ZhangHuangbin wrote:

You can find them in files under /etc/amavis/conf.d/.

There is not. Please take a look at /etc/amavis/conf.d/50-user

Maybe the tutorial you linked me is old, but there is not.

I only see:

@bypass_virus_checks_maps

and

@bypass_spam_checks_maps

as I wrote above.... so, what can i do?

(Note: as I wrote the variable $bypass_decode_parts is not there, maybe another file?)

Ok for sendmail I have disabled it in /etc/cron.*

14

Re: Always connection refused from Amavis

There're several files under /etc/amavis/conf.d/, not just 50-user.

15

Re: Always connection refused from Amavis

ZhangHuangbin wrote:

There're several files under /etc/amavis/conf.d/, not just 50-user.

Hi, I checked each file inside /etc/amavis/conf.d but there is no $bypass_decode_parts variable.
(I am using ubuntu 12.10)

So, does my change is wrong ?

16

Re: Always connection refused from Amavis

No $bypass_decode_parts is ok. Just below two is enough:

@bypass_virus_checks_maps = (1);
@bypass_spam_checks_maps  = (1);

17

Re: Always connection refused from Amavis

Good!
Thank you. It works correctly

18

Re: Always connection refused from Amavis

Your VPS is SWAP? This can help in case of limited RAM.

I had the same problem on a VPS with 512M ram and was well resolved

https://www.digitalocean.com/community/ … -12-10-x64