I'd like to create a php script to delete unused emails for my cpanel account. Anyone help me please?
I'd like to create a php script to delete unused emails for my cpanel account. Anyone help me please?
well. I'm not sure what you mean... how are you wishing to determine what "unused" isOriginally Posted by technicolor
email users are stored in:
/home/USERDIR/etc/DOMAIN/{passwd,shadow}
and there's a folder in /home/USERDIR/etc/DOMAIN/ for some email names
if you're wanting to delete other unused emails, you'll have to be more specific about what you're trying to do in order for anyone to help you.
Hi, i propose this question again. I need a php script to delete automatically and dayly unused email account. Unused means that test@example.com was not read from POP3 and webmail from 100 days. Thanks for help and sorry for english
for this solution you would have to sift through the mail logs. You would have to track (daily) which accounts received valid logins from pop or imap (webmail likely uses imap).
then you could know who to delete.. but unless you keep your mail logs for 100 days, you wont be able to do this without storing this historical infomation somewhere.
the maillog for dovecot--I'm not sure if mailman is exactly the same--entries look like this:
MON DAY TIME HOST dovecto: POP3(email_address): ....
so I'd grab those, and store them with their dates.. any that dont have entries within 100 days can be deleted in your case