How to configure email servisce?

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

  1. Taras Tupko

    Taras Tupko New Member

    could anyone help me with the mail? the postfix is running. the hostnames is screen 1
    and the hosts is screen 2
     

    Attached Files:

    • 1.png
      1.png
      File size:
      10.4 KB
      Views:
      7
    • 2.png
      2.png
      File size:
      21.7 KB
      Views:
      5
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    You have a duplicate line, remove the first 176. IP line from /etc/hosts
     
  3. Taras Tupko

    Taras Tupko New Member

    I have removed the first 176 - (screen 2)
    And a restarted the server
    restarted the postfix(screnn 1) but the log mail is empty
     

    Attached Files:

    • 1.png
      1.png
      File size:
      42.4 KB
      Views:
      9
    • 2.png
      2.png
      File size:
      22.8 KB
      Views:
      9
  4. Taras Tupko

    Taras Tupko New Member

    Are there any ideas?
     
  5. till

    till Super Moderator Staff Member ISPConfig Developer

    When the mail.log is empty, then this means that there are no errors, so that's fine. Now test mail system again and check which messages you get in the mail.lg file.
     
  6. Taras Tupko

    Taras Tupko New Member

    I tried to reset the password in WordPress site, and the mail did not come.
    and the mail.log is empty
     
  7. Taras Tupko

    Taras Tupko New Member

    my email.log
     

    Attached Files:

    • 1.png
      1.png
      File size:
      17.1 KB
      Views:
      4
  8. till

    till Super Moderator Staff Member ISPConfig Developer

    Restart postfix, you should at least find info about the postfix restart there.
     
  9. Taras Tupko

    Taras Tupko New Member

    Code:
    Jul  5 10:30:15 ispconfig postfix/postfix-script[4414]: stopping the Postfix mail system
    Jul  5 10:30:15 ispconfig postfix/master[4275]: terminating on signal 15
    Jul  5 10:30:17 ispconfig postfix/postfix-script[4826]: warning: symlink leaves directory: /etc/postfix/./makedefs.out
    Jul  5 10:30:17 ispconfig postfix/postfix-script[4994]: starting the Postfix mail system
    Jul  5 10:30:17 ispconfig postfix/master[4996]: daemon started -- version 3.4.13, configuration /etc/postfix
    Jul  5 10:30:41 ispconfig postfix/pickup[4997]: 8D236542965: uid=5008 from=<[email protected]>
    Jul  5 10:30:41 ispconfig postfix/cleanup[5002]: 8D236542965: message-id=<[email protected]>
    Jul  5 10:30:41 ispconfig postfix/qmgr[4998]: 8D236542965: from=<[email protected]>, size=1254, nrcpt=1 (queue active)
    Jul  5 10:30:42 ispconfig postfix/smtp[5004]: 8D236542965: host mx15.ukraine.com.ua[185.234.177.10] said: 450 4.7.25 Client host rejected: cannot find your hostname, [82.117.240.50] (in reply to RCPT TO command)
    Jul  5 10:30:42 ispconfig postfix/smtp[5004]: 8D236542965: to=<[email protected]>, relay=mx15.ukraine.com.ua[185.234.177.12]:25, delay=0.91, delays=0.12/0.07/0.64/0.07, dsn=4.7.25, status=deferred (host mx15.ukraine.com.ua[185.234.177.12] said: 450 4.7.25 Client host rejected: cannot find your hostname, [82.117.240.50] (in reply to RCPT TO command))
    
    I have restarted the postfix but the email did not come. there is the log file. Maybe the post files could help.
    main.cf
    Code:
    # See /usr/share/postfix/main.cf.dist for a commented, more complete version
    
    
    # Debian specific:  Specifying a file name will cause the first
    # line of that file to be used as the name.  The Debian default
    # is /etc/mailname.
    #myorigin = /etc/mailname
    
    smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
    biff = no
    
    # appending .domain is the MUA's job.
    append_dot_mydomain = no
    
    # Uncomment the next line to generate "delayed mail" warnings
    #delay_warning_time = 4h
    
    readme_directory = /usr/share/doc/postfix
    
    # See http://www.postfix.org/COMPATIBILITY_README.html -- default to 2 on
    # fresh installs.
    compatibility_level = 2
    
    
    
    # TLS parameters
    smtpd_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
    smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
    smtpd_tls_security_level=may
    
    smtp_tls_CApath=/etc/ssl/certs
    smtp_tls_security_level=may
    smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
    
    
    smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
    myhostname = ispconfig.vikisoft.kiev.ua
    alias_maps = hash:/etc/aliases
    alias_database = hash:/etc/aliases
    myorigin = /etc/mailname
    mydestination = $myhostname, ispconfig.vikisoft.kiev.ua, localhost.vikisoft.kiev.ua, , localhost
    relayhost =
    mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
    mailbox_size_limit = 0
    recipient_delimiter = +
    inet_interfaces = all
    inet_protocols = all
    html_directory = /usr/share/doc/postfix/html
    

    and master.cf
    Code:
    #
    # Postfix master process configuration file.  For details on the format
    # of the file, see the master(5) manual page (command: "man 5 master" or
    # on-line: http://www.postfix.org/master.5.html).
    #
    # Do not forget to execute "postfix reload" after editing this file.
    #
    # ==========================================================================
    # service type  private unpriv  chroot  wakeup  maxproc command + args
    #               (yes)   (yes)   (no)    (never) (100)
    # ==========================================================================
    smtp      inet  n       -       y       -       -       smtpd
    #smtp      inet  n       -       y       -       1       postscreen
    #smtpd     pass  -       -       y       -       -       smtpd
    #dnsblog   unix  -       -       y       -       0       dnsblog
    #tlsproxy  unix  -       -       y       -       0       tlsproxy
    submission inet n       -       y       -       -       smtpd
      -o syslog_name=postfix/submission
      -o smtpd_tls_security_level=encrypt
      -o smtpd_sasl_auth_enable=yes
    #  -o smtpd_tls_auth_only=yes
    #  -o smtpd_reject_unlisted_recipient=no
    #  -o smtpd_client_restrictions=$mua_client_restrictions
    #  -o smtpd_helo_restrictions=$mua_helo_restrictions
    #  -o smtpd_sender_restrictions=$mua_sender_restrictions
    #  -o smtpd_recipient_restrictions=
      -o smtpd_relay_restrictions=permit_sasl_authenticated,reject
    #  -o milter_macro_daemon_name=ORIGINATING
    smtps     inet  n       -       y       -       -       smtpd
      -o syslog_name=postfix/smtps
      -o smtpd_tls_wrappermode=yes
      -o smtpd_sasl_auth_enable=yes
    #  -o smtpd_reject_unlisted_recipient=no
    #  -o smtpd_client_restrictions=$mua_client_restrictions
    #  -o smtpd_helo_restrictions=$mua_helo_restrictions
    #  -o smtpd_sender_restrictions=$mua_sender_restrictions
    #  -o smtpd_recipient_restrictions=
      -o smtpd_relay_restrictions=permit_sasl_authenticated,reject
    #  -o milter_macro_daemon_name=ORIGINATING
    #628       inet  n       -       y       -       -       qmqpd
    pickup    unix  n       -       y       60      1       pickup
    cleanup   unix  n       -       y       -       0       cleanup
    qmgr      unix  n       -       n       300     1       qmgr
    #qmgr     unix  n       -       n       300     1       oqmgr
    tlsmgr    unix  -       -       y       1000?   1       tlsmgr
    rewrite   unix  -       -       y       -       -       trivial-rewrite
    bounce    unix  -       -       y       -       0       bounce
    defer     unix  -       -       y       -       0       bounce
    trace     unix  -       -       y       -       0       bounce
    verify    unix  -       -       y       -       1       verify
    flush     unix  n       -       y       1000?   0       flush
    proxymap  unix  -       -       n       -       -       proxymap
    proxywrite unix -       -       n       -       1       proxymap
    smtp      unix  -       -       y       -       -       smtp
    relay     unix  -       -       y       -       -       smtp
            -o syslog_name=postfix/$service_name
    #       -o smtp_helo_timeout=5 -o smtp_connect_timeout=5
    showq     unix  n       -       y       -       -       showq
    error     unix  -       -       y       -       -       error
    retry     unix  -       -       y       -       -       error
    discard   unix  -       -       y       -       -       discard
    local     unix  -       n       n       -       -       local
    virtual   unix  -       n       n       -       -       virtual
    lmtp      unix  -       -       y       -       -       lmtp
    anvil     unix  -       -       y       -       1       anvil
    scache    unix  -       -       y       -       1       scache
    postlog   unix-dgram n  -       n       -       1       postlogd
    #
    # ====================================================================
    # Interfaces to non-Postfix software. Be sure to examine the manual
    # pages of the non-Postfix software to find out what options it wants.
    #
    # Many of the following services use the Postfix pipe(8) delivery
    # agent.  See the pipe(8) man page for information about ${recipient}
    # and other message envelope options.
    # ====================================================================
    #
    # maildrop. See the Postfix MAILDROP_README file for details.
    # Also specify in main.cf: maildrop_destination_recipient_limit=1
    #
    maildrop  unix  -       n       n       -       -       pipe
      flags=DRhu user=vmail argv=/usr/bin/maildrop -d ${recipient}
    #
    # ====================================================================
    #
    # Recent Cyrus versions can use the existing "lmtp" master.cf entry.
    #
    # Specify in cyrus.conf:
    #   lmtp    cmd="lmtpd -a" listen="localhost:lmtp" proto=tcp4
    #
    # Specify in main.cf one or more of the following:
    #  mailbox_transport = lmtp:inet:localhost
    #  virtual_transport = lmtp:inet:localhost
    #
    # ====================================================================
    #
    # Cyrus 2.1.5 (Amos Gouaux)
    # Also specify in main.cf: cyrus_destination_recipient_limit=1
    #
    #cyrus     unix  -       n       n       -       -       pipe
    #  user=cyrus argv=/cyrus/bin/deliver -e -r ${sender} -m ${extension} ${user}
    #
    # ====================================================================
    # Old example of delivery via Cyrus.
    #
    #old-cyrus unix  -       n       n       -       -       pipe
    #  flags=R user=cyrus argv=/cyrus/bin/deliver -e -m ${extension} ${user}
    #
    # ====================================================================
    #
    # See the Postfix UUCP_README file for configuration details.
    #
    uucp      unix  -       n       n       -       -       pipe
      flags=Fqhu user=uucp argv=uux -r -n -z -a$sender - $nexthop!rmail ($recipient)
    #
    # Other external delivery methods.
    #
    ifmail    unix  -       n       n       -       -       pipe
      flags=F user=ftn argv=/usr/lib/ifmail/ifmail -r $nexthop ($recipient)
    bsmtp     unix  -       n       n       -       -       pipe
      flags=Fq. user=bsmtp argv=/usr/lib/bsmtp/bsmtp -t$nexthop -f$sender $recipient
    scalemail-backend unix    -    n    n    -    2    pipe
      flags=R user=scalemail argv=/usr/lib/scalemail/bin/scalemail-store ${nexthop} ${user} ${extension}
    mailman   unix  -       n       n       -       -       pipe
      flags=FR user=list argv=/usr/lib/mailman/bin/postfix-to-mailman.py
      ${nexthop} ${user}
    
    
     
  10. till

    till Super Moderator Staff Member ISPConfig Developer

    In your first post, you said that you are using ISPConfig. The postfix config files are not from an ISPConfig system.

    And regarding your mail.log, according to the error message you missed setting up DNS records for your hostname. Other mail systems will not accept emails from your server when its hostname is unresolvable in DNS.
     
  11. Taras Tupko

    Taras Tupko New Member

    ok, now I have some confused. I have the ISPConfig and there is some sites there, and I want to reset my pass in the site ( it have sent the email ) what the servise have to sent the email ispconfig or email server on ubuntu?
     
  12. till

    till Super Moderator Staff Member ISPConfig Developer

    The mail config is not the one from an ISPConfig system. You might have ISPConfig installed but have chosen to leave out mail service and to not configure it.

    In Regard to your problem, I posted what you have to do to get the emails delivered, please reread post #30.
     
  13. Taras Tupko

    Taras Tupko New Member

    so, I confuse totaly. I just want that the reset pass start worked. And I dont know how to do it. I tried to configure the with your tutorial
    ISPConfig and e-mail but it didn`t work. Than I tried to configure postfix the same situation. May be I the problem is in my dns ?
    I didnt configure the dns in ispconfig ( I bought my domain in other service). My main domain with ispconfig panel is ispconfig.vikisoft.kiev.ua. My dns post is A with ispconfig.vikisoft.kiev.ua and my IP 176.113.209.170. MY mx for ispconfig.vikisoft.kiev.ua is mail.ispconfig.vikisoft.kiev.ua My hosts is 176.113.209.170 ispconfig.vikisoft.kiev.ua mail and hostname is mail.
    My port 25 is opened.
    I realy dont know why it does not work

    and my log, when I tried to reset pass is
    Code:
    Jul  6 15:31:02 ispconfig postfix/pickup[393615]: 02155542BBF: uid=5008 from=<[email protected]>
    Jul  6 15:31:02 ispconfig postfix/cleanup[397403]: 02155542BBF: message-id=<[email protected]>
    Jul  6 15:31:02 ispconfig postfix/qmgr[6920]: 02155542BBF: from=<[email protected]>, size=1251, nrcpt=1 (queue active)
    Jul  6 15:31:02 ispconfig postfix/smtp[397404]: 02155542BBF: to=<[email protected]>, relay=none, delay=0.16, delays=0.15/0.01/0/0, dsn=5.4.6, status=bounced (mail for vikisoft.kiev.ua loops back to myself)
    Jul  6 15:31:02 ispconfig postfix/cleanup[397403]: 1484B542BC0: message-id=<[email protected]>
    Jul  6 15:31:02 ispconfig postfix/qmgr[6920]: 1484B542BC0: from=<>, size=3319, nrcpt=1 (queue active)
    Jul  6 15:31:02 ispconfig postfix/bounce[397405]: 02155542BBF: sender non-delivery notification: 1484B542BC0
    Jul  6 15:31:02 ispconfig postfix/qmgr[6920]: 02155542BBF: removed
    Jul  6 15:31:02 ispconfig postfix/smtp[397404]: 1484B542BC0: to=<[email protected]>, relay=none, delay=0.02, delays=0.02/0/0/0, dsn=5.4.6, status=bounced (mail for royal.co.ua loops back to myself)
    Jul  6 15:31:02 ispconfig postfix/qmgr[6920]: 1484B542BC0: removed
    
     
  14. Jesse Norell

    Jesse Norell ISPConfig Developer Staff Member ISPConfig Developer

    As @till mentioned, your postfix config did not come from ISPConfig, but to confirm, you did install ISPConfig and you intend to run an ISPConfig mail server? If that's the case, I would either 1) if possible, just reinstall the system again, using the autoinstaller so nothing is left out, or 2) run through the Perfect Server guide for your OS/web server and ensure all software is installed that you need, then run "ispconfig_update.sh --force" and let the installer reconfigure services (and if it says it finds postfix but mail service is not enabled, answer yes to enable mail service).

    If you are instead trying to just setup your own mail system and manually configure it... well, it can be done and can be fun if you like learning, but operating a mail system well is not a simple task, it requires ongoing work throughout the entire life of the mail system, so be sure that is what you want to sign up for. If so, post your main.cf and master.cf as of now.
     
  15. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    It does not work since you are not using ISPConfig.
     
    ahrasis likes this.
  16. Taras Tupko

    Taras Tupko New Member

    _____
    thanks for idea, I have chosen the second way, and checked the perfect server, updated the ispconfig and the log I think is correct

    Code:
    Jul 11 08:49:27 ispconfig postfix/pickup[2466]: 20095542979: uid=5008 from=<[email protected]>
    Jul 11 08:49:27 ispconfig postfix/cleanup[5144]: 20095542979: message-id=<[email protected]>
    Jul 11 08:49:27 ispconfig postfix/qmgr[2467]: 20095542979: from=<[email protected]>, size=1238, nrcpt=1 (queue active)
    
    but the email have not come, what ports must be opened? or maybe I have to configure mx or spf?
     
  17. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    Now that you are using ISPConfig, you can use the e-mail tutorial which is linked to in my signature. It has troubleshooting instructions. Read also the comments.
    Those three lines of log you pasted may not be the complete log for that e-mail? Surely something happens to the mail and the log should show it.
     

Share This Page