email alias with folder

Discussion in 'ISPConfig 3 Priority Support' started by luisdaniel, May 22, 2015.

  1. luisdaniel

    luisdaniel New Member

    Hello there!
    I'm looking for a solution to create an email alias and in the destiny it will a new folder, with same name as alias, and every email goes to that folder.
    Let me give you an example:
    The email box address is [email protected] and I want to create an alias [email protected], and every email sent to [email protected] go to the folder email2 where is inside the main email.
    And it'll be cool if it's possible create my own php to create this alias and avoid using panel control.
    Best regards
  2. Croydon

    Croydon ISPConfig Developer ISPConfig Developer

    You will have to do this via mail filters in the mail box. After creating the alias mail address go to tab "mail filter" in the mail box, create a new one with "To" and "contains" and then let it move the mail to a new folder.

    You can add mail addresses and set filters using the remoting api. See the remoting examples in the ISPConfig download package.
  3. luisdaniel

    luisdaniel New Member

    But that will be done in server side?
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    ISPConfig will write the .sieve file for that email account to move the incoming emails into the desired folder.
  5. luisdaniel

    luisdaniel New Member

    Thanks for your help.
    Let me see if I right, the location of the file .sieve is in /var/vmail/<account/domain>/<user>/.sieve or it's other?
    If yes, I need to add this code into it:
    if address :is "to" "<email>" {
    fileinto "<folder name>";​
    } elsif address :is "to" "<email2>" {
    fileinto "<folder name2>";​
    } else {
    And I need also to add a row to mysql into table mail_forwarding telling the source, destination and is alias.
    Do I need anything else?
  6. Croydon

    Croydon ISPConfig Developer ISPConfig Developer

    Bad idea. If you do it this way, ISPConfig will overwrite your data next time the mailbox is changed in the panel. In addition mail forwards added "by hand" are not in sync with the ispconfig datalog.
    Use the remoting api to make changes.

Share This Page