Customising quarantine email URLs

Questions and answers about how to do stuff
Post Reply
User avatar
DavidRa
Posts: 25
Joined: 24 Dec 2012 08:29
Location: Sydney, AU
Contact:

Customising quarantine email URLs

Post by DavidRa » 30 Dec 2012 11:48

Is there a supported way to customise the links in the quarantine emails? I am running EFA as (effectively) a hosted appliance behind a NAT firewall. As a result, all the links in the email are to:

http://INTERNAL_IP/messages/release/MSG_GUID/

For example (less obfuscated):

http://10.0.0.3/messages/release/123456 ... 890abcdef/

I'd really prefer to have the URL use a defined name (antispam.domain.com, for example) so that I can release messages without having to VPN into the hosting network. It may be that I failed to set up the appliance correctly - but I do not remember seeing settings related to this (other than the computer name of the appliance, which does not appear to be used in the emails). Having said that I also do not see any use of the hostname defined in Baruwa setup - which is a short name, not a FQDN (a problem, perhaps?)

I checked out /usr/share/pyshared/baruwa/settings.py and the QUARANTINE_REPORT_HOSTURL contains the IP address - so changing it there looks like it would fix the emails, but I suspect that running efa-configure (e.g. as part of a version upgrade) might .. "break" it again?

Happy to provide further information - if someone can tell me what I can usefully provide.
Last edited by DavidRa on 30 Dec 2012 23:40, edited 1 time in total.

User avatar
darky83
Site Admin
Posts: 529
Joined: 30 Sep 2012 11:03
Location: eFa
Contact:

Re: Customising quarantine email URLs

Post by darky83 » 30 Dec 2012 16:03

I was planning to add this as an option to efa-configure

in efa-configure I will use the following command to change the line:

Code: Select all

sed -i "/^QUARANTINE_REPORT_HOSTURL = / c\QUARANTINE_REPORT_HOSTURL = 'http://1.1.1.1' " /etc/baruwa/settings.py
So I search for ^QUARANTINE_REPORT_HOSTURL = and change everything behind the line, so if you use the above command and change 1.1.1.1 to your hostname you should not break any future configure items in efa-configure.
E.F.A 3.0.2.6 update released

User avatar
darky83
Site Admin
Posts: 529
Joined: 30 Sep 2012 11:03
Location: eFa
Contact:

Re: Customising quarantine email URLs

Post by darky83 » 30 Dec 2012 17:49

Just added this to the EFA-Configure script..

You can try it out by downloading the development version:

Code: Select all

cd /tmp
wget https://raw.github.com/darky83/EFA/master/Build/0.3/usr/local/sbin/EFA-Configure.bash
chmod 700 EFA-Configure.bash
./EFA-Configure.bash
E.F.A 3.0.2.6 update released

User avatar
DavidRa
Posts: 25
Joined: 24 Dec 2012 08:29
Location: Sydney, AU
Contact:

Re: Customising quarantine email URLs

Post by DavidRa » 30 Dec 2012 23:51

OK I checked the emails this morning; not only does the link now point to the hostname desired, the error text that used to accompany the "Release" link has vanished too. Win-win!

Old "Release" content:
MailScanner has detected a possible fraud attempt from "INTERNAL_IP" claiming to be Release

New "Release" content:
Release

Also, I tried the EFA-Configure script to change it and it successfully updated /etc/baruwa/settings.py (the file to which /usr/share/pyshared/baruwa/settings.py is linked, just in case anyone is confused by the different files we referred to) so that looks good.

Thanks Darky!

Post Reply