Amavisd default action isn’t to discard spam

When you install amavisd-new it appears the spam still gets passed on to the sender.
The default action in /etc/amavisd.conf around line 163 is:

# final_spam_destiny   => D_BOUNCE;

One would presume based on prior experience with config files that, while it is commented out, that would be the default action. From what I have seen it isn’t. What seems to actually happens is that if ‘$*_quarantine_to’ variable is assigned emails will get delivered there and to the original recipient. Suggesting the D_PASS is the default.

Anyway to fix it, just uncomment and change

# final_spam_destiny   => D_BOUNCE; 

to:

final_spam_destiny   => D_DISCARD; 

and restart amavisd service.

Further information:

D_PASS Mail will pass to recipients, regardless of bad contents. If a quarantine is configured, a copy of the mail will go there, if not, at least the recipient received the mail. Note that including a recipient in a @*_lovers_maps is functionally equivalent to setting $final_*_destiny = D_PASS; for that recipient.

D_BOUNCE Mail will not be delivered to its recipients. A non-delivery notification (bounce) will be created by amavisd-new and sent to the sender by amavisd-new. Exceptions: bounce (DSN) will not be sent if a virus name matches @viruses_that_fake_sender_maps , or to messages from mailing lists (Precedence: bulk|list|junk), or for spam level that exceeds the $sa_dsn_cutoff_level. If a quarantine is configured, a copy of the mail will go there. If not, we have lost the mail, but if the mail was legitimate, the sender should receive notification of the disposition of the message.

D_DISCARD Mail will not be delivered to its recipients and the sender normally will NOT be notified. If a quarantine is configured, a copy of the mail will go there. If not, we have lost the mail. Note that there are additional settings available that can send notifications to persons that normally may not be notified when an undesirable message is found, so it is possible to notify the sender even when using D_DISCARD.

Report on Exchange mailbox folder sizes (powershell)

Recently had the task of finding out how a users Exchange mailbox quota was nearly full.
The command I used was:

Get-MailboxFolderStatistics -Identity "User A" | fl Name, ItemsInFolder, FolderSize
Get-Mailbox | Get-MailboxStatistics | fl DisplayName, ItemCount, TotalItemSize

Turns out it was the sent items folder…. :-)

Configure Wordpress 3.5 with Shibboleth2

Recently I installed Wordpress. There was a requirement to get Single Sign On (SSO) working for the admin users.
Googling for Shibboleth and Wordpress brings up a Wordpress plugin that hasn’t been updated in over two years.

There were some problems with this plugin:
1). It didn’t work. I thought I’d try it any way, it’s broken.
2). The plugin automatically creates users in the Wordpress DB if they don’t exist.
Ideally in our secure environments we don’t want users getting automatically created anywhere.

I thought about trying to fix the plugin, but considering I don’t really do PHP or Wordpress the time investment would be too high. Therefore I started looking for alternative SSO methods or rather SSO plugins. After thinking about how our other SSO based sites worked I remembered about the REMOTE_USER Apache variable. (Cue Google…)

The solution was to uninstall the broken Shibboleth2 plugin and install the ‘HTTP Authentication’ plugin here. Just ensure /wp-admin/ location in protected by Shibboleth and manually create the users in Wordpress. If they don’t exist in Wordpress then they fail to login…Exactly what we require!

How to fix: mktime(): It is not safe to rely on the system’s timezone settings

You might encounter a similar error message perhaps running wordpress or some other webapp.

[Tue Mar 12 09:41:14 2013] [error] [client 1.2.3.4] PHP Warning:  mktime(): It is not safe to rely on 
the system's timezone settings. 
You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case
 you used any of those methods and you are still getting this warning, you most likely misspelled the 
timezone identifier. We selected 'Australia/ACT' for 'EST/10.0/no DST' instead in 
/var/www/html/smarty/plugins/function.html_select_date.php on line 192

To resolve either fix the code or an easy fix is edit: /etc/php5/php.ini or /etc/php.ini depending on your operating system.
Look for the line:

;date.timezone = 

and make it:

date.timezone = 'Australia/Brisbane'

See a list of supported timezones from here: http://www.php.net/manual/en/timezones.php

Need a PHP Shell? Try: Weevely

Get it here: http://epinna.github.com/Weevely/
Similar to C99 perhaps equally as useful, I’m sure you can think of some uses!!!