Custom rules: out of office from different domain

Discussion in 'Installation/Configuration' started by Shyciii, Jul 11, 2023.

  1. Shyciii

    Shyciii Member

    Hi. I want custom rules for out of office. The complexity is that different text must be sent as a response depending on the domain from which it was sent. So send a different out of office text if a letter comes from *@valami.hu, and a different out of office text if a letter comes from *@mas.hu.
    As far as I can see, this could be written under mailbox/custom rules, the only question is how. May something:
    if address :domain :is "valami.hu" "" {
    ????
    stop;
    }​
     
  2. Shyciii

    Shyciii Member

    I try the following code in .ispconfig.sieve:

    if currentdate :value "ge" "iso8601" "2023-07-10T14:00:00" {
    if currentdate :value "le" "iso8601" "2023-07-14T14:00:00" {
    if header :contains "from" "valami.hu" {

    vacation :days 1
    :subject "Automatikus válasz"
    :addresses ["[email protected]"]
    "Tisztelt Levélíró CCPRO!

    Words";

    }
    }
    }​

    But doesnt works. When remove if header rows, then the autoreply works.
     
    ahrasis likes this.
  3. Shyciii

    Shyciii Member

    RESOLVED

    Code:
    require ["body", "copy", "date", "envelope", "fileinto", "imap4flags", "mailbox", "regex", "reject", "relational", "subaddress", "vacation", "variables"];
    
    if currentdate :value "ge" "iso8601" "2023-07-10T14:00:00" {
    if currentdate :value "le" "iso8601" "2023-07-14T14:00:00" {
    if envelope :domain :is "from" "anyam.hu" {
    
    vacation  :days 1
      :subject "Automatikus válasz"
      :addresses ["[email protected]"]
      "Tisztelt Levélíró!
    
      blablabla
    
    ";
    }
    if envelope :domain :is "from" "apam.hu" {
    
    vacation  :days 1
      :subject "Automatikus válasz"
      :addresses ["[email protected]"]
      "Tisztelt Levélíró!
    
      blablabla2
    
    ";
    }
    }
    }
     
    ahrasis and till like this.

Share This Page