PDA

View Full Version : Accept only email tickets from specific domains


DiePlage
06-27-2008, 08:27 AM
Hi Folks,

I'm quite sure that I saw some kind of email-filter somwhere in the osticket config files.

I want to restrict Email-Tickets to specific mail-domains only as this would kill 100% of our spam.

Any hints are welcome :-)

So long, DiePlage

DiePlage
07-02-2008, 01:53 AM
Does really noone know?
Or is there just no way to whitelist / blacklist email-senders?
What I want is to only accept email-tickets from
*@customer1.com
*@customer2.net
etc.
and blacklist anyone else.

4ice
07-02-2008, 04:55 AM
Perhaps the quickest way is to use the banlist in osTicket as a whitelist. So just add all customers addresses to the banlist and alter the function isbanned() in class.banlist.php:
function isbanned($email) {
return db_num_rows(db_query('SELECT id FROM '.BANLIST_TABLE.' WHERE email='.db_input($email)))?true:false;
}
to
function isbanned($email) {
return db_num_rows(db_query('SELECT id FROM '.BANLIST_TABLE.' WHERE email='.db_input($email)))?false:true;
}
So turn around true and false.

This is just an idea. Haven't tried it and I'm also not sure if this is the only thing you should change.

chrissigler
04-13-2010, 01:17 PM
I know this is an old thread, and I know it's my only post... Big bad idea to resurrect old threads... But since I arrived here looking for a solution, I thought someone else might down the road.

The true/false switch won't work. The function is used to check for additions to the ban list as well. So once you make the switch, you can't add anyone to the banlist because it thinks they're already on it.

The concept (banlist to whitelist) is great, though. And it only takes three little tweaks to make it happen (from what I can tell on my testing). Really you're just reversing the logic (adding a "!") in two statements...

In include/class.ticket.php:
if(!$errors && BanList::isbanned($var['email'])) {
...becomes... if(!$errors && !BanList::isbanned($var['email'])) {

And in include/staff/viewticket.inc.php:
if(!$errors['err'] && ($emailBanned=BanList::isbanned($ticket->getEmail())))...becomes...if(!$errors['err'] && !($emailBanned=BanList::isbanned($ticket->getEmail())))

And scp/tickets.php:
if(!$errors && BanList::isbanned($ticket->getEmail()))...becomes... if(!$errors && !BanList::isbanned($ticket->getEmail()))




So, it won't do it by domain. No without some adjustments to some logic in other places, at least. But this will make your banlist into a whitelist.

boomerzack
05-10-2010, 08:53 AM
Do you think its possable to send an email alert to the customer to let them know their email address is not valid?

I have set it to use reverse logic so only known email addresses can log tickets, but I would like to let genuine customers know that their email/ticket request has been blocked.

Thanks in advance for any help