Skip to content

Instantly share code, notes, and snippets.

View tkorkunckaya's full-sized avatar

Raif Tolga Korkunckaya tkorkunckaya

View GitHub Profile
@tkorkunckaya
tkorkunckaya / postfix_patterns
Last active December 12, 2015 01:29 — forked from jamtur01/postfix_patterns
Postfix patterns file for logstash
QUEUEID (?:[A-F0-9]+|NOQUEUE)
EMAILADDRESSPART [a-zA-Z0-9_.+-=:]+
EMAILADDRESS %{EMAILADDRESSPART:local}@%{EMAILADDRESSPART:remote}
RELAY (?:%{HOSTNAME:relayhost}(?:\[%{IP:relayip}\](?::%{POSREAL:relayport})?)?)
POSREAL [0-9]+(.[0-9]+)?
DELAYS %{POSREAL:a}/%{POSREAL:b}/%{POSREAL:c}/%{POSREAL:d}
DSN %{POSINT}.%{POSINT}.%{POSINT}
STATUS sent|deferred|bounced|expired
PERMERROR 5[0-9]{2}
MESSAGELEVEL reject|warning|error|fatal|panic
@tkorkunckaya
tkorkunckaya / daemon.php
Created October 3, 2012 07:12 — forked from anonymous/daemon.php
phpredis and pcntl_fork()
<?php
//if $fork is true, each time daemon got a job, fork a child to handle it
$fork = true;
$redis = init_redis();
while (true) //loops infinitely
{
echo "start loop @ " . date("H:i:s" ,time()) . "\n";
$job = $redis->lPop("queue");