Regarding mail ports

Discussion in 'Installation/Configuration' started by kendel, Jan 5, 2013.

  1. kendel

    kendel New Member

    Just wondering how do you find out what the default ports the mail server is running on, like incomming and outgoing? And can they be changed?
  2. falko

    falko Super Moderator ISPConfig Developer

    Smtp: 25
    pop3: 110
    imap: 143
    imaps: 993
    pop3s: 995
  3. kendel

    kendel New Member

    Ok I see so they are defaulted, just wanted to be sure, so I installed roundcube on the mail server which responds to internal ip of but it doesnt respond to the hostname of

    I made these changes in ispconfig on the cpanel server: (ubuntu)


    isset($_SERVER['HTTPS'])? $http = 'https' : $http = 'http';
    $http = 'http';
    header('Location:' . $http . '://' . $serverData['server_name'] . '/roundcube');

    now it redirects properly but doesn't pull up roundcube, rather I get page not found error.
  4. kendel

    kendel New Member

    Also, would it have been better to install roundcube to the panel server and change the config files to connect to the mail server? Then make changes to ispconfig so it connects to roundcube on local host? Right now I am at a stand stil trying to make ispconfig load the roundcube off the mailserver and then giving it the ablity to access externally...
  5. tahunasky

    tahunasky New Member

    I create my own apache webmail redirection - which uses the default created subdomain mail.

    Then i create a symbolic link in /etc/httpd/conf/sites-enabled to the _default.conf

    What it does - for any sub-domain (i host a few virtual domains) of mail it gets redirected to my squirrelmail ( i have used roundcube too but its slow compared to sqm) and ssl used. I prefer this to

    OR you can just create a roundcube.conf like this:

    This will work when someone users or Change /opt/roundcubemail-0.8.0 to the directory where you have installed it.

    Remember to restart httpd to make changes take effect.
    Last edited: Jan 6, 2013
  6. kendel

    kendel New Member

    I think I understand a little bit, but there was no apache installation on my mailserver, so do I put the virtual host on the webserver and point it to the internal IP somehow?
  7. tahunasky

    tahunasky New Member

    If you dont have apache installed how does roundcube work, as it needs a webserver running - either apache, nginx or something else !

    I would suggest you install apache or nginx as if you try to run from another server, its going to be slower and more complicated to setup - and will be harder to learn/understand whats going on.
    Unless its a large user base there really is no point. I have in the past had separate boxes running smtp and imap/webmail, but that was for a 1000 plus users, but most setups i do are for 20 to 100 users and i only ever have 1 box running postfix/dovecot/webmail, and the only other box i need is a backup mx, which is shared between several companies.
    Last edited: Jan 6, 2013
  8. kendel

    kendel New Member

    Sorry I was mistaken it does have apache, I just wasn't using it as an apache server.
  9. till

    till Super Moderator Staff Member ISPConfig Developer

    All you have to do is to create a alias in apache for this type of access like I described in the PM and tahunasky explained in detail in his post. The setup is described in the perfect setup guide for squirrelmail and the setup for roundcube is similar, you just change the paths from squirrelmail to roundcube.

    E.g. for debian, chapter 20.2:
  10. kendel

    kendel New Member

    How can I check for errors, I did everything you listed and it still does not work.

    I created a DNS A record for with internal IP.

    then I did the Virtual host record on the mailserver (hostname

    then I followed the rest of steps for squirrelmail except replacing with roundcube.

    Externally it still does not work.

    I also realized that I made 2 modifications to roundcube.. first was

    nano /etc/apache2/conf.d/roundcube.conf
    which I added
    DocumentRoot /usr/share/roundcube

    The second I created through webmin a virtual host on the apache server for the directory of /var/www/roundcube
  11. till

    till Super Moderator Staff Member ISPConfig Developer

    Then you might have done the same configuration 3 times. Please check that you added just one vhost for roundcube, it does not matter if you do this on the shell or with webmin. Then check the apache error.log for errors.
  12. kendel

    kendel New Member

    Here is a list of things that I did, maybe you can tell me where I went wrong.
    First, I installed roundcube on the email server.
    (using roundcube.0.8.4 on ubuntu 12.04)
    apt-get -y install apache2
    Reconfigure Roundcube
    aptitude install roundcube roundcube-mysql
    dpkg-reconfigure roundcube-core
    Create Symlink for RoundCube
    sudo ln -s /usr/share/roundcube /var/www/roundcube
    restart apache
    So far this part works.
    I then followed the link and substituted everything for roundcube.
    nano /etc/apache2/conf.d/roundcube.conf
    (note: there was already a file in that location called roundcube and contained some information I left untouched)
    <Directory /usr/share/roundcube>
      Options FollowSymLinks
      <IfModule mod_php5.c>
        AddType application/x-httpd-php .php
        php_flag magic_quotes_gpc Off
        php_flag track_vars On
        php_admin_flag allow_url_fopen Off
        php_value include_path .
        php_admin_value upload_tmp_dir /var/lib/roundcube/tmp
        php_admin_value open_basedir /usr/share/roundcube:/etc/roundcube:/var/lib/roundcube:/etc/hostname:/etc/mailname:/var/spool/roundcube
        php_flag register_globals off
      <IfModule mod_dir.c>
        DirectoryIndex index.php
      # access to configtest is limited by default to prevent information leak
      <Files configtest.php>
        order deny,allow
        deny from all
        allow from
    Create the directory /var/lib/roundcube/tmp...
    mkdir /var/lib/roundcube/tmp
    ... and make it owned by the user www-data:
    chown www-data /var/lib/roundcube/tmp  (this command does not seem to work)
    Reload Apache again:
    /etc/init.d/apache2 reload 
    I then used Webmin on the email server to create the virtual host:
    DocumentRoot /var/www/roundcube
    ServerAdmin [email protected]
    ServerAlias webmail.*
    <Directory />
    Options FollowSymLinks
    AllowOverride None
    <Directory /var/www/>
    Options Indexes FollowSymLinks MultiViews
    AllowOverride None
    Order allow,deny
    allow from all
    ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
    <Directory "/usr/lib/cgi-bin">
    AllowOverride None
    Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
    Order allow,deny
    Allow from all
    ErrorLog /var/log/apache2/error.log
    LogLevel warn
    CustomLog /var/log/apache2/access.log combined
    Alias /doc/ "/usr/share/doc/"
    <Directory "/usr/share/doc/">
    Options Indexes MultiViews FollowSymLinks
    AllowOverride None
    Order deny,allow
    Deny from all
    Allow from ::1/128
    <Directory /var/www/roundcube>
    allow from all
    Options +Indexes
    Finally I created the DNS records by attaching an "A" record Host: subdomain IP: (internal ip).
    Last edited: Jan 7, 2013
  13. kendel

    kendel New Member

    How do you properly write this to not get an error, it seems the steps i am looking for is a proxypass
    ProxyRequests Off
    <Proxy *>
    Order deny,allow
    Allow from all
    ProxyPass /
    ProxyPassReverse /
    <Location />
    Order allow,deny
    Allow from all

    I created a Virtual Server using webmin and the settings above, but it always goes back to the main server
    mod_proxy is installed running ubuntu 12.04....

    How can I fix this?

    The idea is my webserver gets port 80, but for requests of a subdomain should be sent to the mailserver on port 81. There are 2 seperate servers with apache instances (different internal IPs)
    Last edited: Jan 9, 2013
  14. kendel

    kendel New Member

    Still looking for help on this. I am now up to checking if vhost is enabled but ispconfig overwrites any changes I make to the domain.conf file.:mad:
    I followed this link: but the section in vi /etc/apache2/apache2.conf that it wants to be added does not exist.
    Last edited: Jan 10, 2013
  15. till

    till Super Moderator Staff Member ISPConfig Developer

    Never edit a domain config file manually and using webmin to edit apache files can conflict with ispconfig. If you want to add code to a vhost config file, add it in the apache or nginx directives field of the webite in ispconfig.

    The tutorial you followed is about a completely different topic and not suitable to display roundcube. Beside that, its from 2007and will mostnlikely not work with ispconfig 3.0.4 ans later anyway. I highly recommend to undo all changes you made according to this guide or you eill likely break your setup.
  16. kendel

    kendel New Member


Share This Page