Raspberry Pi Email Server

Powered by Drupal

raspberry-pi-email-server.png

The RasPi’s small size and low power consumption make it an ideal choice for use as a home email server. After trying a couple of different pieces of software, I finally found an excellent combination: Postfix with Dovecot and Squirrelmail, plus Spamasssassin and Sieve for spam filtering. There are many, many tutorials out there for the first trilogy of programs, but since the configuration is slightly different for each distribution I kept coming unstuck when setting mine up on the Pi. Having finally got mine configured properly, I’ve put together a set of 5 tutorials, which will take you from a vanilla Raspbian image to a fully functioning email server in no time. When writing the tutorial I made an effort to explain what each setting does instead of just dumping commands. With a bit of luck at the end of the process you’ll not only have a working server, you’ll understand how it works… without having to wade through reams of documentation like I did! If you follow the tutorials from start to finish, here’s what you’ll end up with:

  1. An email server that you can run 24/7/365 for under £5 of electricity per year
  2. Personalised email address like you@yourdomain.com (requires you to have registered a domain name with a registrar like namecheap.com - see my DNS basics tutorial)
  3. The ability to connect from anywhere, and read & send email, using a secure IMAP connection on your phone, tablet or computer
  4. Log in to webmail using any web browser on a secure HTTPS connection, read & send email
  5. Complete control over your personal communication. Your emails are stored on YOUR server, and nobody is scanning them to sell you adverts.
  6. Smart spam filtering with Spamassassin
  7. Customisable mail sorting with Sieve rules

Postfix, the Mail Transfer Agent

Postfix Logo

Postfix is the program that lets you send and receive email using Simple Mail Transfer Protocol (SMTP). Whilst you, the user, may connect to your email server using IMAP (on port 143 or 993), or POP (on port 110 or 995), email servers talk to each other using SMTP on port 25. So, this is the basic core of the server. Without it, you wouldn’t be able to send or receive any emails! I’ve covered the setup here: Raspberry Pi Email Server Part 1: Postfix

Dovecot, the POP/IMAP Server

dovecotLogo-300x130_0.png

Dovecot is used for two things:

  1. It provides you with IMAP functionality
  2. It checks that you are who you say you are using Simple Authentication and Security Layer (SASL) before you send or fetch mail

If you’re not interested in connecting with IMAP on your devices, you still need Dovecot. Not only is it doing SASL for you, but Squirrelmail connects using IMAP in order to provide you with webmail. I’ve covered Dovecot installation and configuration here: Raspberry Pi Email Server Part 2: Dovecot

Squirrelmail, for Webmail

Squirrelmail Logo

Squirrelmail is handy because it allows you to check your email in any browser, from anywhere. Of the first three, it’s probably the easiest to configure. I’ve covered it here: Raspberry Pi Email Server Part 3: Squirrelmail

Spamassassin, for Marking Spam

Spamassassin Logo

Spamassassin is the program that we will use to audit incoming mail and decide whether or not it’s spam. Spamassassin doesn’t actually sort the mail into the spam folder, it only changes information in the headers based on the results of the scan. I’ve covered it here: Raspberry Pi Email Server Part 4: Spam Detection with Spamassassin.

LMTP & Sieve for Spam Sorting & Mailbox Organisation

After Spamassassin has checked incoming mail to see if it’s spam or not, we need another program to sort it into the right mail folder. This final step will be done with Dovecot’s Local Mail Transfer Protocol (LMTP) daemon and a Sieve plugin. Sieve is a simple programming language that allows users to define what to do with incoming email based on a predefined set of rules – think “if the header contains this flag, put it in the spam folder” kind of thing and you’ll get the gist. Aside from spam filtering, Sieve can be used to automatically sort & de-clutter your inbox. These steps are covered in the final tutorial: Raspberry Pi Email Server Part 5: Spam Sorting with LMTP & Sieve Enjoy! I’d love to hear how you get on, so leave a comment below :)

Comments

Hi Sam,

Thank you for your feedback.

I managed to 'block' it by adding my two extra domains that are using the mail server to the restricted list /etc/postfix/helo_access. I checked some more of the 'spam' emails and saw all of them are trying to route via mail.edujo.co.uk which doesn't exist anymore.

I'm not receiving any more 'spam' emails from that source.

Regards,

Jo

Hi Sam,

I've only just realised that my outgoing emails are not being delivered (that's anything that is sent outside my LAN) for the last week or so. Having checked some of the Mail delivery Notifications, it seems my ip reputation is not good...I went to this website to check: http://miracare.mirapoint.com/checkip.html

I completed the form with all the evidence for a blocked or undelivered email and my ip seems ok now, but emails are stills not delivered. It's been about an hour now...Maybe it takes longer?

Some of the messages show: "522 IP FOUND IN DNSRBL" and a search showed that my ip has only recently started sending emails, hence it was blocked because it is still relatively new.

Any ideas on how to get it unlisted online?

Regards,

Jo

Jo, unfortunately I think you're fighting a losing battle trying to take care of a dynamic IP address because it's not really yours, but shared between you and loads of other people. The IP may be blacklisted due to years of people with spam malware on their machines using it, and even if you got it unlisted you could be assigned a completely new address with the same problems the next time you reboot your router! Try and get a static IP address if you can, then you can look after it properly. Sam

Hi Sam,

Thanks for the reply. You confirmed what I suspected. I phoned up TalkTalk yesterday anyway, but they won't budge and give me a static IP unless I sign up for a business account.

I'll move my edujo.co.uk email back to my previous providers and chnage back once I have a static IP with Plusnet or someone...

Regards,

Jo

Hi Sam,

I have spoken to PlusNet and they can give me a static IP and I will be able to telnet into the router (for etc/hosts). I signed up today and will be activated in 10 days, so hopefully no more issues after that!

Reading your posts throughout this process of creating a email server, I decided to give your name as the person who referred me, but they need your username in order to give you discount on your account with them. Please email me with your username for PlusNet, then I will contact them so they can apply the discount for you (You have my email).

Regards,

Jo

Hi Jo

Apologies I've not read the full history of your comments, but are you planning on using telnet to connect over the Internet?

Telnet send all of your details (username, password) in the clear which would mean anyone between you and your router could
sniff the traffic and harvest your credentials. Whilst you could argue the risk is low, I would suggest you look to use something
like SSH - assuming the router is DD-WRT, OpenWRT, Tomato etc it will support this protocol.

You could set up a VPN server that you connect to, then use Telnet to connect to the box "from inside the network" if you like,
but when secure protocols exisit and can be used with less hassle, I'd recommend it!

I know on the site somewhere Sam has alread detailed how to harden SSH would recommend you also have a read of that.

Cheers

RayGannon

Sat, 04/09/2016 - 16:24

Thank you for a fantastic Raspberry Pi email server tutorial. I enjoy your writing style and really appreciate the modular approach.

The parts of your tutorial that I've implemented have been working great with one minor exception. I occasionally see email I want to receive being rejected from certain domains during the HELO phase. My hope is that it's something I can resolve with a local hosts entry but I'm not sure where to start. Slightly sanitized log entry below...

Apr 8 21:38:32 mailserver postfix/smtpd[29701]: connect from p3nlsmtpcp01-03.prod.phx3.secureserver.net[184.168.200.142]
Apr 8 21:38:34 mailserver postfix/smtpd[29701]: NOQUEUE: reject: RCPT from p3nlsmtpcp01-03.prod.phx3.secureserver.net[184.168.200.142]: 450 4.7.1 : Helo command rejected: Host not found; from= to= proto=ESMTP helo=
Apr 8 21:39:34 mailserver postfix/smtpd[29701]: disconnect from p3nlsmtpcp01-03.prod.phx3.secureserver.net[184.168.200.142]
Apr 8 21:42:54 mailserver postfix/anvil[29703]: statistics: max connection rate 1/60s for (smtp:184.168.200.142) at Apr 8 21:38:32
Apr 8 21:42:54 mailserver postfix/anvil[29703]: statistics: max connection count 1 for (smtp:184.168.200.142) at Apr 8 21:38:32
Apr 8 21:42:54 mailserver postfix/anvil[29703]: statistics: max cache size 1 at Apr 8 21:38:32

Hi Ray, Thanks for that :) glad it has been useful. Your server is rejecting mail from that other server because the other server doesn't have a DNS A or MX record (so it seems like a made up hostname). The way to fix this is to contact the postmaster of that domain; properly configured mail servers should have the correct DNS records, so you don't want to misconfigure your server just because they have been lazy. Are you sure that was a legitimate email? Sam

Thanks for the reply Sam.

I see dozens of similar log entries every day which I'm sure are spam from infected computers.

I do believe this case is legitimate email as I had just placed an order with them. I do see this behaviour from time to time with legitimate senders during periods of heavy load. Like during some promotion or new product release. My assumption is that they are using an external service to handle the temporary increase in traffic.

In this particular instance I would like to apply a temporary fix on my side if that's an option.

Sam Hobbs

Mon, 04/11/2016 - 08:46

I think you're probably right about the external service. Ok, well you'll probably see an increase in spam if you do this, but you can remove the DNS check by deleting reject_unknown_helo_hostname from your helo restrictions (then reload postfix). Sam

Hi, Sam!
You have wrote a great tutorial! It helps to understand a lot about how mail server works.
I'd like to ask you for help. I'm done with two first steps of your tutorial and now trying to send email, but I fail
Please, look at my log:
9:01:52 raspberrypi postfix/smtps/smtpd[4918]: connect from unknown[192.168.1.1]
Apr 11 19:01:53 raspberrypi postfix/smtps/smtpd[4918]: 8084F60D2E: client=unknown[192.168.1.1], sasl_method=PLAIN, sasl_username=help
Apr 11 19:01:53 raspberrypi postfix/cleanup[4929]: 8084F60D2E: message-id=<570BF4A2.5020803@itservice34.ru>
Apr 11 19:01:53 raspberrypi postfix/qmgr[850]: 8084F60D2E: from=, size=548, nrcpt=1 (queue active)
Apr 11 19:01:53 raspberrypi postfix/smtps/smtpd[4918]: disconnect from unknown[192.168.1.1]
Apr 11 19:01:53 raspberrypi postfix/smtp[4930]: 8084F60D2E: to=, relay=none, delay=0.26, delays=0.12/0.14/0/0, dsn=4.4.3, status=deferred (Host or domain name not found. Name service error for name=yandex.ru type=MX: Host not found, try again)
Apr 11 19:01:54 raspberrypi dovecot: imap-login: Login: user=, method=PLAIN, rip=192.168.1.1, lip=192.168.1.40, mpid=4939, TLS, session=
Apr 11 19:01:58 raspberrypi dovecot: imap-login: Login: user=, method=PLAIN, rip=192.168.1.1, lip=192.168.1.40, mpid=4947, TLS, session=
Apr 11 19:03:10 raspberrypi postfix/smtpd[4948]: connect from unknown[87.250.230.162]
Apr 11 19:03:10 raspberrypi postfix/smtpd[4948]: NOQUEUE: reject: RCPT from unknown[87.250.230.162]: 454 4.7.1 : Relay access denied; from= to= proto=ESMTP helo=
Apr 11 19:03:10 raspberrypi postfix/smtpd[4948]: disconnect from unknown[87.250.230.162]
Apr 11 19:04:25 raspberrypi postfix/qmgr[850]: 6FC8660C87: from=, size=548, nrcpt=1 (queue active)
Apr 11 19:04:26 raspberrypi postfix/smtp[4949]: 6FC8660C87: to=, relay=none, delay=92628, delays=92628/0.07/0/0, dsn=4.4.3, status=deferred (Host or domain name not found. Name service error for name=yandex.ru type=MX: Host not found, try again)
Apr 11 19:06:30 raspberrypi postfix/anvil[4910]: statistics: max connection rate 1/60s for (smtp:87.250.230.159) at Apr 11 18:58:38
Apr 11 19:06:30 raspberrypi postfix/anvil[4910]: statistics: max connection count 1 for (smtp:87.250.230.159) at Apr 11 18:58:38
Apr 11 19:06:30 raspberrypi postfix/anvil[4910]: statistics: max cache size 1 at Apr 11 18:58:38
Apr 11 19:07:22 raspberrypi postfix/smtpd[4951]: connect from unknown[87.250.241.191]
Apr 11 19:07:22 raspberrypi postfix/smtpd[4951]: NOQUEUE: reject: RCPT from unknown[87.250.241.191]: 454 4.7.1 : Relay access denied; from= to= proto=ESMTP helo=
Apr 11 19:07:23 raspberrypi postfix/smtpd[4951]: disconnect from unknown[87.250.241.191]
Apr 11 19:07:39 raspberrypi postfix/smtpd[4951]: connect from unknown[87.250.230.158]
Apr 11 19:07:39 raspberrypi postfix/smtpd[4951]: NOQUEUE: reject: RCPT from unknown[87.250.230.158]: 454 4.7.1 : Relay access denied; from= to= proto=ESMTP helo=
Apr 11 19:07:39 raspberrypi postfix/smtpd[4951]: disconnect from unknown[87.250.230.158]
Apr 11 19:09:09 raspberrypi postfix/smtpd[4951]: connect from unknown[87.250.230.160]
Apr 11 19:09:09 raspberrypi postfix/smtpd[4951]: NOQUEUE: reject: RCPT from unknown[87.250.230.160]: 454 4.7.1 : Relay access denied; from= to= proto=ESMTP helo=
Apr 11 19:09:09 raspberrypi postfix/smtpd[4951]: disconnect from unknown[87.250.230.160]
Apr 11 19:09:25 raspberrypi postfix/qmgr[850]: 8084F60D2E: from=, size=548, nrcpt=1 (queue active)
Apr 11 19:09:25 raspberrypi postfix/smtp[4991]: 8084F60D2E: to=, relay=none, delay=452, delays=452/0.07/0/0, dsn=4.4.3, status=deferred (Host or domain name not found. Name service error for name=yandex.ru type=MX: Host not found, try again)
Apr 11 19:12:29 raspberrypi postfix/anvil[4953]: statistics: max connection rate 1/60s for (smtp:87.250.241.191) at Apr 11 19:07:22
Apr 11 19:12:29 raspberrypi postfix/anvil[4953]: statistics: max connection count 1 for (smtp:87.250.241.191) at Apr 11 19:07:22
Apr 11 19:12:29 raspberrypi postfix/anvil[4953]: statistics: max cache size 2 at Apr 11 19:07:39
P.S. Sorry for my english, I'm from Russia.

Hi, Looks like DNS resolution is failing (Host or domain name not found. Name service error for name=yandex.ru type=MX: Host not found, try again). Do you have a DNS resolver installed locally? Try this:
sudo apt-get install dnsmasq resolvconf
Does that help? BTW, you posted your comment four times. Comments don't show up until I approve them (but you should be able to see them if you're using the same browser and haven't deleted cookies etc.) Sam

Sorry for a lot of comments)
Thanks a lot, problem really was in DNS resolving. Now I can send emails, but I can't get answer for them. The log is:
Apr 11 20:20:30 raspberrypi postfix/smtpd[6729]: connect from forward19j.cmail.yandex.net[5.255.227.238]
Apr 11 20:20:30 raspberrypi postfix/smtpd[6729]: NOQUEUE: reject: RCPT from forward19j.cmail.yandex.net[5.255.227.238]: 454 4.7.1 : Relay access denied; from= to= proto=ESMTP helo=
Apr 11 20:20:30 raspberrypi postfix/smtpd[6729]: disconnect from forward19j.cmail.yandex.net[5.255.227.238]
Apr 11 20:20:39 raspberrypi postfix/smtpd[6729]: connect from forward20h.cmail.yandex.net[87.250.230.162]
Apr 11 20:20:39 raspberrypi postfix/smtpd[6729]: NOQUEUE: reject: RCPT from forward20h.cmail.yandex.net[87.250.230.162]: 454 4.7.1 : Relay access denied; from= to= proto=ESMTP helo=
Apr 11 20:20:39 raspberrypi postfix/smtpd[6729]: disconnect from forward20h.cmail.yandex.net[87.250.230.162]
I can't understand the problem, foreign host is sending mail for user on my server, not outside.

Sam Hobbs

Mon, 04/11/2016 - 22:08

Is your mydestination correct? Should include your domain name. If it's correct, are you sure that log entry is from a valid ham email? Sam

Thanks a lot for your detailed tutorial, Sam !
My goal was to replace a 'Kerio connect' server running on Ubuntu, by a standard mail server on Raspberry Pi 2
Your explanations were so clear that I decided to apply, and Hurrah : all is working : Postfix, Dovecot (for Thunderbird access), squirrelmail , and Spamassassin.
I can now power off the Ubuntu PC (a bit old, noisy, .... and using too much energy ) to only keep Raspberry online 24/7.
One more time, thanks a lot (from France)

Hi Sam,
I am sorry for that to brother you usually. Are you busy in replying visitors' emails? I hope this will not make you feel time occupied. As the subject I mention, Apache user www-data send mail to itself after installing Drupal. Why www-data will send mail arbitrarily to itself?
The mod-security has too many question for me. I may need to refer the book you recommend.

Sincerely thanks
Jeff

Martin Wilkins

Thu, 04/28/2016 - 07:06

I am a complete novice but use computers all day. Mainly spreadsheets. I tinkered with visual basic a few years ago but was too busy to give it time and it never went anywhere. I was talking with an acquaintance about emails etc & he said I should have a secure mail server using raspberry pi for my home use. Your tutorial is very readable and I am tempted but a few questions arise.
1. Can I still use my Googlemail and btinternet address's as well as other family members?
2. Is there a danger I could lose all my emails?
3. Could I still use Outlook?
4. What advantages would I achieve?
I am approaching retirement and looking for something to challenge the grey matter. Would this be something to start with or could you please suggest an alternative?
Many thanks. Martin

Hi Martin Answering your questions in order...
  1. Do you mean can you send mail to those addresses? If so, yes. If you mean can you send mail from those addresses, then no - you need to register a domain name and your new email address will be something@yourdomain.com
  2. Yes, if you don't back it all up and something happens to the server like SD card corruption. However, the emails will be on both the server and the client if you use IMAP, so it's not that likely you'll lose both.
  3. Yes (if you mean the desktop client), although I'd recommend one of the many open source alternatives.
  4. The advantages are mainly privacy related, plus it's really interesting to know how it all works, and having a custom email address is pretty cool.
Before you start, see if your ISP can give you a static IP address, because it will simplify the process considerably and make it less likely that your outgoing mail ends up in spam folders when sending to big freemail providers like gmail. Sam

Hi Sam,

I'm now finally with PlusNet and have a static IP address. From inside my LAN I can now connect to my email server using my domain name and not my LAN IP address as before.

I still have the issues from before but wanted to wait until I moved to PlusNet before asking advice again:

- It seems that I cannot send emails to people outside my LAN (or domain) or I don't know if they are receiving it as expected
- From /var/log/mail.log it looks like spamd is not functioning or connecting properly

mail.log:

May 2 14:48:33 pi-box postfix/smtpd[2436]: connect from mail104.extendcp.co.uk[79.170.40.104]
May 2 14:48:33 pi-box postfix/smtpd[2436]: 4F469450FA: client=mail104.extendcp.co.uk[79.170.40.104]
May 2 14:48:33 pi-box postfix/cleanup[2441]: 4F469450FA: message-id=<000901d1a480$5d7fc9c0$187f5d40$@edujo.co.uk>
May 2 14:48:33 pi-box postfix/qmgr[1844]: 4F469450FA: from=, size=2915, nrcpt=1 (queue active)
May 2 14:48:33 pi-box postfix/smtpd[2436]: disconnect from mail104.extendcp.co.uk[79.170.40.104]
May 2 14:48:33 pi-box spamc[2443]: connect to spamd on ::1 failed, retrying (#1 of 3): Connection refused
May 2 14:48:33 pi-box spamc[2443]: connect to spamd on 127.0.0.1 failed, retrying (#1 of 3): Connection refused
May 2 14:48:33 pi-box postfix/smtpd[2436]: connect from mail104.extendcp.co.uk[79.170.40.104]
May 2 14:48:33 pi-box postfix/smtpd[2436]: EBAE84578D: client=mail104.extendcp.co.uk[79.170.40.104]
May 2 14:48:33 pi-box postfix/cleanup[2441]: EBAE84578D: message-id=<003c01d1a47f$38579200$a906b600$@edujo.co.uk>
May 2 14:48:33 pi-box postfix/qmgr[1844]: EBAE84578D: from=, size=2916, nrcpt=1 (queue active)
May 2 14:48:34 pi-box postfix/smtpd[2436]: disconnect from mail104.extendcp.co.uk[79.170.40.104]
May 2 14:48:34 pi-box spamc[2445]: connect to spamd on ::1 failed, retrying (#1 of 3): Connection refused
May 2 14:48:34 pi-box spamc[2445]: connect to spamd on 127.0.0.1 failed, retrying (#1 of 3): Connection refused
May 2 14:48:34 pi-box spamc[2443]: connect to spamd on ::1 failed, retrying (#2 of 3): Connection refused
May 2 14:48:34 pi-box spamc[2443]: connect to spamd on 127.0.0.1 failed, retrying (#2 of 3): Connection refused
May 2 14:48:35 pi-box spamc[2445]: connect to spamd on ::1 failed, retrying (#2 of 3): Connection refused
May 2 14:48:35 pi-box spamc[2445]: connect to spamd on 127.0.0.1 failed, retrying (#2 of 3): Connection refused
May 2 14:48:35 pi-box spamc[2443]: connect to spamd on ::1 failed, retrying (#3 of 3): Connection refused
May 2 14:48:35 pi-box spamc[2443]: connect to spamd on 127.0.0.1 failed, retrying (#3 of 3): Connection refused
May 2 14:48:35 pi-box spamc[2443]: connection attempt to spamd aborted after 3 retries
May 2 14:48:35 pi-box postfix/pickup[2194]: 735D945C67: uid=114 from=
May 2 14:48:35 pi-box postfix/pipe[2442]: 4F469450FA: to=, relay=spamassassin, delay=2.2, delays=0.09/0.03/0/2.1, dsn=2.0.0, status=sent (d$
May 2 14:48:35 pi-box postfix/qmgr[1844]: 4F469450FA: removed
May 2 14:48:35 pi-box postfix/cleanup[2441]: 735D945C67: message-id=<000901d1a480$5d7fc9c0$187f5d40$@edujo.co.uk>
May 2 14:48:35 pi-box postfix/qmgr[1844]: 735D945C67: from=, size=3024, nrcpt=1 (queue active)
May 2 14:48:35 pi-box dovecot: lmtp(2451): Connect from local
May 2 14:48:35 pi-box dovecot: lmtp(2451, jo): jiQzIcNoJ1eTCQAA6C2HcQ: msgid=<000901d1a480$5d7fc9c0$187f5d40$@edujo.co.uk>: saved mail to INBOX
May 2 14:48:35 pi-box postfix/lmtp[2450]: 735D945C67: to=, relay=pi-box.co.uk[private/dovecot-lmtp], delay=0.19, delays=0.03/0.02/0.04/0.09$
May 2 14:48:35 pi-box dovecot: lmtp(2451): Disconnect from local: Successful quit
May 2 14:48:35 pi-box postfix/qmgr[1844]: 735D945C67: removed
May 2 14:48:36 pi-box spamc[2445]: connect to spamd on ::1 failed, retrying (#3 of 3): Connection refused
May 2 14:48:36 pi-box spamc[2445]: connect to spamd on 127.0.0.1 failed, retrying (#3 of 3): Connection refused
May 2 14:48:36 pi-box spamc[2445]: connection attempt to spamd aborted after 3 retries
May 2 14:48:36 pi-box postfix/pickup[2194]: 1629D45793: uid=114 from=
May 2 14:48:36 pi-box postfix/pipe[2444]: EBAE84578D: to=, relay=spamassassin, delay=2.2, delays=0.05/0.02/0/2.1, dsn=2.0.0, status=sent (d$
May 2 14:48:36 pi-box postfix/cleanup[2441]: 1629D45793: message-id=<003c01d1a47f$38579200$a906b600$@edujo.co.uk>
May 2 14:48:36 pi-box postfix/qmgr[1844]: EBAE84578D: removed
May 2 14:48:36 pi-box postfix/qmgr[1844]: 1629D45793: from=, size=3025, nrcpt=1 (queue active)
May 2 14:48:36 pi-box dovecot: lmtp(2451): Connect from local
May 2 14:48:36 pi-box dovecot: lmtp(2451, jo): kiQzIcNoJ1eTCQAA6C2HcQ: msgid=<003c01d1a47f$38579200$a906b600$@edujo.co.uk>: saved mail to INBOX
May 2 14:48:36 pi-box postfix/lmtp[2450]: 1629D45793: to=, relay=pi-box.co.uk[private/dovecot-lmtp], delay=0.08, delays=0.04/0/0/0.04, dsn=$
May 2 14:48:36 pi-box postfix/qmgr[1844]: 1629D45793: removed
May 2 14:48:36 pi-box dovecot: lmtp(2451): Disconnect from local: Successful quit

Any ideas?

Thanks in advance.

Jo

Hi Sam,

Couldn't see spamassassin when I ran systemctl, but upon restarting the service it was running 'again'. Does it not automatically start up when I reboot the Pi?

Here's that part of the output:

spamassassin.service loaded active running Perl-based spam filter using text analysis

Regards,

Jo

May be something new in Jessie - I think I've discussed this with someone else before (you can check the comments on that part of the tutorial...). What do you get if you do:
sudo systemctl enable spamassassin
Sam

Hi Sam,

This is what I get:

admin@pi-box:~ $ sudo systemctl enable spamassassin
[sudo] password for admin:
Synchronizing state for spamassassin.service with sysvinit using update-rc.d...
Executing /usr/sbin/update-rc.d spamassassin defaults
Executing /usr/sbin/update-rc.d spamassassin enable

Regards,

Jo

Hello I am loving the tutorials as they are easy to follow. I wanted to ask if there was a way to set this up to auto forward emails sent through the Pi. Example is a simple PLC that can only send IMAP email, can it relay through the mail server to auto forward as a verified email? And is there a way to make it so only the PLC can send through it? Any info would be great but in the meantime I will keep working to get the system set up. Thanks again for the awesome tutorial.

You can give the PLC a username/pw for the pi and have it send mail that way, or add the whole of your LAN to mynetworks and any machine on your network will be able to send mail through it without authentication. You can't send email using IMAP though, you send with SMTP - IMAP is just for retrieving messages from an inbox... Sam

I have actually figured out another way of doing it using Stunnel to just act as a sort of authentication for the PLC sending the email. Haven't gotten to test it just yet as I am working on finding an app to test email sending on port 25 but hopefully will work out. Thank you for the reply though. I am brand new to this so learning as I go.

Add new comment

The content of this field is kept private and will not be shown publicly.

Filtered HTML

  • Web page addresses and email addresses turn into links automatically.
  • Allowed HTML tags: <a href hreflang> <em> <strong> <cite> <blockquote cite> <code> <ul type> <ol start type> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.