How to configure email servisce?

Discussion in 'Server Operation' started by Taras Tupko, Jun 28, 2022.

  1. Taras Tupko

    Taras Tupko New Member

    Hello, I have installed the ispconfig 3.2 and it works. I installed the wordpress site and want to reset my password but the email with the link does not come. Who could help me to configure this.
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    How did you install ISPConfig?
     
  3. Taras Tupko

    Taras Tupko New Member

  4. till

    till Super Moderator Staff Member ISPConfig Developer

    So you used a site that steals my tutorials ... nice. Check your /var/log/mail.log for errors.
     
    Th0m likes this.
  5. Taras Tupko

    Taras Tupko New Member

    Jun 28 16:52:05 posti postfix/postfix-script[247750]: stopping the Postfix mail system
    Jun 28 16:52:05 posti postfix/master[4936]: terminating on signal 15
    Jun 28 16:52:05 posti postfix/postfix-script[247771]: fatal: the Postfix mail system is not running
    Jun 28 16:52:06 posti postfix/postfix-script[247827]: warning: symlink leaves directory: /etc/postfix/./smtpd.key
    Jun 28 16:52:06 posti postfix/postfix-script[247830]: warning: symlink leaves directory: /etc/postfix/./makedefs.out
    Jun 28 16:52:06 posti postfix/postfix-script[247833]: warning: symlink leaves directory: /etc/postfix/./smtpd.cert
    Jun 28 16:52:06 posti postfix/postfix-script[248018]: starting the Postfix mail system
    Jun 28 16:52:06 posti postfix/master[248020]: daemon started -- version 3.4.13, configuration /etc/postfix
    Jun 28 16:52:36 posti postfix/pickup[248021]: 71C7EBA1887: uid=5008 from=<[email protected]>
    Jun 28 16:52:36 posti postfix/cleanup[248031]: 71C7EBA1887: message-id=<[email protected]>
    Jun 28 16:52:36 posti postfix/qmgr[248022]: 71C7EBA1887: from=<[email protected]>, size=1253, nrcpt=1 (queue active)
    Jun 28 16:52:36 posti postfix/smtp[248033]: connect to 127.0.0.1[127.0.0.1]:10024: Connection refused
    Jun 28 16:52:36 posti postfix/smtp[248033]: 71C7EBA1887: to=<[email protected]>, relay=none, delay=0.24, delays=0.14/0.1/0/0, dsn=4.4.1, status=deferred (connect to 127.0.0.1[127.0.0.1]:10024: Connection refused)
     
  6. till

    till Super Moderator Staff Member ISPConfig Developer

    amavisd is not started. Restart amavisd and then check mail.log, the most common reason for not working amavis is that you missed setting up the hostname correctly.
     
  7. Taras Tupko

    Taras Tupko New Member

    sudo /etc/init.d/amavis restart
    the result is

    Code:
    See "systemctl status amavis.service" and "journalctl -xe" for details.
     failed!
    
    journalctl -xe

    Code:
    чер 28 16:59:15 posti systemd[1]: amavis.service: Control process exited, code=exited, status=1/FAILURE
    -- Subject: Unit process exited
    -- Defined-By: systemd
    -- Support: http://www.ubuntu.com/support
    --
    -- An ExecStart= process belonging to unit amavis.service has exited.
    --
    -- The process' exit code is 'exited' and its exit status is 1.
    чер 28 16:59:15 posti systemd[1]: amavis.service: Failed with result 'exit-code'.
    -- Subject: Unit failed
    -- Defined-By: systemd
    -- Support: http://www.ubuntu.com/support
    --
    -- The unit amavis.service has entered the 'failed' state with result 'exit-code'.
    чер 28 16:59:15 posti systemd[1]: Failed to start LSB: Starts amavisd-new mailfilter.
    -- Subject: A start job for unit amavis.service has failed
    -- Defined-By: systemd
    -- Support: http://www.ubuntu.com/support
    --
    -- A start job for unit amavis.service has finished with a failure.
    --
    -- The job identifier is 39221 and the job result is failed.
    чер 28 16:59:15 posti sudo[248251]: pam_unix(sudo:session): session closed for user root
    
    
    systemctl status amavis.service
    Code:
    amavis.service - LSB: Starts amavisd-new mailfilter
         Loaded: loaded (/etc/init.d/amavis; generated)
         Active: failed (Result: exit-code) since Tue 2022-06-28 16:59:15 UTC; 41s ago
           Docs: man:systemd-sysv-generator(8)
        Process: 248264 ExecStart=/etc/init.d/amavis start (code=exited, status=1/FAILURE)
    
    чер 28 16:59:15 posti amavis[248264]: Starting amavisd:
    чер 28 16:59:15 posti amavis[248289]:   The value of variable $myhostname is "posti", but should have been
    чер 28 16:59:15 posti amavis[248289]:   a fully qualified domain name; perhaps uname(3) did not provide such.
    чер 28 16:59:15 posti amavis[248289]:   You must explicitly assign a FQDN of this host to variable $myhostname
    чер 28 16:59:15 posti amavis[248289]:   in /etc/amavis/conf.d/05-node_id, or fix what uname(3) provides as a host's
    чер 28 16:59:15 posti amavis[248289]:   network name!
    чер 28 16:59:15 posti amavis[248264]: (failed).
    чер 28 16:59:15 posti systemd[1]: amavis.service: Control process exited, code=exited, status=1/FAILURE
    чер 28 16:59:15 posti systemd[1]: amavis.service: Failed with result 'exit-code'.
    чер 28 16:59:15 posti systemd[1]: Failed to start LSB: Starts amavisd-new mailfilter.
    
     
  8. till

    till Super Moderator Staff Member ISPConfig Developer

    Ok, so you set the hostname wrong and that#s why amavis fails. The file:

    /etc/hostname

    should contain the short hostname, e.g. 'posti' The file /etc/hosts then contains
    the information to resolve the hostname correctly, example:

    192.168.0.199 posti.yourdomain.tld posti

    and it#s important that you list the FQDN hostname first and then the short hostname. Putting that in the wrong order makes Linux hostname command fail and this makes amavis fail. Then restart the server.
     
  9. Taleman

    Taleman Well-Known Member HowtoForge Supporter

  10. Taras Tupko

    Taras Tupko New Member


    Alright, my main domen is ispconfig.vikisoft.kiev.ua:8080 - it is the admin panel
    If I want to configure the email, I have to setting the file /etc/hostname - like posti( 1 scrin)
    and the /etc/hosts - 176.113.209.170 posti.ispconfig.vikisoft.kiev.ua posti (scrin 2)
    or i can just use only ispconfig ?
     

    Attached Files:

    • 1.png
      1.png
      File size:
      15.8 KB
      Views:
      9
    • 2.png
      2.png
      File size:
      25.8 KB
      Views:
      7
  11. Taleman

    Taleman Well-Known Member HowtoForge Supporter

  12. Taras Tupko

    Taras Tupko New Member

    Thank you, I configure the hostname and hosts, the amavis is running, but the email is not comming
    The new log

    Code:
    Jun 28 17:43:15 posti postfix/pickup[248021]: B9CEEBA1888: uid=5008 from=<[email protected]>
    Jun 28 17:43:15 posti postfix/cleanup[251058]: B9CEEBA1888: message-id=<[email protected]>
    Jun 28 17:43:15 posti postfix/qmgr[248022]: B9CEEBA1888: from=<[email protected]>, size=1255, nrcpt=1 (queue active)
    Jun 28 17:43:16 posti postfix/smtpd[250641]: 4A65CBA06CC: client=localhost[127.0.0.1]
    Jun 28 17:43:16 posti postfix/cleanup[251058]: 4A65CBA06CC: message-id=<[email protected]>
    Jun 28 17:43:16 posti postfix/qmgr[248022]: 4A65CBA06CC: from=<[email protected]>, size=1764, nrcpt=1 (queue active)
    Jun 28 17:43:16 posti postfix/smtpd[250641]: disconnect from localhost[127.0.0.1] ehlo=1 mail=2 rcpt=2 data=2 noop=1 quit=1 commands=9
    Jun 28 17:43:16 posti amavis[250563]: (250563-02) Passed CLEAN {RelayedOpenRelay}, [127.0.0.1] <[email protected]> -> <[email protected]>, Message-ID: <[email protected]>, mail_id: Wu0QeLc4I3fj, Hits: 1, size: 1254, queued_as: 4A65CBA06CC, 567 ms
    Jun 28 17:43:16 posti postfix/smtp[251052]: B9CEEBA1888: to=<[email protected]>, relay=127.0.0.1[127.0.0.1]:10024, delay=0.68, delays=0.1/0/0/0.57, dsn=2.0.0, status=sent (250 2.0.0 from MTA(smtp:[127.0.0.1]:10025): 250 2.0.0 Ok: queued as 4A65CBA06CC)
    Jun 28 17:43:16 posti postfix/qmgr[248022]: B9CEEBA1888: removed
    Jun 28 17:43:16 posti postfix/smtp[251059]: 4A65CBA06CC: host mx15.ukraine.com.ua[185.234.177.11] said: 450 4.7.25 Client host rejected: cannot find your hostname, [82.117.240.50] (in reply to RCPT TO command)
    Jun 28 17:43:16 posti postfix/smtp[251059]: connect to mx15.ukraine.com.ua[2a0c:a80:0:b10c::1]:25: Network is unreachable
    Jun 28 17:43:16 posti postfix/smtp[251059]: 4A65CBA06CC: to=<[email protected]>, relay=mx15.ukraine.com.ua[185.234.177.13]:25, delay=0.57, delays=0.07/0.01/0.37/0.13, dsn=4.7.25, status=deferred (host mx15.ukraine.com.ua[185.234.177.13] said: 450 4.7.25 Client host rejected: cannot find your hostname, [82.117.240.50] (in reply to RCPT TO command))
    
    and the other email

    Code:
    Jun 28 18:12:45 posti postfix/pickup[248021]: 491D4BA1889: uid=5008 from=<[email protected]>
    Jun 28 18:12:45 posti postfix/cleanup[252840]: 491D4BA1889: message-id=<[email protected]>
    Jun 28 18:12:45 posti postfix/qmgr[248022]: 491D4BA1889: from=<[email protected]>, size=1237, nrcpt=1 (queue active)
    Jun 28 18:12:45 posti postfix/smtpd[252845]: connect from localhost[127.0.0.1]
    Jun 28 18:12:45 posti postfix/smtpd[252845]: A38E0BA1887: client=localhost[127.0.0.1]
    Jun 28 18:12:45 posti postfix/cleanup[252840]: A38E0BA1887: message-id=<[email protected]>
    Jun 28 18:12:45 posti postfix/smtpd[252845]: disconnect from localhost[127.0.0.1] ehlo=1 mail=1 rcpt=1 data=1 quit=1 commands=5
    Jun 28 18:12:45 posti postfix/qmgr[248022]: A38E0BA1887: from=<[email protected]>, size=1720, nrcpt=1 (queue active)
    Jun 28 18:12:45 posti amavis[250563]: (250563-06) Passed CLEAN {RelayedOpenRelay}, [127.0.0.1] <[email protected]> -> <[email protected]>, Message-ID: <[email protected]>, mail_id: bvQakKT20h5G, Hits: 1, size: 1236, queued_as: A38E0BA1887, 420 ms
    Jun 28 18:12:45 posti postfix/smtp[252842]: 491D4BA1889: to=<[email protected]>, relay=127.0.0.1[127.0.0.1]:10024, delay=0.54, delays=0.12/0/0/0.42, dsn=2.0.0, status=sent (250 2.0.0 from MTA(smtp:[127.0.0.1]:10025): 250 2.0.0 Ok: queued as A38E0BA1887)
    Jun 28 18:12:45 posti postfix/qmgr[248022]: 491D4BA1889: removed
    Jun 28 18:12:46 posti postfix/smtp[252846]: A38E0BA1887: to=<[email protected]>, relay=mxs.ukr.net[212.42.75.251]:25, delay=0.9, delays=0.11/0/0.6/0.19, dsn=5.0.0, status=bounced (host mxs.ukr.net[212.42.75.251] said: 550 SPF match mandatory for 82.117.240.50 [email protected] (in reply to RCPT TO command))
    Jun 28 18:12:46 posti postfix/cleanup[252840]: 8B2E6BA188A: message-id=<[email protected]>
    Jun 28 18:12:46 posti postfix/bounce[252907]: A38E0BA1887: sender non-delivery notification: 8B2E6BA188A
    Jun 28 18:12:46 posti postfix/qmgr[248022]: 8B2E6BA188A: from=<>, size=3886, nrcpt=1 (queue active)
    Jun 28 18:12:46 posti postfix/qmgr[248022]: A38E0BA1887: removed
    Jun 28 18:12:46 posti postfix/pipe[252908]: 8B2E6BA188A: to=<[email protected]>, relay=dovecot, delay=0.12, delays=0.06/0.01/0/0.05, dsn=5.1.1, status=bounced (user unknown)
    Jun 28 18:12:46 posti postfix/qmgr[248022]: 8B2E6BA188A: removed
    
     
    Last edited: Jun 28, 2022
  13. Taras Tupko

    Taras Tupko New Member

    and the 25 port is opened
     
  14. PDP

    PDP New Member HowtoForge Supporter

    I am a bit confused. I have Roundcube running on my server. I have a multi-server setup. Under hostname, I have
    example posti.your domain.tld
    in my case -- services.domain name

    I have a short name in /etc/hosts
    essentially:
    IP address services.domain name services

    Postfix and Roundcube are working. It is all behind a firewall.

    I used https://www.howtoforge.com/tutorial/perfect-server-ubuntu-18-04-nginx-bind-dovecot-and-ispconfig-3/. I am using ubuntu 20.04 and I used can convert apache2 to nginx perfect server then upgrade your ISPConfig. I would like to upgrade to Ubuntu 20.10 - but the discussions always confuse me. Different members with differing comments. I am 68 years old and I have been doing this stuff forever and been confused forever.

    So in /etc/hostname, I don't use the short name. It works, but from the discussion, it seems like it shouldn't work. What gives?
     
    Last edited: Jun 30, 2022
  15. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    Did you use ISPConfig installation tutorial for Ubuntu 18.04 and ISPConfig version 3.1, but are using Ubuntu 20.04? Which version of ISPConfig are you using?
    ISPConfig does not work on Ubuntu 20.10, don't upgrade to that. ISPConfig is eventually going to support Ubuntu 22.04, but does not support it yet. Find the correct installation tutorial from https://www.ispconfig.org/documentation/ . Or use the automatic ISPConfig install: https://www.howtoforge.com/ispconfig-autoinstall-debian-ubuntu/
    The file /etc/hosts is supposed to contain
    Code:
    ipaddress FQDN plain_hostname
    If you only have "short name", which I assume means the plain_hostname, that does not work (at least with ISPConfig setup).
    If you have problems with your setup, start with this: https://forum.howtoforge.com/threads/please-read-before-posting.58408/
     
    Last edited: Jun 29, 2022
  16. PDP

    PDP New Member HowtoForge Supporter

    Given my knowledge and understanding level, I always follow the tutorial. I am using the latest version of Ispconfi3 - according to the Help Page (ISPConfig Version: 3.2.8p1). Ubuntu version 20.4. Multiversion setup with from 2 to 5 servers. The installation on ubuntu 20.04 cause a few problems - not that bad and I followed the apache tutorial as best I could. I am willing to share my setup.
     
    Last edited: Jun 30, 2022
  17. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    https://www.ispconfig.org/get-support/
    You should have started a new thread, it begins to look like you issue is not related to this thread.
    I am confused by your statement in #14 you used Ubuntu 18.04 installation tutorial, but are using Ubuntu 20.04. That is not a good way, the instructions are different for Ubuntu 20.04.
    If you can start from the beginning, install an empty Ubuntu 20.04, then use the ISPConfig autoinstall. It can install Apache or NGINX, read the instructions before installing or experiment, the installation does not take too long so you can try and see what happens, and when you know how it works install again.
     
  18. PDP

    PDP New Member HowtoForge Supporter

    I am a bit off subject. I install 20.04 from scratch - probably 5 times and probably 10. I am using OVH so if reinstall the server. There is a tutorial that notes that Apache 20.04 can be used as a template for nginx. That is what I did. As I remember it took 4 or 5 sleepless nights. There difference and FTP was a problem - but I use PHPStorm with SFTP and that works just fine for me. It has been 2 or 3 years and my notes are gone - well most of them. I thought an Nginx version of the perfect would be out by now. I use the autoinstall a couple - I was wild about it. I like the step-by-step approach. I would like to move up to 20.10

    So, technically I modified the 18.04 install based on the 20.04 Apache tutorial with the tutorial said could be done. It is worked so I assume it can be done. It tool 5 maybe 10 clean installs. 4 or 5 days working 24 hours. That is just me. I should have kept better notes. I don't like to fall behind on version upgrades. That has its own risks.

    The thread is on subject and amavis, hosts and hostname are part of the installation. My comment was intended to be about host and hostname and I wander too much. But my install has some unique elements that were worth clarifying. Hosts and hostname are what I was checking on. I am still a bit confused.

    My hostname reads
    services.xxxx.net

    hosts have IP addresses with fully quality names and short names. It works - but the comments in this thread give me a reason to question if my setup is in error or not. I still don't have a clear answer to the question of what should be in the hosts or the hostname file. I do intend to update my installation to Ubuntu 20.10 - perhaps apache - perhaps nginx. I have a multiserver set up so I can play around with the installation on one server - so host - hostname, and amavis are important. Keeping the operation system up-to-date is critical for security. That is a given.
     
    Last edited: Jun 30, 2022
  19. till

    till Super Moderator Staff Member ISPConfig Developer

    Ubuntu 20.10 is not an LTS release, so you would get security updates for a short time only. Better keep Ubuntu 20.04 which is stillö fully supported by Ubuntu with updates.

    Using a long name is always fine. But that's not what the original poster here did, he used the short name but made a mistake so that hostname command fails. So either use always the long name as you did or the hosts file must be correct too, otherways mail system might fail.

    Yes, that's fine. Today, one would normally us the autoinstaller though, which supports apache and nginx on Ubuntu 20.04:
    https://www.howtoforge.com/ispconfig-autoinstall-debian-ubuntu/

    That's fine. As mentioned earlier, this thread is about issues with systems that use a short hostname only and about amavis failures due to that, your amavis is working and you don't use a short hostname, so this topic does not apply to your setup as @Taleman mentioned.

    Correct, and that's why it is important to use an LTS release (as you did) that gets still security updates and Ubuntu 20.04 gets updates until Apr 2030. So do not switch to Ubuntu 20.10 which is an intermediate release mainly for desktops. Wait until ISPConfig supports Ubuntu 22.04 and then switch to that release.
     
  20. PDP

    PDP New Member HowtoForge Supporter

    This is cool. I didn't understand the specifics about using an LTS release. That is helpful. If I managed to set up NGINX on 20.04 it was because I persisted - over and over - trying to get it to work. I was surprised it worked and my persistence lacked good notes.
     
    till likes this.

Share This Page