mail_alias_add not for mail alias domain

Discussion in 'General' started by KoS, Nov 21, 2013.

  1. KoS

    KoS Member HowtoForge Supporter


    in the API documentation of mail_alias_add there is a params "type" which can be enum('alias','aliasdomain','forward','catchall')). i tried adding an mail aliasdomain that way (first created the source and destination domains), but i get an "email_error_isemail".

    when i look at the code of mail_alias_add, it uses the mail/form/mail_alias.tform.php. shouldn't it use the mail_aliasdomain.tform.php for the aliasdomain-type ?
    or in which form should the source and destination domains be supplied? i tried plain domain name, e.g. "", and with a @ at the beginning, e.g. "", because on the web-interface the alias domains are displayed with an @ in front of the domain name.

  2. till

    till Super Moderator Staff Member ISPConfig Developer

    The mail_alias_add function id for adding email alias addresses, not domains. The type list in api doku is not correct.

    To add a aliasdomain, use the function "mail_aliasdomain_add".
  3. KoS

    KoS Member HowtoForge Supporter

    thanks, i'll try.

    i checked the documentation that's with ispconfig in
    ispconfig3_install/remoting_client/API-docs/index.html and didn't see the funciton. now checking the source code interface/lib/classes/ i see the function.

    is there an up-to-date documentation of the API? so that i don't miss some more functions :)
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    No, thats the latest documentation available. But you can find all functions in /usr/local/ispconfig/interface/lib/classes/
  5. KoS

    KoS Member HowtoForge Supporter

    okay, so i'll concentrate more on the code :)

    so i tried the mail_aliasdomain_add function and here are my findings:

    source: (the @ is mandatory)
    destination: (@ is mandatory for aliasdomain, but not checked)
    type: 'alias' -> email alias
    type: 'forward' -> email forward
    type: empty -> doesn't show up in the GUI, but an entry in the mail_forwarding table is created with an empty type -> i think that should'nt be possible

    but the desired "aliasdomain" isn't visible in mail_aliasdomain.tform.php line 118, but it works and creates the "Domain Alias" as expected :)

    so the validator for the type field is not working ?
  6. till

    till Super Moderator Staff Member ISPConfig Developer

    The type field is used by the interface to show the records in different lists, type is not used by postfix. so it does not matter whcih type you use for postfix, but it matters for the web interface. The type field is set by the interface scripts in the code, so it cant be altered by the logged in user and dos not require a validator therefor.

Share This Page