# ssmtp functionality via sendmail need advise



## proton1234 (Dec 15, 2019)

Could someone help me to replicate ssmtp functionality using sendmail or advise me please other MTA.

I installed ssmtp and edited ssmtp.conf. PHPmail() and local mail to root etc sending OK to configured mailbox via external ssmtp server using login/password authentification on 587 port. And everything just fine except SSMTP always "interactive delivery mode" which makes website busy until email is finished to sent from frontend.

I've found that sendmail can be switched to "background delivery mode" (submit.cf ->DelivetyMode=b) and this solves website busy problem. So I disable ssmtp via editiong /etc/mail/mailer.conf and try to set up same fuctionality with sendmail + saslauthd + AuthInfo + SMART_HOST.  Everything is working except local mail - messages from cron aren't delivered.
I 've read that it's because SMART_HOST not intended to handle local emails and I have to configure also

```
define(`MAIL_HUB', `smtp.myisp.com.')dnl
define(`LOCAL_RELAY', `smtp.myisp.com.')dnl
```
I tried to do that but seems did something wrong so local mail still not sending to remote smtp server.

Also as an alternative I tried with no positive result

```
FEATURE(`nullclient', `smtp.myisp.com')
undefine(`ALIAS_FILE')
```


----------



## trev (Dec 16, 2019)

Sendmail treats the "w" class as the domains for which it will attempt local delivery.  The default FreeBSD configuration (/etc/mail/freebsd.mc) includes these lines, for example:


```
FEATURE(local_lmtp)
...
define(`confCW_FILE', `-o /etc/mail/local-host-names')
...
```

/etc/mail/local-host-names is the file containing names of hosts for which the system receives email. What's in your file?


----------



## proton1234 (Dec 16, 2019)

trev said:


> /etc/mail/local-host-names is the file containing names of hosts for which the system receives email. What's in your file?


I have no such file in /etc/mail


----------



## trev (Dec 16, 2019)

Well there you go, no local mail delivery.


----------



## proton1234 (Dec 16, 2019)

trev said:


> Well there you go, no local mail delivery.


so what I should put there?


----------



## trev (Dec 16, 2019)

Include all aliases for your machine in /etc/mail/local-host-names.


----------



## proton1234 (Dec 16, 2019)

trev said:


> Sendmail treats the "w" class


what's the w class?


trev said:


> Include all aliases for your machine in /etc/mail/aliases.


aliases are default if you mean /etc/mail/aliases


----------



## trev (Dec 16, 2019)

See previous post - corrected 

Please consult the sendmail documentation for an explanation of the w class beyond what I have already explained.


----------



## proton1234 (Dec 16, 2019)

trev said:


> Please consult the sendmail documentation for an explanation of the w class beyond what I have already explained.


sorry but actually you explained nothing
echo '$=w' | sendmail -bt
prints localhost, domain name, IPs etc


----------



## proton1234 (Dec 16, 2019)

trev said:


> See previous post - corrected


In opposite to your view and according to this guide localhost and and resolvable domain name should be removed from W class. What do you think about that?





						How to Remove a Host from Sendmail's Class w
					






					weldon.whipple.org


----------

