set up a local Postfix as a trigger for a script

36 Views Asked by At

I have a Laptop which is completely closed down. Meaning I am not allowed or able to install anything or change configuration on it. On the laptop there is a software running to monitor the movement of structures. This software can send out an alarm by email. I want to create an external alarm sound/light that can be heard over a bigger distance.

My plan is to connect a raspberry pi with a dhcp server to the laptop to establish a connection and then have a local mailserver on the pi that the software uses to send a mail to the pi itself and trigger a relay for whatever warning equipment I connect to it.

None of the machines will ever be connected to the internet. Its an offline only system with just the 2 machines. So encryption or so is not needed. It should be as simple and reliable as possible.

I did set up a raspberry pi with raspbian and installed postfix on it. I created 2 users one for the software to send the mail via smtp and one to receive the mail and trigger the alarm. I am able to send mails from one user to another on the pi. but somehow I can not connect to the smtp server from another machine in the same network.

I tried to follow some tutorials but somehow none of them seems to be for a local only solution.

my main.cf looks like this at the moment:

# Debian specific:  Specifying a file name will cause the first
# line of that file to be used as the name.  The Debian default
# is /etc/mailname.
#myorigin = /etc/mailname

smtpd_banner = $myhostname ESMTP $mail_name (Raspbian)
biff = no

# appending .domain is the MUA's job.
append_dot_mydomain = no

# Uncomment the next line to generate "delayed mail" warnings
#delay_warning_time = 4h

readme_directory = no

# See http://www.postfix.org/COMPATIBILITY_README.html -- default to 2 on
# fresh installs.
compatibility_level = 2



# TLS parameters
smtpd_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
smtpd_tls_security_level=may

smtp_tls_CApath=/etc/ssl/certs
smtp_tls_security_level=may
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache


smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
myhostname = warnpi.fritz.box
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = warnpi.local, $myhostname, warnpi, localhost.warnpi.local, localhost
relayhost =
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = loopback-only
default_transport = error
relay_transport = error
inet_protocols = all
0

There are 0 best solutions below