mirror of
				https://github.com/paperless-ngx/paperless-ngx.git
				synced 2025-10-30 03:56:23 -05:00 
			
		
		
		
	Enhancement: Allow excluding mail attachments by name (#4691)
* Adds new filtering to exclude attachments from processing * Frontend use include / exclude mail rule filename filters --------- Co-authored-by: shamoon <4887959+shamoon@users.noreply.github.com>
This commit is contained in:
		| @@ -21,7 +21,8 @@ | ||||
|         <pngx-input-text i18n-title title="Filter to" formControlName="filter_to" [error]="error?.filter_to"></pngx-input-text> | ||||
|         <pngx-input-text i18n-title title="Filter subject" formControlName="filter_subject" [error]="error?.filter_subject"></pngx-input-text> | ||||
|         <pngx-input-text i18n-title title="Filter body" formControlName="filter_body" [error]="error?.filter_body"></pngx-input-text> | ||||
|         <pngx-input-text i18n-title title="Filter attachment filename" formControlName="filter_attachment_filename" i18n-hint hint="Only consume documents which entirely match this filename if specified. Wildcards such as *.pdf or *invoice* are allowed. Case insensitive." [error]="error?.filter_attachment_filename"></pngx-input-text> | ||||
|         <pngx-input-text i18n-title title="Filter attachment filename includes" formControlName="filter_attachment_filename_include" i18n-hint hint="Only consume documents which entirely match this filename if specified. Wildcards such as *.pdf or *invoice* are allowed. Case insensitive." [error]="error?.filter_attachment_filename_include"></pngx-input-text> | ||||
|         <pngx-input-text i18n-title title="Filter attachment filename excluding" formControlName="filter_attachment_filename_exclude" i18n-hint hint="Do not consume documents which entirely match this filename if specified. Wildcards such as *.pdf or *invoice* are allowed. Case insensitive." [error]="error?.filter_attachment_filename_exclude"></pngx-input-text> | ||||
|       </div> | ||||
|       <div class="col-md-4"> | ||||
|         <pngx-input-select i18n-title title="Action" [items]="actionOptions" formControlName="action" i18n-hint hint="Action is only performed when documents are consumed from the mail. Mails without attachments remain entirely untouched."></pngx-input-select> | ||||
|   | ||||
| @@ -158,7 +158,8 @@ export class MailRuleEditDialogComponent extends EditDialogComponent<PaperlessMa | ||||
|       filter_to: new FormControl(null), | ||||
|       filter_subject: new FormControl(null), | ||||
|       filter_body: new FormControl(null), | ||||
|       filter_attachment_filename: new FormControl(null), | ||||
|       filter_attachment_filename_include: new FormControl(null), | ||||
|       filter_attachment_filename_exclude: new FormControl(null), | ||||
|       maximum_age: new FormControl(null), | ||||
|       attachment_type: new FormControl(MailFilterAttachmentType.Attachments), | ||||
|       consumption_scope: new FormControl(MailRuleConsumptionScope.Attachments), | ||||
|   | ||||
| @@ -49,7 +49,9 @@ export interface PaperlessMailRule extends ObjectWithPermissions { | ||||
|  | ||||
|   filter_body: string | ||||
|  | ||||
|   filter_attachment_filename: string | ||||
|   filter_attachment_filename_include: string | ||||
|  | ||||
|   filter_attachment_filename_exclude: string | ||||
|  | ||||
|   maximum_age: number | ||||
|  | ||||
|   | ||||
| @@ -23,7 +23,8 @@ const mail_rules = [ | ||||
|     filter_to: null, | ||||
|     filter_subject: null, | ||||
|     filter_body: null, | ||||
|     filter_attachment_filename: null, | ||||
|     filter_attachment_filename_include: null, | ||||
|     filter_attachment_filename_exclude: null, | ||||
|     maximum_age: 30, | ||||
|     attachment_type: MailFilterAttachmentType.Everything, | ||||
|     action: MailAction.MarkRead, | ||||
| @@ -40,7 +41,8 @@ const mail_rules = [ | ||||
|     filter_to: null, | ||||
|     filter_subject: null, | ||||
|     filter_body: null, | ||||
|     filter_attachment_filename: null, | ||||
|     filter_attachment_filename_include: null, | ||||
|     filter_attachment_filename_exclude: null, | ||||
|     maximum_age: 30, | ||||
|     attachment_type: MailFilterAttachmentType.Everything, | ||||
|     action: MailAction.Delete, | ||||
| @@ -57,7 +59,8 @@ const mail_rules = [ | ||||
|     filter_to: null, | ||||
|     filter_subject: null, | ||||
|     filter_body: null, | ||||
|     filter_attachment_filename: null, | ||||
|     filter_attachment_filename_include: null, | ||||
|     filter_attachment_filename_exclude: null, | ||||
|     maximum_age: 30, | ||||
|     attachment_type: MailFilterAttachmentType.Everything, | ||||
|     action: MailAction.Flag, | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Trenton H
					Trenton H