Out of nowhere, I’m getting these emails from Google emails of failed attempts to deliver email. I’m using Gmail’s SMTP server for voicemail and module updates notifications.
My Gmail is getting filled with these:
Delivery incomplete
There was a temporary problem delivering your message to [email protected]. Gmail will retry for 22 more hours. You'll be notified if the delivery fails permanently.
LEARN MORE
The response was:
The recipient server did not accept our requests to connect. Learn more at https://support.google.com/mail/answer/7720 [freepbx.marinko.net 76.xxx.xxx.xxx: timed out]
---------- Forwarded message ----------
From: "(Cron Daemon)" <[email protected]>
To: [email protected]
Cc:
Bcc:
Date: Mon, 19 Jul 2021 06:00:01 -0700 (PDT)
Subject: Cron <asterisk@freepbx> /var/www/html/admin/modules/sangomaconnect/bin/keep_alive.php 2>&1 >/dev/null
/bin/sh: /var/www/html/admin/modules/sangomaconnect/bin/keep_alive.php: No such file or directory
I don’t know how FreePBX handles an external mail server, but this would happen if provides a sendmail program that simply forwards everything to the external server, without attempting to do local delivery of local addresses.
Generally linux programs that want to send mail, other than the big mail clients, like thunderbird, hand off the mail to “sendmail”. Even if the mail server isn’t actually the sendmail package, it will still implement a program of that name.
There is a second issue here, which isn’t about implementation details. The mail that got bounced was produced because a cron job failed. Successful jobs would normally be silent. Consequently, one wants to consider the contents of the bounced message as a symptom of a problem that isn’t related to email.
[email protected] is obviously masked for privacy, but my domain does not have mail configured.
I’ve removed sangomaconnect module, but emails are still being sent, some delayed, and some failed. I guess that Gmail will keep trying for quite some time before it marks it as failed.
The asterisk part is almost certainly obtained by translating the owner for the relevant cron file to it symbolic way, in the normal Unix/Linux way (i.e. using /etc/passwd). The domain name is probably taken from /etc/hosts. It will be trying to email the owner of the file, assuming that email handling has been correctly configured for that.
This is an extract from “man 5 crontab”, for Debian, but other Linuxes are likely to be similar. I’m assuming you are getting the default behaviour:
In addition to LOGNAME, HOME, and SHELL, cron(8) will look at MAILTO if
it has any reason to send mail as a result of running commands in
``this’’ crontab. If MAILTO is defined (and non-empty), mail is sent
to the user so named. MAILTO may also be used to direct mail to multi‐
ple recipients by separating recipient users with a comma. If MAILTO
is defined but empty (MAILTO=“”), no mail will be sent. Otherwise mail
is sent to the owner of the crontab.
Please read the full man page for the full context of this quote.
I’ve tried to find where to set MAILTO, but with no luck. My email setup Debug on System Admin module is full of bounced emails and the same message repeats every 5 minutes. My IP is banned.
Does anyone know where [email protected] is stored?
After the latest module update it looks like sangomaconnect module is again on my system:
Assuming that you have the cron daemon that matches the man page I used, you put it at the start of the file you displayed in your last post. You would need to use the -e, rather than the -l, option.
I can’t guarantee that it will expect a full internet email address, as this sort of thing pre-dated internet email and, historically, would have used local email, on the machine.
I’m not familiar with postfix, or how FreePBX configures it when you set it up to use gmail, but as this is going through postfix, there is almost certainly a way of defining mail aliases so that asterisk at the local machine gets translated into a usable internet email address.
Thank you guys!
I think I solved it by adding MAILTO= [email protected] at the top of crontab file. This is the latest email I got:
Subject:
Cron asterisk@freepbx /var/www/html/admin/modules/sangomaconnect/bin/check_license_sc.php
From:
(Cron Daemon) [email protected]
To: [email protected]
Body:
SangomaConnect Server is not running
Not sure how to start it?
I just don’t understand that I’m the only one who uses Gmail as an email provider.
Ok, I removed sangomaconnect.
If I remove MAILTO= mailto:[email protected] from my crontab file
Where would I put [email protected] ? Whereever there’s [email protected] reference?
And, what about last line @pbx.domain.com @domain.com ?
If I’ve understood what has been said, you are allowed to configure postfix directly, rather than through FreePBX and they are suggesting the file described in