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" istechnicolor said:I'd like to create a php script to delete unused emails for my cpanel account. Anyone help me please?
Hi, i propose this question again. I need a php script to delete automatically and dayly unused email account. Unused means that [email protected] was not read from POP3 and webmail from 100 days. Thanks for help and sorry for englishwell. I'm not sure what you mean... how are you wishing to determine what "unused" is
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.
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).Hi, i propose this question again. I need a php script to delete automatically and dayly unused email account. Unused means that [email protected] was not read from POP3 and webmail from 100 days. Thanks for help and sorry for english
Where can i read mail logs login? Every day i can read this file and update a database where i can update last login for every email account. Do you think is this a solution for my problem?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
/var/log/maillog is probably what you want.Where can i read mail logs login? Every day i can read this file and update a database where i can update last login for every email account. Do you think is this a solution for my problem?
In this file are considered "login" pop3 login and webmail login?/var/log/maillog is probably what you want.
and yes, read it every day.. grab the info you need and put it someplace.
as I said in my original message on this topic, webmail is likely IMAP login, so look for either IMAP or POP (or both)In this file are considered "login" pop3 login and webmail login?
Thanks for your help
Thread starter | Similar threads | Forum | Replies | Date |
---|---|---|---|---|
J | How delete large file server.log? | Databases | 3 | |
G | Directory /var/run/mysqld deleted after server reboot (Graceful Server Reboot) | Databases | 10 | |
G | My all databases are deleted. why? | Databases | 1 | |
S | My database is all ways deleted after two or 3 days | Databases | 1 | |
C | Mysql Views automaticaly deleted | Databases | 3 |