Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Undelivered Mail Returned to Sender #605

Closed
luckydonald opened this issue Feb 28, 2024 · 11 comments
Closed

Undelivered Mail Returned to Sender #605

luckydonald opened this issue Feb 28, 2024 · 11 comments

Comments

@luckydonald
Copy link

luckydonald commented Feb 28, 2024

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

@luckydonald
Copy link
Author

luckydonald commented 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

@willbrowningme
Copy link
Member

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.

@luckydonald
Copy link
Author

luckydonald commented Mar 1, 2024

Permanent link to the stuff from above:

$this->user->failedDeliveries()->create([
'recipient_id' => $this->recipientId,
'alias_id' => $this->alias->id,
'bounce_type' => null,
'remote_mta' => null,
'sender' => $this->sender,
'email_type' => 'F',
'status' => null,
'code' => $exception->getMessage(),
'attempted_at' => now(),
]);


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.

@willbrowningme
Copy link
Member

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

@luckydonald
Copy link
Author

luckydonald commented 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.

@willbrowningme
Copy link
Member

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.

@luckydonald
Copy link
Author

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

@willbrowningme
Copy link
Member

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.

@luckydonald
Copy link
Author

luckydonald commented 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.

@willbrowningme
Copy link
Member

Just pushed a new release now.

@luckydonald
Copy link
Author

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 up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants