• Sendmail error (Connection refused by [127.0.0.1])

    From Ali Khoshbin@21:1/5 to All on Wed Jan 12 00:41:02 2022
    Dear Colleagues,
    I am a newbie in Linux Sendmail. I get the below error while trying to send an email via Sendmail by command:

    sendmail user@domain.com < email.txt

    sendmail log is as below:
    Jan 12 09:37:54 mail3 sendmail[523382]: 20C67sIA523382: to=user@domain.com, ctladdr=root (0/0), delay=00:00:00, xdelay=00:00:00, mailer=sendmail user@domain.com < email.txtrelay, pri=30029, relay=[127.0.0.1] [127.0.0.1], dsn=4.0.0, stat=Deferred:
    Connection refused by [127.0.0.1]

    My configuration is as below:
    CentOS Linux release 8.5.2111.
    sendmail version as below:
    sendmail.x86_64 8.15.2-34.el8 @appstream
    sendmail-cf.noarch 8.15.2-34.el8 @appstream

    Listening ports:
    tcp 0 0 validIP:25 0.0.0.0:* LISTEN 113547/sendmail: ac
    tcp 0 0 InvalidIP:25 0.0.0.0:* LISTEN 113547/sendmail: ac


    service sendmail status:
    Redirecting to /bin/systemctl status sendmail.service
    ● sendmail.service - Sendmail Mail Transport Agent
    Loaded: loaded (/usr/lib/systemd/system/sendmail.service; enabled; vendor preset: disabled)
    Active: active (running) since Sun 2022-01-09 10:20:10 +0330; 3 days ago
    Process: 113546 ExecStart=/usr/sbin/sendmail -bd $SENDMAIL_OPTS $SENDMAIL_OPTARG (code=exited, status=0/SUCCESS)
    Process: 113541 ExecStartPre=/etc/mail/make aliases (code=exited, status=0/SUCCESS)
    Process: 113539 ExecStartPre=/etc/mail/make (code=exited, status=0/SUCCESS)
    Main PID: 113547 (sendmail)
    Tasks: 1 (limit: 48769)
    Memory: 3.0M
    CGroup: /system.slice/sendmail.service
    └─113547 sendmail: accepting connections

    Jan 09 10:20:10 mailX systemd[1]: Starting Sendmail Mail Transport Agent...
    Jan 09 10:20:10 mailX sendmail[113547]: starting daemon (8.15.2): SMTP+queueing@01:00:00
    Jan 09 10:20:10 mailX systemd[1]: sendmail.service: Can't open PID file /run/sendmail.pid (yet?) after start: No suc>
    Jan 09 10:20:10 mailX systemd[1]: Started Sendmail Mail Transport Agent.


    vim /etc/mail/local-host-names

    below entry exists in above file
    mailX.domain.com

    altered sendmail.mc file


    executed
    sudo m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf

    with no problem.

    What do you think that my issue may be that I cannot send email & receive this error as mentioned above in my maillog folder:

    Jan 12 09:37:54 mail3 sendmail[523382]: 20C67sIA523382: to=user@domain.com, ctladdr=root (0/0), delay=00:00:00, xdelay=00:00:00, mailer=sendmail user@domain.com < email.txtrelay, pri=30029, relay=[127.0.0.1] [127.0.0.1], dsn=4.0.0, stat=Deferred:
    Connection refused by [127.0.0.1]

    Thanks in advance for your comments
    Ali

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Claus =?iso-8859-1?Q?A=DFmann?= @21:1/5 to Ali Khoshbin on Wed Jan 12 05:50:28 2022
    Ali Khoshbin wrote:

    dsn=4.0.0, stat=Deferred: Connection refused by [127.0.0.1]

    Does
    telnet 127.0.0.1 25
    work? (enter quit after getting the greeting)

    Did someone (your OS distribution) change the default port for
    mail submission?
    Check /etc/mail/submit.cf: does it use 587 somewhere?
    If so, either change it back or run sendmail also on that
    port: see cf/README: do not use no_default_msa

    PS: 8.15.2 is pretty old.

    --
    Note: please read the netiquette before posting. I will almost never
    reply to top-postings which include a full copy of the previous
    article(s) at the end because it's annoying, shows that the poster
    is too lazy to trim his article, and it's wasting the time of all readers.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From zeneca@21:1/5 to All on Thu Jan 13 09:44:56 2022
    Le 12/01/22 à 09:41, Ali Khoshbin a écrit :
    Dear Colleagues,
    I am a newbie in Linux Sendmail. I get the below error while trying to send an email via Sendmail by command:

    sendmail user@domain.com < email.txt

    sendmail log is as below:
    Jan 12 09:37:54 mail3 sendmail[523382]: 20C67sIA523382: to=user@domain.com, ctladdr=root (0/0), delay=00:00:00, xdelay=00:00:00, mailer=sendmail user@domain.com < email.txtrelay, pri=30029, relay=[127.0.0.1] [127.0.0.1], dsn=4.0.0, stat=Deferred:
    Connection refused by [127.0.0.1]

    My configuration is as below:
    CentOS Linux release 8.5.2111.
    sendmail version as below:
    sendmail.x86_64 8.15.2-34.el8 @appstream
    sendmail-cf.noarch 8.15.2-34.el8 @appstream

    Listening ports:
    tcp 0 0 validIP:25 0.0.0.0:* LISTEN 113547/sendmail: ac
    tcp 0 0 InvalidIP:25 0.0.0.0:* LISTEN 113547/sendmail: ac


    service sendmail status:
    Redirecting to /bin/systemctl status sendmail.service
    ● sendmail.service - Sendmail Mail Transport Agent
    Loaded: loaded (/usr/lib/systemd/system/sendmail.service; enabled; vendor preset: disabled)
    Active: active (running) since Sun 2022-01-09 10:20:10 +0330; 3 days ago
    Process: 113546 ExecStart=/usr/sbin/sendmail -bd $SENDMAIL_OPTS $SENDMAIL_OPTARG (code=exited, status=0/SUCCESS)
    Process: 113541 ExecStartPre=/etc/mail/make aliases (code=exited, status=0/SUCCESS)
    Process: 113539 ExecStartPre=/etc/mail/make (code=exited, status=0/SUCCESS)
    Main PID: 113547 (sendmail)
    Tasks: 1 (limit: 48769)
    Memory: 3.0M
    CGroup: /system.slice/sendmail.service
    └─113547 sendmail: accepting connections

    Jan 09 10:20:10 mailX systemd[1]: Starting Sendmail Mail Transport Agent... Jan 09 10:20:10 mailX sendmail[113547]: starting daemon (8.15.2): SMTP+queueing@01:00:00
    Jan 09 10:20:10 mailX systemd[1]: sendmail.service: Can't open PID file /run/sendmail.pid (yet?) after start: No suc>
    Jan 09 10:20:10 mailX systemd[1]: Started Sendmail Mail Transport Agent.


    vim /etc/mail/local-host-names

    below entry exists in above file
    mailX.domain.com

    altered sendmail.mc file


    executed
    sudo m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf

    with no problem.

    What do you think that my issue may be that I cannot send email & receive this error as mentioned above in my maillog folder:

    Jan 12 09:37:54 mail3 sendmail[523382]: 20C67sIA523382: to=user@domain.com, ctladdr=root (0/0), delay=00:00:00, xdelay=00:00:00, mailer=sendmail user@domain.com < email.txtrelay, pri=30029, relay=[127.0.0.1] [127.0.0.1], dsn=4.0.0, stat=Deferred:
    Connection refused by [127.0.0.1]

    Thanks in advance for your commentstcp 0 0 localhost:smtp 0.0.0.0:* LISTEN
    Ali



    I suppose Validip and invalidip are your ip adresses, but is at least on listening on 127.0.0.1 ??. Doesn't seems so.
    On my Centos 7.9 it loock

    tcp 0 0 localhost:smtp 0.0.0.0:* LISTEN

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From J.O. Aho@21:1/5 to zeneca on Thu Jan 13 10:20:03 2022
    On 13/01/2022 09.44, zeneca wrote:
    Le 12/01/22 à 09:41, Ali Khoshbin a écrit :

    I suppose Validip and invalidip are your ip adresses, but is at least on listening on 127.0.0.1 ??. Doesn't seems so.
    On my Centos 7.9 it loock

    tcp        0      0 localhost:smtp          0.0.0.0:*          LISTEN

    could it be that localhost = 127.0.0.1 ?


    Jan 12 09:37:54 mail3 sendmail[523382]: 20C67sIA523382:
    to=user@domain.com, ctladdr=root (0/0), delay=00:00:00,
    xdelay=00:00:00, mailer=sendmail user@domain.com < email.txtrelay,
    pri=30029, relay=[127.0.0.1] [127.0.0.1], dsn=4.0.0, stat=Deferred:
    Connection refused by [127.0.0.1]

    It seems like the OP did managed to connect to localhost (127.0.0.1),
    compared to my log there is a big difference on the mailer, for me it's
    relay.

    It's more about his sendmail configuration and I think we need our best mind-readers and scrying glasses to be able to figure out what is
    wrongly configured. Maybe Ali could provide the sendmail.mc


    --

    //Aho

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From zeneca@21:1/5 to All on Thu Jan 13 16:28:51 2022
    Le 12/01/22 à 09:41, Ali Khoshbin a écrit :
    Dear Colleagues,
    I am a newbie in Linux Sendmail. I get the below error while trying to send an email via Sendmail by command:

    sendmail user@domain.com < email.txt

    sendmail log is as below:
    Jan 12 09:37:54 mail3 sendmail[523382]: 20C67sIA523382: to=user@domain.com, ctladdr=root (0/0), delay=00:00:00, xdelay=00:00:00, mailer=sendmail user@domain.com < email.txtrelay, pri=30029, relay=[127.0.0.1] [127.0.0.1], dsn=4.0.0, stat=Deferred:
    Connection refused by [127.0.0.1]

    My configuration is as below:
    CentOS Linux release 8.5.2111.
    sendmail version as below:
    sendmail.x86_64 8.15.2-34.el8 @appstream
    sendmail-cf.noarch 8.15.2-34.el8 @appstream

    Listening ports:
    tcp 0 0 validIP:25 0.0.0.0:* LISTEN 113547/sendmail: ac
    tcp 0 0 InvalidIP:25 0.0.0.0:* LISTEN 113547/sendmail: ac


    service sendmail status:
    Redirecting to /bin/systemctl status sendmail.service
    ● sendmail.service - Sendmail Mail Transport Agent
    Loaded: loaded (/usr/lib/systemd/system/sendmail.service; enabled; vendor preset: disabled)
    Active: active (running) since Sun 2022-01-09 10:20:10 +0330; 3 days ago
    Process: 113546 ExecStart=/usr/sbin/sendmail -bd $SENDMAIL_OPTS $SENDMAIL_OPTARG (code=exited, status=0/SUCCESS)
    Process: 113541 ExecStartPre=/etc/mail/make aliases (code=exited, status=0/SUCCESS)
    Process: 113539 ExecStartPre=/etc/mail/make (code=exited, status=0/SUCCESS)
    Main PID: 113547 (sendmail)
    Tasks: 1 (limit: 48769)
    Memory: 3.0M
    CGroup: /system.slice/sendmail.service
    └─113547 sendmail: accepting connections

    Jan 09 10:20:10 mailX systemd[1]: Starting Sendmail Mail Transport Agent... Jan 09 10:20:10 mailX sendmail[113547]: starting daemon (8.15.2): SMTP+queueing@01:00:00
    Jan 09 10:20:10 mailX systemd[1]: sendmail.service: Can't open PID file /run/sendmail.pid (yet?) after start: No suc>
    Jan 09 10:20:10 mailX systemd[1]: Started Sendmail Mail Transport Agent.


    vim /etc/mail/local-host-names

    below entry exists in above file
    mailX.domain.com

    altered sendmail.mc file


    executed
    sudo m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf

    with no problem.

    What do you think that my issue may be that I cannot send email & receive this error as mentioned above in my maillog folder:

    Jan 12 09:37:54 mail3 sendmail[523382]: 20C67sIA523382: to=user@domain.com, ctladdr=root (0/0), delay=00:00:00, xdelay=00:00:00, mailer=sendmail user@domain.com < email.txtrelay, pri=30dnl #



    Check your sendmail.mc to contains :

    dnl #
    DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')dnl
    dnl #

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From company 99001@21:1/5 to zeneca on Sat Jun 18 22:50:32 2022
    On Thursday, January 13, 2022 at 6:58:54 PM UTC+3:30, zeneca wrote:
    Le 12/01/22 à 09:41, Ali Khoshbin a écrit :
    Dear Colleagues,
    I am a newbie in Linux Sendmail. I get the below error while trying to send an email via Sendmail by command:

    sendmail us...@domain.com < email.txt

    sendmail log is as below:
    Jan 12 09:37:54 mail3 sendmail[523382]: 20C67sIA523382: to=us...@domain.com, ctladdr=root (0/0), delay=00:00:00, xdelay=00:00:00, mailer=sendmail us...@domain.com < email.txtrelay, pri=30029, relay=[127.0.0.1] [127.0.0.1], dsn=4.0.0, stat=Deferred:
    Connection refused by [127.0.0.1]

    My configuration is as below:
    CentOS Linux release 8.5.2111.
    sendmail version as below:
    sendmail.x86_64 8.15.2-34.el8 @appstream
    sendmail-cf.noarch 8.15.2-34.el8 @appstream

    Listening ports:
    tcp 0 0 validIP:25 0.0.0.0:* LISTEN 113547/sendmail: ac
    tcp 0 0 InvalidIP:25 0.0.0.0:* LISTEN 113547/sendmail: ac


    service sendmail status:
    Redirecting to /bin/systemctl status sendmail.service
    ● sendmail.service - Sendmail Mail Transport Agent
    Loaded: loaded (/usr/lib/systemd/system/sendmail.service; enabled; vendor preset: disabled)
    Active: active (running) since Sun 2022-01-09 10:20:10 +0330; 3 days ago Process: 113546 ExecStart=/usr/sbin/sendmail -bd $SENDMAIL_OPTS $SENDMAIL_OPTARG (code=exited, status=0/SUCCESS)
    Process: 113541 ExecStartPre=/etc/mail/make aliases (code=exited, status=0/SUCCESS)
    Process: 113539 ExecStartPre=/etc/mail/make (code=exited, status=0/SUCCESS)
    Main PID: 113547 (sendmail)
    Tasks: 1 (limit: 48769)
    Memory: 3.0M
    CGroup: /system.slice/sendmail.service
    └─113547 sendmail: accepting connections

    Jan 09 10:20:10 mailX systemd[1]: Starting Sendmail Mail Transport Agent...
    Jan 09 10:20:10 mailX sendmail[113547]: starting daemon (8.15.2): SMTP+queueing@01:00:00
    Jan 09 10:20:10 mailX systemd[1]: sendmail.service: Can't open PID file /run/sendmail.pid (yet?) after start: No suc>
    Jan 09 10:20:10 mailX systemd[1]: Started Sendmail Mail Transport Agent.


    vim /etc/mail/local-host-names

    below entry exists in above file
    mailX.domain.com

    altered sendmail.mc file


    executed
    sudo m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf

    with no problem.

    What do you think that my issue may be that I cannot send email & receive this error as mentioned above in my maillog folder:

    Jan 12 09:37:54 mail3 sendmail[523382]: 20C67sIA523382: to=us...@domain.com, ctladdr=root (0/0), delay=00:00:00, xdelay=00:00:00, mailer=sendmail us...@domain.com < email.txtrelay, pri=30dnl #



    Check your sendmail.mc to contains :

    dnl #
    DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')dnl
    dnl #


    Hello,
    Excuse me for the long delay.
    Actually I was assigned to another task.
    Now I have moved to setup the sendmail

    My question is that:
    I have added :
    dnl #
    DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')dnl
    dnl #

    to my sendmail.mc file but still the server does not listen to port 25 by running command "netstat -ant | grep :25
    "

    Do I have to add the server's valid IP to the sendmail.mc file too?

    Thanks for your suggestions in advance

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Marco Moock@21:1/5 to All on Sun Jun 19 08:13:31 2022
    Am Samstag, 18. Juni 2022, um 22:50:32 Uhr schrieb company 99001:

    dnl #
    DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')dnl
    dnl #

    Please use

    DAEMON_OPTIONS(`Name=MTA, Addr=127.0.0.1, Port=smtp')dnl

    without dnl or a space in front. dnl comments out a line in m4.

    Then run sendmailconfig and check if it works.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Claus =?iso-8859-1?Q?A=DFmann?= @21:1/5 to All on Mon Jun 20 01:29:52 2022
    Did you ever try what was suggested in other replies?

    telnet 127.0.0.1 25
    and
    telnet 127.0.0.1 587
    ?

    --
    Note: please read the netiquette before posting. I will almost never
    reply to top-postings which include a full copy of the previous
    article(s) at the end because it's annoying, shows that the poster
    is too lazy to trim his article, and it's wasting the time of all readers.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Ali Khoshbin@21:1/5 to All on Sun Jun 19 23:08:20 2022
    Hi,
    I got the "connection refused" while trying to telnet to the IP & ports related to smtp as it shows the sendmail is not listening on this port.
    What should I do?
    Thanks in advance for your priceless help.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From company 99001@21:1/5 to Marco Moock on Sun Jun 19 22:19:24 2022
    On Sunday, June 19, 2022 at 10:43:33 AM UTC+4:30, Marco Moock wrote:
    Am Samstag, 18. Juni 2022, um 22:50:32 Uhr schrieb company 99001:

    dnl #
    DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')dnl
    dnl #
    Please use

    DAEMON_OPTIONS(`Name=MTA, Addr=127.0.0.1, Port=smtp')dnl

    without dnl or a space in front. dnl comments out a line in m4.

    Then run sendmailconfig and check if it works.

    Hi 😊
    Thanks for the comment but it does not work .
    my sendmail.mc file content is as below:

    divert(-1)dnl
    dnl #
    dnl # This is the sendmail macro config file for m4. If you make changes to
    dnl # /etc/mail/sendmail.mc, you will need to regenerate the
    dnl # /etc/mail/sendmail.cf file by confirming that the sendmail-cf package is dnl # installed and then performing a
    dnl #
    dnl # /etc/mail/make
    dnl #
    include(`/usr/share/sendmail-cf/m4/cf.m4')dnl
    VERSIONID(`setup for linux')dnl
    OSTYPE(`linux')dnl
    dnl #
    dnl # Do not advertize sendmail version.
    dnl #
    dnl define(`confSMTP_LOGIN_MSG', `$j Sendmail; $b')dnl
    dnl #
    dnl # default logging level is 9, you might want to set it higher to
    dnl # debug the configuration
    dnl #
    dnl define(`confLOG_LEVEL', `9')dnl
    dnl #
    dnl # Uncomment and edit the following line if your outgoing mail needs to
    dnl # be sent out through an external mail server:
    dnl #
    dnl define(`SMART_HOST', `smtp.your.provider')dnl
    dnl #
    define(`confDEF_USER_ID', ``8:12'')dnl
    dnl define(`confAUTO_REBUILD')dnl
    define(`confTO_CONNECT', `1m')dnl
    define(`confTRY_NULL_MX_LIST', `True')dnl
    define(`confDONT_PROBE_INTERFACES', `True')dnl
    define(`PROCMAIL_MAILER_PATH', `/usr/bin/procmail')dnl
    define(`ALIAS_FILE', `/etc/aliases')dnl
    define(`STATUS_FILE', `/var/log/mail/statistics')dnl
    define(`UUCP_MAILER_MAX', `2000000')dnl
    define(`confUSERDB_SPEC', `/etc/mail/userdb.db')dnl
    define(`confPRIVACY_FLAGS', `authwarnings,novrfy,noexpn,restrictqrun')dnl define(`confAUTH_OPTIONS', `A')dnl
    dnl #
    dnl # The following allows relaying if the user authenticates, and disallows dnl # plaintext authentication (PLAIN/LOGIN) on non-TLS links
    dnl #
    dnl define(`confAUTH_OPTIONS', `A p')dnl
    dnl #
    dnl # which realm to use in SASL database (sasldb2)
    dnl #
    define(`confAUTH_REALM', `mail')dnl
    dnl #
    dnl # PLAIN is the preferred plaintext authentication method and used by
    dnl # Mozilla Mail and Evolution, though Outlook Express and other MUAs do
    dnl # use LOGIN. Other mechanisms should be used if the connection is not
    dnl # guaranteed secure.
    dnl # Please remember that saslauthd needs to be running for AUTH.
    dnl #
    dnl TRUST_AUTH_MECH(`EXTERNAL DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')dnl
    dnl define(`confAUTH_MECHANISMS', `EXTERNAL GSSAPI DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')dnl
    dnl #
    dnl # Basic sendmail TLS configuration with self-signed certificate for
    dnl # inbound SMTP (and also opportunistic TLS for outbound SMTP).
    dnl #
    define(`confCACERT_PATH', `/etc/pki/tls/certs')dnl
    define(`confCACERT', `/etc/pki/tls/certs/ca-bundle.crt')dnl define(`confSERVER_CERT', `/etc/pki/tls/certs/sendmail.pem')dnl define(`confSERVER_KEY', `/etc/pki/tls/private/sendmail.key')dnl define(`confTLS_SRV_OPTIONS', `V')dnl
    dnl #
    dnl # This allows sendmail to use a keyfile that is shared with OpenLDAP's
    dnl # slapd, which requires the file to be readble by group ldap
    dnl #
    dnl define(`confDONT_BLAME_SENDMAIL', `groupreadablekeyfile')dnl
    dnl #
    dnl define(`confTO_QUEUEWARN', `4h')dnl
    dnl define(`confTO_QUEUERETURN', `5d')dnl
    dnl define(`confQUEUE_LA', `12')dnl
    dnl define(`confREFUSE_LA', `18')dnl
    define(`confTO_IDENT', `0')dnl
    dnl # If you're operating in a DSCP/RFC-4594 environment with QoS
    dnl define(`confINET_QOS', `AF11')dnl
    dnl FEATURE(delay_checks)dnl
    FEATURE(`no_default_msa', `dnl')dnl
    FEATURE(`smrsh', `/usr/sbin/smrsh')dnl
    FEATURE(`mailertable', `hash -o /etc/mail/mailertable.db')dnl FEATURE(`virtusertable', `hash -o /etc/mail/virtusertable.db')dnl FEATURE(redirect)dnl
    FEATURE(always_add_domain)dnl
    FEATURE(use_cw_file)dnl
    FEATURE(use_ct_file)dnl
    dnl #
    dnl # The following limits the number of processes sendmail can fork to accept dnl # incoming messages or process its message queues to 20.) sendmail refuses dnl # to accept connections once it has reached its quota of child processes. dnl #
    dnl define(`confMAX_DAEMON_CHILDREN', `20')dnl
    dnl #
    dnl # Limits the number of new connections per second. This caps the overhead dnl # incurred due to forking new sendmail processes. May be useful against dnl # DoS attacks or barrages of spam. (As mentioned below, a per-IP address dnl # limit would be useful but is not available as an option at this writing.) dnl #
    dnl define(`confCONNECTION_RATE_THROTTLE', `3')dnl
    dnl #
    dnl # The -t option will retry delivery if e.g. the user runs over his quota. dnl #
    FEATURE(local_procmail, `', `procmail -t -Y -a $h -d $u')dnl FEATURE(`access_db', `hash -T<TMPF> -o /etc/mail/access.db')dnl FEATURE(`blacklist_recipients')dnl
    EXPOSED_USER(`root')dnl
    dnl #
    dnl # For using Cyrus-IMAPd as POP3/IMAP server through LMTP delivery uncomment dnl # the following 2 definitions and activate below in the MAILER section the dnl # cyrusv2 mailer.
    dnl #
    dnl define(`confLOCAL_MAILER', `cyrusv2')dnl
    dnl define(`CYRUSV2_MAILER_ARGS', `FILE /var/lib/imap/socket/lmtp')dnl
    dnl #
    dnl # The following causes sendmail to only listen on the IPv4 loopback address DAEMON_OPTIONS(`Name=MTA, Addr=127.0.0.1, Port=smtp')dnl

    dnl #
    dnl # The following causes sendmail to additionally listen to port 587 for
    dnl # mail from MUAs that authenticate. Roaming users who can't reach their
    dnl # preferred sendmail daemon due to port 25 being blocked or redirected find dnl # this useful.
    dnl #
    dnl DAEMON_OPTIONS(`Port=submission, Name=MSA, M=Ea')dnl
    dnl #
    dnl # The following causes sendmail to additionally listen to port 465, but
    dnl # starting immediately in TLS mode upon connecting. Port 25 or 587 followed dnl # by STARTTLS is preferred, but roaming clients using Outlook Express can't dnl # do STARTTLS on ports other than 25. Mozilla Mail can ONLY use STARTTLS dnl # and doesn't support the deprecated smtps; Evolution <1.1.1 uses smtps
    dnl # when SSL is enabled-- STARTTLS support is available in version 1.1.1.
    dnl #
    dnl # For this to work your OpenSSL certificates must be configured.
    dnl #
    dnl DAEMON_OPTIONS(`Port=smtps, Name=TLSMTA, M=s')dnl
    dnl #
    dnl # The following causes sendmail to additionally listen on the IPv6 loopback dnl # device. Remove the loopback address restriction listen to the network. dnl #
    dnl # "NEW COMMENT BY ALI" DAEMON_OPTIONS(`port=smtp,Addr=::1, Name=MTA-v6, Family=inet6')dnl
    dnl #
    dnl # enable both ipv6 and ipv4 in sendmail:
    dnl #
    dnl DAEMON_OPTIONS(`Name=MTA-v4, Family=inet, Name=MTA-v6, Family=inet6')
    dnl #
    dnl # We strongly recommend not accepting unresolvable domains if you want to dnl # protect yourself from spam. However, the laptop and users on computers dnl # that do not have 24x7 DNS do need this.
    dnl #
    FEATURE(`accept_unresolvable_domains')dnl
    dnl #
    dnl FEATURE(`relay_based_on_MX')dnl
    dnl #
    dnl # Also accept email sent to "localhost.localdomain" as local email.
    dnl #
    LOCAL_DOMAIN(`mail3.mydomain.com')dnl
    dnl #
    dnl # The following example makes mail from this host and any additional
    dnl # specified domains appear to be sent from mydomain.com
    dnl #
    dnl MASQUERADE_AS(`mydomain.com')dnl
    dnl #
    dnl # masquerade not just the headers, but the envelope as well
    dnl #
    dnl FEATURE(masquerade_envelope)dnl
    dnl #
    dnl # masquerade not just @mydomainalias.com, but @*.mydomainalias.com as well dnl #
    dnl FEATURE(masquerade_entire_domain)dnl
    dnl #
    dnl MASQUERADE_DOMAIN(localhost)dnl
    dnl MASQUERADE_DOMAIN(localhost.localdomain)dnl
    dnl MASQUERADE_DOMAIN(mydomainalias.com)dnl
    dnl MASQUERADE_DOMAIN(mydomain.lan)dnl
    MAILER(smtp)dnl
    MAILER(procmail)dnl
    dnl MAILER(cyrusv2)dnl

    Then i executed the command below :

    sudo m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf

    then used below command to sendmail :

    /usr/sbin/sendmail info@me.org
    Subject:Hello
    just for test
    ctrl+D

    now I checked the log in /var/log/maillog

    Jun 20 09:12:46 mail3 sendmail[150479]: 25K4gUCY150479: to=info@mydomain.com, ctladdr=root (0/0), delay=00:00:16, xdelay=00:00:00, mailer=relay, pri=30037, relay=[127.0.0.1] [127.0.0.1], dsn=4.0.0, stat=Deferred: Connection refused by [127.0.0.1]


    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Marco Moock@21:1/5 to All on Mon Jun 20 08:30:09 2022
    Am Sun, 19 Jun 2022 22:19:24 -0700 (PDT)
    schrieb company 99001 <company99001@gmail.com>:

    Thanks for the comment but it does not work .
    my sendmail.mc file content is as below:

    I am not an m4 expert, but you have divert(-1)dnl
    at the beginning and no divert again, so I assume all content of your
    m4 file is being discarded.
    Please check that by running m4 /path/sendmail.mc manually.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Marco Moock@21:1/5 to All on Mon Jun 20 10:14:51 2022
    Am Mon, 20 Jun 2022 01:10:36 -0700 (PDT)
    schrieb company 99001 <company99001@gmail.com>:

    I am waiting for other friends comments too or even a correct
    sendmail.mc file.

    You need to check YOUR file. Or use the standard sendmail.mc provided
    by your distribution and change only the lines you want.
    Please check the part about divert.

    Or you can download and extract it from the tarball from your
    distribution.
    If you need further help, provide info about the OS you use.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Claus =?iso-8859-1?Q?A=DFmann?= @21:1/5 to All on Mon Jun 20 03:41:42 2022
    What's the output of

    grep '^O DaemonP' /etc/mail/se*cf
    netstat -na -p tcp | egrep '\.(25|587) '


    is sendmail running using /etc/mail/se*cf?


    --
    Note: please read the netiquette before posting. I will almost never
    reply to top-postings which include a full copy of the previous
    article(s) at the end because it's annoying, shows that the poster
    is too lazy to trim his article, and it's wasting the time of all readers.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From company 99001@21:1/5 to All on Mon Jun 20 01:10:36 2022
    Hello
    thanks
    I am waiting for other friends comments too or even a correct sendmail.mc file. Yours,

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From company 99001@21:1/5 to All on Mon Jun 20 21:13:00 2022
    Hello,
    Thanks for all the support from my excellent colleagues.
    The version is as below:
    CentOS Linux release 8.5.2111
    Sendmail version:Version 8.15.2

    I would be thankful to get the source sendmail file.

    Thanks again

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Claus =?iso-8859-1?Q?A=DFmann?= @21:1/5 to All on Tue Jun 21 00:54:40 2022
    company 99001 wrote:

    I would be thankful to get the source sendmail file.

    Have you looked at
    https://ftp.sendmail.org/

    Anyway, that won't fix your configuration problem...
    Still waiting for your answers to my questions.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From company 99001@21:1/5 to All on Mon Jun 20 22:57:47 2022
    Hi,
    grep '^O DaemonP' /etc/mail/se*cf
    O DaemonPortOptions=Name=MTA, Addr=127.0.0.1, Port=smtp

    netstat -na -p tcp | egrep '\.(25|587)
    No result

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Claus =?iso-8859-1?Q?A=DFmann?= @21:1/5 to All on Tue Jun 21 02:59:22 2022
    company 99001 wrote:

    netstat -na -p tcp | egrep '\.(25|587)
    No result

    Really?
    First: there is a ' missing, so your shell should ask for more input...
    Second, which OS?
    If you run Linux instead of *BSD:

    netstat -na -t | egrep ':(25|587)'

    Anyway, did you restart the sendmail daemon?
    If so, is it running?

    ps axuw| fgrep sendmail


    --
    Note: please read the netiquette before posting. I will almost never
    reply to top-postings which include a full copy of the previous
    article(s) at the end because it's annoying, shows that the poster
    is too lazy to trim his article, and it's wasting the time of all readers.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Claus =?iso-8859-1?Q?A=DFmann?= @21:1/5 to All on Sun Jun 26 04:27:44 2022
    company 99001 wrote:

    there exist issue in restarting the mdameon service.

    What is "mdameon"? "mdaemon: email server for windows"?
    Are you running sendmail?
    sendmail -bD &
    and then try netstat / telnet etc. as explained before

    Is there any raw copy of sendmail.mc file avilable for download?

    There are probably millions of them (tried a search engine?)
    and most of them are different... how is that going to help you?
    You can download the sendmail source code (URL given before) and
    look into cf/cf/


    --
    Note: please read the netiquette before posting. I will almost never
    reply to top-postings which include a full copy of the previous
    article(s) at the end because it's annoying, shows that the poster
    is too lazy to trim his article, and it's wasting the time of all readers.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From company 99001@21:1/5 to All on Sun Jun 26 01:18:30 2022
    Hello,
    I am running CentOS Linux release 8.5.2111.
    My sendmail version is also Version 8.15.2
    No result was shown after executing the command: netstat -na -t | egrep ':(25|587)'
    there exist issue in restarting the mdameon service.
    Is there any raw copy of sendmail.mc file avilable for download?
    Thanks for all your help

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Claus =?iso-8859-1?Q?A=DFmann?= @21:1/5 to All on Sun Jun 26 04:57:56 2022
    company 99001 wrote:

    Thanks for the comment but it does not work .
    my sendmail.mc file content is as below:

    Delete all the lines starting with dnl and then remove FEATURE(`no_default_msa', `dnl')dnl



    divert(-1)dnl
    VERSIONID(`setup for linux')dnl
    OSTYPE(`linux')dnl
    define(`confDEF_USER_ID', ``8:12'')dnl
    define(`confTO_CONNECT', `1m')dnl
    define(`confTRY_NULL_MX_LIST', `True')dnl
    define(`confDONT_PROBE_INTERFACES', `True')dnl
    define(`PROCMAIL_MAILER_PATH', `/usr/bin/procmail')dnl
    define(`ALIAS_FILE', `/etc/aliases')dnl
    define(`STATUS_FILE', `/var/log/mail/statistics')dnl
    define(`UUCP_MAILER_MAX', `2000000')dnl
    define(`confUSERDB_SPEC', `/etc/mail/userdb.db')dnl
    define(`confPRIVACY_FLAGS', `authwarnings,novrfy,noexpn,restrictqrun')dnl define(`confAUTH_OPTIONS', `A')dnl
    define(`confAUTH_REALM', `mail')dnl
    define(`confCACERT_PATH', `/etc/pki/tls/certs')dnl
    define(`confCACERT', `/etc/pki/tls/certs/ca-bundle.crt')dnl define(`confSERVER_CERT', `/etc/pki/tls/certs/sendmail.pem')dnl define(`confSERVER_KEY', `/etc/pki/tls/private/sendmail.key')dnl define(`confTLS_SRV_OPTIONS', `V')dnl
    define(`confTO_IDENT', `0')dnl
    FEATURE(`smrsh', `/usr/sbin/smrsh')dnl
    FEATURE(`mailertable', `hash -o /etc/mail/mailertable.db')dnl FEATURE(`virtusertable', `hash -o /etc/mail/virtusertable.db')dnl FEATURE(redirect)dnl
    FEATURE(always_add_domain)dnl
    FEATURE(use_cw_file)dnl
    FEATURE(use_ct_file)dnl
    FEATURE(local_procmail, `', `procmail -t -Y -a $h -d $u')dnl FEATURE(`access_db', `hash -T<TMPF> -o /etc/mail/access.db')dnl FEATURE(`blacklist_recipients')dnl
    EXPOSED_USER(`root')dnl
    DAEMON_OPTIONS(`Name=MTA, Addr=127.0.0.1, Port=smtp')dnl FEATURE(`accept_unresolvable_domains')dnl
    LOCAL_DOMAIN(`mail3.mydomain.com')dnl
    MAILER(smtp)dnl
    MAILER(procmail)dnl

    rebuild the cf file, restart sendmail(!), and try:

    date | /usr/sbin/sendmail -v info@me.org


    --
    Note: please read the netiquette before posting. I will almost never
    reply to top-postings which include a full copy of the previous
    article(s) at the end because it's annoying, shows that the poster
    is too lazy to trim his article, and it's wasting the time of all readers.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Marco Moock@21:1/5 to All on Sun Jun 26 10:39:56 2022
    Am Sonntag, 26. Juni 2022, um 01:18:30 Uhr schrieb company 99001:

    Is there any raw copy of sendmail.mc file avilable for download?

    You already showed us your mc file and I told you aber the divert
    issue. Please post your mc file here and we tell you where to change
    it, ok?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Ali Khoshbin@21:1/5 to All on Mon Jun 27 23:28:30 2022
    Hello,
    First of all Thanks for your time

    I edited the sendmail.mc file & rebuild the file with no error
    then tried to send email & checked the logfile. There is the same error
    Jun 28 10:46:20 mail3 sendmail[300672]: 25S6FwAK300672: to=info@mydomain.com, ctladdr=root (0/0), delay=00:00:22, xdelay=00:00:00, mailer=relay, pri=30045, relay=[127.0.0.1] [127.0.0.1], dsn=4.0.0, stat=Deferred: Connection refused by [127.0.0.1]

    For your info
    When I run netstat -ant | grep :25 there is no result

    Trying to run service sendmail status provides below error


    Redirecting to /bin/systemctl status sendmail.service
    ● sendmail.service - Sendmail Mail Transport Agent
    Loaded: loaded (/usr/lib/systemd/system/sendmail.service; enabled; vendor preset: disabled)
    Active: failed (Result: exit-code) since Wed 2022-06-15 14:03:23 +0430; 1 weeks 5 days ago
    Process: 61593 ExecStart=/usr/sbin/sendmail -bd $SENDMAIL_OPTS $SENDMAIL_OPTARG (code=exited, status=70)
    Process: 61588 ExecStartPre=/etc/mail/make aliases (code=exited, status=0/SUCCESS)
    Process: 61586 ExecStartPre=/etc/mail/make (code=exited, status=0/SUCCESS)

    Jun 15 14:03:23 mail3 systemd[1]: Starting Sendmail Mail Transport Agent...
    Jun 15 14:03:23 mail3 sendmail[61593]: 554 5.0.0 /etc/mail/sendmail.cf: line 64: unknown configuration line "
    Jun 15 14:03:23 mail3 sendmail[61593]: "
    Jun 15 14:03:23 mail3 sendmail[61593]: NOQUEUE: SYSERR(root): /etc/mail/sendmail.cf: line 64: unknown configuration line "\n"
    Jun 15 14:03:23 mail3 systemd[1]: sendmail.service: Control process exited, code=exited status=70
    Jun 15 14:03:23 mail3 systemd[1]: sendmail.service: Failed with result 'exit-code'.
    Jun 15 14:03:23 mail3 systemd[1]: Failed to start Sendmail Mail Transport Agent.
    [root@mail3 log]# service sendmail status
    Redirecting to /bin/systemctl status sendmail.service
    ● sendmail.service - Sendmail Mail Transport Agent
    Loaded: loaded (/usr/lib/systemd/system/sendmail.service; enabled; vendor preset: disabled)
    Active: failed (Result: exit-code) since Wed 2022-06-15 14:03:23 +0430; 1 weeks 5 days ago
    Process: 61593 ExecStart=/usr/sbin/sendmail -bd $SENDMAIL_OPTS $SENDMAIL_OPTARG (code=exited, status=70)
    Process: 61588 ExecStartPre=/etc/mail/make aliases (code=exited, status=0/SUCCESS)
    Process: 61586 ExecStartPre=/etc/mail/make (code=exited, status=0/SUCCESS)

    Jun 15 14:03:23 mail3 systemd[1]: Starting Sendmail Mail Transport Agent...
    Jun 15 14:03:23 mail3 sendmail[61593]: 554 5.0.0 /etc/mail/sendmail.cf: line 64: unknown configuration line "
    Jun 15 14:03:23 mail3 sendmail[61593]: "
    Jun 15 14:03:23 mail3 sendmail[61593]: NOQUEUE: SYSERR(root): /etc/mail/sendmail.cf: line 64: unknown configuration line "\n"
    Jun 15 14:03:23 mail3 systemd[1]: sendmail.service: Control process exited, code=exited status=70
    Jun 15 14:03:23 mail3 systemd[1]: sendmail.service: Failed with result 'exit-code'.
    Jun 15 14:03:23 mail3 systemd[1]: Failed to start Sendmail Mail Transport Age

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Tom Furie@21:1/5 to Ali Khoshbin on Tue Jun 28 06:33:19 2022
    On 2022-06-28, Ali Khoshbin <akhoshbin@gmail.com> wrote:
    Trying to run service sendmail status provides below error

    Jun 15 14:03:23 mail3 sendmail[61593]: NOQUEUE: SYSERR(root): /etc/mail/sendmail.cf: line 64: unknown configuration line "\n"

    Your clue is right there. There's an error at line 64 of
    /etc/mail/sendmail.cf.

    Cheers,
    Tom

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From company 99001@21:1/5 to All on Tue Jun 28 08:00:11 2022
    Hi,
    I had to turn off the server for an UPS test.
    After restarting it. The sendmail started working.
    strange situation.
    Thanks to everyone specially Claus Aßmann for his great understanding & suggestions.
    Ali,

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Marco Moock@21:1/5 to All on Wed Jun 29 13:46:58 2022
    Am Tue, 28 Jun 2022 08:00:11 -0700 (PDT)
    schrieb company 99001 <company99001@gmail.com>:

    The sendmail started working.
    strange situation.

    Then you should find out why. I don't know if you properly restarted
    the system and I don't know if you properly processed you mc config.
    These 2 steps are necessary to make the changes work without restarting
    the OS.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Ali Khoshbin@21:1/5 to All on Sat Jul 2 02:01:39 2022
    Hello,
    Thanks for your comments. If I get enough time, I will check them.
    Thanks again

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Marco Moock@21:1/5 to All on Sat Jul 2 12:38:23 2022
    Am Samstag, 02. Juli 2022, um 02:01:39 Uhr schrieb Ali Khoshbin:

    Thanks for your comments. If I get enough time, I will check them.
    Thanks again

    You're welcome, but it would be nice if you use the same name all the
    time, Ali Khoshbin and company 99001 the same time is very confusing.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Ali Khoshbin@21:1/5 to All on Mon Jul 4 23:16:39 2022
    Dear Marco,
    Thanks for your comments.
    I did not realize that an email was sent with the another account.
    Yours,

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)