Create a Post
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Advisor

sendmail to mailserver

Hi,

Trying to test mail from sendmail to mailserver. Syntax used is 

./sendmail -s 'SmartView' -t MAILSERVER -f SENDER_EMAIL_ADDRESS RECEIVER_EMAIL_ADDRESS

I have used fwmonitor to capture output and opened it in Wireshark. It goes like this:

220  answer from mailserver 

HELO mgmt.mydomain.com

250 reply from mailserver

And then it stops. The next thing should be something like this from sendmail

MAIL FROM: me@mydomain.com but it never happens.

Anyone knows why and if there is something wrong with the syntax used?

Tags (1)
8 Replies
Highlighted
Contributor

On security gateways I have used the following command in the past:

echo -e "Subject: Mail test\r\n\r\nTest.\r\n" | sendmail --domain=example.com -f no-reply@example.com -v user@example.com --host=<ipaddress_of_mta>

0 Kudos
Highlighted
Advisor

Thank you Niels but this is sendmail from a management server r80.10 and it looks like it doesn't support the parameters you are using:

0 Kudos
Highlighted
Contributor

On a R77.30 gateway there seems to be at least two versions of sendmail:

  • /usr/sbin/sendmail
  • $FWDIR/bin/sendmail

The one I was using is /usr/sbin/sendmail.

0 Kudos
Highlighted
Advisor

You are correct, there are two. The one I was trying was $FWDIR/bin/sendmail since I'm trying to run a mail alert script and are supposed to use internal_sendmail. I hope someome can confirm that internal_sendmail is $FWDIR/bin/sendmail

0 Kudos
Highlighted
Contributor

The other one should work like this:

echo "Test" | $FWDIR/bin/sendmail -s 'SmartView' -t MAILSERVER -f SENDER_EMAIL_ADDRESS RECEIVER_EMAIL_ADDRESS

0 Kudos
Highlighted
Advisor

When using echo I could send send mail.

Solution to my problem was to use $FWDIR/bin/sendmail -s 'SmartView' -t MAILSERVER -f SENDER_EMAIL_ADDRESS RECEIVER_EMAIL_ADDRESS

instead of 

internal_sendmail -s 'SmartView' -t MAILSERVER -f SENDER_EMAIL_ADDRESS RECEIVER_EMAIL_ADDRESS

in the Global properties configuration. 

Highlighted
Explorer

HI , 

Can you please help me how can I send an attachment over same email. 

I have scheduled MDS backup and want to send a report when it is completed with logs files attached.

I am using below script to send email and using R80.30 OS

echo -e "Subject: Mail test\r\n\r\nTest.\r\n" | sendmail --domain=abc.com -f server@abc.com -v Receipient@abc.com --host=smtp.abc.com

0 Kudos
Highlighted
Explorer

Unfortunately, the sendmail client on the Check Point devices has been slimmed down and cannot have attachments. I ran into the same problem and this is something my SE told me. 

0 Kudos