Delete all emails from a POP3 server
176659
def delete_all
      start do |pop3|
        unless pop3.mails.empty?
          pop3.delete_all
          pop3.finish
        end
      end
    end
839651
def delete(params={})
      key = params.delete(:key)
      Zcloudjp::Client.delete("/machines/#{machine.id}/metadata/#{key}", machine.request_options)
    end
1358891
public function clear()
    {
        try {
            // Standardize the params array
            $params = array_change_key_case((array)$this->emailConfig, CASE_LOWER);

            // Initialize the mailer
            $this->mailer = new PHPMailer(true);

            // Set any global options in the params
            // All of these are optional, but if we have them, we should fill them.
            $this->_fillParams($params, array('content-type', 'encoding', 'hostname',
                                             'message-id', 'priority', 'smtp-debug',
                                             'sendmail'), false);

            switch ( strtolower($this->emailMode) ) {
            case 'sendmail':
                $this->mailer->IsSendmail();
                break;

            case 'mail':
                $this->mailer->IsMail();
                break;

            case 'smtp':
                $this->mailer->IsSMTP();
                $this->mailer->SMTPAuth = true;
                $this->_requireParams($params, array('host', 'username', 'password'));
                $this->_fillParams($params, array('port', 'smtp-secure', 'timeout'));
                break;

            case 'smtp-no-auth':
                $this->mailer->IsSMTP();
                $this->_requireParams($params, array('host'));
                $this->_fillParams($params, array('port', 'smtp-secure', 'timeout'));
                break;

            case 'qmail':
                $this->mailer->IsQmail();
                break;

            default:
                throw new EmailException("Invalid Email type: '{$this->emailMode}'");
            }

        } catch (phpmailerException $e) {
            throw new EmailException($e->getMessage(), $e->getCode());
        }
        return $this;
    }
829337
def delete_user(email, profile="splunk"):
    '''
    
    '''

    client = _get_splunk(profile)

    user = list_users(profile).get(email)

    if user:
        try:
            client.users.delete(user.name)
        except (AuthenticationError, HTTPError) as e:
            log.info('Exception: %s', e)
            return False
    else:
        return False

    return user.name not in client.users
122719
def cleanup(self):
        """"""
        for item in self.server_map:
            self.member_del(item, reconfig=False)
        self.server_map.clear()
617695
def all_server_links(server_id, rel_to=None):
    """"""
    return [
        server_link(rel, server_id, self_rel=(rel == rel_to))
        for rel in ('delete-server', 'get-server-info', 'server-command')
    ]
1303605
def _cleanup(self, domains):
        """"""
        for option in domains.values():
            try:
                os.remove(option['pot'])
            except (IOError, OSError):
                # It is not a problem if we can't actually remove the temporary file
                pass
879124
def remove(self, server_id):
        
        server = self._storage.pop(server_id)
        server.stop()
        server.cleanup()
36331
def delete_den(self):
        '''
        
        '''
        keys = self.list_keys()
        for status, keys in six.iteritems(self.list_keys()):
            for key in keys[self.DEN]:
                try:
                    os.remove(os.path.join(self.opts['pki_dir'], status, key))
                    eload = {'result': True,
                             'act': 'delete',
                             'id': key}
                    self.event.fire_event(eload,
                                          salt.utils.event.tagify(prefix='key'))
                except (OSError, IOError):
                    pass
        self.check_minion_cache()
        return self.list_keys()
538051
def dump_emails(part):
    """"""

    print("Sent emails:")
    for email in mail.outbox:
        print(getattr(email, part))
688169
def delete(self, request, key):
        """"""

        request.DELETE = http.QueryDict(request.body)
        email_addr = request.DELETE.get('email')
        user_id = request.DELETE.get('user')

        if not email_addr:
            return http.HttpResponseBadRequest()

        try:
            email = EmailAddressValidation.objects.get(address=email_addr,
                                                       user_id=user_id)
        except EmailAddressValidation.DoesNotExist:
            pass
        else:
            email.delete()
            return http.HttpResponse(status=204)

        try:
            email = EmailAddress.objects.get(address=email_addr,
                                             user_id=user_id)
        except EmailAddress.DoesNotExist:
            raise http.Http404

        email.user = None
        email.save()
        return http.HttpResponse(status=204)
967738
def clear_all():
    

    sure = input("Are you sure to drop the complete database content? (Type "
                 "in upppercase YES)")
    if not (sure == 'YES'):
        db_log('Not deleting the database.')
        sys.exit(5)

    client = pymongo.MongoClient(host=dbhost, port=dbport)
    db = client[dbname]

    for col in db.collection_names(include_system_collections=False):
        db_log("Dropping collection ", col, lvl=warn)
        db.drop_collection(col)
1338164
def delete(options = {})
      return each({ match: '*', count: 500, max_iterations: 1_000_000, batch_size: 500 }.merge(options)) do |keys|
        @connection.del(*keys)
      end
    end
781138
def clear(self):
        
        collection = self.ds.connection(COLLECTION_MANAGED_PROCESS)
        return collection.delete_many(filter={})
34441
protected function stopCollectingMailSystemMail() {
    if (\Drupal::moduleHandler()->moduleExists('mailsystem')) {
      \Drupal::configFactory()->getEditable('mailsystem.settings')->setData($this->originalConfiguration['mailsystem.settings'])->save();
    }
  }
313316
def delete(no_logs, config_file):
    """"""
    config = _load_config(config_file)

    s3 = boto3.client('s3')
    cfn = boto3.client('cloudformation')
    logs = boto3.client('logs')

    try:
        stack = cfn.describe_stacks(StackName=config['name'])['Stacks'][0]
    except botocore.exceptions.ClientError:
        raise RuntimeError('This project has not been deployed yet.')
    bucket = _get_from_stack(stack, 'Parameter', 'LambdaS3Bucket')
    lambda_package = _get_from_stack(stack, 'Parameter', 'LambdaS3Key')
    function = _get_from_stack(stack, 'Output', 'FunctionArn').split(':')[-1]
    api_id = _get_from_stack(stack, 'Output', 'ApiId')
    if api_id:
        log_groups = ['API-Gateway-Execution-Logs_' + api_id + '/' + stage
                      for stage in config['stage_environments'].keys()]
    else:
        log_groups = []
    log_groups.append('/aws/lambda/' + function)

    print('Deleting {}...'.format(config['name']))
    cfn.delete_stack(StackName=config['name'])
    waiter = cfn.get_waiter('stack_delete_complete')
    waiter.wait(StackName=config['name'])

    if not no_logs:
        print('Deleting logs...')
        for log_group in log_groups:
            try:
                logs.delete_log_group(logGroupName=log_group)
            except botocore.exceptions.ClientError:
                print('  Log group {} could not be deleted.'.format(log_group))

    print('Deleting files...')
    try:
        s3.delete_object(Bucket=bucket, Key=lambda_package)
        s3.delete_bucket(Bucket=bucket)
    except botocore.exceptions.ClientError:
        print('  S3 bucket {} could not be deleted.'.format(bucket))
341831
public static smtp_server delete(nitro_service client, smtp_server resource) throws Exception
	{
		resource.validate("delete");
		return ((smtp_server[]) resource.delete_resource(client))[0];
	}