Realtime IM/Chat Notification
from procmail and other event generating tools
... using PSYC
- Carlo v. Loesch (psyced.org)
___(the /me-guy)
- Stephen R. van den Berg (Cubic Circle BV)
___(the procmail-guy)
overview: events
in real-time:
- e-mail
- wiki edits
- forum/blog posts
- system monitoring
- software check-ins
SMTP is a push technology with messages traveling our way rather than us having to look for them. Yet, during the 90s we stopped reading our mail on our mail servers, e-mail clients needed protocols to access our e-mails and now these e-mail clients periodically ask the server for new mail rather than receiving it in real-time. This introduces an unnecessary latency in e-mail conversation.
This talk provides a practical solution how procmail can be used to forward a mail's author and subject line straight to an IRC, XMPP or PSYC client, so at least you know when a new e-mail has arrived, immediately, and you can hit that "Get Mail" button. You can even set up such a mechanism for all users on the system, so they don't have to figure out procmail by themselves.
We will also show realtime notification interfaces for software versioning system check-ins, syslog daemon events, Mediawiki edits, Phpbbs and Drupal message submissions. All of these things can be brought to you in real-time rather than by e-mail or not at all.
http://www.linuxtag.org/2007/de/conf/events/vp-donnerstag/vortragsdetails.html?talkid=64
overview: display
how to show?
- popups? naaah
- Jabber message
- IRC channel
- webchat
- PSYC newscast
10 minutes? eh!?
thunderbird's defaults:
... latency in e-mail!
SMTP can be real-time
- SMTP? real-time!
- spooling no must
- greylisted?
- SEND, SOML, SAML?
- POP and IMAP spoiled it
- your port 25?
procmail
- most common mail delivery agent
- aged, robust and proven
- sorts mails
- weeds out spam
- event driven, no polling
PSYC in your .procmailrc
after weeding out spam and boring stuff:
:0 hc
!psyc://psyced.org/~nickname
- ! = forward action
- h = header
- c = continuing recipe
- 0 = don't ask
jabber in your .procmailrc
PSYCRELAY=psyc://localhost
:0 hc
!xmpp:user@jabber.example.net
- procmail does no XMPP
- too complex. too time critical.
- procmail uses PSYC relay
- http://about.psyc.eu/procmail
let's wear a uniform!
psyc://psyced.org/~lynX is my uniform
- because humans are not resources
- addresses users at PSYC servers
- simple UDP packet
(optional shared secret)
- how does that look like?
what a weird protocol!
.
:_target xmpp:user@jabber.example.net
:_origin Mary Foo <spam@gotthroo.example.com>
:_subject Vulcans: VIAGRA for your ears!
:_nick_alias bombMail
_notice_received_email
([_nick_alias]) [_origin]: [_subject]
.
how can i see that?
- a psyced server is multi-protocol
- IRC client
- XMPP client
- webchat.. telnet..
- PSYC client!
pidgin receiving a notification
procmail -> psyced -> jabberd -> gaim
(type='headline' == unpleasant pop-up)
ircII receiving a notification
procmail -> psyced -> IRC client
do i have to use your server?
- no, it's open source
- psyced in C and LPC
- alternatives in development
- PSYC is a decentralized
- optimized for interserver
- IRC & XMPP good with clients
mail notify for all!
and now what about a global /etc/procmailrc
:0 hc
!psyc://localhost/~$LOGNAME
users use 'any' software to get notified
- authentication plan needed
mediawiki notify plugin
(Wiki:lynx) has made a major change in
http://about.psyc.eu/Routing saying: packet ids
(Wiki:fippo) has made a minor change in
http://about.psyc.eu/Wikinotify
- -> discussion channel
- also via 'MUC'
- output flavor
- the php source for this:
mediawiki notify plugin source
function psycnotify($art, $user, $text, $sum, $isminor, $isw, $sect) {
global $psyctarget, $psychost;
$url = "http://" . $_SERVER['SERVER_NAME'];
$url.= str_replace("index.php?title=","index.php/",substr($_SERVER['REQUEST_URI'],0,-14));
$s = ":_target\t$psyctarget\n\n"
. ":_nick_wiki\t". strToLower($user->mName) ."\n"
. ":_article\t". $art->mTitle->mTextform ."\n"
. ":_page\t$url$sect\n";
if ($sect) $s.= ":_section\t$sect\n";
if ($sum) $s .= ":_summary\t$sum\n";
$mc = "_notice_update_wiki";
if ($isminor) $mc .= "_minor";
$s.= $mc."\n(Wiki:[_nick_wiki]) has made a ".($isminor?"minor":"major")." change in [_page]\n";
if ($sum) $s .= "saying: [_summary]\n";
$udp = fsockopen($psychost, $psycport);
fwrite($udp, ".\n". $s .".\n");
fclose($udp);
return true;
}
$wgHooks['ArticleSaveComplete'][] = array('psycnotify');
mediawiki notify installation
- psyced with #wikinotify channel ready
- install on same machine, or config trust
- join #wikinotify via IRC
- psyc://wiki.example.org/@wikinotify via PSYC
- xmpp:*wikinotify@wiki.example.org via jabberMUC
blogs, forums and mp3
- drupal notify? same thing
- http://about.psyc.eu/Drupal
- psyc syndication for phpbb even has an admin interface
- perl! http://perl.psyc.eu
- psycmp3: now playing
- remote control it
cvs2psyc
edit $CVSROOT/loginfo:
DEFAULT /path/cvs2psyc psyc://example.org/@cvs '%r' '%p' '%s'
sends _notice_update_software_CVS
(CVS:lynx in psyced/place) tagesschau.c changed: new feed url
- multicast distribution
- programmable places