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)
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);' 1
now, 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
in first part of this text i described how i installed base ubuntu system in chroot, and then got exim, courier and postgresql in there. now to some configuration.
Continue reading smtp + sql = more than it seems so (part 2)
Changes:
SVN repo at: http://svn.depesz.com/svn/pgsql-tools/trunk
for quite some time i wanted to write about my experiences with combining smtp server with sql server.
this subject for some people might be too boring, for others – it might be seen as a simple howto. but in my opinion it clearly shows that when you combine 2 such technologies outcome is much better then it would seem (it's called synergy in merketoid-speak).
this subject will be divided into several parts, that will be posted separately (yeah, let's get some traffic to website 🙂
also, i hope to extend it in future if/when i'll find something else that can be added/changed in proposed solution.
so, without further ado, let's start:
Continue reading smtp + sql = more than it seems so (part 1)
(pgdba@[LOCAL]:5830) 21:45:26 [pgdba] # SELECT version(); version ----------------------------------------------------------------------------------------------------------------------- PostgreSQL 8.3.0 ON i686-pc-linux-gnu, compiled BY GCC gcc (GCC) 4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2) (1 ROW)
well, actually it is not released yet, but at the very least it's named 8.3 in cvs head 🙂