Hi,
if my red ip address change, I would like to send an e-mail.
I can run the test e-mail
System | Mail Service [Send testmail]
but
cat email_test | sendmail vorname.nachname@gmx.at -f
does not work.
Sorry I cannot post more Details as I’m new here I’m only allowed to post 2 links … ?
Any Ideas?
root@ipfire-******:~# cat email_test
From: vorname.nachname@gmx.at
To: vorname.nachname@gmx.at
Subject: “Test with dma”
Date: Sat, 3 Jul 2021 15:25:03 +0000 (UTC)
test2 from dma on ipfie-dev
root@ipfire-***:/var/spool/dma# cat M1c8040c.2925b870
…This is the DragonFly Mail Agent v0.13 at ipfire-.localdomain.
There was an error delivering your mail to vorname.nachname@gmx.at.
mail.gmx.net [212.227.17.190] did not like our MAIL FROM:
501 Syntax error in parameters or arguments
Received: from root (uid 0)
(envelope-from vorname.nachname@gmx.at )
id 1c80219
by ipfire-*.localdomain (DragonFly Mail Agent v0.13);
Mon, 03 Mar 2025 11:40:36 +0100
From: vorname.nachname@gmx.at
To: vorname.nachname@gmx.at
Subject: “Test with dma”
Date: Sat, 3 Jul 2021 15:25:03 +0000 (UTC)
Message-Id: <67c58724.1c80219.7078e9c8@ipfire-.localdomain>
test2 from dma on ipfie-dev
/var/ipfire/dma/dma.conf:
MAILNAME ipfire-******.localdomain
AUTHPATH /var/ipfire/dma/auth.conf
SPOOLDIR /var/spool/dma
STARTTLS
FULLBOUNCE
PORT 587
SMARTHOST mail.gmx.net
SECURETRANSFER
MASQUERADE vorname.nachname@gmx.at
I tried to add MASQUERADE - did not help at all …
Hallo @alexander
Welcome to the IPFire community.
Here is a link to a\one of the config files used by the apcupsd addon to send an email using the dma system.
You should be able to use it to figure out how to structure your script.
Keep in mind that gmx does not accept mails from known dial-up ip addresses.
Hello Adolf,
thx a lot for this link.
I was able to solve my problem.
I removed in /var/ipfire/dma/dma.conf
MASQUERADE vorname.nachname@gmx.at
with this entry System | Mail Service [Send test mail] did not work anymore.
this is my bash script:
#/bin/bash
IP=$(/sbin/ip address | /bin/grep inet | /bin/grep red0 | /usr/bin/cut -b 10-22)
IP_alt=$(/bin/cat /root/mail/ip_red_alt)
/bin/echo $IP
/bin/echo $IP_alt
if [[ "$IP" != "$IP_alt" ]]; then
echo "IP address change!";
echo $IP > /root/mail/ip_red_alt
SUBJECT="IP Adresse: "$IP
FROM="alexander.kratky@gmx.at"
TO="alexander.kratky@gmx.at"
(
echo From: $FROM
echo To: $TO
echo Subject: $SUBJECT
) | sudo -u nobody /usr/sbin/sendmail -t -f $FROM
else
echo "IP address did not change!";
fi
exit 0
in the subject of the mail I find my IP Address.
I was not able to send also a mail body.
But I’ve my information …
EDIT: moderator formatted code block
Hi Arne,
thx for your input. my script works now! I think this policy is valid if I run a mail server. As I understand it, I use something like a mail client.