Fix path on rejected echomails, change layout of message_path quoting original message and control lines
This commit is contained in:
parent
77b9bb30c4
commit
03bfc9dbfc
@ -44,6 +44,7 @@ class EchoareaNotExist extends Netmails
|
||||
|
||||
Log::info(sprintf('%s:+ Creating ECHOAREA NOT EXIST netmail to [%s]',self::LOGKEY,$ao->ftn));
|
||||
|
||||
$o->to = $this->mo->from;
|
||||
$o->subject = 'Echoarea doesnt exist - '.$this->mo->set->get('set_echoarea');
|
||||
|
||||
// Message
|
||||
|
@ -13,12 +13,12 @@ trait MessagePath
|
||||
{
|
||||
$reply = "This is your original message:\r\r";
|
||||
|
||||
$reply .= "+--[ BEGIN MESSAGE ]----------------------------------+\r";
|
||||
$reply .= "+------------------------------------[ BEGIN MESSAGE ]-+\r";
|
||||
$reply .= sprintf("TO: %s\r",$mo->to);
|
||||
$reply .= sprintf("SUBJECT: %s\r",$mo->subject);
|
||||
$reply .= str_replace("\r---","\r#--",$mo->msg)."\r";
|
||||
|
||||
$reply .= "+--[ CONTROL LINES ]----------------------------------+\r";
|
||||
$reply .= "+------------------------------------[ CONTROL LINES ]-+\r";
|
||||
$reply .= sprintf("DATE: %s\r",$mo->date->format('Y-m-d H:i:s'));
|
||||
if ($mo->msgid)
|
||||
$reply .= sprintf("MSGID: %s\r",$mo->msgid);
|
||||
@ -28,22 +28,26 @@ trait MessagePath
|
||||
foreach ($mo->kludges as $k=>$v)
|
||||
$reply .= sprintf("%s %s\r",$k,$v);
|
||||
|
||||
$reply .= "+--[ PATH ]-------------------------------------------+\r";
|
||||
$reply .= "+---------------------------------------------[ PATH ]-+\r";
|
||||
|
||||
if ($mo->path->count())
|
||||
if ($mo instanceof Netmail) {
|
||||
foreach ($mo->path as $o)
|
||||
$reply .= sprintf("VIA: %s\r",$mo->via($o));
|
||||
|
||||
} else {
|
||||
} elseif ($mo instanceof Echomail) {
|
||||
// Rejected echomails dont have a collection of Address::class for paths
|
||||
foreach ($mo->path as $o)
|
||||
$reply .= sprintf("VIA: %s\r",$o->ftn);
|
||||
$reply .= sprintf("VIA: %s\r",(is_string($o) ? $o : $o->ftn));
|
||||
|
||||
} else {
|
||||
throw new \Exception('Message object is not an Netmail or Echomail?');
|
||||
}
|
||||
|
||||
else
|
||||
$reply .= "No path information? This would be normal if this message came directly to the hub\r";
|
||||
|
||||
$reply .= "+--[ END MESSAGE ]------------------------------------+\r\r";
|
||||
$reply .= "+--------------------------------------[ END MESSAGE ]-+\r\r";
|
||||
|
||||
return $reply;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user