mirror of
https://github.com/anonaddy/anonaddy.git
synced 2026-04-25 14:15:53 +03:00
[GH-ISSUE #5] New email to a soft deleted alias causes 'Integrity constraint violation: 1062 Duplicate entry' #616
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/anonaddy#616
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @vensko on GitHub (Nov 8, 2019).
Original GitHub issue: https://github.com/anonaddy/anonaddy/issues/5
github.com/anonaddy/anonaddy@2294f26926/app/Console/Commands/ReceiveEmail.php (L207)If an alias was (soft) deleted and a new email arrives to it, it attempts to create the same alias again and causes the '1062 Duplicate entry' exception.
@anonaddy commented on GitHub (Nov 11, 2019):
Thanks for your comments.
This issue and #7 are both caused by the same issue. It is my fault for not mentioning this in the Self Hosting section of the readme file.
Before Postfix pipes an email to the application it does a database lookup to check if an alias has been deactivated or deleted. If the alias has been deactivated Postfix DISCARDS the email, if the alias has been deleted then Postfix REJECTS the email.
I've just updated the Postfix configuration of the readme to include instructions on how to set this up.
So because of this a deleted or deactivated alias will never be piped through to the application and the integrity constraint violation error will not be thrown.
If you would rather not use the above method you could pipe all emails through to the application and then write a simple function in
ReceiveEmail.phpto check if aliases have been deactivated/deleted.