|
@@ -55,18 +55,19 @@ class ForwardEmail extends Mailable implements ShouldQueue
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
- * Build the message.4
|
|
|
|
|
|
+ * Build the message.
|
|
*
|
|
*
|
|
* @return $this
|
|
* @return $this
|
|
*/
|
|
*/
|
|
public function build()
|
|
public function build()
|
|
{
|
|
{
|
|
$replyToDisplay = $this->replyToAddress ?? $this->sender;
|
|
$replyToDisplay = $this->replyToAddress ?? $this->sender;
|
|
-
|
|
|
|
$replyToEmail = $this->alias->local_part.'+'.sha1(config('anonaddy.secret').$replyToDisplay).'@'.$this->alias->domain;
|
|
$replyToEmail = $this->alias->local_part.'+'.sha1(config('anonaddy.secret').$replyToDisplay).'@'.$this->alias->domain;
|
|
|
|
|
|
|
|
+ $fromEmail = $this->alias->isUuid() ? $this->alias->email : config('mail.from.address');
|
|
|
|
+
|
|
$email = $this
|
|
$email = $this
|
|
- ->from(config('mail.from.address'), base64_decode($this->displayFrom)." '".$this->sender."'")
|
|
|
|
|
|
+ ->from($fromEmail, base64_decode($this->displayFrom)." '".$this->sender."'")
|
|
->replyTo($replyToEmail, $replyToDisplay)
|
|
->replyTo($replyToEmail, $replyToDisplay)
|
|
->subject($this->user->email_subject ?? base64_decode($this->emailSubject))
|
|
->subject($this->user->email_subject ?? base64_decode($this->emailSubject))
|
|
->text('emails.forward.text')->with([
|
|
->text('emails.forward.text')->with([
|
|
@@ -81,11 +82,13 @@ class ForwardEmail extends Mailable implements ShouldQueue
|
|
])
|
|
])
|
|
->withSwiftMessage(function ($message) {
|
|
->withSwiftMessage(function ($message) {
|
|
$message->getHeaders()
|
|
$message->getHeaders()
|
|
- ->addTextHeader('List-Unsubscribe', '<' . $this->deactivateUrl . '>, <mailto:' . $this->alias->id . '@unsubscribe.' . config('anonaddy.domain') . '>');
|
|
|
|
|
|
+ ->addTextHeader('List-Unsubscribe', '<mailto:' . $this->alias->id . '@unsubscribe.' . config('anonaddy.domain') . '?subject=unsubscribe>, <' . $this->deactivateUrl . '>');
|
|
|
|
|
|
$message->getHeaders()
|
|
$message->getHeaders()
|
|
->addTextHeader('Return-Path', config('anonaddy.return_path'));
|
|
->addTextHeader('Return-Path', config('anonaddy.return_path'));
|
|
|
|
|
|
|
|
+ $message->setId(bin2hex(random_bytes(16)).'@'.$this->alias->domain);
|
|
|
|
+
|
|
if ($this->fingerprint) {
|
|
if ($this->fingerprint) {
|
|
$message->attachSigner($this->openpgpsigner);
|
|
$message->attachSigner($this->openpgpsigner);
|
|
}
|
|
}
|