Send notification emails when inbound emails are rejected
With this commit, explanatory messages are sent when inbound messages are rejected. Four error types are defined: PARSING_ERROR, INACTIVE_ACCOUNT, UNKNOWN_ACCOUNT, and INTERNAL_EXCEPTION. PARSING_ERROR (probably the most frequent one) occurs when the Gerrit metadatas can't be parsed. INACTIVE_ACCOUNT occurs when the user's account is Inactive. UNKNOWN_ACCOUNT occurs when zero or more than one accounts are found for the incoming email address. This might be caused by multiple sources providing the same user. INTERNAL_EXCEPTION is used for all the other exceptions that can't be described properly to the end user. For now, it is only fired when two Changes are found with the same Id. This _should_ be a rare exception, but it might occur. This change also introduces a new MailHeader enum, and removes the old MetadataName one. This allows for a cleaner way to define both Mail headers and Gerrit "internal" metadata names. Feature: Issue 8210 Change-Id: I48a081f2ce1be391b9f3ff991760740d5ada3357
This commit is contained in:

committed by
David Pursehouse

parent
96251c8d71
commit
2a10edcddc
@@ -136,6 +136,7 @@ import com.google.gerrit.server.git.validators.RefOperationValidators;
|
||||
import com.google.gerrit.server.git.validators.UploadValidationListener;
|
||||
import com.google.gerrit.server.git.validators.UploadValidators;
|
||||
import com.google.gerrit.server.index.change.ReindexAfterRefUpdate;
|
||||
import com.google.gerrit.server.mail.AutoReplyMailFilter;
|
||||
import com.google.gerrit.server.mail.EmailModule;
|
||||
import com.google.gerrit.server.mail.ListMailFilter;
|
||||
import com.google.gerrit.server.mail.MailFilter;
|
||||
@@ -145,6 +146,7 @@ import com.google.gerrit.server.mail.send.CreateChangeSender;
|
||||
import com.google.gerrit.server.mail.send.DeleteReviewerSender;
|
||||
import com.google.gerrit.server.mail.send.FromAddressGenerator;
|
||||
import com.google.gerrit.server.mail.send.FromAddressGeneratorProvider;
|
||||
import com.google.gerrit.server.mail.send.InboundEmailRejectionSender;
|
||||
import com.google.gerrit.server.mail.send.MailSoyTofuProvider;
|
||||
import com.google.gerrit.server.mail.send.MailTemplates;
|
||||
import com.google.gerrit.server.mail.send.MergedSender;
|
||||
@@ -265,6 +267,7 @@ public class GerritGlobalModule extends FactoryModule {
|
||||
factory(RegisterNewEmailSender.Factory.class);
|
||||
factory(ReplacePatchSetSender.Factory.class);
|
||||
factory(SetAssigneeSender.Factory.class);
|
||||
factory(InboundEmailRejectionSender.Factory.class);
|
||||
bind(PermissionCollection.Factory.class);
|
||||
bind(AccountVisibility.class).toProvider(AccountVisibilityProvider.class).in(SINGLETON);
|
||||
factory(ProjectOwnerGroupsProvider.Factory.class);
|
||||
@@ -391,6 +394,9 @@ public class GerritGlobalModule extends FactoryModule {
|
||||
|
||||
DynamicMap.mapOf(binder(), MailFilter.class);
|
||||
bind(MailFilter.class).annotatedWith(Exports.named("ListMailFilter")).to(ListMailFilter.class);
|
||||
bind(AutoReplyMailFilter.class)
|
||||
.annotatedWith(Exports.named("AutoReplyMailFilter"))
|
||||
.to(AutoReplyMailFilter.class);
|
||||
|
||||
factory(UploadValidators.Factory.class);
|
||||
DynamicSet.setOf(binder(), UploadValidationListener.class);
|
||||
|
Reference in New Issue
Block a user