Initial commit spam/ham scripts for dovecot
This commit is contained in:
		
							parent
							
								
									1707d577ad
								
							
						
					
					
						commit
						1e2f36d7a1
					
				| 
						 | 
					@ -0,0 +1,2 @@
 | 
				
			||||||
 | 
					#!/bin/sh
 | 
				
			||||||
 | 
					exec /usr/bin/rspamc -h localhost:11334 learn_ham
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,16 @@
 | 
				
			||||||
 | 
					require ["vnd.dovecot.pipe", "copy", "imapsieve", "environment", "variables"];
 | 
				
			||||||
 | 
					  
 | 
				
			||||||
 | 
					if environment :matches "imap.mailbox" "*" {
 | 
				
			||||||
 | 
					  set "mailbox" "${1}";
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					if string "${mailbox}" "Trash" {
 | 
				
			||||||
 | 
					  stop;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					if environment :matches "imap.user" "*" {
 | 
				
			||||||
 | 
					  set "username" "${1}";
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					pipe :copy "rspamd-learn-ham.sh" [ "${username}" ];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,3 @@
 | 
				
			||||||
 | 
					#!/bin/sh
 | 
				
			||||||
 | 
					exec /usr/bin/rspamc -h localhost:11334 learn_spam
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,8 @@
 | 
				
			||||||
 | 
					require ["vnd.dovecot.pipe", "copy", "imapsieve", "environment", "variables"];
 | 
				
			||||||
 | 
					  
 | 
				
			||||||
 | 
					if environment :matches "imap.user" "*" {
 | 
				
			||||||
 | 
					  set "username" "${1}";
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					pipe :copy "rspamd-learn-spam.sh" [ "${username}" ];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue