import json
import subprocess
import sys
import pickle
from os import path

class Base(object):
  def __init__(self):
    self.stato = 0
  def load(self,**parms):
    pass
  def test(self):
    pass
  def backup(self):
    pass
  def delete(self):
    pass
  def run(self):
    pass

class deletemail(Base):
  def __init__(self):
    Base.__init__(self)

  def load(self,**parms):
    dominio = parms['dominio']
    server = parms['server']
    user = parms['user']

    self.posizione = "{}/{}/{}".format(dominio.strip(),server.strip(),user.strip())
 
  def test(self):
    '''
    verifica che la path sia corretta, verificando l'esistenza di 'Maildir'
    '''
    posizioneMaildir = "{}/Maildir".format(self.posizione)
    response = path.exists(posizioneMaildir)
    return response

  #def backup(self):

  #def delete(self):

  def run(self):
    if test():
      return True

