1

Topic: Sending and Receiving Emails

==== Required information ====
- iRedMail version (check /etc/iredmail-release): 0.9.5-1
- Linux/BSD distribution name and version: CentOS 7
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): MySQL
- Web server (Apache or Nginx): Nginx
- Manage mail accounts with iRedAdmin-Pro? no
- Related log if you're reporting an issue: yes
=

I am having issues sending and receiving emails. Here is a snap shot of the error I get. If I need to post more just let me know.

Oct 13 09:18:46 webmail postfix/postfix-script[4056]: stopping the Postfix mail system
Oct 13 09:18:46 webmail postfix/master[3978]: terminating on signal 15
Oct 13 09:18:47 webmail postfix/postfix-script[4140]: warning: /var/spool/postfix/etc/resolv.conf and /etc/resolv.conf differ
Oct 13 09:18:47 webmail postfix/postfix-script[4145]: starting the Postfix mail system
Oct 13 09:18:47 webmail postfix/master[4147]: daemon started -- version 2.10.1, configuration /etc/postfix
Oct 13 09:18:47 webmail postfix/qmgr[4149]: 367318508E: from=<mbump@lorik.us>, size=995, nrcpt=1 (queue active)
Oct 13 09:18:47 webmail postfix/qmgr[4149]: 66E44CAFD6: from=<mbump@lorik.us>, size=506, nrcpt=1 (queue active)
Oct 13 09:18:47 webmail postfix/smtp[4151]: connect to 127.0.0.1[127.0.0.1]:10024: Connection refused
Oct 13 09:18:47 webmail postfix/smtp[4153]: connect to 127.0.0.1[127.0.0.1]:10026: Connection refused
Oct 13 09:18:47 webmail postfix/smtp[4151]: 367318508E: to=<mbump@bumpnet.org>, relay=none, delay=13016, delays=13016/0.03/0/0, dsn=4.4.1, status=deferred (connect to 127.0.0.1[127.0.0.1]:10024: Co
nnection refused)
Oct 13 09:18:47 webmail postfix/smtp[4153]: 66E44CAFD6: to=<mbump314@gmail.com>, relay=none, delay=2503, delays=2503/0.02/0/0, dsn=4.4.1, status=deferred (connect to 127.0.0.1[127.0.0.1]:10026: Con
nection refused)

----

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

2 (edited by brix 2016-10-14 04:39:13)

Re: Sending and Receiving Emails

Seems like Amavis is not running, check if it's running with this command:
systemctl status amavisd

and start if it's stopped:
systemctl start amavisd

or restart:
systemctl restart amavisd

If Amavis doesn't want to start, please post the logs.
Are there any other errors in the log file?
Hope it helps.

3

Re: Sending and Receiving Emails

Looks like you were correct. I got many errors. Here it is below:


[root@webmail ~]# systemctl status amavisd
● amavisd.service - Amavisd-new is an interface between MTA and content checkers.
   Loaded: loaded (/usr/lib/systemd/system/amavisd.service; enabled; vendor preset: disabled)
   Active: failed (Result: start-limit) since Thu 2016-10-13 10:25:59 CDT; 1min 27s ago
     Docs: http://www.ijs.si/software/amavisd/#doc
  Process: 2810 ExecStart=/usr/sbin/amavisd -c /etc/amavisd/amavisd.conf (code=exited, status=255)

Oct 13 10:25:59 webmail systemd[1]: Failed to start Amavisd-new is an interface between MTA and content checkers..
Oct 13 10:25:59 webmail systemd[1]: Unit amavisd.service entered failed state.
Oct 13 10:25:59 webmail systemd[1]: amavisd.service failed.
Oct 13 10:25:59 webmail systemd[1]: amavisd.service holdoff time over, scheduling restart.
Oct 13 10:25:59 webmail systemd[1]: start request repeated too quickly for amavisd.service
Oct 13 10:25:59 webmail systemd[1]: Failed to start Amavisd-new is an interface between MTA and content checkers..
Oct 13 10:25:59 webmail systemd[1]: Unit amavisd.service entered failed state.
Oct 13 10:25:59 webmail systemd[1]: amavisd.service failed.

Thanks again for the help!!

4

Re: Sending and Receiving Emails

There is probably more info inside log file. Please restart Amavis again, check and post what it outputs to /var/log/syslog.

5

Re: Sending and Receiving Emails

this is what I get when restarting.

Oct 14 01:07:28 webmail amavisd[12232]: Error in config file "/etc/amavisd/amavisd.conf": Global symbol "@lorik" requires explicit package name at /etc/amavisd/amavisd.conf line 505.
Oct 14 01:07:28 webmail amavisd[12232]: Global symbol "@lorik" requires explicit package name at /etc/amavisd/amavisd.conf line 505.
Oct 14 01:07:28 webmail amavisd[12232]: Global symbol "@lorik" requires explicit package name at /etc/amavisd/amavisd.conf line 535.
Oct 14 01:07:28 webmail amavisd[12232]: Global symbol "@lorik" requires explicit package name at /etc/amavisd/amavisd.conf line 535.
Oct 14 01:07:28 webmail systemd[1]: amavisd.service: control process exited, code=exited status=255
Oct 14 01:07:28 webmail systemd[1]: Failed to start Amavisd-new is an interface between MTA and content checkers..

6

Re: Sending and Receiving Emails

There are some problems in the Amavis config file. Did you maybe modified the config file manually? If yes, what did you modify?

Please run Amavis in debug mode and post the output:
/usr/sbin/amavisd  -c /etc/amavisd/amavisd.conf debug

Maybe check the config file -  /etc/amavisd/amavisd.conf - around the error lines (505, 535) and post the findings.

7

Re: Sending and Receiving Emails

This is what happens when I ran the debug script.

[root@webmail ~]# /usr/sbin/amavisd  -c /etc/amavisd/amavisd.conf debug
Error in config file "/etc/amavisd/amavisd.conf": Global symbol "@lorik" requires explicit package name at /etc/amavisd/amavisd.conf line 505.
Global symbol "@lorik" requires explicit package name at /etc/amavisd/amavisd.conf line 505.
Global symbol "@lorik" requires explicit package name at /etc/amavisd/amavisd.conf line 535.
Global symbol "@lorik" requires explicit package name at /etc/amavisd/amavisd.conf line 535.


And here is what is in the config file.

# Add dkim_key here.
dkim_key("postmaster@lorik.us", "dkim", "/var/lib/dkim/postmaster@lorik.us.pem");

# Note that signing mail for subdomains with a key of a parent
# domain is treated by recipients as a third-party key, which
# may 'hold less merit' in their eyes. If one has a choice,
# it is better to publish a key for each domain (e.g. host1.a.cn)
# if mail is really coming from it. Sharing a pem file
# for multiple domains may be acceptable, so you don't need
# to generate a different key for each subdomain, but you
# do need to publish it in each subdomain. It is probably
# easier to avoid sending addresses like host1.a.cn and
# always use a parent domain (a.cn) in 'From:', thus
# avoiding the issue altogether.
#dkim_key("host1.postmaster@lorik.us", "dkim", "/var/lib/dkim/postmaster@lorik.us.pem");
#dkim_key("host3.postmaster@lorik.us", "dkim", "/var/lib/dkim/postmaster@lorik.us.pem");

# Add new dkim_key for other domain.
#dkim_key('Your_New_Domain_Name', 'dkim', 'Your_New_Pem_File');

@dkim_signature_options_bysender_maps = ( {
    # ------------------------------------
    # For domain: postmaster@lorik.us.
    # ------------------------------------
    # 'd' defaults to a domain of an author/sender address,
    # 's' defaults to whatever selector is offered by a matching key

    #'postmaster@lorik.us'    => { d => "postmaster@lorik.us", a => 'rsa-sha256', ttl =>  7*24*3600 },
    #"spam-reporter@postmaster@lorik.us"    => { d => "postmaster@lorik.us", a => 'rsa-sha256', ttl =>  7*24*3600 },

    # explicit 'd' forces a third-party signature on foreign (hosted) domains
    "postmaster@lorik.us"  => { d => "postmaster@lorik.us", a => 'rsa-sha256', ttl => 10*24*3600 },
    #"host1.postmaster@lorik.us"  => { d => "host1.postmaster@lorik.us", a => 'rsa-sha256', ttl => 10*24*3600 },
    #"host2.postmaster@lorik.us"  => { d => "host2.postmaster@lorik.us", a => 'rsa-sha256', ttl => 10*24*3600 },
    # ---- End domain: postmaster@lorik.us -

8

Re: Sending and Receiving Emails

I didn't change this configuration manually, but when I finished the install I had to edit the sql table for username. When the install finished the username was "postmaster@postmaster@lorik.us". I changed that to postmaster@lorik.us. I couldn't login to iredadmin, because it was invalid email. That's all I changed after the install. Thank you again for the help.

mbump wrote:

This is what happens when I ran the debug script.

[root@webmail ~]# /usr/sbin/amavisd  -c /etc/amavisd/amavisd.conf debug
Error in config file "/etc/amavisd/amavisd.conf": Global symbol "@lorik" requires explicit package name at /etc/amavisd/amavisd.conf line 505.
Global symbol "@lorik" requires explicit package name at /etc/amavisd/amavisd.conf line 505.
Global symbol "@lorik" requires explicit package name at /etc/amavisd/amavisd.conf line 535.
Global symbol "@lorik" requires explicit package name at /etc/amavisd/amavisd.conf line 535.


And here is what is in the config file.

# Add dkim_key here.
dkim_key("postmaster@lorik.us", "dkim", "/var/lib/dkim/postmaster@lorik.us.pem");

# Note that signing mail for subdomains with a key of a parent
# domain is treated by recipients as a third-party key, which
# may 'hold less merit' in their eyes. If one has a choice,
# it is better to publish a key for each domain (e.g. host1.a.cn)
# if mail is really coming from it. Sharing a pem file
# for multiple domains may be acceptable, so you don't need
# to generate a different key for each subdomain, but you
# do need to publish it in each subdomain. It is probably
# easier to avoid sending addresses like host1.a.cn and
# always use a parent domain (a.cn) in 'From:', thus
# avoiding the issue altogether.
#dkim_key("host1.postmaster@lorik.us", "dkim", "/var/lib/dkim/postmaster@lorik.us.pem");
#dkim_key("host3.postmaster@lorik.us", "dkim", "/var/lib/dkim/postmaster@lorik.us.pem");

# Add new dkim_key for other domain.
#dkim_key('Your_New_Domain_Name', 'dkim', 'Your_New_Pem_File');

@dkim_signature_options_bysender_maps = ( {
    # ------------------------------------
    # For domain: postmaster@lorik.us.
    # ------------------------------------
    # 'd' defaults to a domain of an author/sender address,
    # 's' defaults to whatever selector is offered by a matching key

    #'postmaster@lorik.us'    => { d => "postmaster@lorik.us", a => 'rsa-sha256', ttl =>  7*24*3600 },
    #"spam-reporter@postmaster@lorik.us"    => { d => "postmaster@lorik.us", a => 'rsa-sha256', ttl =>  7*24*3600 },

    # explicit 'd' forces a third-party signature on foreign (hosted) domains
    "postmaster@lorik.us"  => { d => "postmaster@lorik.us", a => 'rsa-sha256', ttl => 10*24*3600 },
    #"host1.postmaster@lorik.us"  => { d => "host1.postmaster@lorik.us", a => 'rsa-sha256', ttl => 10*24*3600 },
    #"host2.postmaster@lorik.us"  => { d => "host2.postmaster@lorik.us", a => 'rsa-sha256', ttl => 10*24*3600 },
    # ---- End domain: postmaster@lorik.us -

9

Re: Sending and Receiving Emails

Well as far as I know, iRedMail doesn't officially support per user DKIM keys, so you have to change the config to include just the domain part.
Rename key file

mv /var/lib/dkim/postmaster@lorik.us.pem /var/lib/dkim/lorik.us.pem

Change in Amavis config from:

dkim_key("postmaster@lorik.us", "dkim", "/var/lib/dkim/postmaster@lorik.us.pem");

to:

dkim_key("lorik.us", "dkim", "/var/lib/dkim/lorik.us.pem");

Also change in Amavis config from:

"postmaster@lorik.us"  => { d => "postmaster@lorik.us", a => 'rsa-sha256', ttl => 10*24*3600 }, 

to:

"lorik.us"  => { d => "lorik.us", a => 'rsa-sha256', ttl => 10*24*3600 }, 

Then restart Amavis
Hope it helps