Solved ssmtp alternative

marcus123

Member

Reaction score: 3
Messages: 37

We have been using ssmtp on a web server for few years, we use it to send email only, we like it as it's easy to setup and support common security features.

However, as ssmtp is unmaintained, we would like to find an alternative, we are interested in msmtp, is anyone using it? is it good?
 

Lamia

Aspiring Daemon

Reaction score: 207
Messages: 770

Ssmtp works. I'm sure it will be continuously maintained by one or more persons in this community.

It does a great jump as a send-only email service(MTA).
 

scottro

Daemon

Reaction score: 866
Messages: 2,019

I've used msmtp for years, but as an individual account mailer, rather than a server one, and found it quite reliable. (And better than ssmtp for using more than one individual account, e.g., gmail and something else.)

Here's something a cursory google search found about using with php on a webserver, for Ubuntu, but should work without too much modification.

(Though from the post above, it seems that you'd be ok sticking with ssmtp.)

 
OP
marcus123

marcus123

Member

Reaction score: 3
Messages: 37

Thanks Lamia and scottro.

ssmtp is really good and easy, while msmtp supports multiple account is a good feature for us. (actually we have thought of sending emails from different SMTP server)

However, I found someone on the web mentioned how to use msmtp on desktop too, is msmtp more suitable for desktop rather than server?
 

rootbert

Well-Known Member

Reaction score: 152
Messages: 409

postfix ... very good security track, fast,scalable,easy to use, well documented (and quite some companies offering support)
 

Lamia

Aspiring Daemon

Reaction score: 207
Messages: 770

postfix ... very good security track, fast,scalable,easy to use, well documented (and quite some companies offering support)
Of course, Postfix has its place. For send-only (say to a relay), Postfix is an overkill.
 
OP
marcus123

marcus123

Member

Reaction score: 3
Messages: 37

Of course, Postfix has its place. For send-only (say to a relay), Postfix is an overkill.

Agree, and thanks rootbert. We have used Postfix on other cases which require sending and receiving. But for this case, send only, we prefer to use those are more simpler to setup like ssmtp / msmtp.
 
OP
marcus123

marcus123

Member

Reaction score: 3
Messages: 37

What further maintenance is required for this simple pkg - https://www.freshports.org/mail/ssmtp/?

Last update was later last year. Not too long!

Haha, actually nope for me, yes, the last update was not too long ago, just feel more comfortable if the software being used is maintained by someone.

If I have to say, perhaps adding the support of sending email via different SMTP. 😜
 

scottro

Daemon

Reaction score: 866
Messages: 2,019

As for msmtp, yes, I think it's better for desktop, (especially because of the multiple account thing.
http://srobb.net/mutt.html#Sending is an old page on mutt I did, but in that section is configuring msmtp. Just go down a few paragraphs (the first few deal with using mutt's builtin smtp), and you'll see the msmtp stuff.
 

Lamia

Aspiring Daemon

Reaction score: 207
Messages: 770

I thought he knew about that too. I keep wondering what he wanted. It's all about swapping the conf files. Perhaps, a script for swapping with a few conditions would help as an example.
 

aragats

Daemon

Reaction score: 703
Messages: 1,618

This script emulates --account=id option of msmtp (can be improved further):
Code:
#!/bin/sh
  
ACCID1=main
ACCID2=secondary
CONF1=/path/to/config1
CONF2=/path/to/config2
EXEC=/usr/local/bin/ssmtp

if [ "x$1" = "x" ] ; then
    echo "Usage: $0 --account=<id> <other options>"
    exit 1
fi

ARG1_LEFT=`echo $1 | cut -d= -f1`
ARG1_RIGHT=`echo $1 | cut -d= -f2`

if [ "x$ARG1_LEFT" = "x--account" ] ; then
    if [ "x$ARG1_RIGHT" = "x$ACCID1" ] ; then
        $EXEC "-C $CONF1 $2 $3 $4"
    else
        if [ "x$ARG1_RIGHT" = "x$ACCID2" ] ; then
            $EXEC -C $CONF2 $2 $3 $4
        else
            $EXEC $*
        fi
    fi
fi
 
OP
marcus123

marcus123

Member

Reaction score: 3
Messages: 37

I thought he knew about that too. I keep wondering what he wanted. It's all about swapping the conf files. Perhaps, a script for swapping with a few conditions would help as an example.

Thanks all.

Actually we are thinking of the possibility of switching SMTP when needed (in an admin. friendly way). For example, we normally use SMTP server A to send emails, when the SMTP server A is down for any reasons, we may easily switch to SMTP server B without changing the server config. Therefore, it could be better if we could make a web interface to let administrator switch it by just clicking a switch. Do you think it is possible?
 

aragats

Daemon

Reaction score: 703
Messages: 1,618

For anything you want. You can rename/move/symlink either the script which is called to send email or ssmtp (or whatever else program's) config file.
 

Lamia

Aspiring Daemon

Reaction score: 207
Messages: 770

You can use a monitoring agent like monit to auto-switch the config too.
 

Duffyx

Active Member

Reaction score: 44
Messages: 121

DMA is a nice alternative to ssmtp and it comes with the FreeBSD base system ;-)!
 

proton1234

Member

Reaction score: 1
Messages: 90

Ssmtp works. I'm sure it will be continuously maintained by one or more persons in this community.

It does a great jump as a send-only email service(MTA).
Is there is a way to switch SSMTP from deliverymode = interactive to deliverymode = background? As far as I know it always use interactive mode but this does not suit my needs.
 

Lamia

Aspiring Daemon

Reaction score: 207
Messages: 770

Is there is a way to switch SSMTP from deliverymode = interactive to deliverymode = background? As far as I know it always use interactive mode but this does not suit my needs.
I'm not sure what you meant by interactive or delivery mode.

We only set its config file, add it to rc.conf and replace sendmail commands with its commands in the mailer file. That's all. It requires restarting the PC, I think. Off you go, it will then always be used to send outgoing emails that sendmail would have set.
 

proton1234

Member

Reaction score: 1
Messages: 90

I'm not sure what you meant by interactive or delivery mode.
I meant corresponding sendmail sending modes. Open /etc/mail/submit.cf and look for
Code:
O DeliveryMode=i
this is a default setting for a sendmail when it used to send message to someone using CLI and "-Am" option not used. Prompt is busy until message is sent. Then change it to
Code:
O DeliveryMode=b
That would return command prompt immediately and mesage will be sent in background mode.

SSMTP send messages always in the interactive mode and in some cases this isn't fast enough. I need a simply MTA that would be able to send messages in the background mode using smtp authentication like SSMTP do.
 
Top