Sieve question: Rewriting from using variables (ccsend issues)
As a journalist, I deal with a lot of PR companies that use constant contact. For years, I've built up a nice sieve filter that sports these people into my PR folder. I guess to help with dkim/SPF issues, Constant Contact has started rewriting the from header to the sender's address rewritten to end with a ccsend domain. The sender's actual email address is now in the reply-to header. This has resulted in all my PR emails ending up in the main inbox. Rather than rewrite hundreds of rules, I asked (foolishly?) ChatGPT if there was a way to check for ccsend in the from and then use the reply-to as the from. This is what it came up with and this would be the first rule in the sieve file: #Many PR companies use ccsend for lists. Check if headers contain "ccsend" and #then use reply-to for rules if allof (header :contains "from" "ccsend") { # Set "Reply-To" as "From" address set "from" "${reply-to}"; } Before I put this into production, will this work? Do the rest of the rules go inside the last curly bracket or after it? Thanks for any advice. ___ dovecot mailing list -- dovecot@dovecot.org To unsubscribe send an email to dovecot-le...@dovecot.org
Re: sieve question
On 21 Apr 2020, at 11:54, Ralph Seichter wrote: > * mj: > Our autoreply message reads: "Your email has not been read nor >> forwarded", which is also the case, forcing the sender to take action. > > No, it does not. An auto-reply message, even if it is actually read by > the sender, can be ignored without penalty. An MTA rejection puts the > ball into the sender's court because the message has never been accepted > by the recipient's MX. Yep, that was the point I was trying to make upthread, but you stated it better. > By the way, a rejection is "legally safe", while > your catch-all-and-let-messages-rot approach is not, in case you have > not considered that. Good point, I haven’t thought of that. That, alone, is a reason not to do this. > Of course, you can do as you please, but that does not change the facts > and mechanics involved. -- @notallmikaylas Any man who is genuinely scared that feminism means female dominance pictures a world where men are treated like women. Think about that.
Re: sieve question
On 4/21/20 7:54 PM, Ralph Seichter wrote: No, it does not. An auto-reply message, even if it is actually read by the sender, can be ignored without penalty. An MTA rejection puts the ball into the sender's court because the message has never been accepted by the recipient's MX. By the way, a rejection is "legally safe", while your catch-all-and-let-messages-rot approach is not, in case you have not considered that. Of course, you can do as you please, but that does not change the facts and mechanics involved. Thank you for your feedback, we will take it into consideration. MJ
Re: sieve question
* mj: > Our autoreply message reads: "Your email has not been read nor > forwarded", which is also the case, forcing the sender to take action. No, it does not. An auto-reply message, even if it is actually read by the sender, can be ignored without penalty. An MTA rejection puts the ball into the sender's court because the message has never been accepted by the recipient's MX. By the way, a rejection is "legally safe", while your catch-all-and-let-messages-rot approach is not, in case you have not considered that. Of course, you can do as you please, but that does not change the facts and mechanics involved. -Ralph
Re: sieve question
Hi all, Thanks for the interesting discussion. The idea behind the catch-all mailbox is basically to have a transitional period between now and the nullmx config we did not know about. (thanks for mentioning that, we will do it!) Our autoreply message reads: "Your email has not been read nor forwarded", which is also the case, forcing the sender to take action. It is just kept in a simple catch-all mailbox, for a couple of weeks/months, in case we discover that something important was accidentally still sent to the old domain. And yes, that would be neither fish nor flesh for the time being, but only during the transitional period. Afterwards we will put the nullmx config in place. Thanks for again for all your thoughts: appreciated. MJ On 4/21/20 4:02 AM, LuKreme wrote: On Apr 20, 2020, at 19:13, @lbutlr wrote: The other thing you can do is NOMX the old domain. Sorry, nullmx is what I meant. Btw, I think this is the best solution. Sent from my iPhone
Re: sieve question
I do agree with that. It depends on what he wants to do and how to handle the old domain stuff. Remo > On Apr 20, 2020, at 18:13, @lbutlr wrote: > > > >> On 20 Apr 2020, at 04:27, mj wrote: >> >> Hi Ralph! >> >> Thanks for your reply! >> >> On 4/20/20 12:19 PM, Ralph Seichter wrote: >>> I suggest you don't use Sieve for this, but simply configure Postfix >>> to reject messages to @old.domain.com with the desired message. MTA >>> rejections signal clearly that the message has not been delivered, and >>> you can also include an URL pointing to a web page with more detailed >>> information. >> >> However, this means those emails are not actually delivered anymore. > > Yes, with a rejection message that informs why the message was not delivered. > This is the best thing you can do as it will force people to actually change > the email. > > If you delay this by doing something temporary, all you are doing is delaying > it. Once you cut off the old email you’ll be in the exact same situation you > are in right now, as very few people will update email addresses. > > If all you do now is autrespond with an automated message, most people will > never see that message. And if your auto-responder is paying the message is > not read or forwarded, what are you gaining? It is much better for the sender > to get an actual error which they are much more likely to see. > > The other thing you can do is NOMX the old domain. > > > > -- > in the long run there's still time to change the road you're on
Re: sieve question
On Apr 20, 2020, at 19:13, @lbutlr wrote: > > The other thing you can do is NOMX the old domain. Sorry, nullmx is what I meant. Btw, I think this is the best solution. Sent from my iPhone
Re: sieve question
> On 20 Apr 2020, at 04:27, mj wrote: > > Hi Ralph! > > Thanks for your reply! > > On 4/20/20 12:19 PM, Ralph Seichter wrote: >> I suggest you don't use Sieve for this, but simply configure Postfix >> to reject messages to @old.domain.com with the desired message. MTA >> rejections signal clearly that the message has not been delivered, and >> you can also include an URL pointing to a web page with more detailed >> information. > > However, this means those emails are not actually delivered anymore. Yes, with a rejection message that informs why the message was not delivered. This is the best thing you can do as it will force people to actually change the email. If you delay this by doing something temporary, all you are doing is delaying it. Once you cut off the old email you’ll be in the exact same situation you are in right now, as very few people will update email addresses. If all you do now is autrespond with an automated message, most people will never see that message. And if your auto-responder is paying the message is not read or forwarded, what are you gaining? It is much better for the sender to get an actual error which they are much more likely to see. The other thing you can do is NOMX the old domain. -- in the long run there's still time to change the road you're on
Re: sieve question
Well, I do not use postfix, but qmail. I would however, create an autorepond telling them the new address and then fwd the old address to the new one. But nothing to do with sieve, it’s at the SMTP level. Remo > On Apr 20, 2020, at 08:40, Ralph Seichter wrote: > > * mj: > >> this means those emails are not actually delivered anymore. > > Sure. That's how I interpreted your notification text "This message is > sent automatically, and your message has NOT been read nor forwarded." > If the message is not being read, why accept it in the first place? > >> For now, I would like them to *be* delivered, so we still have them in >> case something important comes in. > > Speaking for myself: If I send email to a business partner, that email > can be a) rejected, so I know I'll have to find another way to reach the > intended recipient, or it can be b) accepted, in which case I expect it > to be read/processed. > > What you describe seems to be neither fish nor flesh to me. Using MTA > rejects leaves no doubt that the *sender* has to become active. As I > understand it, that is you goal, is it not? > > -Ralph
Re: sieve question
* mj: > this means those emails are not actually delivered anymore. Sure. That's how I interpreted your notification text "This message is sent automatically, and your message has NOT been read nor forwarded." If the message is not being read, why accept it in the first place? > For now, I would like them to *be* delivered, so we still have them in > case something important comes in. Speaking for myself: If I send email to a business partner, that email can be a) rejected, so I know I'll have to find another way to reach the intended recipient, or it can be b) accepted, in which case I expect it to be read/processed. What you describe seems to be neither fish nor flesh to me. Using MTA rejects leaves no doubt that the *sender* has to become active. As I understand it, that is you goal, is it not? -Ralph
Re: sieve question
Hi Ralph! Thanks for your reply! On 4/20/20 12:19 PM, Ralph Seichter wrote: I suggest you don't use Sieve for this, but simply configure Postfix to reject messages to @old.domain.com with the desired message. MTA rejections signal clearly that the message has not been delivered, and you can also include an URL pointing to a web page with more detailed information. However, this means those emails are not actually delivered anymore. For now, I would like them to *be* delivered, so we still have them in case something important comes in. Your postfix suggestion would be my next step, in a couple of months perhaps. Hopefully someone has a suggestion for my sieve script. Thanks again, MJ
Re: sieve question
* mj: > Can anyone suggest what to do here? I suggest you don't use Sieve for this, but simply configure Postfix to reject messages to @old.domain.com with the desired message. MTA rejections signal clearly that the message has not been delivered, and you can also include an URL pointing to a web page with more detailed information. -Ralph
sieve question
Hi, We are trying to auto-reply to emails that still use one of our old domains. To do this, I have setup a catch-all mailbox for anything sent to that old domain using postfix virtual: @old.domain.com catch-...@new.domain.com Then I defined a sieve script for catch-...@new.domain.com, like: require ["vacation"]; if allof ( not exists ["list-help", "list-unsubscribe", "list-subscribe", "list-owner", "list-post", "list-archive", "list-id", "Mailing-List"] ) { vacation text: This message is sent automatically, and your message has NOT been read nor forwarded. Please update your addressbooks! All the best! :-) . ; } However, sieve never sends any auto-reply, because it logs: discarding vacation response for implicitly delivered message; no known (envelope) recipient address found in message headers (recipient=, and no additional `:addresses' are specified) I have googled this, but adding :addresses in this case will not work, as we are trying to answer (basically) emails sent to any email addresses sent to that domain, and thus I cannot define specific :addresses Can anyone suggest what to do here? Thanks and stay healthy! MJ
Re: Sieve question
On 3 Jul 2019, at 01:28, Stephan Bosch via dovecot wrote: > On 03/07/2019 04:44, @lbutlr via dovecot wrote: >> I have the following in my active sieve file, and there are no errors logged. >> >> >> if header :contains "to" "+root" { >>setflag "\\Seen"; >>fileinto :create "root"; >>stop; >> } >> >> The message is put in .root, bit is not marked as seen. >> >> Is the default action to put mail in a folder matching the extension taking >> precedence? > > That should work. What version is this (output from `dovecot -`n`)? There > have been some bugs with flags in the recent history. # 2.3.6 (7eab80676): /usr/local/etc/dovecot/dovecot.conf # Pigeonhole version 0.5.6 (92dc263a) # OS: FreeBSD 11.2-RELEASE-p10 i386 It seems ti be working now. Does dovecot need to refresh the sieve rules periodically? (It has not been restarted recently., so it’s not that).
Re: Sieve question
On 03/07/2019 04:44, @lbutlr via dovecot wrote: I have the following in my active sieve file, and there are no errors logged. if header :contains "to" "+root" { setflag "\\Seen"; fileinto :create "root"; stop; } The message is put in .root, bit is not marked as seen. Is the default action to put mail in a folder matching the extension taking precedence? That should work. What version is this (output from `dovecot -`n`)? There have been some bugs with flags in the recent history. Regards, Stephan.
Sieve question
I have the following in my active sieve file, and there are no errors logged. if header :contains "to" "+root" { setflag "\\Seen"; fileinto :create "root"; stop; } The message is put in .root, bit is not marked as seen. Is the default action to put mail in a folder matching the extension taking precedence?
Re: Sieve question
On Feb 10, 2016, at 12:18 AM, A.L.E.Cwrote: > require ["copy"] > if header :contains “from” “t...@example.com” { > redirect :copy “us...@example.com”; > redirect “us...@example.com”; > } Ah, right, that makes sense. Thanks. -- Honesty may be the best policy, but insanity is a better defense.
Re: Sieve question
Op 10-2-2016 om 10:30 schreef @lbutlr: On Feb 10, 2016, at 12:18 AM, A.L.E.Cwrote: require ["copy"] if header :contains “from” “t...@example.com” { redirect :copy “us...@example.com”; redirect “us...@example.com”; } Ah, right, that makes sense. Thanks. The copy extension is not needed here. The redirect action is explicit and will not be affected by cancellation of the implicit keep in the absence of ":copy". Just keep in mind that the total number of redirects is limited (subject to configuration). Regards, Stephan.
Sieve question
Is it possible to use redirect in a sieve to redirect to multiple addresses? if header :contains “from” “t...@example.com” { redirect “us...@example.com,us...@example.com”; } I thought this would work, But I am seeing a “redirect address is invalid: not a single addres [sic] (found ‘,’). -- I'll have what the gentleman on the floor is having.
Re: Sieve question
On 02/10/2016 02:18 AM, @lbutlr wrote: > Is it possible to use redirect in a sieve to redirect to multiple addresses? > > if header :contains “from” “t...@example.com” { > redirect “us...@example.com,us...@example.com”; > } I never tried, but according to RFC redirect argument is supposed to be an email address, so even a list is not allowed, but you may try redirect [“us...@example.com","us...@example.com”]; Anyway, there's "copy" extension. So, this should work: require ["copy"] if header :contains “from” “t...@example.com” { redirect :copy “us...@example.com”; redirect “us...@example.com”; } -- Aleksander 'A.L.E.C' Machniak Kolab Groupware Developer[http://kolab.org] Roundcube Webmail Developer [http://roundcube.net] --- PGP: 19359DC1 @@ GG: 2275252 @@ WWW: http://alec.pl
Re: [Dovecot] Sieve question
Op 13-6-2011 4:41, Dhaval Patel schreef: -- require fileinto; if header :contains X-Spam-Flag YES { fileinto spam; } -- My first question is, where is this global script? Do I configure the sieve_global_dir = /etc/dovecot/sieve/? What about he filename? http://wiki.dovecot.org/LDA/Sieve/Dovecot#Executing_Multiple_Scripts_Sequentially Use sieve_before. Script name is mainly important when a directory is specified, in which case it must end with .sieve. The directory/file can be located anywhere you like. Most users will not need any additional rules. There are some users that do and I am having a difficult time figuring out how it would be setup. My second question is the following. Is there a way in the global script to check if there is a file called /etc/dovecot/sieve/username or /home/vmail/username/personal_sieve_script and include it? Not like that. There is an include extension, but that is not able to do optional includes (maybe it should). You can use multiscript support for this too. Make the sieve_before setting dependent on the user, make it point to two alternative directories, each containing (symlinks to) a different set of scripts. I was using maildrop before this and procmail before that so I apologies for sounding stupid if this is not how Sieve scripts work. I am by no means tied the methods I describe above. If anyone knows of a better way to achieve what I am trying to do, I would appreciate if you let me know of it. Regards, Stephan.
[Dovecot] Sieve question
I have successfully setup Postfix - Dovecot with virtual users and spam filtering with spamassassin. Now the last remaining part is for the user defined rules. Let me describe my environment and what I am trying to achieve. I have Postfix setup to call spamc and deliver to Dovecot according to the master.cf line below. -- dovecot unix - n n - - pipe flags=DRhu user=vmail:vmail argv=/usr/bin/spamc -u vmail -e /usr/lib/dovecot/deliver -d ${recipient} -- The emails get checked by Spamassassin and are delivered to the users's mailbox (/home/vmail/username). I use an actual username (dhav) and not email address (dha...@example.com). Things are working fine with that. From reading http://wiki.dovecot.org/LDA/Sieve I see that Sieve can do global and user specified filtering. So I am planning to put the following rule into the global script so spammy emails go to the user's INBOX.spam folder. -- require fileinto; if header :contains X-Spam-Flag YES { fileinto spam; } -- My first question is, where is this global script? Do I configure the sieve_global_dir = /etc/dovecot/sieve/? What about he filename? Most users will not need any additional rules. There are some users that do and I am having a difficult time figuring out how it would be setup. My second question is the following. Is there a way in the global script to check if there is a file called /etc/dovecot/sieve/username or /home/vmail/username/personal_sieve_script and include it? I was using maildrop before this and procmail before that so I apologies for sounding stupid if this is not how Sieve scripts work. I am by no means tied the methods I describe above. If anyone knows of a better way to achieve what I am trying to do, I would appreciate if you let me know of it. Thanks, Dhaval
[Dovecot] Sieve question
Hi, is there a possibility to give the if cases a AND / OR sensetivity? if header :comparator i;ascii-casemap :contains X-Spam-Flag YES *AND NO *X-Amavis-Alert INFECTED{ fileinto Spam; stop; } elsif header :comparator i;ascii-casemap :contains X-Amavis-Alert INFECTED { fileinto Virus; stop; } else { keep; } I know - I could turn the two cases arround and it would sort in Virus before Spam which would prevent Virusmails going into the Spam folder accidently but I'm just intested for some other cases. Thanks
Re: [Dovecot] Sieve question
On Sat, 10 Jul 2010 19:38:34 +0200 Leander S. leander.schae...@googlemail.com wrote: Hi, is there a possibility to give the if cases a AND / OR sensetivity? You know about anyof/allof in the sieve language, yes? -- Perry E. Metzgerpe...@piermont.com
Re: [Dovecot] Sieve question
On 7/7/2009 1:59 PM, CJ Keist wrote: If there is a separate sieve mailing list let me know. But have question if someone else has done this or not. Right now I have web form people use to setup their vacation replies using Sieve (1.1.6). The form alows them to set what they want their reply address to be, whether to send the reply once, weekly or bi-weekly. I would like to setup another option to let them set the date in which to de-active the vacation replies automatically. Right now they have to remember to log back into the form to turn off the vacation reply. Has anyone set something like this up? From what I've seen of the sieve RFCs, there's no provision for setting this. (Or has that been added?) I also run into this request regularly with my users who want their vacation replies to turn on at 2pm Friday and turn off at 9am Monday. Which currently means that someone has to babysit the sieve scripts. Ideally, it would be an option to the vacation element (i.e. start time and end time). The reason that a start/end time would be useful is in the case of where someone wants to setup their vacation replies ahead of time, and have them automatically enable/disable for the specified time period. (apologies for continuing an old thread, but I'm curious)
Re: [Dovecot] Sieve question
On 10/16/2009 08:04 PM Thomas Harold wrote: … Ideally, it would be an option to the vacation element (i.e. start time and end time). The reason that a start/end time would be useful is in the case of where someone wants to setup their vacation replies ahead of time, and have them automatically enable/disable for the specified time period. (apologies for continuing an old thread, but I'm curious) Not yet tested, but it should be possible with the 'Date and Index Extensions'¹ for Sieve. From the Sieve NEWS file: v0.1.12 21-08-2009 Stephan Bosch stephan AT rename-it DOT nl … + Implemented the new date extension. This allows matching against date values in header fields and the current date at the time of script evaluation. Regards, Pascal -- 1 = http://tools.ietf.org/html/rfc5260 -- The trapper recommends today: face1e55.0928...@localdomain.org
Re: [Dovecot] Sieve question
On 07/07/2009 07:59 PM CJ Keist wrote: If there is a separate sieve mailing list let me know. But have question if someone else has done this or not. Right now I have web form people use to setup their vacation replies using Sieve (1.1.6). The form alows them to set what they want their reply address to be, whether to send the reply once, weekly or bi-weekly. I would like to setup another option to let them set the date in which to de-active the vacation replies automatically. Right now they have to remember to log back into the form to turn off the vacation reply. Has anyone set something like this up? The users are on holiday while the script is active? During this time the users does not login to imap/pop3? And you are using sieve only for vacation replies? If you answered all questions with 'yes', read on. Save the sieve script under a specific name, e.g. ~/sieve/vacation-reply.sieve. Use a post-loging Script, which tells the user she/he has to deactivate the sieve script in order to use the imap/pop3 server. For further information see: http://wiki.dovecot.org/PostLoginScripting Regards, Pascal -- The trapper recommends today: deadbeef.0919...@localdomain.org
[Dovecot] Sieve question
If there is a separate sieve mailing list let me know. But have question if someone else has done this or not. Right now I have web form people use to setup their vacation replies using Sieve (1.1.6). The form alows them to set what they want their reply address to be, whether to send the reply once, weekly or bi-weekly. I would like to setup another option to let them set the date in which to de-active the vacation replies automatically. Right now they have to remember to log back into the form to turn off the vacation reply. Has anyone set something like this up? -- C. J. Keist Email: cj.ke...@colostate.edu UNIX/Network ManagerPhone: 970-491-0630 Engineering Network ServicesFax: 970-491-5569 College of Engineering, CSU Ft. Collins, CO 80523-1301 All I want is a chance to prove 'Money can't buy happiness'