How to enable SRS in cPanel 11.28

February 15th, 2011 by mg No comments »

SPF is an easy and lightway way to filter out large amount of spam messages. The exim package, that comes bundled with cPanel is compiled with SPF and SRS support. Although tagged experimental, both are – in my experience – stable and production ready. One problem remains – though SPF support can be enabled from cPanel’s interface – it is currently not possible to turn SRS on, which can screw up forwarding pretty bad. Fortunately, enabling it manually is quite easy and only requires modification of two router (virtual_aliases_nostar and virtual_aliases) and adding third one in exim’s configuration file.

Patch below – just change your srs_config accordingly.

--- exim.conf   2011-02-14 14:58:41.000000000 +0100
+++ exim.conf_old       2009-05-06 17:12:36.000000000 +0200
@@ -1,21 +1,6 @@
 #!!# cPanel Exim 4 Config

+hide srs_config = WriteYourSecretTokenHere

@@ -991,7 +811,6 @@
   driver = redirect
   allow_defer
   allow_fail
+  srs = forward
   require_files = "+/etc/valiases/$domain"
   data = ${lookup{$local_part@$domain}lsearch{/etc/valiases/$domain}}
   file_transport = address_file
@@ -1041,24 +860,21 @@
   require_files = +/etc/vdomainaliases/$domain
   condition = ${lookup {$domain} lsearch {/etc/vdomainaliases/$domain}{yes}{no} }
   data = $local_part@${lookup {$domain} lsearch {/etc/vdomainaliases/$domain} }
+
+srs_router:
+  driver = redirect
+  srs = reverseandforward
+  data = ${srs_recipient}
+
 virtual_aliases:
     driver = redirect
     allow_defer
     allow_fail
     require_files = "+/etc/valiases/$domain"
+    srs = forward
     data = ${lookup{*}lsearch{/etc/valiases/$domain}}
     file_transport = address_file
     group = mail
     pipe_transport = virtual_address_pipe

How to list files in directory, except the newest one

February 15th, 2011 by mg No comments »
ls -t "katalog" | egrep '*.ext$' | tail -n +2

Hello world!

February 14th, 2011 by mg No comments »
int main()
{
    printf("Hello world");
}