|
FastMail Forum All posts relating to FastMail.FM should go here: suggestions, comments, requests for help, complaints, technical issues etc. |
|
Thread Tools |
14 Dec 2018, 02:42 AM | #1 |
Member
Join Date: Mar 2018
Posts: 53
|
sieve script for blocking mailchimp to specific alias email
How would I write a rule for sieve to stop ALL mail being sent to a specific alias email via mailchimp. Alias email has to be in the semi-public domain so no point changing it but certain organisations are begging me for money via mailchimp. If you need the raw data info let me know which bit. thx
|
14 Dec 2018, 05:18 AM | #2 |
The "e" in e-mail
Join Date: May 2003
Location: mostly in Thailand
Posts: 3,095
|
When constructing complex sieve rules, you need to carefully examine the headers of the messages you want to manipulate. Perhaps, you could post the headers of two representative messages,, obscuring personally identifiable information. (I suggest changing the part of an email address that identifies an individual account to something like '<my-account>', '<sender's-account>').
|
14 Dec 2018, 11:01 AM | #3 |
Cornerstone of the Community
Join Date: Jun 2004
Location: Rupert, WV
Posts: 882
|
When a particular email is opened to be read, click on the 'more' dropdown and then the 'Add rule from message' choice. The 'Mailing List ID' spec should already be one of the conditions, then click the 'Add Condition' button and add the specific email address that you want this rule to apply to.
If that doesn't work, you can delete the 'ID' condition, and add one like this: https://monosnap.com/file/Kag0BI2Cee...jz4Xs37WpHhFKz This is what I'd do, hopefully it works for you as well. - Bruce edit: if it's a legitimate mailing list email, perhaps just unsubscribe from it.. |
15 Dec 2018, 02:18 PM | #4 | ||
Member
Join Date: Mar 2018
Posts: 53
|
Quote:
Quote:
if header :contains "X-Mailer" ["MailChimp"] {reject } Last edited by ferrety : 15 Dec 2018 at 02:46 PM. |
||
15 Dec 2018, 03:33 PM | #5 |
The "e" in e-mail
Join Date: May 2003
Location: mostly in Thailand
Posts: 3,095
|
You can create a rule based on the To alias and the X-Mailer header.
Go to Settings->Rules, click New rule, and use Code:
If all of the following conditions apply Any recipient email is exactly <the desired alias> Code:
A header called X-Mailer begins with MailChimp Mailer Permanently delete the message Then click Save |
15 Dec 2018, 05:19 PM | #6 | |
Member
Join Date: Mar 2018
Posts: 53
|
Quote:
|
|
15 Dec 2018, 05:33 PM | #7 | ||
Member
Join Date: Mar 2018
Posts: 53
|
Quote:
Quote:
|
||
15 Dec 2018, 07:56 PM | #8 | |
The "e" in e-mail
Join Date: May 2003
Location: mostly in Thailand
Posts: 3,095
|
Quote:
Code:
if allof( address :is ["To","Cc","Resent-To","X-Delivered-To"] "MyAlias@MyDomain.com", header :matches "X-Mailer" "MailChimp Mailer*" ) { discard; stop; } |
|
17 Dec 2018, 05:16 PM | #9 |
Essential Contributor
Join Date: May 2018
Posts: 478
|
I do what was just described. But I always keep the rule disabled at the start of the list of rules to make it easier to spot in the sieve script. It will be the first rule that's is always commented out. No need to go back and delete it.
|
17 Dec 2018, 05:29 PM | #10 | ||
Member
Join Date: Mar 2018
Posts: 53
|
Quote:
Really appreciate your knowledge here Will the script I wrote fail, if so what about it have I messed up. Again forgetting aliases (so as to make it less complicated)? PS I signed up for a free mailchimp account (giving the spammy gits no private info) I used an alias email & sent my self test emails while fiddling with sieve script. To test if my script was stopping them. It only started stopping them when I set it like below Quote:
|
||
18 Dec 2018, 03:46 PM | #11 |
The "e" in e-mail
Join Date: May 2003
Location: mostly in Thailand
Posts: 3,095
|
Your simpler version will likely not have issues. However, it is best not to be sloppy with things like sieve code, and be very specific in the conditions you want to test. People have often run into trouble in the past by having their rules unexpectedly match something other than what was intended. You probably do not need to change your code here. However, for the future, I would recommend using Rules or (if, for some reason you cannot in a specific situation) being very careful and specific about your tests.
|
18 Dec 2018, 11:33 PM | #12 | |
Member
Join Date: Mar 2018
Posts: 53
|
Quote:
|
|
19 Dec 2018, 02:33 AM | #13 |
The "e" in e-mail
Join Date: Feb 2006
Location: EU
Posts: 4,945
|
|