1

I'm a beginner in linux and Raspberry Pi but I have some experiences with files systems and embedded systems in general.

I would like to achieve a read-only file system with Raspbian (Buster) and from there I would like to send some e-mails. First of all, I want to start sending e-mails via bash.

I'm using a Mac terminal to connect via ssh to my Raspberry 4 Model B. I followed this tutorial, to achieve a read only file system. This seems to work and I can switch between a ro and a rw system.

To send e-mails, I would like to use msmtp and iCloud. Therefore, I followed a post in this forum. I can't refer to the exact post, so I will show the steps here.

Install package

sudo apt-get install msmtp msmtp-mta

For gmail accounts, these are the specific elements you should put into /etc/msmtprc

# Generics
defaults
auth           on
tls            on
# following is different from ssmtp:
tls_trust_file /etc/ssl/certs/ca-certificates.crt
# user specific log location, otherwise use /var/log/msmtp.log, however, 
# this will create an access violation if you are user pi, and have not changes the access rights
logfile        ~/.msmtp.log

# Gmail specifics
account        gmail
host           smtp.gmail.com
port           587

from          root@raspi-buster
user           your-gmail-accountname@gmail.com
password       your-gmail-account-password

# Default
account default : gmail

I changed the Gmail specific settings to iCloud specific settings

# Generics
defaults
auth           on
tls            on
# following is different from ssmtp:
tls_trust_file /etc/ssl/certs/ca-certificates.crt
# user specific log location, otherwise use /var/log/msmtp.log, however, 
# this will create an access violation if you are user pi, and have not changes$
logfile        ~/.msmtp.log

# Gmail specifics
account        icloud
host           smtp.mail.me.com
port           587

from          root@raspi-buster
user           myName@icloud.com
password       MyPassword

# Default
account default : icloud

Now test it!

echo 'your message' | msmtp destination-email-address@icloud.com

msmtp: cannot create temporary file: Permission denied

I get this result, even I set the file system to rw. Is it possible to map the temporary file to the RAM? It would be great, if anyone could explain me the issue in detail and give me an advise how to go on :)

Pascal
  • 121
  • 4

1 Answers1

1

I think your problems is specific file permission rights on a directory that the mail program is trying to use to create a temporary file rather than the read/write permissions on a mounted filesystem.

Has the logfile ~/.msmtp.log been created in your home directory. Take a look inside it to see if there is a helpful error message about creating a file/directory and then go and fix the permissions.

mhaselup
  • 206
  • 1
  • 3