Hi,

I’m looking for some way to send my own alerts via e-mail in some way. Whenever I try to search for this, most docker images have a much grander goal, and I have a hard time understanding how to use them for my purpose.

What would I want? It’d be nice to have a docker running some smpt-server (I suppose), so that I can make my own python script that scrapes a website, looks at some metric, and e-mails me whenever whatever I’m looking for is found. I only want it to be available on and to receive mails from localhost, no dns, just forward e-mails to my personal one, no web-interface, etc.

I’m quite new to self-hosting, but I hope you still understand what I’m looking for. Is it possible? Should I look for another solution? Will this not work? Any help/input very much welcome.

  • Illecors@lemmy.cafe
    link
    fedilink
    English
    arrow-up
    3
    ·
    1 year ago

    This is the way, @mumblefish. I use mail from mailutils:

    mail "$recipient" \
              -r "$emailFrom" \
              -s "$emailSubject" \
              < "$filename"
    

    where $filename is a file containing the body content of the email.

    • mumblerfish@lemmy.worldOP
      link
      fedilink
      arrow-up
      1
      ·
      edit-2
      1 year ago

      I wanted to try this first, I can see lemmy parsed a less-than into “<”, which I replaced. But I’m getting no e-mails to the $recipient address. I set $emailFrom to a completely fake one, and another time as my personal, same as $recipient, address, but I’m not receiving any e-mails.

      • Kit
        link
        fedilink
        arrow-up
        2
        ·
        1 year ago

        It’s definitely going to go to spam since there’s no SPF record. You’ll need to manually whitelist that address on the receiving end.

        • mumblerfish@lemmy.worldOP
          link
          fedilink
          arrow-up
          1
          ·
          1 year ago

          Cannot find it in my spam-folder either, and with the mailutils mail I set also set the -r $emailFrom to something that is whitelisted in my spamfilter. But maybe my mail-service provider has some other block. Could that be? Or that it looks very fishy with an e-mail with only from, to, and subject headers non-empty?

          • Illecors@lemmy.cafe
            link
            fedilink
            English
            arrow-up
            1
            ·
            1 year ago

            You’ve initially said you wanted to receive it locally only. Now you’re pulling external email providers into the mix. You need to set up spf and dmarc for that at the minimum. I can help you with it, but it’s nowhere near as simple as just emailing a local user.

            • mumblerfish@lemmy.worldOP
              link
              fedilink
              arrow-up
              1
              ·
              1 year ago

              Sorry, I must not have explained myself very well. I guess it is the part on receiving on localhost. What I meant to say was that I would like the smtp, or whatever, to only be available on localhost, so that no one else on the network can use the service to send e-mails.

            • Kit
              link
              fedilink
              arrow-up
              1
              ·
              1 year ago

              You definitely don’t need dmarc for that. Don’t even need dkim, really.