View Full Version : -jailshell: /bin/mail: Permission denied
phppete
11-29-2006, 12:25 PM
OK, so its not an FQ issue but just wondered if anyone knows how I can send email via a shell script if mail is disabled?
Kevin
11-29-2006, 12:28 PM
You could try using the sendmail command instead (most other email programs include a wrapper).
However, if they have the mail command completely disabled like that there is a good chance the server is not even configured to send email out. In that case you would have better luck sending the email yourself with SMTP unless of course they have that firewalled.
phppete
11-29-2006, 12:34 PM
Thanks Kevin (yet again for helping with a non FQ issue). My script is a database backup script which gzips it, and attaches it to an email, deletes any older ones past 30 days:
/usr/bin/mysqldump --opt -q -e -h${host} -u${username} -p${password} ${database} | gzip - > ${path}${mydate}_${sitename}.sql.gz
uuencode ${path}${mydate}_${sitename}.sql.gz ${mydate}_${sitename}.sql.gz | mail -s "Database Backup ${sitename}" ${email}
find ${path} -type f -mtime +30 -exec rm {} \;
sendmail isn't even configured so I guess I'll have to dig out my old PHP scripts for doing this but its so much easier doing it as above, thankfully my main client hosts here, makes my life so much easier :smile:
hobbes
11-29-2006, 01:03 PM
Do you mean the mail command is disabled or email in general is disabled? Assuming the former, are there any other email commands available (e.g., pine)? And of course a simple PHP script would also do the trick (again assuming email is enabled).
vBulletin® v3.6.8, Copyright ©2000-2012, Jelsoft Enterprises Ltd.