Is it possible to suspend inactive email account ?

ozgurerdogan

Verified User
Joined
Apr 20, 2008
Messages
343
For security purpose, I want to suspend mail account that did not authanticated smtp in for x days. Is that possible somehow?
 
Hello,

I think its possible to it.

https://help.directadmin.com/item.php?id=445
Listing all E-Mail accounts on a system

#!/bin/sh
cd /etc/virtual
for i in `cat domains`; do
{
if [ ! -s $i/passwd ]; then
continue;
fi

for u in `cat $i/passwd | cut -d: -f1`; do
{
echo "$u@$i";

Here can wirte script:
-----------------------------------------------------------------------------------
first if
check log time from here > /home/$DAUSER/imap/$DOMAIN/$EMLUSER/Maildir/dovecot.index.log`
if email accounts and domain = $u@$i

second if look > today date.time - last login time bigger than "x" time

echo emailccount@domain was not login durin x time...
-------------------------------------------------------------------------------------

};
done;

};
done;
exit 0;
 
Hello,
Yes I can do it. But I don't have time. Maybe some other friends can do it faster for you.
And than you can add script auto suspend in it.
Its simple solution mentioned above. To make it better have to write that code OOP logic.

Best regards.
 
Last edited:
Back
Top