DA default mail for cron

nservices

Verified User
Joined
Dec 11, 2008
Messages
301
Hello,
by default DirectAdmin using the username mailbox to send cron output
1. how can I change this default to empty value so no email will sent for cron output
2. how can I mass change this value from USERNAME to empty value for all existing users

All the best,
 
Hello,

Directadmin does not seem to have a template from users cron files, so you might need to do some magic.

1. Update every single crontask of all users to mute their output by adding:

Code:
 >/dev/null 2>&1
in the end of lines.

for example:

Code:
*/15 * * * * /home/userbob/script.sh

should become:

Code:
*/15 * * * * /home/userbob/script.sh >/dev/null 2>&1

Please note you should update files:

- /var/spool/cron/$username
- /usr/local/directadmin/data/users/$username/crontab.conf

where $username is a placeholder for every single user from your server.


2. Another variant:

Install:

/home/$username/.forward

owned by $username:$username and permissions 644 with a content

Code:
[COLOR=#000000][FONT=&quot]:blackhole:[/FONT][/COLOR]

or any other real email address to which you want to redirect incoming emails.

With :blackhole: all incoming emails for username@domain.com to username@server.hostname.com will be removed at an arrival time.



I hope it will help you.
 
Back
Top