What have i done wrong (Postal Mail Server)

Discussion in 'HOWTO-Related Questions' started by SiGLOTFi, Jul 15, 2023.

  1. SiGLOTFi

    SiGLOTFi New Member



    Kindly assist as to what could be the root cause of this problem and possible solutions.
     
  2. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    Is it really the case that youtube video is the only way to describe the problem?
    Can you at least write text that explains the broad features of the problem.
     
    ahrasis and till like this.
  3. SiGLOTFi

    SiGLOTFi New Member

    Basically i followed the instruction found in the attached text file.

    And was able to successfully install Postal Mail Server but the problem here is that if i should test the SMTP on SMTPer.net, the generated credential works fine and i am able to successfully send a test mail.

    But if i should use the same credentials in any other SMTP supported mailer/sender, it doesn't seem to establish a connection with my SMTP.

    So i don't know if this is a configuration problem or an error from on my part.

    Thanks in anticipation for your assistance
     

    Attached Files:

  4. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    Why is this a problem?
    My signature has link to e-mail setup tutorial. It is for ISPConfig, which you maybe do not use, but you can use the troubleshooting chapter.
     
  5. pyte

    pyte Active Member HowtoForge Supporter

    Code:
    Nmap scan report for postal.siglot.net (194.163.141.78)
    Host is up (0.0044s latency).
    Not shown: 599 closed ports
    PORT   STATE SERVICE
    22/tcp open  ssh
    
    Nmap done: 1 IP address (1 host up) scanned in 0.11 seconds
    I am not able to reach the server on port 25 or 587. This cannot work.
     
    ahrasis likes this.
  6. SiGLOTFi

    SiGLOTFi New Member

    Good day house, i have gotten another VPS to further continue the bugging of the previous error i posted a few while back.

    This is what i am trying to achieve. I will like the experts in the house to help see if these setup will be possible.

    I want to use 1 VPS server for both
    1. Website hosting (via CyberPanel)
    2. Postal Installation

    I have been able to successfully completed the first step and the website is live but with regards to options 2. I have met a road block.

    In the installation process. i am currently stucked at the "Postal Initialization" stage where i am getting the error below.

    Code:
    Pulling web      ... done
    Pulling smtp     ... done
    Pulling worker   ... done
    Pulling cron     ... done
    Pulling requeuer ... done
    Creating postal_runner_run ... done
    Initializing database
    Access denied for user 'root'@'localhost' (using password: YES)
    Couldn't create 'postal' database. Please check your configuration.
    rake aborted!
    ActiveRecord::ConnectionNotEstablished: Access denied for user 'root'@'localhost' (using password: YES)
    /usr/local/bundle/gems/activerecord-6.1.7.3/lib/active_record/connection_adapters/mysql2_adapter.rb:45:in `rescue in new_client'
    /usr/local/bundle/gems/activerecord-6.1.7.3/lib/active_record/connection_adapters/mysql2_adapter.rb:39:in `new_client'
    /usr/local/bundle/gems/activerecord-6.1.7.3/lib/active_record/connection_adapters/mysql2_adapter.rb:23:in `mysql2_connection'
    /usr/local/bundle/gems/activerecord-6.1.7.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:882:in `public_send'
    /usr/local/bundle/gems/activerecord-6.1.7.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:882:in `new_connection'
    /usr/local/bundle/gems/activerecord-6.1.7.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:926:in `checkout_new_connection'
    /usr/local/bundle/gems/activerecord-6.1.7.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:905:in `try_to_checkout_new_connection'
    /usr/local/bundle/gems/activerecord-6.1.7.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:866:in `acquire_connection'
    /usr/local/bundle/gems/activerecord-6.1.7.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:588:in `checkout'
    /usr/local/bundle/gems/activerecord-6.1.7.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:428:in `connection'
    /usr/local/bundle/gems/activerecord-6.1.7.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:1128:in `retrieve_connection'
    /usr/local/bundle/gems/activerecord-6.1.7.3/lib/active_record/connection_handling.rb:327:in `retrieve_connection'
    /usr/local/bundle/gems/activerecord-6.1.7.3/lib/active_record/connection_handling.rb:283:in `connection'
    /usr/local/bundle/gems/activerecord-6.1.7.3/lib/active_record/tasks/mysql_database_tasks.rb:8:in `connection'
    /usr/local/bundle/gems/activerecord-6.1.7.3/lib/active_record/tasks/mysql_database_tasks.rb:21:in `create'
    /usr/local/bundle/gems/activerecord-6.1.7.3/lib/active_record/tasks/database_tasks.rb:133:in `create'
    /usr/local/bundle/gems/activerecord-6.1.7.3/lib/active_record/tasks/database_tasks.rb:193:in `block in create_current'
    /usr/local/bundle/gems/activerecord-6.1.7.3/lib/active_record/tasks/database_tasks.rb:506:in `block (2 levels) in each_current_configuration'
    /usr/local/bundle/gems/activerecord-6.1.7.3/lib/active_record/tasks/database_tasks.rb:503:in `each'
    /usr/local/bundle/gems/activerecord-6.1.7.3/lib/active_record/tasks/database_tasks.rb:503:in `block in each_current_configuration'
    /usr/local/bundle/gems/activerecord-6.1.7.3/lib/active_record/tasks/database_tasks.rb:502:in `each'
    /usr/local/bundle/gems/activerecord-6.1.7.3/lib/active_record/tasks/database_tasks.rb:502:in `each_current_configuration'
    /usr/local/bundle/gems/activerecord-6.1.7.3/lib/active_record/tasks/database_tasks.rb:193:in `create_current'
    /usr/local/bundle/gems/activerecord-6.1.7.3/lib/active_record/railties/databases.rake:45:in `block (2 levels) in <top (required)>'
    /usr/local/bundle/gems/sentry-ruby-5.8.0/lib/sentry/rake.rb:24:in `execute'
    /usr/local/bundle/gems/bundler-2.4.9/lib/bundler/cli/exec.rb:58:in `load'
    /usr/local/bundle/gems/bundler-2.4.9/lib/bundler/cli/exec.rb:58:in `kernel_load'
    /usr/local/bundle/gems/bundler-2.4.9/lib/bundler/cli/exec.rb:23:in `run'
    /usr/local/bundle/gems/bundler-2.4.9/lib/bundler/cli.rb:492:in `exec'
    /usr/local/bundle/gems/bundler-2.4.9/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
    /usr/local/bundle/gems/bundler-2.4.9/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
    /usr/local/bundle/gems/bundler-2.4.9/lib/bundler/vendor/thor/lib/thor.rb:392:in `dispatch'
    /usr/local/bundle/gems/bundler-2.4.9/lib/bundler/cli.rb:34:in `dispatch'
    /usr/local/bundle/gems/bundler-2.4.9/lib/bundler/vendor/thor/lib/thor/base.rb:485:in `start'
    /usr/local/bundle/gems/bundler-2.4.9/lib/bundler/cli.rb:28:in `start'
    /usr/local/bundle/gems/bundler-2.4.9/exe/bundle:45:in `block in <top (required)>'
    /usr/local/bundle/gems/bundler-2.4.9/lib/bundler/friendly_errors.rb:117:in `with_friendly_errors'
    /usr/local/bundle/gems/bundler-2.4.9/exe/bundle:33:in `<top (required)>'
    /opt/postal/app/bin/bundle:3:in `load'
    /opt/postal/app/bin/bundle:3:in `<main>'
    
    Caused by:
    Mysql2::Error::ConnectionError: Access denied for user 'root'@'localhost' (using password: YES)
    /usr/local/bundle/gems/mysql2-0.5.5/lib/mysql2/client.rb:97:in `connect'
    /usr/local/bundle/gems/mysql2-0.5.5/lib/mysql2/client.rb:97:in `initialize'
    /usr/local/bundle/gems/activerecord-6.1.7.3/lib/active_record/connection_adapters/mysql2_adapter.rb:40:in `new'
    /usr/local/bundle/gems/activerecord-6.1.7.3/lib/active_record/connection_adapters/mysql2_adapter.rb:40:in `new_client'
    /usr/local/bundle/gems/activerecord-6.1.7.3/lib/active_record/connection_adapters/mysql2_adapter.rb:23:in `mysql2_connection'
    /usr/local/bundle/gems/activerecord-6.1.7.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:882:in `public_send'
    /usr/local/bundle/gems/activerecord-6.1.7.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:882:in `new_connection'
    /usr/local/bundle/gems/activerecord-6.1.7.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:926:in `checkout_new_connection'
    /usr/local/bundle/gems/activerecord-6.1.7.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:905:in `try_to_checkout_new_connection'
    /usr/local/bundle/gems/activerecord-6.1.7.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:866:in `acquire_connection'
    /usr/local/bundle/gems/activerecord-6.1.7.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:588:in `checkout'
    /usr/local/bundle/gems/activerecord-6.1.7.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:428:in `connection'
    /usr/local/bundle/gems/activerecord-6.1.7.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:1128:in `retrieve_connection'
    /usr/local/bundle/gems/activerecord-6.1.7.3/lib/active_record/connection_handling.rb:327:in `retrieve_connection'
    /usr/local/bundle/gems/activerecord-6.1.7.3/lib/active_record/connection_handling.rb:283:in `connection'
    /usr/local/bundle/gems/activerecord-6.1.7.3/lib/active_record/tasks/mysql_database_tasks.rb:8:in `connection'
    /usr/local/bundle/gems/activerecord-6.1.7.3/lib/active_record/tasks/mysql_database_tasks.rb:21:in `create'
    /usr/local/bundle/gems/activerecord-6.1.7.3/lib/active_record/tasks/database_tasks.rb:133:in `create'
    /usr/local/bundle/gems/activerecord-6.1.7.3/lib/active_record/tasks/database_tasks.rb:193:in `block in create_current'
    /usr/local/bundle/gems/activerecord-6.1.7.3/lib/active_record/tasks/database_tasks.rb:506:in `block (2 levels) in each_current_configuration'
    /usr/local/bundle/gems/activerecord-6.1.7.3/lib/active_record/tasks/database_tasks.rb:503:in `each'
    /usr/local/bundle/gems/activerecord-6.1.7.3/lib/active_record/tasks/database_tasks.rb:503:in `block in each_current_configuration'
    /usr/local/bundle/gems/activerecord-6.1.7.3/lib/active_record/tasks/database_tasks.rb:502:in `each'
    /usr/local/bundle/gems/activerecord-6.1.7.3/lib/active_record/tasks/database_tasks.rb:502:in `each_current_configuration'
    /usr/local/bundle/gems/activerecord-6.1.7.3/lib/active_record/tasks/database_tasks.rb:193:in `create_current'
    /usr/local/bundle/gems/activerecord-6.1.7.3/lib/active_record/railties/databases.rake:45:in `block (2 levels) in <top (required)>'
    /usr/local/bundle/gems/sentry-ruby-5.8.0/lib/sentry/rake.rb:24:in `execute'
    /usr/local/bundle/gems/bundler-2.4.9/lib/bundler/cli/exec.rb:58:in `load'
    /usr/local/bundle/gems/bundler-2.4.9/lib/bundler/cli/exec.rb:58:in `kernel_load'
    /usr/local/bundle/gems/bundler-2.4.9/lib/bundler/cli/exec.rb:23:in `run'
    /usr/local/bundle/gems/bundler-2.4.9/lib/bundler/cli.rb:492:in `exec'
    /usr/local/bundle/gems/bundler-2.4.9/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
    /usr/local/bundle/gems/bundler-2.4.9/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
    /usr/local/bundle/gems/bundler-2.4.9/lib/bundler/vendor/thor/lib/thor.rb:392:in `dispatch'
    /usr/local/bundle/gems/bundler-2.4.9/lib/bundler/cli.rb:34:in `dispatch'
    /usr/local/bundle/gems/bundler-2.4.9/lib/bundler/vendor/thor/lib/thor/base.rb:485:in `start'
    /usr/local/bundle/gems/bundler-2.4.9/lib/bundler/cli.rb:28:in `start'
    /usr/local/bundle/gems/bundler-2.4.9/exe/bundle:45:in `block in <top (required)>'
    /usr/local/bundle/gems/bundler-2.4.9/lib/bundler/friendly_errors.rb:117:in `with_friendly_errors'
    /usr/local/bundle/gems/bundler-2.4.9/exe/bundle:33:in `<top (required)>'
    /opt/postal/app/bin/bundle:3:in `load'
    /opt/postal/app/bin/bundle:3:in `<main>'
    Tasks: TOP => db:create
    (See full trace by running task with --trace)
    ERROR: 1
    
    This is the exact commands i employed in my bid to install Postal

    Code:
    hostname -f
    
    sudo hostname postal.siglot.net
    
    sudo apt-get update && sudo apt upgrade
    
    sudo apt install apt-transport-https ca-certificates curl gnupg lsb-release -y
    
    curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
    
    echo \ "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu \ $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
    
    sudo apt-get update
    
    sudo apt-get install docker.io
    
    sudo curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
    
    sudo chmod +x /usr/local/bin/docker-compose
    
    docker-compose --version
    
    =======================================================================================
    
    apt install git curl jq
    
    git clone https://postalserver.io/start/install /opt/postal/install
    
    sudo ln -s /opt/postal/install/bin/postal /usr/bin/postal
    =======================================================================================
    docker run -d \
       --name postal-mariadb \
       -p 127.0.0.1:3306:3306 \
       --restart always \
       -e MARIADB_DATABASE=postal \
       -e MARIADB_ROOT_PASSWORD=shaPostalDB1900 \
       mariadb
    
    docker run -d \
       --name postal-rabbitmq \
       -p 127.0.0.1:5672:5672 \
       --restart always \
       -e RABBITMQ_DEFAULT_USER=postal \
       -e RABBITMQ_DEFAULT_PASS=shaPostalDB1900 \
       -e RABBITMQ_DEFAULT_VHOST=postalvhost \
       rabbitmq:3.8
    ======================================================
    postal bootstrap postal.siglot.net
    
    apt install nano -y
    
    nano /opt/postal/config/postal.yml
    ======================================================
    postal initialize
    
    postal make-user
    
    postal start
    
    postal status
     
  7. pyte

    pyte Active Member HowtoForge Supporter

    Your database credentials are wrong. But it says it right there in the log a simple internet search would have been enough
     
  8. SiGLOTFi

    SiGLOTFi New Member

    You're indeed right. I was aware it's a credential issue but i have my credential in the postal.yml file properly written (as shown in picture below) so i don't know which DB credential is actually giving me the problem.

    image_2023-08-25_165058792.png

    Do note that i have CyberPanel installed on the VPS Server as well so in my own amateur opinion, i hope its not a conflict issue with CyberPanel.
     

Share This Page