in previous part of this howto we setup autoresponder/vacation system.
additionally i promised to show how to filter user mails.
Continue reading smtp + sql = more than it seems so (part 7)
in previous part of this howto we setup autoresponder/vacation system.
additionally i promised to show how to filter user mails.
Continue reading smtp + sql = more than it seems so (part 7)
today (2008-03-10) magnus hagander commited patch which adds new, quite handy functionality: “enum type for guc parameters".
in last part of this howto we did setup pop3/imap client access.
together with things set in all previous parts it makes a fully working mail system.
but, there are still things that might be added/modified. one of these is vacation support …
Continue reading smtp + sql = more than it seems so (part 6)
couple of times is was brought to attention of #postgresql channel – how to find longest prefix.
case: you have phone number, and you want to find which carrier it is bound to.
there are at least 3 ways of finding it, and i decided to take a look at which is fastest.
last time i finished with working smtp system, with accounts, aliases and quota. now, let's add ability to get th
e mails for client (imap/pop3) and some smtp-auth.
Continue reading smtp + sql = more than it seems so (part 5)
at the end of previous part of this text, we got our system working, and accepting emails for local accounts. plus i promised to add quota now 🙂 so, let's do it.
Continue reading smtp + sql = more than it seems so (part 4)
i will try to follow development of 8.4, and write examples of what's possible with it, based on current HEAD code.
of course there is no guarantee that it will work in final, released 8.4 (it is a bit too early to talk about it, but given the fact that the patch got committed, there is pretty good chance we will see it whenever 8.4 will be released.
today 2 new features: limit (select ) and optional as in select.
at the end of last part of this text, i finished having ready postgresql and exim (pop/imap installed but not configured), with exim being able to ask postgresql whether given domain is local. now, let the saga continue.
Continue reading smtp + sql = more than it seems so (part 3)
i have this program, which forks-off worker processes, and then runs in them various tasks.
one of the tasks is to execute some command via system(), but since we need to get stdout and stderr (separately), we used ipc::run module.
simple example of such code would be:
#!/usr/bin/perl use strict; use Time::HiRes qw( usleep ); use IPC::Run qw( run ); use POSIX ":sys_wait_h"; sub REAPER { my $child; while (($child = waitpid(-1,WNOHANG)) > 0) { } $SIG{CHLD} = \&REAPER; } $SIG{CHLD} = \&REAPER; for (1..100) { my $x = fork; die "cannot fork?!: $!\n" unless defined $x; if ($x) { usleep(10000); next; } my @cmd = qw(ls -lad .); my ($in, $out, $err); my $status = run \@cmd, \$in, \$out, \$err or die "ls: $?"; printf ("%u\n", $status); exit; }
what it does:
what's wrong? here is output from it on my machine:
=> perl test.pl ls: -1 at test.pl line 24. ... ... ...
which basically means ls failed – which is far from true, as this ls succeeds, simple check:
=> perl -e 'use IPC::Run qw(run);my @cmd = qw(ls -lad .);my ($in, $out, $err);my $status = run \@cmd, \$in, \$out, \$err or die "ls: $?";printf ("%u\n", $status);'
1now, the riddle is: why it fails? (yes, i now know the answer, but it took me some time).
due to requests (in “real life", not on blog), i put my .vimrc in svn, to be easily accessible.
svn repo at: http://svn.depesz.com/svn/environment/.vim/main-rc.vim