#!/usr/bin/perl -w # Copyright (C) 2013, Eric Wong and all contributors # License: AGPLv3 or later (https://www.gnu.org/licenses/agpl-3.0.txt) # This is the command-line mail delivery agent for servers. # Try to keep this small as it may be invoked frequently for each message # delivered. my $usage = "ssoma-mda [-1] /path/to/git/repo < /path/to/rfc2822_message"; use strict; use warnings; use Ssoma::MDA; use Ssoma::Git; use Email::Simple; my $once = $ARGV[0] eq "-1"; my $repo = pop @ARGV or die "Usage: $usage\n"; my $git = Ssoma::Git->new($repo); my $mda = Ssoma::MDA->new($git); my $simple; { local $/; $simple = Email::Simple->new(); } $mda->deliver($simple, $once);