Msmtp: Difference between revisions

imported>Onny
mNo edit summary
msmtp includes the msmtp-queue script to queue offline messages.
 
(7 intermediate revisions by 3 users not shown)
Line 1: Line 1:
[https://marlam.de/msmtp/ msmtp] is a basic email sender client. It is easy to configure but lacks some features like queuing when offline.
[https://marlam.de/msmtp/ msmtp] is an easy to configure basic email sender client with fairly complete sendmail compatibility.


== Installation ==
== Installation ==
Line 10: Line 10:
programs.msmtp = {
programs.msmtp = {
   enable = true;
   enable = true;
   accounts = {
   accounts.default = {
     default = {
     host = "example.org";
      host = "example.org";
    from = "hello@example.org";
      from = "hello@example.org";
    user = "hello@example.org";
      user = "hello@example.org";
    password = "mypassword123";
      password = "mypassword123";
    };
   };
   };
};
};
Line 26: Line 24:


<syntaxhighlight lang="console">
<syntaxhighlight lang="console">
# sendmail john.doe@mail.com
# echo -e "Content-Type: text/plain\r\nSubject: Test\r\n\r\nHello World" | sendmail john.doe@mail.com
Subject: Test Send Mail
Hello World
control d (this key combination of control key and d will finish the email.)
</syntaxhighlight>
</syntaxhighlight>


A mail with the subject ''Test Send Mail'' will be send to the recipient ''john.doe@mail.com' including the body text ''Hello World''.
A mail with the subject ''Test'' will be sent to the recipient ''john.doe@mail.com'' including the body text ''Hello World''. A Mime-Header is added to the mail content for better compatibility.


== Configuration ==
== Configuration ==
Line 47: Line 42:
       auth = true;
       auth = true;
       tls = true;
       tls = true;
      # try setting `tls_starttls` to `false` if sendmail hangs
       from = "<from address here>";
       from = "<from address here>";
       host = "<hostname here>";
       host = "<hostname here>";