Learn about Centmin Mod LEMP Stack today
Register Now

Sysadmin Port 25 closing soon

Discussion in 'System Administration' started by Andy, Nov 14, 2023.

  1. Andy

    Andy Active Member

    518
    84
    28
    Aug 6, 2014
    Ratings:
    +120
    Local Time:
    7:18 AM
    My host (reliablesite.net) announced that they will close port 25 soon.
    I check and looks like i have port 25 open
    @eva2000 do you know what is using this port and what is my course of action?
    Thanks a lot.

     
  2. duderuud

    duderuud Active Member

    176
    60
    28
    Dec 5, 2020
    The Netherlands
    Ratings:
    +132
    Local Time:
    1:18 PM
    1.25 x
    10.6
    You should know that :)

    Do you send out email with an MTA?
     
  3. eva2000

    eva2000 Administrator Staff Member

    50,901
    11,799
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,255
    Local Time:
    10:18 PM
    Nginx 1.25.x
    MariaDB 10.x
    Postfix mail server for outbound system email messages uses port 25. Usually for hosts that block port 25 I either go through webhost's unblocking criteria or use Amazon SES 3rd party SMTP in Postfix relay configuration..

    Centmin Mod is provided as is so no official support for reconfiguring Postfix MTA mail server beyond what Centmin Mod initial setups up and configures for Postfix local outbound email sending.

    However, if you want to sent email outbound via remote mail server like with smtp email providers like Amazon SES, PepiPost/NetcoreCloud, Mailgun, Mailjet etc there are various online guides if you search for "centos postfix relay". Instructions for Debian and Ubuntu may differ from CentOS 6 or CentOS 7 operating systems that Centmin Mod runs on so bear that in mind and read many online guides to understand the best gist of configuring Postfix relay for external mail sending via remote smtp server.

    Remember, troubleshooting and setup is all on you as I provide no support, however fellow forum members are welcome to help each other out.

    The following guides are a start and you should read them all and re-read them to get an understanding of what is required paying attention to differences of CentOS 6 vs CentoS 7 vs Debian/Ubuntu if any.

    Note you can skip installing Postfix via yum as it's already installed
    You can also setup a test VPS with a hourly billing provider and test various Postfix relay guides until you find one that works for you etc.
     
  4. eva2000

    eva2000 Administrator Staff Member

    50,901
    11,799
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,255
    Local Time:
    10:18 PM
    Nginx 1.25.x
    MariaDB 10.x
    Or just request unblocking as you only use Postfix mail server for Linux system messages to yourself.

    Centmin Mod installs pflogsumm command which can provide summary of postfix log entries and volume sent via command
    Code (Text):
    pflogsumm -d today --verbose_msg_detail /var/log/maillog

    also installed is command shortcut alias for the command
    Code (Text):
    postfixlog

    which will run same command for today's log entries
    Or instead of just -d today flag, for all dates remove -d today flag
    Code (Text):
    pflogsumm -d today --verbose_msg_detail /var/log/maillog

    I wouldn't publicly post such output though as it reveals all email addresses for sender and receiver logged by postfix so something for you to privately go through and see if you do not recognise some of the email addresses
    Example output for last /var/log/maillog
    Code (Text):
    pflogsumm --verbose_msg_detail /var/log/maillog
    Grand Totals
    ------------
    messages
        142   received
        142   delivered
          0   forwarded
          0   deferred
          0   bounced
          0   rejected (0%)
          0   reject warnings
          0   held
          0   discarded (0%)
     160241   bytes received
     160241   bytes delivered
          1   senders
          1   sending hosts/domains
          2   recipients
          2   recipient hosts/domains
    Per-Day Traffic Summary
    -----------------------
        date          received  delivered   deferred    bounced     rejected
        --------------------------------------------------------------------
        Jan 26 2020        36         36
        Jan 27 2020        41         41
        Jan 28 2020        27         27
        Jan 29 2020        38         38
    Per-Hour Traffic Daily Average
    ------------------------------
        time          received  delivered   deferred    bounced     rejected
        --------------------------------------------------------------------
        0000-0100           3          3          0          0          0
        0100-0200           1          1          0          0          0
        0200-0300           2          2          0          0          0
        0300-0400           1          1          0          0          0
        0400-0500           1          1          0          0          0
        0500-0600           2          2          0          0          0
        0600-0700           1          1          0          0          0
        0700-0800           2          2          0          0          0
        0800-0900           1          1          0          0          0
        0900-1000           2          2          0          0          0
        1000-1100           2          2          0          0          0
        1100-1200           2          2          0          0          0
        1200-1300           2          2          0          0          0
        1300-1400           2          2          0          0          0
        1400-1500           1          1          0          0          0
        1500-1600           1          1          0          0          0
        1600-1700           2          2          0          0          0
        1700-1800           2          2          0          0          0
        1800-1900           2          2          0          0          0
        1900-2000           1          1          0          0          0
        2000-2100           1          1          0          0          0
        2100-2200           2          2          0          0          0
        2200-2300           2          2          0          0          0
        2300-2400           3          3          0          0          0
    Host/Domain Summary: Message Delivery
    --------------------------------------
     sent cnt  bytes   defers   avg dly max dly host/domain
     -------- -------  -------  ------- ------- -----------
        137   156436        0     0.0 s    0.0 s  host.domain.com
          5     3805        0     0.4 s    0.5 s  domain.com
    Host/Domain Summary: Messages Received
    ---------------------------------------
     msg cnt   bytes   host/domain
     -------- -------  -----------
        142   160241   host.domain.com
    Senders by message count
    ------------------------
        142   root@host.domain.com
    Recipients by message count
    ---------------------------
        137   root@host.domain.com
          5   username@domain.com
    Senders by message size
    -----------------------
     160241   root@host.domain.com
    Recipients by message size
    --------------------------
     156436   root@host.domain.com
       3805   username@domain.com
    message deferral detail: none
    message bounce detail (by relay): none
    message reject detail: none
    message reject warning detail: none
    message hold detail: none
    message discard detail: none
    smtp delivery failures: none
    Warnings: none
    Fatal Errors: none
    Panics: none
    Master daemon messages: none

    /var/log/mailog gets auto rotated so may not contain all postfix log dates so change the log name that pflogsumm analyses
    Code (Text):
    ls -lahrt /var/log/ | grep maillog
    -rw-------   1 root     root             16M Jan  5 03:24 maillog-20200105
    -rw-------   1 root     root            405M Jan 12 02:22 maillog-20200112
    -rw-------   1 root     root            180K Jan 19 02:50 maillog-20200119
    -rw-------   1 root     root            149K Jan 26 03:23 maillog-20200126
    -rw-------   1 root     root             80K Jan 29 22:10 maillog
    

    Code (Text):
    pflogsumm --verbose_msg_detail /var/log/maillog-20200126

    or use wildcard for all mail logs
    Code (Text):
    pflogsumm --verbose_msg_detail /var/log/maillog*
     
  5. eva2000

    eva2000 Administrator Staff Member

    50,901
    11,799
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,255
    Local Time:
    10:18 PM
    Nginx 1.25.x
    MariaDB 10.x