Class: PostfixAdmin::Mailbox

Inherits:
ApplicationRecord show all
Includes:
DovecotCramMD5Password
Defined in:
lib/postfix_admin/mailbox.rb

Constant Summary

Constants inherited from ApplicationRecord

ApplicationRecord::RE_DOMAIN_NAME_LIKE, ApplicationRecord::RE_DOMAIN_NAME_LIKE_BASE, ApplicationRecord::RE_DOMAIN_NAME_LIKE_WITH_ANCHORS, ApplicationRecord::RE_EMAIL_LIKE, ApplicationRecord::RE_EMAIL_LIKE_BASE, ApplicationRecord::RE_EMAIL_LIKE_WITH_ANCHORS

Instance Method Summary collapse

Methods included from DovecotCramMD5Password

#authenticate, #password_unencrypted=

Methods inherited from ApplicationRecord

#active_str, #has_timestamp_columns?, #inactive?, #set_current_time_to_timestamp_columns

Instance Method Details

#quota_strObject



80
81
82
83
84
85
86
87
# File 'lib/postfix_admin/mailbox.rb', line 80

def quota_str
  if quota.zero?
    "--"
  else
    quota_mb = quota / KB_TO_MB
    "#{quota_mb} MB"
  end
end

#quota_usage_strObject



71
72
73
74
75
76
77
78
# File 'lib/postfix_admin/mailbox.rb', line 71

def quota_usage_str
  if quota_usage
    usage_mb = quota_usage.bytes / KB_TO_MB
    usage_mb.to_s
  else
    "0"
  end
end