Quantcast
Channel: iRedMail — iRedMail Support
Viewing all articles
Browse latest Browse all 43431

Re: signing DKIM in the queue

$
0
0

Mails are pushed into the queue via command line.
Direct write to the queue with the function sendmail and php "fputs" by pipe.
As you can see without any authorization.
This is probably the fastest way of shipping.

var $sendmail_path="/usr/lib/sendmail";
var $sendmail_arguments="";
Function SendMail($to, $subject, $body, $headers, $return_path)
    {
        $command=$this->sendmail_path." -t -i";
        switch($this->bulk_mail ? $this->bulk_mail_delivery_mode : $this->delivery_mode)
        {
            case SENDMAIL_DELIVERY_DEFAULT:
            case SENDMAIL_DELIVERY_INTERACTIVE:
            case SENDMAIL_DELIVERY_BACKGROUND:
            case SENDMAIL_DELIVERY_QUEUE:
            case SENDMAIL_DELIVERY_DEFERRED:
                break;
            default:
                return($this->OutputError("it was specified an unknown sendmail delivery mode"));
        }
        if($this->delivery_mode!=SENDMAIL_DELIVERY_DEFAULT)
            $command.=" -od".$this->delivery_mode;
        if(strlen($return_path))
            $command.=" -f '".preg_replace("/'/", "'\\''",$return_path)."'";
        if(strlen($this->sendmail_arguments))
            $command.=" ".$this->sendmail_arguments;
        if(!($pipe=@popen($command,"w")))
            return($this->OutputPHPError("it was not possible to open sendmail input pipe", $php_errormsg));
        if(strlen($headers))
            $headers.="\n";
        if(!@fputs($pipe,"To: ".$to."\nSubject: ".$subject."\n".$headers."\n")
        || !@fputs($pipe,$body)
        || !@fflush($pipe))
            return($this->OutputPHPError("it was not possible to write sendmail input pipe", $php_errormsg));
        pclose($pipe);
        return("");
    }

Best regards,
Pawel


Viewing all articles
Browse latest Browse all 43431

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>