Solved ssmtp alternative

marcus123

Member

Reaction score: 3
Messages: 25

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

Well-Known Member

Reaction score: 52
Messages: 327

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: 512
Messages: 1,425

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
OP
marcus123

marcus123

Member

Reaction score: 3
Messages: 25

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

Member

Reaction score: 9
Messages: 55

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

Lamia

Well-Known Member

Reaction score: 52
Messages: 327

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
OP
marcus123

marcus123

Member

Reaction score: 3
Messages: 25

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.
 

scottro

Daemon

Reaction score: 512
Messages: 1,425

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

Well-Known Member

Reaction score: 52
Messages: 327

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: 530
Messages: 1,266

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
OP
marcus123

marcus123

Member

Reaction score: 3
Messages: 25

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: 530
Messages: 1,266

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

Well-Known Member

Reaction score: 52
Messages: 327

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