1 (edited by lug 2018-01-11 23:31:03)

Topic: Show unkown domains in iredadmin webinterface

==== Required information ====
- iRedMail version (check /etc/iredmail-release): 0.9.7
- Linux/BSD distribution name and version: ubuntu 16.04.3 LTS
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): mysql
- Web server (Apache or Nginx): nginx
- Manage mail accounts with iRedAdmin-Pro? yes
- [IMPORTANT] Related original log or error message is required if you're experiencing an issue.
====

Hi,

one of my mailservers use case is to relay emails from customers who have a dynamic ip or dont want to send emails directly into the web. Therefore they get a user account like customer1@relay.com.
In their local mailserver they use relay.com as smarthost, and are allowed to send as their actual email, not as customer1@relay.com only. For example they send as info@customer1.com, but authenticate as customer1@relay.com

To do this I've put
ALLOWED_LOGIN_MISMATCH_SENDERS = ['customer1@relay.com']
into the iredapd settings file, and that works so far.

BUT, in the iredadmin webinterface, these senders are not shown in the statistics.
The only way to show these is to create the domain they are sending as, in this case customer1.com.

That shows the senders in the stats, but then theres another problem. If there is a second customer and customer 1 wants to send to customer 2, the iredmail server tries to deliver it locally, which doesn't work, because the customers have their own mail servers to recieve mails.

So I have to set an recieving smtp relay (Relay received email to smtp:mail.customer1.com:25)
And all this effort (there are many many customers) just to show the senders in the stats.


So, is there any way to show the senders even if they are not in the iredmail servers database?
If not: Feature Request smile

PS: In awstats they are shown, but I'd like to have it all in one gui (the iredadmin)

Thanks!

----

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

2

Re: Show unkown domains in iredadmin webinterface

Could you try this as a quick testing?

*) Backup file "libs/amavisd/log.py" under iRedAdmin-Pro directory first (e.g. copy it to another folder).
*) Open file "libs/amavisd/log.py", find line below (about line 360-361, and 374-375):

            else:
                sql_append_where += ' AND recip.domain IN %s' % quoted_all_reversed_domain_names
...
            else:
                sql_append_where += ' AND sender.domain IN %s' % quoted_all_reversed_domain_names

*) Comment out above 4 lines like below:

            #else:
            #    sql_append_where += ' AND recip.domain IN %s' % quoted_all_reversed_domain_names
...
            #else:
            #   sql_append_where += ' AND sender.domain IN %s' % quoted_all_reversed_domain_names

Restart Apache or uwsgi (if you're running Nginx) service and login to iRedAdmin-Pro, does it work as you expect now?

If it doesn't work, you can still restore the backup file and restart Apache/uwsgi.

lug wrote:

PS: In awstats they are shown, but I'd like to have it all in one gui (the iredadmin)

Awstats parses log file directly, and it has no idea at all which one is local domain.

3

Re: Show unkown domains in iredadmin webinterface

Nope, it doesn't work. Top senders is still empty, as I've sent as a domain which is not stored in iRedMail.

But the test domain which is stored locally is still shown in the stats, so at least the comments didn't break anything smile

4

Re: Show unkown domains in iredadmin webinterface

Is it possible to give me direct ssh access for testing? I'd like to see whether we can make it modular and control it with a switch.

5

Re: Show unkown domains in iredadmin webinterface

Sorry, I cannot do that. Not because I don't trust you, but because of the german privacy policy. (There is userdate of our customers on that server)

Don't you have an iRedMail test-system?

6

Re: Show unkown domains in iredadmin webinterface

lug wrote:

Don't you have an iRedMail test-system?

Sure i have, but getting same setup as yours will take some time, so if i can use an existing server for testing, it will save me a lot time.

7

Re: Show unkown domains in iredadmin webinterface

If you allow me to use the same license I will set up a seconds test vm and apply my confugurations, feed it with fictive data and then ssh access would be no problem smile

8

Re: Show unkown domains in iredadmin webinterface

lug wrote:

If you allow me to use the same license I will set up a seconds test vm and apply my confugurations, feed it with fictive data and then ssh access would be no problem smile

Yes, go ahead. smile

9

Re: Show unkown domains in iredadmin webinterface

Ok cool, whats the best way to submit the credentials to you?

10

Re: Show unkown domains in iredadmin webinterface

^

11

Re: Show unkown domains in iredadmin webinterface

lug wrote:

Ok cool, whats the best way to submit the credentials to you?

Mail me: zhb _at_ iredmail _dot_ org.

12

Re: Show unkown domains in iredadmin webinterface

sent smile

13

Re: Show unkown domains in iredadmin webinterface

In next iRedAdmin-Pro release, you can add setting "AMAVISD_SHOW_NON_LOCAL_DOMAINS = True" in iRedAdmin-Pro config file for this purpose. big_smile

14

Re: Show unkown domains in iredadmin webinterface

Hi, you've made the local patch file for me and it worked, but after upgrading to iredadmin pro 2.9 it stopped working

https://i.imgur.com/CITEDL4.png

/opt/www/iredadmin/settings.py

AMAVISD_SHOW_NON_LOCAL_DOMAINS = True

15

Re: Show unkown domains in iredadmin webinterface

lug wrote:

Hi, you've made the local patch file for me and it worked, but after upgrading to iredadmin pro 2.9 it stopped working

It may take some time, please be patient. I explained this issue in another forum thread:
https://forum.iredmail.org/post62027.html#p62027

16 (edited by lug 2018-04-06 18:44:56)

Re: Show unkown domains in iredadmin webinterface

Hmm, the daily cronjob should've run now, but still the same issue.

Could  ̶y̶o̶u̶  anyone paste the original

/opt/www/iredadmin/libs/amavisd/log.py

so i can check if there are any differenes?

17

Re: Show unkown domains in iredadmin webinterface

Does it work if you set "AMAVISD_SHOW_NON_LOCAL_DOMAINS = False" in iRedAdmin-Pro config file and restart Apache or uwsgi service?

Then set it to True again.

18 (edited by lug 2018-04-09 16:22:04)

Re: Show unkown domains in iredadmin webinterface

AMAVISD_SHOW_NON_LOCAL_DOMAINS = False

https://i.imgur.com/47ysUkg.png

AMAVISD_SHOW_NON_LOCAL_DOMAINS = True

https://i.imgur.com/hOhVQ8E.png

19

Re: Show unkown domains in iredadmin webinterface

Try this:

*) Login to iRedAdmin-Pro as global admin.
*) Deal with the quarantined emails first, make sure no quarantined emails left.
*) Login to MySQL server as root user, clean up all SQL records in few Amavisd tables, then wait for some inbound/outbound emails, and check the iRedAdmin-Pro Dashboard again:

USE amavisd;
TRUNCATE msgs;
TRUNCATE msgrcpt;
TRUNCATE maddr;

20

Re: Show unkown domains in iredadmin webinterface

It's working for me. Thank you very much! smile