0

I'm trying to configure the sendmail on my ubuntu, the following should install the necessary packages:

sudo apt-get install sendmail sendmail-cf m4

But then when I'm changing the sendmail.mc file how I should compile it to see the changes in sendmail.cf file ??

This tutorial suggests the make command :

cd /etc/mail
make

but then the changes are not reflect in my sendmail.cf command. Also some suggests that :

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

But then I'm getting the error :

m4:/etc/mail/sendmail.mc:10: cannot open `/usr/share/sendmail-cf/m4/cf.m4': No such file or directory

So I don't know how to compile the sendmail.mc file !! And as I mentioned I have installed the sendmail, sendmail-cf and m4 packages.

Haribo
  • 111
  • if you would like to try other method to send email through ubuntu terminal you can look here: https://askubuntu.com/questions/12917/how-to-send-mail-from-the-command-line – CrazyTux Sep 11 '21 at 12:55

1 Answers1

2

I have given up on sendmail and discovered that msmtp is much easier to install. My old server was evidently linking sendmail to msmtp. sudo apt install msmtp I put settings in /etc/msmtprc:

defaults

timeout 15 tls on tls_starttls on tls_certcheck on tls_trust_file /etc/ssl/certs/ca-certificates.crt

account default

host EMAIL_SMTP_SERVER port 587 auto_from off from ACCOUNT@DOMAIN

auth on user ACCOUNT@DOMAIN password PASSWORD

Test it:

sudo ln -s /usr/bin/msmtp /usr/bin/sendmail
echo "Subject: Sendmail (MSMTP) Test" | sendmail -v recipient@domain.com