1

Topic: EC2 AWS Ubuntu 12.04 Can't send nor Receive

I'm running
- the latested iRedAdminPro
on

-  Ubuntu 12.04 on Amazon AWS EC2


I'm not able to send receive email,
although 2 out of 30 some how managed to get in and out.


This is my log files


-sieve.log

Jun 18 06:50:09 lda(root): Fatal: setgid(1001(vmail) from mail_gid setting) failed with euid=65534(nobody), gid=65534(nogroup), egid=65534(nogroup): Operation not permitted (This binary should probably be called with process group set to 1001(vmail) instead of 65534(nogroup))

-mail.err

Jun 18 05:36:30 mail amavis[4617]: (04617-14) (!!)TROUBLE in check_mail: virus_scan FAILED: AV: ALL VIRUS SCANNERS FAILED
Jun 18 05:46:16 mail amavis[4800]: (04800-11) (!!)WARN: all primary virus scanners failed, considering backups

-mail.log ( I had created the actual root@mail.mydomain.com address)

Jun 18 23:58:17 mail postfix/smtp[12995]: B061F234C7: to=<root@mail.mydomain.com>, relay=none, delay=61638, delays=61638/0.03/0/0, dsn=4.4.1, status=deferred (connect to 127.0.0.1[127.0.0.1]:10024: Connection refused)



cat /etc/passd
openldap:x:108:114:OpenLDAP Server Account,,,:/var/lib/ldap:/bin/false
postfix:x:109:116::/var/spool/postfix:/bin/false
clamav:x:110:118::/var/lib/clamav:/bin/false
dovecot:x:111:119:Dovecot mail server,,,:/usr/lib/dovecot:/bin/false
dovenull:x:112:65534:Dovecot login user,,,:/nonexistent:/bin/false
amavis:x:113:120:AMaViS system user,,,:/var/lib/amavis:/bin/sh
vmail:x:1001:1001::/var/vmail:/sbin/nologin
iredadmin:x:1002:1002::/home/iredadmin:/sbin/nologin
iredapd:x:1003:1003:iRedAPD daemon user:/home/iredapd:/sbin/nologin

running processes:

1256 clamav    20   0 44032 1572  608 S  0.0  0.3   0:52.49 freshclam
8377 clamav    20   0  254m 135m  708 S  0.0 23.0   0:10.56 clamd
1327 iredapd   20   0 93968 5800  816 S  0.0  1.0   0:00.57 python
718 dovecot   20   0  8944  164    0 S  0.0  0.0   0:00.09 anvil

telnet localhost smtp
Trying 127.0.0.1...
Connected to mail.mydomain.com.
Escape character is '^]'.
220 mail.mydomain.com ESMTP Postfix (Ubuntu)


ubuntu@mail:~$ sudo /etc/init.d/amavis restart
Stopping amavisd: (not running).
Starting amavisd: (failed).

ubuntu@mail:/var/log$ netstat -pantu | grep 25
(No info could be read for "-p": geteuid()=1000 but you should be root.)
tcp        0      0 127.0.0.1:10025         0.0.0.0:*               LISTEN      -
tcp        0      0 0.0.0.0:25              0.0.0.0:*               LISTEN      -


ubuntu@mail:/var/log/clamav$ netstat -tap
(No info could be read for "-p": geteuid()=1000 but you should be root.)
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 *:ldap                  *:*                     LISTEN      -
tcp        0      0 mail.mydomain.com:10025   *:*                     LISTEN      -
tcp        0      0 mail.mydomain.com:mysql   *:*                     LISTEN      -
tcp        0      0 *:submission            *:*                     LISTEN      -
tcp        0      0 *:pop3                  *:*                     LISTEN      -
tcp        0      0 mail.mydomain.com:10031   *:*                     LISTEN      -
tcp        0      0 *:imap2                 *:*                     LISTEN      -
tcp        0      0 *:http                  *:*                     LISTEN      -
tcp        0      0 *:ssh                   *:*                     LISTEN      -
tcp        0      0 *:smtp                  *:*                     LISTEN      -
tcp        0      0 *:https                 *:*                     LISTEN      -
tcp        0      0 *:sieve                 *:*                     LISTEN      -
tcp        0      0 mail.mydomain.com:7777    *:*                     LISTEN      -
tcp        0      0 *:imaps                 *:*                     LISTEN      -
tcp        0      0 *:pop3s                 *:*                     LISTEN      -
tcp        0    416 ip-10-204-143-239.e:ssh ppp59-167-177-210:14581 ESTABLISHED -
tcp        0      0 mail.mydomain.com:58633   mail.mydomain.com:mysql   TIME_WAIT   -
tcp        0      0 mail.mydomain.com:ldap    mail.mydomain.com:50331   ESTABLISHED -
tcp        0      0 mail.mydomain.com:50277   mail.mydomain.com:ldap    ESTABLISHED -
tcp        0      0 mail.mydomain.com:50331   mail.mydomain.com:ldap    ESTABLISHED -
tcp        0      0 ip-10-204-143-239:https ppp59-167-177-210:10121 TIME_WAIT   -
tcp        0      0 mail.mydomain.com:ldap    mail.mydomain.com:50277   ESTABLISHED -
tcp        0      0 mail.mydomain.com:42780   mail.mydomain.com:imap2   TIME_WAIT   -
tcp6       0      0 [::]:ldap               [::]:*                  LISTEN      -
tcp6       0      0 [::]:ssh                [::]:*                  LISTEN      -

2

Re: EC2 AWS Ubuntu 12.04 Can't send nor Receive

2 issues:

1: "(connect to 127.0.0.1[127.0.0.1]:10024: Connection refused)", it means Amavisd service is not running.
2: "TROUBLE in check_mail: virus_scan FAILED: AV: ALL VIRUS SCANNERS FAILED", ClamAV service is not running.

Please restart above two services first, and make sure they're running.

3

Re: EC2 AWS Ubuntu 12.04 Can't send nor Receive

As you should see in my previous post :

ClamAV is running
1256 clamav    20   0 44032 1572  608 S  0.0  0.3   0:52.49 freshclam
8377 clamav    20   0  254m 135m  708 S  0.0 23.0   0:10.56 clamd

Amavisd = amavis ? doesn't want to start for an unknown reason.
sudo /etc/init.d/amavis restart
Stopping amavisd: (not running).
Starting amavisd: (failed).

Haven't done anything other than running the install script...


why don't they actually start ?...

4

Re: EC2 AWS Ubuntu 12.04 Can't send nor Receive

Just noticed this on the console of my EC2 Instance :

75942.993459] Out of memory: Kill process 6863 (clamscan) score 173 or sacrifice child
[75942.993483] Killed process 6863 (clamscan) total-vm:144416kB, anon-rss:104368kB, file-rss:0kB

it's micro instance, could that be cause not enough memory ?
can I totally disable clamscan then ? so it doesn't block emails ?

5

Re: EC2 AWS Ubuntu 12.04 Can't send nor Receive

vaya wrote:

it's micro instance, could that be cause not enough memory ?

Of course.

I think you have to completely disable Amavisd + SpamAssassin + ClamAV to save memory. Commands:

# postconf -e content_filter=''
# /etc/init.d/postfix restart

# update-rc.d amavis remove
# update-rc.d clamav-daemon remove
# update-rc.d clamav-freshclam remove

# /etc/init.d/amavis stop
# /etc/init.d/clamav-daemon stop
# /etc/init.d/clamav-freshclam stop
vaya wrote:

- the latested iRedAdminPro

Don't forget to disable Amavisd integration in iRedAdmin-Pro config file, settings.ini:

[amavisd]
logging_into_sql = False
...

6

Re: EC2 AWS Ubuntu 12.04 Can't send nor Receive

Fixed ! thank you , I am now able to send and receive on an EC2 micro.

I however have an other issue with my EC2 amazon Instance IP  :

Warning - Reverse DNS does not match SMTP Banner

because my Elastic IP resolves to ec2-xxx-xxx-xxx.compute-1.amazonaws.com

So,

I would like to use Amazon SES smtp relay.

Would you know how to setup iRedMail to send all mail using amazon smtp relay ?

7

Re: EC2 AWS Ubuntu 12.04 Can't send nor Receive

You need Postfix option: relayhost.
Reference: http://www.postfix.org/postconf.5.html#relayhost