1 (edited by jacksonbenete 2013-03-25 20:27:49)

Topic: [SOLVED] iRedMail doesn't works sending or receiving mail

==== ==== Required information ====
- iRedMail version: 0.8.3
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): MySQL
- Linux/BSD distribution name and version: Ubuntu Server 12.04 64bits (VPS in DigitalOcean)
- Related log if you're reporting an issue: (see below)
====

Hello guys, I try to install iRedMail but it doesn't work.
I don't know if is some wrong configuration in DNS or if is the configuration of postfix/iredmail... I doesn't understand of servers too much, I'm trying to learn.

This is my configuration of DNS configuration on DigitalOcean:
http://img199.imageshack.us/img199/4358/dns21march.png

This is my configuration of /etc/hosts
http://www.vereadordemirai.com.br/hosts.txt

The configuration of /etc/hostname
http://www.vereadordemirai.com.br/hostname.txt

This is the result of dig mx
http://www.vereadordemirai.com.br/digmx.txt

This is the result of tail in /var/log/mail.log
http://www.vereadordemirai.com.br/log.txt

Here you can login into roundcube to see the iRedMail is installed right
mx.vereadordemirai.com.br
user: teste@vereadordemirai.com.br
pass: teste

I don't know what can be wrong, a lot of friends try to help-me but anyone solves the problem, tried until the irc channel of iredmail... Would someone help me solving the problem? big_smile

Thanks!

----

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

2

Re: [SOLVED] iRedMail doesn't works sending or receiving mail

Hey Jackson:

Check to see that amavisd is running and that you have an entry that looks like this in /etc/amavisd.conf

$inet_socket_port = 10024;

3

Re: [SOLVED] iRedMail doesn't works sending or receiving mail

Just try to restart Amavisd service first, then try send email again:

# /etc/init.d/amavis restart

Monitor Postfix/Dovecot log files, and paste related error log. Log files are: /var/log/mail.log, /var/log/dovecot.log, /var/log/sieve.log.

4 (edited by jacksonbenete 2013-03-22 01:02:42)

Re: [SOLVED] iRedMail doesn't works sending or receiving mail

Looks like the Amavis was not running, I cannot find the /etc/amavisd.conf file, the file doesn't not exist.
So, when I did the "service amavis restart" the terminal returned
"Stopping amavisd: (not running).
Starting amavisd: amavisd-new."

Now with it running, I tried to send another e-mail, but don't works again.

/var/log/mail.log

Mar 21 13:52:54 mx postfix/smtp[3099]: 5B1EA610F8: to=<teste@vereadordemirai.com.br>, relay=127.0.0.1[127.0.0.1]:10024, delay=18379, delays=18372/0.02/0.01/7.2, dsn=4.5.0, status=deferred (host 127.0.0.1[127.0.0.1] said: 451 4.5.0 Error in processing, id=03079-01, virus_scan FAILED: AV: ALL VIRUS SCANNERS FAILED (in reply to end of DATA command))
Mar 21 13:52:55 mx amavis[3078]: (03078-02) (!!)file(1) utility (/usr/bin/file) FAILED: run_command: can't fork: Cannot allocate memory at /usr/sbin/amavisd-new line 3081.
Mar 21 13:52:56 mx amavis[3078]: (03078-02) (!)ClamAV-clamd: Can't connect to UNIX socket /tmp/clamd.socket: No such file or directory, retrying (2)
Mar 21 13:53:02 mx amavis[3078]: (03078-02) (!)ClamAV-clamd av-scanner FAILED: run_av error: Too many retries to talk to /tmp/clamd.socket (Can't connect to UNIX socket /tmp/clamd.socket: No such file or directory) at (eval 102) line 375.\n
Mar 21 13:53:02 mx amavis[3078]: (03078-02) (!!)WARN: all primary virus scanners failed, considering backups
Mar 21 13:53:02 mx amavis[3078]: (03078-02) (!)run_av (ClamAV-clamscan): run_command: can't fork: Cannot allocate memory at /usr/sbin/amavisd-new line 3081.
Mar 21 13:53:02 mx amavis[3078]: (03078-02) (!)ClamAV-clamscan av-scanner FAILED: /usr/bin/clamscan run_command: can't fork: Cannot allocate memory at /usr/sbin/amavisd-new line 3081. at (eval 102) line 596.
Mar 21 13:53:02 mx amavis[3078]: (03078-02) (!!)TROUBLE in check_mail: virus_scan FAILED: AV: ALL VIRUS SCANNERS FAILED
Mar 21 13:53:02 mx amavis[3078]: (03078-02) (!)PRESERVING EVIDENCE in /var/lib/amavis/tmp/amavis-20130321T135254-03078
Mar 21 13:53:02 mx postfix/smtp[3101]: 96B18611AB: to=<jacksonbenete@gmail.com>, relay=127.0.0.1[127.0.0.1]:10024, delay=12, delays=1.1/4.3/0.02/7.1, dsn=4.5.0, status=deferred (host 127.0.0.1[127.0.0.1] said: 451 4.5.0 Error in processing, id=03078-02, virus_scan FAILED: AV: ALL VIRUS SCANNERS FAILED (in reply to end of DATA command))

/var/log/dovecot.log

Mar 21 13:52:54 imap-login: Info: Login: user=<teste@vereadordemirai.com.br>, method=PLAIN, rip=127.0.0.1, lip=127.0.0.1, mpid=3131, secured
Mar 21 13:52:54 imap(teste@vereadordemirai.com.br): Info: Disconnected: Logged out bytes=303/1443
Mar 21 13:52:54 imap-login: Info: Login: user=<teste@vereadordemirai.com.br>, method=PLAIN, rip=127.0.0.1, lip=127.0.0.1, mpid=3133, secured
Mar 21 13:52:54 imap(teste@vereadordemirai.com.br): Info: Disconnected: Logged out bytes=233/876
Mar 21 13:53:54 imap-login: Info: Login: user=<teste@vereadordemirai.com.br>, method=PLAIN, rip=127.0.0.1, lip=127.0.0.1, mpid=3137, secured
Mar 21 13:53:54 imap(teste@vereadordemirai.com.br): Info: Disconnected: Logged out bytes=352/2089
Mar 21 13:54:55 imap-login: Info: Login: user=<teste@vereadordemirai.com.br>, method=PLAIN, rip=127.0.0.1, lip=127.0.0.1, mpid=3139, secured
Mar 21 13:54:55 imap(teste@vereadordemirai.com.br): Info: Disconnected: Logged out bytes=352/2089
Mar 21 13:55:54 imap-login: Info: Login: user=<teste@vereadordemirai.com.br>, method=PLAIN, rip=127.0.0.1, lip=127.0.0.1, mpid=3142, secured
Mar 21 13:55:54 imap(teste@vereadordemirai.com.br): Info: Disconnected: Logged out bytes=352/2089

/var/log/sieve.log

Mar 21 08:06:02 lda(jackson): Fatal: setgid(1001(vmail) from mail_gid setting) failed with euid=1000(jackson), gid=1000(jackson), egid=1000(jackson): Operation not permitted (This binary should probably be called with process group set to 1001(vmail) instead of 1000(jackson))
Mar 21 08:06:02 lda(postmaster@vereadordemirai.com.br): Info: msgid=<20130321110602.ABFA861183@mx.vereadordemirai.com.br>: saved mail to INBOX
Mar 21 08:41:02 lda(postmaster@vereadordemirai.com.br): Info: msgid=<20130321113407.05CB36127E@mx.vereadordemirai.com.br>: saved mail to INBOX
Mar 21 08:43:14 lda(postmaster@vereadordemirai.com.br): Info: msgid=<20130321114257.03099612BD@mx.vereadordemirai.com.br>: saved mail to INBOX
Mar 21 09:12:46 lda(jackson): Fatal: setgid(1001(vmail) from mail_gid setting) failed with euid=1000(jackson), gid=1000(jackson), egid=1000(jackson): Operation not permitted (This binary should probably be called with process group set to 1001(vmail) instead of 1000(jackson))
Mar 21 10:22:46 lda(jackson): Fatal: setgid(1001(vmail) from mail_gid setting) failed with euid=1000(jackson), gid=1000(jackson), egid=1000(jackson): Operation not permitted (This binary should probably be called with process group set to 1001(vmail) instead of 1000(jackson))
Mar 21 11:22:47 lda(teste@vereadordemirai.com.br): Info: msgid=<20130321142247.25EF161181@mx.vereadordemirai.com.br>: saved mail to INBOX
Mar 21 11:32:47 lda(jackson): Fatal: setgid(1001(vmail) from mail_gid setting) failed with euid=1000(jackson), gid=1000(jackson), egid=1000(jackson): Operation not permitted (This binary should probably be called with process group set to 1001(vmail) instead of 1000(jackson))
Mar 21 12:06:06 lda(jackson): Fatal: setgid(1001(vmail) from mail_gid setting) failed with euid=1000(jackson), gid=1000(jackson), egid=1000(jackson): Operation not permitted (This binary should probably be called with process group set to 1001(vmail) instead of 1000(jackson))
Mar 21 13:12:47 lda(jackson): Fatal: setgid(1001(vmail) from mail_gid setting) failed with euid=1000(jackson), gid=1000(jackson), egid=1000(jackson): Operation not permitted (This binary should probably be called with process group set to 1001(vmail) instead of 1000(jackson))

sad

5

Re: [SOLVED] iRedMail doesn't works sending or receiving mail

1. Please update your ClamAV signatures with command 'freshclam' immediately, then restart ClamAV and Amavisd services.

# freshclam
# /etc/init.d/clamav-daemon restart
# /etc/init.d/amavis restart

2.

Mar 21 11:32:47 lda(jackson): Fatal: setgid(1001(vmail) from mail_gid setting) failed with euid=1000(jackson), gid=1000(jackson), egid=1000(jackson): Operation not permitted (This binary should probably be called with process group set to 1001(vmail) instead of 1000(jackson))

This is unexpected. Did you modify Dovecot config file? Please show us output of command "dovecot -n" here to help troubleshoot.

6 (edited by jacksonbenete 2013-03-22 19:51:58)

Re: [SOLVED] iRedMail doesn't works sending or receiving mail

ZhangHuangbin wrote:

1. Please update your ClamAV signatures with command 'freshclam' immediately, then restart ClamAV and Amavisd services.

When I updated I notice that not really outdated, just 0.0.1 version, anyway this is now updated.

WARNING: Your ClamAV installation is OUTDATED!
WARNING: Local version: 0.97.6 Recommended version: 0.97.7
...
Database updated (2025311 signatures) from db.local.clamav.net (IP: 208.72.56.53)

But when I tried to restart the service, it fail starting.

root@mx:/home/jackson# /etc/init.d/clamav-daemon restart
 * Stopping ClamAV daemon clamd                                          [ OK ]
 * Starting ClamAV daemon clamd                                          [fail]

This is unexpected. Did you modify Dovecot config file? Please show us output of command "dovecot -n" here to help troubleshoot.

I don't remember to did any modification on Dovecot configuration, probably not because I don't modified too much archives since the installation.

# 2.0.19: /etc/dovecot/dovecot.conf
# OS: Linux 3.2.0-23-virtual x86_64 Ubuntu 12.04 LTS 
auth_mechanisms = PLAIN LOGIN
dict {
  acl = mysql:/etc/dovecot/dovecot-share-folder.conf
  expire = db:/var/lib/dovecot/expire/expire.db
  quotadict = mysql:/etc/dovecot/dovecot-used-quota.conf
}
first_valid_uid = 1001
last_valid_uid = 1001
listen = *
log_path = /var/log/dovecot.log
mail_gid = 1001
mail_location = maildir:/%Lh/Maildir/:INDEX=/%Lh/Maildir/
mail_uid = 1001
managesieve_notify_capability = mailto
managesieve_sieve_capability = fileinto reject envelope encoded-character vacation subaddress comparator-i;ascii-numeric relational regex imap4flags copy include variables body enotify environment mailbox date ihave
namespace {
  inbox = yes
  location = 
  prefix = 
  separator = /
  type = private
}
namespace {
  list = children
  location = maildir:/%%Lh/Maildir/:INDEX=/%%Lh/Maildir/Shared/%%u
  prefix = Shared/%%u/
  separator = /
  subscriptions = yes
  type = shared
}
passdb {
  args = /etc/dovecot/dovecot-mysql.conf
  driver = sql
}
plugin {
  acl = vfile
  acl_shared_dict = proxy::acl
  auth_socket_path = /var/run/dovecot/auth-master
  autocreate = INBOX
  autocreate2 = Sent
  autocreate3 = Trash
  autocreate4 = Drafts
  autocreate5 = Junk
  autosubscribe = INBOX
  autosubscribe2 = Sent
  autosubscribe3 = Trash
  autosubscribe4 = Drafts
  autosubscribe5 = Junk
  expire = Trash 7 Trash/* 7 Junk 30
  expire_dict = proxy::expire
  quota = dict:user::proxy::quotadict
  quota_rule = *:storage=1G
  quota_warning = storage=85%% quota-warning 85 %u
  quota_warning2 = storage=90%% quota-warning 90 %u
  quota_warning3 = storage=95%% quota-warning 95 %u
  sieve = /%Lh/sieve/dovecot.sieve
  sieve_dir = /%Lh/sieve
  sieve_global_dir = /var/vmail/sieve
  sieve_global_path = /var/vmail/sieve/dovecot.sieve
}
protocols = pop3 imap sieve
service auth {
  unix_listener /var/spool/postfix/dovecot-auth {
    group = postfix
    mode = 0666
    user = postfix
  }
  unix_listener auth-master {
    group = vmail
    mode = 0666
    user = vmail
  }
  unix_listener auth-userdb {
    group = vmail
    mode = 0660
    user = vmail
  }
}
service dict {
  unix_listener dict {
    group = vmail
    mode = 0660
    user = vmail
  }
}
service quota-warning {
  executable = script /usr/local/bin/dovecot-quota-warning.sh
  unix_listener quota-warning {
    group = vmail
    mode = 0660
    user = vmail
  }
}
ssl = required
ssl_cert = </etc/ssl/certs/iRedMail_CA.pem
ssl_key = </etc/ssl/private/iRedMail.key
userdb {
  args = /etc/dovecot/dovecot-mysql.conf
  driver = sql
}
protocol lda {
  auth_socket_path = /var/run/dovecot/auth-master
  lda_mailbox_autocreate = yes
  log_path = /var/log/sieve.log
  mail_plugins = quota sieve autocreate
  postmaster_address = root
}
protocol imap {
  imap_client_workarounds = tb-extra-mailbox-sep
  mail_plugins = quota imap_quota autocreate
}
protocol pop3 {
  mail_plugins = quota
  pop3_client_workarounds = outlook-no-nuls oe-ns-eoh
  pop3_uidl_format = %08Xu%08Xv
}

Sorry for giving all this work. =/
And thanks for the help so far. smile

7

Re: [SOLVED] iRedMail doesn't works sending or receiving mail

Any related error log in ClamAV log file? check /var/log/clamav/ and/or /var/log/messages.

8

Re: [SOLVED] iRedMail doesn't works sending or receiving mail

/var/log/clamav/clamav.log is empty and /var/log/messages is a directory here, so I have those subdirectories

root@mx:/home/jackson# tail /var/log/messages .
./             .bash_history  .bashrc        .profile
../            .bash_logout   .cache/        .ssh/

Maybe if I remove the clamav completely and install it again, or maybe I can run the iRedMail withou the clamav antivirus, the iRedMail will work without clamav or it is some kind of dependencie?

9

Re: [SOLVED] iRedMail doesn't works sending or receiving mail

Currently, the root cause (as far as we can see) is ClamAV cannot start. I think we can focus on how to solve this instead of disabling ClamAV.

Please try to enable 'LogFile' setting in ClamAV config file /etc/clamav/clamd.conf, then restart /etc/init.d/clamav-daemon again and check the log file specified in 'LogFile' setting. Paste related error log here if you don't understand what it means.

10

Re: [SOLVED] iRedMail doesn't works sending or receiving mail

jackson@mx:~$ sudo tail /var/log/clamav/clamav.log
sudo: /var/lib/sudo writable by non-owner (040777), should be mode 0700
[sudo] password for jackson:
Sun Mar 24 21:39:53 2013 -> clamd daemon 0.97.6 (OS: linux-gnu, ARCH: x86_64, CPU: x86_64)
Sun Mar 24 21:39:53 2013 -> Log file size limited to 1048576 bytes.
Sun Mar 24 21:39:53 2013 -> Reading databases from /var/lib/clamav
Sun Mar 24 21:39:53 2013 -> Not loading PUA signatures.
Sun Mar 24 21:39:53 2013 -> Bytecode: Security mode set to "TrustSigned".
Sun Mar 24 21:39:57 2013 -> Loaded 2021417 signatures.
Sun Mar 24 21:39:58 2013 -> LOCAL: Unix socket file /tmp/clamd.socket
Sun Mar 24 21:39:58 2013 -> LOCAL: Setting connection queue length to 15
Sun Mar 24 21:39:58 2013 -> ERROR: daemonize() failed: Cannot allocate memory
Sun Mar 24 21:39:58 2013 -> Socket file removed.

I tried to reconfigure the clamav at dpkg-reconfigure clamav-base but doesn't work too... I will try to uninstall clamav and install again.

11

Re: [SOLVED] iRedMail doesn't works sending or receiving mail

I tried to uninstall and install again but nothing.
So, I made some little configurations that a I see in a website and the clamav starts sucessfully.
I have allocated some RAM space in the vps using like this:

dd if=/dev/zero of=/swap bs=1024 count=500000
mkswap /swap && chown root. /swap && chmod 0600 /swap && swapon /swap
echo /swap swap swap defaults 0 0 >> /etc/fstab
echo vm.swappiness = 0 >> /etc/sysctl.conf && sysctl -p

So I added two records in the TXT on dns configuration

@    
v=spf1 ip4:198.211.112.217 -all

and

dkim._domainkey    
"v=DKIM1; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDkNhaI+xe1qlRVfxH5b32TXhT+dM484zPC6idnPDAfEDlZ4F....

But it doesn't works yet. I receive some errors sending the e-mail and some errors receiving and e-mail.

SENDING

root@mx:~/iRedMail-0.8.3# tail /var/log/mail.log
Mar 24 22:16:04 mx postfix/master[2000]: warning: process /usr/lib/postfix/smtp pid 3455 exit status 1
Mar 24 22:16:04 mx postfix/master[2000]: warning: /usr/lib/postfix/smtp: bad command startup -- throttling
Mar 24 22:16:12 mx postfix/smtpd[3456]: connect from localhost[127.0.0.1]
Mar 24 22:16:12 mx postfix/smtpd[3456]: 8E4BC61208: client=localhost[127.0.0.1], sasl_method=LOGIN, sasl_username=teste@vereadordemirai.com.br
Mar 24 22:16:13 mx postfix/cleanup[3465]: 8E4BC61208: message-id=<1c33bcb25d621fd6c79a74fe507385e9@vereadordemirai.com.br>
Mar 24 22:16:13 mx roundcube: User teste@vereadordemirai.com.br [186.212.178.199]; Message for jacksonbenete@gmail.com; 250: 2.0.0 Ok: queued as 8E4BC61208
Mar 24 22:16:13 mx postfix/qmgr[24058]: 8E4BC61208: from=<teste@vereadordemirai.com.br>, size=587, nrcpt=1 (queue active)
Mar 24 22:16:13 mx postfix/smtp[3474]: connect to 127.0.0.1[127.0.0.1]:10024: Connection refused
Mar 24 22:16:13 mx postfix/smtp[3474]: 8E4BC61208: to=<jacksonbenete@gmail.com>, relay=none, delay=1.6, delays=1.6/0.01/0/0, dsn=4.4.1, status=deferred (connect to 127.0.0.1[127.0.0.1]:10024: Connection refused)
Mar 24 22:16:13 mx postfix/smtpd[3456]: disconnect from localhost[127.0.0.1]

RECEIVING

root@mx:~/iRedMail-0.8.3# tail /var/log/mail.log
Mar 24 22:16:30 mx postfix/scache[2662]: statistics: domain lookup hits=0 miss=1 success=0%
Mar 24 22:16:30 mx postfix/scache[2662]: statistics: address lookup hits=0 miss=1 success=0%
Mar 24 22:16:43 mx postfix/smtpd[3456]: connect from mail-bk0-f46.google.com[209.85.214.46]
Mar 24 22:16:43 mx cbpolicyd[3114]: module=Greylisting, action=pass, host=209.85.214.46, helo=mail-bk0-f46.google.com, from=jacksonbenete@gmail.com, to=teste@vereadordemirai.com.br, reason=authenticated
Mar 24 22:16:43 mx postfix/smtpd[3456]: C37526110C: client=mail-bk0-f46.google.com[209.85.214.46]
Mar 24 22:16:45 mx postfix/cleanup[3465]: C37526110C: message-id=<CAAgU6uossM60Ojp+68-4pmuu_bG7zWjj82C9daowFUjM1JekPg@mail.gmail.com>
Mar 24 22:16:45 mx postfix/qmgr[24058]: C37526110C: from=<jacksonbenete@gmail.com>, size=1768, nrcpt=1 (queue active)
Mar 24 22:16:45 mx postfix/smtp[3474]: connect to 127.0.0.1[127.0.0.1]:10024: Connection refused
Mar 24 22:16:45 mx postfix/smtp[3474]: C37526110C: to=<teste@vereadordemirai.com.br>, relay=none, delay=1.4, delays=1.4/0/0/0, dsn=4.4.1, status=deferred (connect to 127.0.0.1[127.0.0.1]:10024: Connection refused)
Mar 24 22:16:45 mx postfix/smtpd[3456]: disconnect from mail-bk0-f46.google.com[209.85.214.46]

=/

12

Re: [SOLVED] iRedMail doesn't works sending or receiving mail

jacksonbenete wrote:

Sun Mar 24 21:39:58 2013 -> ERROR: daemonize() failed: Cannot allocate memory

It's now clear that ClamAV cannot start due to lack of memory. You can either add more memory or disable virus scanning on this server by following below steps:

1. Disable virus scanning in Amavisd. Find below line in /etc/amavis/conf.d/*.

# @bypass_virus_checks_maps = (1);  # controls running of anti-virus code

Note: There may be duplicate lines in several lines, make sure you have only one enabled.

2. Remove the first '# ', then restart Amavisd service.

# /etc/init.d/amavis restart

3. Disable ClamAV services.

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

4. Now flush the queue and try to send a testing email with Roundcube webmail.

# postqueue -f

13

Re: [SOLVED] iRedMail doesn't works sending or receiving mail

Awesome ZhangHuangbin, now it works!

Really thank you, I don't know how to thank, I appreciate your patience and their willingness to help, I will never forget what you do to me here. wink

Now I will try to install it again in another server to learn how to do it right for the next time.

God bless you, awesome support of iRedMail!