Create a Post
cancel
Showing results for 
Search instead for 
Did you mean: 
Netanel
Explorer

Scirpts with Sendmail

 

Dear Check Point Support,

We are trying to create a script that automatically checks our encryption certificates (IKE Certificates) on our Gaia system and sends an email report detailing their status—expiration date, days left, whether certificates are expired or about to expire.

However, we are experiencing an issue with the sendmail command on Gaia. Sometimes the command returns exit code 1 and no email is sent. Other times, it returns exit code 0 (indicating success), but the email still does not arrive at the recipient.

We have verified the following:

  • SMTP relay is correctly configured.

  • The sendmail binary has correct permissions.

  • Manual attempts to send emails using sendmail yield the same inconsistent results.

  • SMTP port 25 is reachable from the Gaia system.

  • No relevant error logs are found beyond the exit codes.

We request assistance to diagnose and resolve why the sendmail command behaves inconsistently and why emails are not reliably sent.

Thank you for your support

0 Kudos
6 Replies
_Val_
Admin
Admin

@Netanel, for the record, this is a community site, not an official support channel. If you need our TAC help, please open a support request via https://help.checkpoint.com

That said, I hope our community members could give you some advice.  

the_rock
MVP Gold
MVP Gold

Can you send an example of what you created? Please blur out sensitive data. Here is an sk about it.

Andy

https://support.checkpoint.com/results/sk/sk25941

0 Kudos
Netanel
Explorer

look :
[Expert@cpmoudle:0]# sendmail -t *.*.*.* -s "Check Point Test" -f "mail_sender" -m /tmp/TESTMAIL/test.txt mail
0
[Expert@cpmoudle:0]#

 

 

0 Kudos
HeikoAnkenbrand
MVP Gold
MVP Gold

1) To verify that the DNS is properly configured, you can use tools like "nslookup" to check if domain names are correctly resolving to their respective IP addresses. For example, running "nslookup mail_destination.com" and nslookup $(hostname -i) should return a valid IP address if the DNS is set up correctly.

2) If you're using a relay (e.g., mail_destination.com), run this manual test using telnet:
# telnet mail_destination.com 25

3) Check TLS connection:
# cpopenssl s_client -starttls smtp -connect mail_destination.com:25

4) Check sendmail with -v verbose logging:
# (echo "Subject: Test mail"; echo; echo "Body text") | sendmail -v recipient@mail_destination.com

➜ CCSM Elite, CCME, CCTE ➜ www.checkpoint.tips
0 Kudos
Netanel
Explorer

look 

0 Kudos
JozkoMrkvicka
Authority
Authority

Make sure you use complete path where sendmail binary file is located.

use "/usr/sbin/sendmail" instead of just "sendmail" within the script itself.

Kind regards,
Jozko Mrkvicka

Leaderboard

Epsum factorial non deposit quid pro quo hic escorol.

Upcoming Events

    CheckMates Events