# Postfix message in a sendmail "envelope"(wrapper) ?



## Sivan! (Jul 2, 2022)

In a lab VM environment, I have installed postfix, tried disabling sendmail, postfix logs still say something about sendmail such as

```
Jul  2 18:21:51 6 sendmail[79052]: 262ILX6p079052: to=m...@mail.pcxx.n2.xxx-xx.org, delay=00:00:18, mailer=esmtp, pri=30112, dsn=4.4.3, stat=queued
```

Then I followed instructions from a github page


```
root@6:~ # echo 'sendmail_enable="NO"' >> /etc/rc.conf  
root@6:~ # chmod 0 /usr/libexec/sendmail/sendmail
chmod: /usr/libexec/sendmail/sendmail: Read-only file system
root@6:~ # chmod 0 /usr/sbin/sendmail
chmod: /usr/sbin/sendmail: Read-only file system
root@6:~ # mv /usr/libexec/sendmail/sendmail /usr/libexec/sendmail/sendmail.bak
mv: rename /usr/libexec/sendmail/sendmail to /usr/libexec/sendmail/sendmail.bak: Read-only file system                                                                                                                                  
root@6:~ # mv /usr/sbin/sendmail /usr/sbin/sendmail.bak
mv: rename /usr/sbin/sendmail to /usr/sbin/sendmail.bak: Read-only file system
```

The results of the command says "readonly" file system.  Does that imply that the commands did not go through?


----------



## tingo (Jul 2, 2022)

Yes, you can't change anything on a readonly filesystem. You need to make it read write first...
As for disabling sendmail, this is what you need in /etc/rc.conf:

```
# --- disable sendmail ---
sendmail_enable="NO"
sendmail_submit_enable="NO"
sendmail_outbound_enable="NO"
sendmail_msp_queue_enable="NO"
```


----------



## yuripv79 (Jul 2, 2022)

Do not do this, simply follow the pkg-message for postfix!  Sendmail binary is a *wrapper*, controlled via mailer.conf.


----------



## Alexander88207 (Jul 2, 2022)

Yeah, removing is definitely working against the system and not a proper solution.


----------



## Sivan! (Jul 2, 2022)

I already had the configuration as recommended by tingo in my `/etc/rc.conf`.  In any case I now understand that Sendmail is NOT altogether to be removed as shown in the github page

Where do I find posfix pkg-message ?

Thank you.


----------



## yuripv79 (Jul 2, 2022)

Sivan! said:


> Where do I find posfix pkg-message ?


`pkg info -D postfix`


----------



## Sivan! (Jul 2, 2022)

With apologies, if these questions are trivial:

dsdqmhsx I am following the steps, found in /etc/mail/mailer.conf sendmail everywhere as in the screenshot attached. Then I followed the steps:
`install -d /usr/local/etc/mail` and                                                                                    
`install -m 0644 /usr/local/share/postfix/mailer.conf.postfix /usr/local/etc/mail/mailer.conf`

After that /usr/local/etc/mail/mailer.conf which is a file auto-created by the above command also shows a file that says 'sendmail' in every line.

Is this because sendmail has to be a "binary wrapper" as mentioned by dsdqmhsx ?


----------



## yuripv79 (Jul 2, 2022)

I meant that /usr/sbin/sendmail, /usr/bin/newaliases, and so on are symlinks to /usr/sbin/mailwrapper so that when you execute `sendmail`, or `newaliases`, the real program to be executed is found in mailer.conf.

And yes, /usr/local/sbin/sendmail is a sendmail-compatible postfix binary.


----------



## Sivan! (Jul 2, 2022)

dsdqmhsx said:


> I meant that /usr/sbin/sendmail, /usr/bin/newaliases, and so on are symlinks to /usr/sbin/mailwrapper so that when you execute `sendmail`, or `newaliases`, the real program to be executed is found in mailer.conf.
> 
> And yes, /usr/local/sbin/sendmail is a sendmail-compatible postfix binary.



Don't understand, and am puzzled as to why postfix needs sendmail.


----------



## yuripv79 (Jul 2, 2022)

(disclaimer: I'm not doing anything mail-related for really long time, so I may be not completely correct here)
`sendmail` (and `newaliases`, as in "commands") is a legacy "standard" interface which some programs expect to exist to send the mail locally.  It is NOT required otherwise, but exim and postfix (at least, I didn't check other MTAs) provide these for compatibility.


----------



## Alain De Vos (Dec 17, 2022)

Here is how i disable sendmail:

```
sendmail_enable="NO"    # Run the sendmail inbound daemon
sendmail_cert_create="NO"    # Create a server certificate if none 
sendmail_submit_enable="NO"    # Start a localhost-only MTA for mail submission
sendmail_outbound_enable="NO"    # Dequeue stuck mail
sendmail_msp_queue_enable="NO"    # Dequeue stuck clientmqueue mail
```


----------

