• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Forwarded to devs Plesk cannot send cron notifications when mail service of a subscriber has never been activated

Bitpalast

Plesk addicted!
Plesk Guru
Username:

TITLE


Plesk cannot send cron notifications when mail service of a subscriber has never been activated

PRODUCT, VERSION, OPERATING SYSTEM, ARCHITECTURE

Obsidian, latest MU
CentOS 7.9

PROBLEM DESCRIPTION

As described in Issue - Plesk doesn't send cron notifications when mail service has never been activated

STEPS TO REPRODUCE

Reproduce missing notification:
1) Create a service plan where mail service is deactivated.
2) Create a subscription based on that service plan.
3) Create a cronjob in that subscription with email notifications.
4) Wait for the cronjob to execute.
--> Notification mail is not being sent.

Activate notifications, but keep mail service deactivated:
5) Activate mail service on domain.
6) Deactivate mail service on domain.
--> Notification mail is being sent.

Conclusion: A one-time activation of the mail service is needed that cron of a subscriber can send mail. It continues to being able to send mail if the mail service is deactivated again.

ACTUAL RESULT

/var/log/cron
Oct 18 10:04:01 oder CROND[29425]: (sometestdomain.xx_dfs890mvzh5) CMD (/usr/local/psa/admin/sbin/fetch_url '<some site to fetch>')
Oct 18 10:04:01 oder CROND[29418]: (sometestdomain.xx_dfs890mvzh5) MAIL (mailed 112 bytes of output but got status 0x0064#012)

/var/log/maillog
Oct 18 10:01:01 oder plesk-sendmail[27726]: S27726: from=<sometestdomain.xx_dfs890mvzh5> to=<some email address>
Oct 18 10:01:01 oder plesk-sendmail[27729]: S27726: py-limit-out: stderr: DATA REPLY:554:5.7.0 Your message could not be sent. The user sometestdomain.xx_dfs890mvzh5 is not allowed to send email.

EXPECTED RESULT

/var/log/cron
Oct 18 10:06:01 oder CROND[31035]: (sometestdomain.xx_dfs890mvzh5) CMD (/usr/local/psa/admin/sbin/fetch_url '<some site to fetch>')

/var/log/maillog
Oct 18 10:07:01 oder postfix/pickup[30932]: B150426A04F4: uid=10447 from=<sometestdomain.xx_dfs890mvzh5>
Oct 18 10:07:01 oder postfix/cleanup[31119]: B150426A04F4: message-id=<20221018080701.B150426A04F4@<hostname>>
Oct 18 10:07:01 oder postfix/qmgr[30931]: B150426A04F4: from=<sometestdomain.xx_dfs890mvzh5@<hostname>>, size=1169, nrcpt=1 (queue active)
Oct 18 10:07:02 oder postfix/smtp[31130]: B150426A04F4: to=<some test email>, relay=domain.mail.protection.outlook.com[104.47.51.202]:25, delay=0.63, delays=0/0/0.14/0.49, dsn=2.6.0, status=sent (250 2.6.0 <20221018080701.B150426A04F4@<hostname>> [InternalId=107812269071074, Hostname=DB8P191MB0936.EURP191.PROD.OUTLOOK.COM] 10162 bytes in 0.091, 107.982 KB/sec Queued mail for delivery)
Oct 18 10:07:02 oder postfix/qmgr[30931]: B150426A04F4: removed

ANY ADDITIONAL INFORMATION

It is not clear what exactly the bug in this is.

It could either be that users expect cron notifications to work although email service of a domain is deactivated. Or it could be that cron notifications must not work when the mail service of a domain is deactivated. I tend to the later while the user who initially reported this tends to the first.

YOUR EXPECTATIONS FROM PLESK SERVICE TEAM

Confirm bug
 
Hi Peter and thanks a lot for reporting this for me.

I think I need to add something though. You're right that it's incoherent that activating then deactivating the mail service doesn't go back to the state it was when the mail service was deactivated so you can consider that a bug and fix it BUT the cron should absolutely be able to send mails without having the mail service enabled.
Consider for example domain test.com which is hosted on Plesk but which emails are hosted on Google Workspace (or anywhere else): if the mail service is enabled, Plesk will not make an MX lookup when trying to send emails to [email protected] and try to deliver it locally instead of checking MX and sending the mail to Google's servers. Mail service should not be activated when emails for that domain are not handled by Plesk (we've had that joke in the past) but that doesn't mean cron jobs notifications shouldn't be sent!

So if we want to do things right (which we do), you're right that deactivating the mail service should remove the user from the sendmail DB (since activating it adds it) but we then need another way of insuring cron notifications are being sent:
- maybe the user should be added to the sendmail DB when a cron with notification is set up (but Plesk should then check if mail service gets activated/deactivated that a cron with notification exists and not remove the user from the sendmail DB which seems maybe a bit complicated)
- maybe the cron notifications could be sent from another user? I'm no Linux expert so I'm not sure if that's really an option.

In any case and whichever the best way to fix this is, the issue remains: you should be able to create a cron job with notifications on a subscription/domain which never had mail service enabled and the notifications should be sent (as there's currently no way of knowing it won't be) and this should not depend on forcing the mail service to be active because emails could be handled elsewhere.

I hope this makes sense,
Kind regards
 
Back
Top