Issue :

Need to forward emails based on the time of day and day of the week.

For example:
If an email arrives in between 8:00am and 5:00pm , it should be forwarded to [email protected] . If it comes in between 5:01pm and 7:59am , it should be forwarded to [email protected]. And to take this step further, based on the day of the week (Monday, Tuesday, etc).

And this would be for only 1 email address. All the other email addresses on the box should not be affected by this schedule.

Solution :

This can be achieved by some tweaks.

1. Create two /etc/mail/virtuatable files.
Eg. File 1 — /etc/mail/virtuatable1
File 2 — /etc/mail/virtuatable2
2. Add the two forwarders. Eg. [email protected] in file 1 and [email protected] in file 2.
3. Now set a cron to copy file 1 to /etc/mail/virtuatable at 8:00 a.m and file 2 at 5:01p.m

Contact Us On WhatsApp