[GH-ISSUE #605] Undelivered Mail Returned to Sender #1000

Closed
opened 2026-03-14 11:25:54 +03:00 by kerem · 11 comments
Owner

Originally created by @luckydonald on GitHub (Feb 28, 2024).
Original GitHub issue: https://github.com/anonaddy/anonaddy/issues/605

Screenshot 2024-02-29 at 00 33 21

Now additionally to that rather unhelpful error message (please just put the error there) the sender of that mail got this message back:


Undelivered Mail Returned to Sender

From: MAILER-DAEMON@anon.example.com

Attachments (2):

  • message-delivery-status-attachment
    Reporting-MTA: dns; anon.example.com
    X-Postfix-Queue-ID: F43393DEFA
    X-Postfix-Sender: rfc822; i-just-wanna-test-my-anon-emails@web.de
    Arrival-Date: Thu, 29 Feb 2024 00:01:06 +0100 (CET)
    
    Final-Recipient: rfc822; test@secondary-example-domain.xyz
    Original-Recipient: rfc822;test@secondary-example-domain.xyz
    Action: failed
    Status: 5.3.0
    Diagnostic-Code: x-unix; In DkimSigner.php line 42:
        Symfony\Component\Mime\Crypto\DkimSigner::__construct(): Argument #1 ($pk)
        must be of type string, null given, called in /var/www/anonaddy/app/CustomM
        ailDriver/CustomMailer.php on line 92
    
  • Original Message Name.eml

Body:

This is the mail system at host anon.example.com.

I'm sorry to have to inform you that your message could not
be delivered to one or more recipients. It's attached below.

For further assistance, please send mail to postmaster.

If you do so, please include this problem report. You can
delete your own text from the attached returned message.

The mail system

test@secondary-example-domain.xyz: Command died with status 1: "php". Command output: In
DkimSigner.php line 42:
Symfony\Component\Mime\Crypto\DkimSigner::__construct(): Argument #1 ($pk)
must be of type string, null given, called in /var/www/anonaddy/app/CustomM
ailDriver/CustomMailer.php on line 92

Originally created by @luckydonald on GitHub (Feb 28, 2024). Original GitHub issue: https://github.com/anonaddy/anonaddy/issues/605 <img width="1561" alt="Screenshot 2024-02-29 at 00 33 21" src="https://github.com/anonaddy/anonaddy/assets/2737108/47709d2b-44bd-4318-ba0e-9ed3c44ef9e2"> <br> Now additionally to that rather unhelpful error message (please just put the error there) the sender of that mail got this message back: <br> # Undelivered Mail Returned to Sender **From**: MAILER-DAEMON@anon.example.com **Attachments** (2): <ul><li><details><summary><code>message-delivery-status-attachment</code></summary> ``` Reporting-MTA: dns; anon.example.com X-Postfix-Queue-ID: F43393DEFA X-Postfix-Sender: rfc822; i-just-wanna-test-my-anon-emails@web.de Arrival-Date: Thu, 29 Feb 2024 00:01:06 +0100 (CET) Final-Recipient: rfc822; test@secondary-example-domain.xyz Original-Recipient: rfc822;test@secondary-example-domain.xyz Action: failed Status: 5.3.0 Diagnostic-Code: x-unix; In DkimSigner.php line 42: Symfony\Component\Mime\Crypto\DkimSigner::__construct(): Argument #1 ($pk) must be of type string, null given, called in /var/www/anonaddy/app/CustomM ailDriver/CustomMailer.php on line 92 ``` </details></li> <li><details><summary><code>Original Message Name.eml</code></summary> … </li></ul> **Body**: <blockquote> This is the mail system at host anon.example.com. I'm sorry to have to inform you that your message could not be delivered to one or more recipients. It's attached below. For further assistance, please send mail to postmaster. If you do so, please include this problem report. You can delete your own text from the attached returned message. The mail system <test@secondary-example-domain.xyz>: Command died with status 1: "php". Command output: In DkimSigner.php line 42: Symfony\Component\Mime\Crypto\DkimSigner::__construct(): Argument #1 ($pk) must be of type string, null given, called in /var/www/anonaddy/app/CustomM ailDriver/CustomMailer.php on line 92 </blockquote>
kerem closed this issue 2026-03-14 11:25:59 +03:00
Author
Owner

@luckydonald commented on GitHub (Feb 28, 2024):

Three issues here:

  • The bug
  • The fact that it leaks a stacktrace, hostname, installation details to the person/system mailing me
  • The error in the GUI shouldn't be lacking any information
<!-- gh-comment-id:1970101433 --> @luckydonald commented on GitHub (Feb 28, 2024): Three issues here: - The bug - The fact that it leaks a stacktrace, hostname, installation details to the person/system mailing me - The error in the GUI shouldn't be lacking any information
Author
Owner

@willbrowningme commented on GitHub (Mar 1, 2024):

That failed delivery entry was created here - https://github.com/anonaddy/anonaddy/blob/master/app/Mail/ForwardEmail.php#L366-L376

I've just tested this replicating the same error and the sender of the email does not receive a bounce message.

When the ForwardEmail job is being run it means the message was already accepted into the mail server. So to the sender it will appear as if the message was delivered successfully.

I've just fixed that bug and also added the actual exception error message instead of the generic "please check the logs" message.

<!-- gh-comment-id:1973143939 --> @willbrowningme commented on GitHub (Mar 1, 2024): That failed delivery entry was created here - https://github.com/anonaddy/anonaddy/blob/master/app/Mail/ForwardEmail.php#L366-L376 I've just tested this replicating the same error and the sender of the email does not receive a bounce message. When the ForwardEmail job is being run it means the message was already accepted into the mail server. So to the sender it will appear as if the message was delivered successfully. I've just fixed that bug and also added the actual exception error message instead of the generic "please check the logs" message.
Author
Owner

@luckydonald commented on GitHub (Mar 1, 2024):

Permanent link to the stuff from above: github.com/anonaddy/anonaddy@7becf1ac87/app/Mail/ForwardEmail.php (L366-L376)


I'm not sure if I understand correctly, you say there's no way the sender got that email?

Because that's just what I got back to my external mail I created to test the forwards.

<!-- gh-comment-id:1973291462 --> @luckydonald commented on GitHub (Mar 1, 2024): Permanent link to the stuff from above: https://github.com/anonaddy/anonaddy/blob/7becf1ac87f7676b44050dd2c0b7cb2b9db2521f/app/Mail/ForwardEmail.php#L366-L376 --- I'm not sure if I understand correctly, you say there's no way the sender got that email? Because that's just what I got back to my external mail I created to test the forwards.
Author
Owner

@willbrowningme commented on GitHub (Mar 1, 2024):

What is the QUEUE_CONNECTION set as in your .env file? Are you running with Docker or from the self-hosting instructions?

<!-- gh-comment-id:1973305618 --> @willbrowningme commented on GitHub (Mar 1, 2024): What is the `QUEUE_CONNECTION` set as in your `.env` file? Are you running with Docker or from the self-hosting instructions?
Author
Owner

@luckydonald commented on GitHub (Mar 1, 2024):

Good question.
am using the docker image and I don't think I did set it myself.
Likely can't check before Monday, but possibly empty?
As it's not documented in the readme there, I did not set it intentionally.

<!-- gh-comment-id:1973333353 --> @luckydonald commented on GitHub (Mar 1, 2024): Good question. am using the docker image and I don't think I did set it myself. Likely can't check before Monday, but possibly empty? As it's not documented in the readme there, I did not set it intentionally.
Author
Owner

@willbrowningme commented on GitHub (Mar 1, 2024):

Run docker compose exec addy anonaddy tinker and then enter config('queue.default');.

I suspect it will be sync which would explain it not being queued.

<!-- gh-comment-id:1973342360 --> @willbrowningme commented on GitHub (Mar 1, 2024): Run `docker compose exec addy anonaddy tinker` and then enter `config('queue.default');`. I suspect it will be `sync` which would explain it not being queued.
Author
Owner

@luckydonald commented on GitHub (Mar 5, 2024):

Yes, I could confirm it's set to sync.

<!-- gh-comment-id:1978176494 --> @luckydonald commented on GitHub (Mar 5, 2024): Yes, I could confirm it's set to `sync`.
Author
Owner

@willbrowningme commented on GitHub (Mar 6, 2024):

I've also just updated the catch statement to catch \Throwable instead of just \Exception in order to prevent any stack trace being leaked to the sender.

<!-- gh-comment-id:1980343618 --> @willbrowningme commented on GitHub (Mar 6, 2024): I've also just updated the catch statement to catch `\Throwable` instead of just `\Exception` in order to prevent any stack trace being leaked to the sender.
Author
Owner

@luckydonald commented on GitHub (Mar 25, 2024):

Will this make a release any time soon?
Currently I've rolled back to v0.14.0 as that one isn't blocking as many emails.

Notably it's blocking google account mails.

<!-- gh-comment-id:2017022744 --> @luckydonald commented on GitHub (Mar 25, 2024): Will this make a release any time soon? Currently I've rolled back to [v0.14.0](https://github.com/anonaddy/anonaddy/releases/tag/v0.14.0) as that one isn't blocking as many emails. Notably it's blocking google account mails.
Author
Owner

@willbrowningme commented on GitHub (Mar 25, 2024):

Just pushed a new release now.

<!-- gh-comment-id:2018320128 --> @willbrowningme commented on GitHub (Mar 25, 2024): Just pushed a new release now.
Author
Owner

@luckydonald commented on GitHub (Mar 25, 2024):

Thanks!
Could you also please bump the version in the docker repo?

Basically this line:
github.com/anonaddy/docker@3de44c7adf/Dockerfile (L3)

<!-- gh-comment-id:2019042581 --> @luckydonald commented on GitHub (Mar 25, 2024): Thanks! Could you also please bump the version in the docker repo? Basically this line: https://github.com/anonaddy/docker/blob/3de44c7adf9088d6ae5928bc4fc3cbfd1af696f5/Dockerfile#L3
Sign in to join this conversation.
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/anonaddy#1000
No description provided.