Azurel
Silver Pleskian
Username:
TITLE
mail() not working, if called php script on command-line
PRODUCT, VERSION, OPERATING SYSTEM, ARCHITECTURE
AlmaLinux 8.6 (Sky Tiger)
Plesk Obsidian Version 18.0.44 Update #1,
PROBLEM DESCRIPTION
Since it used to work and now it doesn't, I have to assume here is a new bug or it is a new feature?
STEPS TO REPRODUCE
In the past I called in cronjob like this
# /opt/plesk/php/8.1/bin/php /var/www/vhosts/example.com/httpdocs/testmail.php
And receive an email.
Since version 18.0.43 and possibly the ones before, I don't receive mails called from the command-line with mail() anymore. I can call the same script from the browser and it works there.
var/log/maillog
Execute in command-line (not working)
Execute from browser (working)
ACTUAL RESULT
mail transfer failed
EXPECTED RESULT
Send mail successfully
ANY ADDITIONAL INFORMATION
I have activated mail service on web1.PLESKDOMAIN and mail.PLESKDOMAIN both with "Use DKIM spam protection system to sign outgoing email messages"
"PLESKDOMAIN" means first registered domain (hostname) in Plesk.
YOUR EXPECTATIONS FROM PLESK SERVICE TEAM
Confirm bug
TITLE
mail() not working, if called php script on command-line
PRODUCT, VERSION, OPERATING SYSTEM, ARCHITECTURE
AlmaLinux 8.6 (Sky Tiger)
Plesk Obsidian Version 18.0.44 Update #1,
PROBLEM DESCRIPTION
Since it used to work and now it doesn't, I have to assume here is a new bug or it is a new feature?
STEPS TO REPRODUCE
In the past I called in cronjob like this
# /opt/plesk/php/8.1/bin/php /var/www/vhosts/example.com/httpdocs/testmail.php
PHP:
<?php
$return = mail('[email protected]', 'TESTMAIL', 'TEXT');
var_dump($return);
?>
And receive an email.
Since version 18.0.43 and possibly the ones before, I don't receive mails called from the command-line with mail() anymore. I can call the same script from the browser and it works there.
var/log/maillog
Execute in command-line (not working)
Jun 3 10:55:31 web1 plesk-sendmail[3526675]: S3526675: from=<[email protected]> to=<[email protected]>
Jun 3 10:55:31 web1 plesk-sendmail[3526676]: S3526675: add-from: stderr: PASS
Jun 3 10:55:31 web1 plesk-sendmail[3526676]: S3526675: check-quota: stderr: SKIP
Jun 3 10:55:31 web1 postfix/pickup[3508214]: 5B5D825A0D7F: uid=0 from=<root>
Jun 3 10:55:31 web1 postfix/cleanup[3526662]: 5B5D825A0D7F: message-id=<[email protected]>
Jun 3 10:55:31 web1 postfix/qmgr[3508215]: 5B5D825A0D7F: from=<[email protected]>, size=297, nrcpt=1 (queue active)
Jun 3 10:55:31 web1 postfix-local[3526683]: 5B5D825A0D7F: from=<[email protected]>, to=<[email protected]>, dirname=/var/qmail/mailnames
Jun 3 10:55:31 web1 dk_check[3526684]: 5B5D825A0D7F: DKIM Feed: No signature
Jun 3 10:55:31 web1 postfix-local[3526683]: 5B5D825A0D7F: dk_check: stderr: PASS
Jun 3 10:55:31 web1 dmarc[3526685]: 5B5D825A0D7F: SPF record was not found in Authentication-Results
Jun 3 10:55:31 web1 dmarc[3526685]: 5B5D825A0D7F: DMARC: smtpdomain=mail.PLESKDOMAIN maildomain=web1.PLESKDOMAIN mailfrom=[email protected] stamp=1654246531 ip=unknown adkim=relaxed aspf=relaxed p=REJECT sp=UNSPECIFIED pct=100 align_dkim=fail align_spf=fail spfres=unknown dkimres=unknown dmarccheck=DMARC_POLICY_REJECT dmarcstatus=STOP
Jun 3 10:55:31 web1 postfix-local[3526683]: 5B5D825A0D7F: dmarc: stderr: STOP
Jun 3 10:55:31 web1 postfix-local[3526683]: message discarded by a mail handler
Jun 3 10:55:31 web1 postfix/pipe[3526664]: 5B5D825A0D7F: to=<[email protected]>, relay=plesk_virtual, delay=0.03, delays=0/0/0/0.03, dsn=2.0.0, status=sent (delivered via plesk_virtual service)
Jun 3 10:55:31 web1 postfix/qmgr[3508215]: 5B5D825A0D7F: removed
Execute from browser (working)
Jun 3 11:01:04 web1 plesk-sendmail[3527524]: S3527524: from=<[email protected]> to=<[email protected]>
Jun 3 11:01:04 web1 plesk-sendmail[3527525]: S3527524: add-from: stderr: PASS
Jun 3 11:01:04 web1 plesk-sendmail[3527525]: S3527524: check-quota: stderr: SKIP
Jun 3 11:01:04 web1 plesk-sendmail[3527528]: S3527524: dk_sign: stderr: PASS
Jun 3 11:01:04 web1 postfix/pickup[3508214]: 92B4425A0C6F: uid=10007 from=<[email protected]>
Jun 3 11:01:04 web1 postfix/cleanup[3526662]: 92B4425A0C6F: message-id=<[email protected]>
Jun 3 11:01:04 web1 postfix/qmgr[3508215]: 92B4425A0C6F: from=<[email protected]>, size=658, nrcpt=1 (queue active)
Jun 3 11:01:04 web1 postfix-local[3527533]: 92B4425A0C6F: from=<[email protected]>, to=<[email protected]>, dirname=/var/qmail/mailnames
Jun 3 11:01:04 web1 postfix-local[3527533]: 92B4425A0C6F: dk_check: stderr: PASS
Jun 3 11:01:04 web1 dmarc[3527535]: 92B4425A0C6F: SPF record was not found in Authentication-Results
Jun 3 11:01:04 web1 postfix-local[3527533]: 92B4425A0C6F: dmarc: stderr: PASS
Jun 3 11:01:04 web1 dovecot[3527537]: service=lda, user=[email protected], ip=[]. msgid=<[email protected]>: saved mail to INBOX
Jun 3 11:01:04 web1 postfix/pipe[3527327]: 92B4425A0C6F: to=<[email protected]>, relay=plesk_virtual, delay=0.08, delays=0/0/0/0.08, dsn=2.0.0, status=sent (delivered via plesk_virtual service)
Jun 3 11:01:04 web1 postfix/qmgr[3508215]: 92B4425A0C6F: removed
ACTUAL RESULT
mail transfer failed
EXPECTED RESULT
Send mail successfully
ANY ADDITIONAL INFORMATION
I have activated mail service on web1.PLESKDOMAIN and mail.PLESKDOMAIN both with "Use DKIM spam protection system to sign outgoing email messages"
"PLESKDOMAIN" means first registered domain (hostname) in Plesk.
YOUR EXPECTATIONS FROM PLESK SERVICE TEAM
Confirm bug