What a pile of poo! I have access to four smtp servers and they all have limits on the distribution list size! (They are all about the same size of 100). Google will allow 2000 per list but only if you use one of their clients. Let’s try and bring up an SMTP server, connect it to DNS, and then send them myself.

This page was started in 2016 when I was interested in sending large circulation news letters. I became interested again when I felt I wanted to host some services on my ‘Pi.

Is it worth it?

i.e. making postfix/exim work; a good friend tried running his mail server/service from home and found that keeping up with anti-spam/encryption technology was a lot of work calling on expertise at the edge of his interest. He uses Runbox as his provider now. Can this be made to do what I want?

Raspberry Pi

I returned to this in Nov 2022 and found these resources, as I turned my attention to Raspberry Pi and away from Amazon, it’s too expensive for a hobbyist. My use case is now a low volume activity.

I chose postfix as my mail tool[s]

Postfix

  1. Setting it up
    1. How to setup email alerts on linux using gmail from “How to Geek”, they use ssmtp. This article has a diagram, and includes dovecot on its solution & How to set up a mail server on your Raspberry Pi? from Raspberry Tips,  which uses postfix. <== This looks like the best. I use NOIP to obtain a DNS address, and will need to use it to set the MX record, however, additional TXT records including the RARP record are chargeable.
    2. As I worked my way through this, I came across a series of articles by Linux Babe, starting with  Build Your Own Email Server on Ubuntu: Basic Postfix Setup which deals with the install and DNS configuration.
  2. Making it work
    1. These two links suggest that postfix & DNS maybe enough, from O’Reilly ,Postfix: The Definitive Guide by Kyle D. Dent, and Kiero Connect, Essential DNS Records for Mail Delivery and Spam Protection, it seems they are.
    2. See also, postfix from archlinux.org which includes details on checking the config.
    3. No routing intermediaries are needed, postfix and the responder both use DNS. We’ll see. I have now sent mail out of my servers, but they are rejected by the target servers with SPF or DKIM errors. A note on SPF and DKIM at linuxbabe. The SPF tests requires a reverse lookup DNS record which noip do not support, or do not support on change of address. Thus I need to consider using a different DNS provider or mail solution.

I moved my notes on the mail utilities to this modal.

I suspect I have not finished with postfix and mail dispatch. I am concerned about receiving mail bombs, this talks about postfix’s message size parameter, there are more, but I think that it has a series of parameters to restrict size and maybe flow, this also refers. The config parameters are documented here. But I suspect that SPF and DKIM may be useful here.

I need to consider hardening postfix and may need to make a custom certificate or this, from Runbox.

Dovecot and Mutt

I need another plan; I investigate dovecot. The plan is to use mail to distribute the mail and dovecot to allow people to come and get it. For dovecot I read and used, how to install-dovecot on ubuntu-20-04, I might also need set-up-a-postfix-mail-server-with-dovecot-and-squirrelmail-on-ubuntu/ from ionos; its documentation of the smtp is better. Mutt is recommended as a mail tool. It takes a -f parameter for the mail file and takes a file scheme argument too. So mutt -f imaps://user@mailhost.

This all goes on easily enough, but it seems there are two storage regimes for UNIX mail. The comment dated 9th April refers. Dovecot in 2023 seems to work it out.

I used the certs I bought from NOIP to identify dovecot, and use thunderbird to link to myuser@mydnsname, I had to revise the user name which was generated to username only. imaps is port 993, and smtp is 587 (i think). I needed to make a firewall rule for imaps for the hub and used the provided smtp rule. The home hub interface is as shit as ever.

I was thinking about how to manage the mailboxes for remote users and came across this articles add user account to linux using a webpage which recommends LDAP which I last looked at a long time ago and using users without logins and home directories. Basically I need to look at the apps I plan to use.

Mailgun

I had been pointed at mailgun by one of the mastadon installs. It’s not so well reviewed well in the article above. This describes how to use Mailgun as an smtp server for gmail and hotmail accounts.

I found some additional resources about mailgun.

  1.  Their pricing page, looking for the free one
  2. A how to get started at Rec & Rec+
  3. Jeff Reifmann on getting started too
  4. and they have a video, getting started with Mailgun, a video, which I have not yet watched.

In Feb ’18, I read up about Amazon & DNS and then I found this on mail & EC2. And then I found this, 7 Best Transactional Email Services: Sendgrid vs. Mandrill & More. I was also pointed at Runbox.

15 Replies

  1. Pingback: Diaspora |
  2. I have read and described the links in the Raspberry Pi section. I have postfix running on a dev system, and can send mails between users. Do I need mail relay? Do I need permission for a mail relay, or can I get the destination address from DNS? Is NOIP actually the simplest answer?

  3. I returned to my postfix server. I mailed my ionos account and received a 554 error. I amended the /etc/mailname record, I checked the main.cf and set the myhostname parameter.

    I set up an MX record on the NOIP site. This may not yet have propagated. I also sent a message to myself at google mail.

    The error log messages still identify the sending system as ‘raspberry’ which is the result of `hostname` command.

    The error log messages are here.

    Here is the ionos error message page , which also may point at an SMTP error which is actually a DNS/PTR/SPF error. The google error message page is here and refers to Reverse_DNS_lookup and/or SPF/DKIM, this page refers to SPF/DKIM

    The good news is that the mails are getting there and returning error messages; the bad news obviously is that they are being rejected.

    Two problems, the receivers think it’s coming from raspberry which they can’t see on reverse lookup, so it’s either an identity declaration, or a DNS error; the google error message is more explicit; I need an SPF/DKIM setting.

    See above, NOIP won’t do an SPF record with dynamic IP.

  4. This seems a blind alley; there’s lots of advice on using google as a mail relay, including this, from google; I am confused if you need a google workspace account and if that is free to google mail users. See also, How to use google’s smtp server, this seems to be an “in the box” solution, although it points to how to configure postfix as a send only smtp server. Also the Rasperrytips article does not document getting permission to use a relay, however NOIP also offer to Setup Alternate-Port SMTP. Is this what I need? No! I need more DNS records for which they charge.

    Also Route outgoing SMTP relay messages through Google from Google; which led me to this q=”how to open a google admin account, most of which seem to be about how to login, but as I said above mashable suggests its now free to google mail users, but not the route I am taking.

  5. I added the comments about whether it’s worth it to host the mail boxes? And whether NOIP will dynamically maintain the SPF records. They don’t.

  6. No routing intermediaries are needed, postfix and the responder both use DNS. We’ll see.

    Postfix

    I am in a position where I can send mail out of my servers, but they are rejected with SPF or DKIM errors. Here is a note on SPF and DKIM at linuxbabe. The SPF tests requires a reverse lookup DNS record which noip do not support, or do not support on change of address. Thus I need to consider using a different DNS provider or mail solution.

    SMTP and phantom routing

    Postfix does not need any route hints. These links were found when I thought it did. Route outgoing SMTP relay messages through Google from Google; which led me to this q=”how to open a google admin account”, most of which seem to be about how to login, but as I said above mashable suggests it’s now free to google mail users.

    Sending smtp email using raspberry pi, pretty basic on the server, also uses google as the mail browser. This might be useful when I finally expose the mailboxes.

    I found the following links using google

    1. 1. http://www.howtogeek.com/51819/how-to-setup-email-alerts-on-linux-using-gmail/, this is very simple, wonder if it does what I want?
    2. 2. Sending Emails? Send them from Linux Terminal , I was looking for instructions in how to use ‘mail’
    3. How to set up simple mail server on debian-linux

    This was removed from the main article today.

  7. I have got Dovecot working. I used the page, install dovecot ubuntu 20.04 at tecadmin.net. It looks like the instructions on this page are now dated; the config instructions file names are wrong and the defaults work in most cases.

    I enabled the protocols; both of them. For authentication I set the parameters in 10-auth.conf. I left the Listen parameter at default which may need to be closed for live. I did not set the mail_location parameter but I did set up the postfix user parameter. The ssl parameters were defaulted to use the keys distributed with the package.

    I tested with Mutt on the imap port and then remotely with Thunderbird which while not being happy with the cert works allowed me to store an exclusion and let me read the mail box.

    How to restrict incoming mails? This is a postfix thing. Do I need to restrict the listen parameter on dovecot to localhost? Will I need to set firewall rules on the box, or the external firewall?

  8. This all goes on easily enough, but it seems there are two storage regimes. I either have a mismatch or I have an addressing problem. i.e. either the imap server can’t find the mail, or my test browser’s can’t find the imap server. I suspect the former. What I found,

    1. On linux, use maildir instead of mbox from stack exchange
    2. simple-way-to-send-email-to-dovecot-mailbox-from-unix-scripts from stack exchange
    3. minimal-mta-that-delivers-mail-locally-for-cron from stack exchange
    4. mbox 2 maildir from dovecot forums
    5. https://wiki.edgarbv.com/index.php/Converting_from_mbox_to_maildir
    6. mbox-to-maildir-converter-tool from 831.com

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.