Change Ports or Modify Reports

Report bugs and workarounds
Post Reply
pipjo
Posts: 43
Joined: 06 Jul 2017 09:08

Change Ports or Modify Reports

Post by pipjo »

I have eFa pretty much configured now apart from one issue.

Yesterday shawniverson fixed the issue I had with not being able to mark mails as spam from the footer text on the email. It turns out this was because I have to use port forwarding externally to get to my device. Internally http://spam.pipjo.co.uk worked fine but externally it needed to be http://spam.pipjo.co.uk:5752 I updated my signature files to point to port 5727 and then rerouted efa traffic internally to go through my Firewall which NATs it back to the internal destination on the correct port. This is all working correctly.

But...

When I received the Quarantine Report I have tested it and the addresses on the report do not work internally as they are not pointing to port 5727, and as they are using port 80 I cannot point them to another port without affecting all other traffic using port 80.

From what I can see I have two options:

1 - Change the port that eFa is using for Web UI and communications from links in emails from 80 to 5272
2 - Modify the Quarantine report to use port 5272

I have tried the following for 1, but this just resulted in being unable to connect to the GUI or use any links:
1) Edit apache config file (/etc/httpd/conf/httpd.conf) and change the Listen port to 8080 and restart apache
2) Edit the report files (/etc/MailScanner/reports/en/*) you will see that in a bunch of files there the variable $hostname is used, you should change this to reflect the new URL with the port in all the files
3) edit the QUARANTINE_REPORT_HOSTURL in the mailwatch config (/var/www/html/mailscanner/conf.php)

For 2 I have tried to locate the file that is used to create the links in the Quarantine Report but have not been able to.

Can anyone help with the above, or think of another option?

Thanks

PJ
User avatar
pdwalker
Posts: 1553
Joined: 18 Mar 2015 09:16

Re: Change Ports or Modify Reports

Post by pdwalker »

Did you try #3? That sounds like the easiest and most maintainable option.
pipjo
Posts: 43
Joined: 06 Jul 2017 09:08

Re: Change Ports or Modify Reports

Post by pipjo »

Sorry, bad formatting. 3 is the third step in the process I found for changing the Port used by eFa. Making these 3 changes resulted in the GUI not being available on either port 80 or 5272.
User avatar
pdwalker
Posts: 1553
Joined: 18 Mar 2015 09:16

Re: Change Ports or Modify Reports

Post by pdwalker »

Can you undo your changes to get your ui working again?
pipjo
Posts: 43
Joined: 06 Jul 2017 09:08

Re: Change Ports or Modify Reports

Post by pipjo »

Yes, reverting them works. Just hope someone can advise the correct way to do this.
User avatar
shawniverson
Posts: 3644
Joined: 13 Jan 2014 23:30
Location: Indianapolis, Indiana USA
Contact:

Re: Change Ports or Modify Reports

Post by shawniverson »

In /var/www/html/mailscanner/quarantine_report.inc.php on line 528

Code: Select all

            $links = '<a href="' . MAILWATCH_HOSTURL . '/viewmail.php?token=' . $qitem['token'] . '&id=' . $qitem['id'] . '">' . __('view61') . '</a>';
MAILWATCH_HOSTURL is used to generate the report links.

In /var/www/html/mailscanner/conf.php:

Code: Select all

define('MAILWATCH_HOSTURL', 'http://' . rtrim(gethostname()) . '/mailscanner');
So, perhaps do this?

Code: Select all

define('MAILWATCH_HOSTURL', 'http://' . rtrim(gethostname()) . ':5272/mailscanner');
pipjo
Posts: 43
Joined: 06 Jul 2017 09:08

Re: Change Ports or Modify Reports

Post by pipjo »

Worked perfectly. Thanks again for all your help.
Post Reply