Change Ports or Modify Reports

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

Change Ports or Modify Reports

Post by pipjo » 17 Jul 2017 09:29

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

pdwalker
Posts: 661
Joined: 18 Mar 2015 09:16

Re: Change Ports or Modify Reports

Post by pdwalker » 21 Jul 2017 03:48

Did you try #3? That sounds like the easiest and most maintainable option.

pipjo
Posts: 16
Joined: 06 Jul 2017 09:08

Re: Change Ports or Modify Reports

Post by pipjo » 21 Jul 2017 07:06

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.

pdwalker
Posts: 661
Joined: 18 Mar 2015 09:16

Re: Change Ports or Modify Reports

Post by pdwalker » 21 Jul 2017 08:15

Can you undo your changes to get your ui working again?

pipjo
Posts: 16
Joined: 06 Jul 2017 09:08

Re: Change Ports or Modify Reports

Post by pipjo » 21 Jul 2017 17:10

Yes, reverting them works. Just hope someone can advise the correct way to do this.

User avatar
shawniverson
Posts: 2251
Joined: 13 Jan 2014 23:30
Location: Rushville, Indiana, USA
Contact:

Re: Change Ports or Modify Reports

Post by shawniverson » 22 Jul 2017 15:57

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');
Version 3.0.2.3 released! Update now to keep your eFa secure!

pipjo
Posts: 16
Joined: 06 Jul 2017 09:08

Re: Change Ports or Modify Reports

Post by pipjo » 22 Jul 2017 21:41

Worked perfectly. Thanks again for all your help.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest