sendmail

Christos Ricudis ricudis at paiko.gr
Thu Aug 6 20:52:50 EEST 1998


Hello Linux-greek-users!

Linux-greek-users wrote to All about "sendmail":

 L> auto pou 8a i8ela na kano einai o ka8e xrhsths na mporei na
 L> orisei ena diko tou DSxxx.xxx.xxx. Dhaldh o xrhsths test px 
 L> na mporei na anoigei to pine kai na blepei ta mail pou exei 

De mporeis na to kaneis apey8eias, alla mporeis na allakseis to mail 
me ena filtro, to opoio koitaei poy paei kai apo poy erxetai to mail 
kai allazei tis diey8ynseis, etsi wste to sendmail na kanei explicit 
routing. 

As always, perl is your friend : 

#/usr/bin/perl

$state=0;

$relay{"Christos Ricudis <ricudis\@paiko.gr>"}="paparouna.flowers.com";
$relay{"Christos Ricudis <ricudis\@lemnos.geo.auth.gr>"}="sfyri.tools.org";
$relay{"Harris Kosmidis <hkosmidi\@hal.csd.auth.gr>"}="perdika.birds.net";

while(<>) {
        chop;
        if ((/^$/) && ($state==0)) {
                $state=1;
                $r=$relay{"$from"};
                if ($r ne "") {
                        if ($to =~ /^(.*)<(.*)>(.*)$/) {
                                print "To: $1<$2%$r>$3\n";
                        } elsif ($ to =~ /^(.*) \((.*)\)(.*)$/) {
                                print "To: $1%$r ($2)$3\n";
                        } else {
                                print "To: $to%$r\n";
                        }
                } else {
                        print "To: $to\n";
                }
		print "\n";
                next;
        }
        if ($state==0) {

                if (/^From: (.*)$/i) {
                        $from=$1;
                        print "$_\n";
                } elsif (/^To: (.*)$/i) {
                        $to=$1;
                } else {
                        print "$_\n";
                }

        }
        print OUTFILE "$_\n";
}


Ayto to bazeis san filtro prin apo to sendmail. Yp'opshn oti DEN einai
teleio. Den ekatsa na ftiaksw enan kanoniko parser gia tis diey8ynseis
sto To: aplws ebala ta pio syxna xrhsimopoioymena formats. Kanonika 8a
prepei na koitakseis to RFC822, na breis ti formats mporei na exei ena
address field, kai na kaneis ton analogo parser. Epishs kati allo: Sto
associative array me toys apostoleis, 8a prepei na baleis akribws ayto
poy bazei to pine sto From: field gia ton apostolea. Kanonika 8a'prepe
kai ekei na kanw ena substring search alla opws kserete oloi sas eimai
enas entelws baremenos typos tou opoiou h monadikh asxolia se ayth thn 
basanistikh zwh einai na grafei mail me teleia stoixish sta deksia. To
epomeno analogo mail yposxomai oti 8a exei stoixismeno kai ton kwdika.

Ciao,
  Christos
--
====================================================================
Gia boithia (h na diagrafhte) e-mail sto majordomo at argos.hol.gr
Ta archives tis listas einai sto http://www.argos.hol.gr/lists :
prin steilete kapoia erothsh psakte mipos exei hdh apanththei.
Gia opoiodipote problima stilte e-mail ston owner-linux-greek-users
====================================================================



More information about the Linux-greek-users mailing list