Where is the .mc or sendmail.mc file

Hello,

I am not able to find an .mc file that resembles that of sendmail.cf. I would not expect to craft one from scratch. I would appreciate some insight.

Thanks in advance!

Mike
 
Solved

I just compared and it appears to be so. Now if I could just get somebody to configure it for me lol.

Thanks for clearing that up!
 
The comments at the start of /etc/mail/Makefile show all the things that it automates. This is an excellent bit of automation that is underappreciated.
 
I appreciate it!

I am still green as evidence would show but I certainly appreciate the incredible amount of time that has been committed to the development and support of FreeBSD.

I hope others appreciate it too!

Mike
 
Your mail(1) command still connects to the local MTA (sendmail), it's that MTA that will move the mail to the configured smart host (your smtp.myprovider.com).
 
Your mail(1) command still connects to the local MTA (sendmail)
Why "mail" command if I invoke "sendmail"?
it's that MTA that will move the mail to the configured smart host (your smtp.myprovider.com).
As I can see from -v output sendmail is still trying to send mail from currentOSuser@mydomain.com instead of configured account at smtp.myprovider.com

Seems like I need to perform some additional steps from here https://www.freebsd.org/doc/handbook/SMTP-Auth.html because there is no saslauthd installed on my system.
 
Did you run make and make install in /etc/mail/? Then make restart to restart sendmail(8) to have it pick up the new config?

For a local submit you need to modify /etc/mail/`hostname -f`.submit.mc (or the *.cf if you're hardcore). I often mix them up and edit the wrong files.

For testing I just send an email using the mail(1) command, then watch /var/log/maillog.

As I can see from -V output sendmail is still trying to send mail from currentOSuser@mydomain.com instead of configured account at smtp.myprovider.com
That will always happen, if you need to change it you're going to need to do more configuration. This is not done by setting a smart host. A smart host is just the next step in a chain of mailservers where mail gets transferred to. It doesn't change anything of the originally submitted email (which will have a source address of $user@$hostname). To change that $hostname part to $mydomain you need to set DOMAIN_NAME in the mc file, or Dj in cf.
 
Yes, I did look at that. That's why I mentioned it. Normally the MTA (in this case sendmail(8)) will try to lookup the MX record of the destination domain and deliver the mail on its own. When you define a smart host all mail is transferred to the smart host and it's assumed the smart host takes care of further delivery. Setting a smart host doesn't change anything on the originally submitted email, it's passed on 'as-is'.

In this respect a smart host is similar to setting a gateway for TCP/IP. It just passes the packets to the gateway and the router passes it further along. It doesn't change anything on the original packet, it's just a way to route traffic.
 
When you define a smart host all mail is transferred to the smart host and it's assumed the smart host takes care of further delivery.
As far as I understand if remote smtp server requires login and password my config won't work without saslauthd running
By the way my rc.conf setings are
Code:
sendmail_enable="NO"
sendmail_outbound_enable="NO"
sendmail_submit_enable="YES"
sendmail_msp_queue_enable="YES"
 
As far as I understand if remote smtp server requires login and password my config won't work without saslauthd running
That's possible, normally an MTA just delivers the email on port 25, no authentication, nothing, just connect and deliver. That's one of the reasons why spamming is so easy to do.

You can remove all those sendmail_* options, it's the default way sendmail(8) starts (see /etc/defaults/rc.conf).
 
You can remove all those sendmail_* options, it's the default way sendmail(8) starts (see /etc/defaults/rc.conf).
I need sending only sendmail or other MTA with delivery mode = "background" with message queue to send messages from website via PHP mail so I don't think that it's a good idea to rollback to defaults. Correct me if I'm wrong please.
 
to send messages from website via PHP mail so I don't think that it's a good idea to rollback to defaults.
Are you stuck with PHP mail? Or can you use other libraries? In your case mail/phpmailer might be a better and easier solution. It can connect directly to your mail provider (with authentication). That way you don't have to configure a local MTA.
 
Are you stuck with PHP mail? Or can you use other libraries? In your case mail/phpmailer might be a better and easier solution. It can connect directly to your mail provider (with authentication). That way you don't have to configure a local MTA.
PHP+ smtp authentification will work in interactive mode too. Connecting to smtp provider in interactive mode is slow - one message to send would take ~5 sec and system would be busy until it get an Ok or an Error from smtp server. While in background delivery mode system is available immediately. You can test it by yourself changing in submit.cf delivery mode from i to b and then send to someone something via sendmail yourbuddy@hismailbox.com[/COLOR]
Code:
# default delivery mode
O DeliveryMode=i
ssmtp is a good alternative to sendmail in my case but it work only in interactive mode, msmtp seems do the same and interactive only too.
 
Last edited by a moderator:
Back
Top