Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > Linux Forums > Installation/Configuration

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 9th August 2007, 10:02
Tr!n!Ty Tr!n!Ty is offline
Junior Member
 
Join Date: Sep 2006
Posts: 17
Thanks: 1
Thanked 0 Times in 0 Posts
Cool No Quota information in the mail

Hello,

I have a problem with the mail for the quota When i received mail there's no information in

Quote:
DAILY QUOTA REPORT:

----------------------------------------------
| % UTILISATION | NOM DU COMPTE |
----------------------------------------------

--
I look in the post in the forum and modifie this line in /usr/local/sbin/quota_notify

Quote:
close(QF);
next if (! $used);
my $percent = int($used / $quota * 100);
$lusers{$user} = $percent;
Added that too :

Quote:
# Added to show if the path to the mailboxes are correct.
# At this point, its showing all the correct path to each mailbox
printf($mboxBase."/".$domain."/".$name."\n");
My main.cf

Quote:
# See /usr/share/postfix/main.cf.dist for a commented, more complete version
# Debian specific: Specifying a file name will cause the first
# line of that file to be used as the name. The Debian default
# is /etc/mailname.
#myorigin = /etc/mailname
myhostname = xxxxxxx
smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
biff = no

# appending .domain is the MUA's job.
append_dot_mydomain = no

# Uncomment the next line to generate "delayed mail" warnings
#delay_warning_time = 4h

# TLS parameters
smtpd_tls_cert_file = /etc/postfix/smtpd.cert
smtpd_tls_key_file = /etc/postfix/smtpd.key
smtpd_use_tls = yes
smtpd_tls_session_cache_database = btree:${queue_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${queue_directory}/smtp_scache

# See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for
# information on enabling SSL in the smtp client.
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases

#mydestination = localhost.$mydomain
mydestination = mail.xxxxxxx.org, mail.xxxxx.org, localhost, localhost.localdomain
mynetworks = 127.0.0.0/8
mailbox_size_limit = 51200000
maximal_queue_lifetime = 62d
debug_peer_level = 4
maildrop_destination_recipient_limit = 1

################################################## ##########
# UTILISATION MYSQL
################################################## ##########
virtual_mailbox_base = /home/vmail
virtual_uid_maps = static:5000
virtual_gid_maps = static:5000
virtual_transport = virtual
virtual_mailbox_extended = yes

virtual_mailbox_domains = proxy:mysql:/etc/postfix/mysql-virtual_domains.cf
virtual_mailbox_maps = proxy:mysql:/etc/postfix/mysql-virtual_mailboxes.cf
virtual_alias_maps = proxy:mysql:/etc/postfix/mysql-virtual_forwardings.cf, mysql:/etc/postfix/mysql-virtual_email2email.cf


inet_protocols = ipv4
virtual_alias_domains =
smtpd_sasl_auth_enable = yes
broken_sasl_auth_clients = yes
smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination
transport_maps = proxy:mysql:/etc/postfix/mysql-virtual_transports.cf
virtual_create_maildirsize = yes
virtual_mailbox_limit_maps = proxy:mysql:/etc/postfix/mysql-virtual_mailbox_limit_maps.cf
virtual_mailbox_limit_override = yes
virtual_maildir_limit_message = "The user you are trying to reach is over quota."
virtual_overquota_bounce = yes
proxy_read_maps = $local_recipient_maps $mydestination $virtual_alias_maps $virtual_alias_domains $virtual_mailbox_maps $virtual_mailbox_domains $relay_recipient_maps $relay_domains $canonical_maps $sender_canonical_maps $recipient_canonical_maps $relocated_maps $transport_maps $mynetworks $virtual_mailbox_limit_maps
content_filter = amavis:[127.0.0.1]:10024
receive_override_options = no_address_mappings
and my mysql-virtual_mailbox_limit_maps.cf

Quote:
user = mail_admin
password = password
dbname = mail
query = SELECT quota FROM users WHERE email = '%s'
hosts = 127.0.0.1
When i do "sudo /usr/local/sbin/quota_notify"

I look the mysql.log and i don't see requet for the quotas

Anyone have idear ?

Thanks for help

there is juste quotas who don't work
Reply With Quote
Sponsored Links
  #2  
Old 10th August 2007, 16:31
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,740 Times in 2,575 Posts
Default

Did you modify the quota_notify script as shown on http://www.howtoforge.com/virtual_us...debian_etch_p5 ?
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #3  
Old 12th August 2007, 11:12
Tr!n!Ty Tr!n!Ty is offline
Junior Member
 
Join Date: Sep 2006
Posts: 17
Thanks: 1
Thanked 0 Times in 0 Posts
Default

Hello Falko,

I change the line but same issue i post my quota_notify

Quote:
my $POSTFIX_CF = "/etc/postfix/main.cf";
my $MAILPROG = "/usr/sbin/sendmail -t";
my $WARNPERCENT = 80;
my @POSTMASTERS = ('postmaster@xxxxx.org');
my $CONAME = 'Server xxxxx';
my $COADDR = 'postmaster@xxxxx.org';
my $SUADDR = 'postmaster@xxxxx.org';
my $MAIL_REPORT = 1;
my $MAIL_WARNING = 1;

#get virtual mailbox base from postfix config
open(PCF, "< $POSTFIX_CF") or die $!;
my $mboxBase;
while (<PCF>) {
next unless /virtual_mailbox_base\s*=\s*(.*)\s*/;
$mboxBase = $1;
}
close(PCF);

#assume one level of subdirectories for domain names
my @domains;
opendir(DIR, $mboxBase) or die $!;
while (defined(my $name = readdir(DIR))) {
next if $name =~ /^\.\.?$/; #skip '.' and '..'
next unless (-d "$mboxBase/$name");
push(@domains, $name);
}
closedir(DIR);
#iterate through domains for username/maildirsize files
my @users;
chdir($mboxBase);
foreach my $domain (@domains) {
opendir(DIR, $domain) or die $!;
while (defined(my $name = readdir(DIR))) {
next if $name =~ /^\.\.?$/; #skip '.' and '..'
next unless (-d "$domain/$name");
push(@users, {"$name\@$domain" => "$mboxBase/$domain/$name"});

# Added to show if the path to the mailboxes are correct.
# At this point, its showing all the correct path to each mailbox
printf($mboxBase."/".$domain."/".$name."\n");

}
}
closedir(DIR);

#get user quotas and percent used
my (%lusers, $report);
foreach my $href (@users) {
foreach my $user (keys %$href) {
my $quotafile = "$href->{$user}/maildirsize";
next unless (-f $quotafile);
open(QF, "< $quotafile") or die $!;
my ($firstln, $quota, $used);
while (<QF>) {
my $line = $_;
if (! $firstln) {
$firstln = 1;
die "Error: corrupt quotafile $quotafile"
unless ($line =~ /^(\d+)S/);
$quota = $1;
last if (! $quota);
next;
}
die "Error: corrupt quotafile $quotafile"
unless ($line =~ /\s*(-?\d+)/);
$used += $1;
}
close(QF);
next if (! $used);
my $percent = int($used / $quota * 100);
$lusers{$user} = $percent;
}
}

#send a report to the postmasters
if ($MAIL_REPORT) {
open(MAIL, "| $MAILPROG");
select(MAIL);
map {print "To: $_\n"} @POSTMASTERS;
print "From: $COADDR\n";
print "Subject: Daily Quota Report.\n";
print "DAILY QUOTA REPORT:\n\n";
print "----------------------------------------------\n";
print "| % UTILISATION | NOM DU COMPTE |\n";
print "----------------------------------------------\n";
foreach my $luser ( sort { $lusers{$b} <=> $lusers{$a} } keys %lusers ) {
printf("| %3d | %32s |\n", $lusers{$luser}, $luser);
print "---------------------------------------------\n";
}
print "\n--\n";
print "$CONAME\n";
close(MAIL);
}

#email a warning to people over quota
if ($MAIL_WARNING) {
foreach my $luser (keys (%lusers)) {
next unless $lusers{$luser} >= $WARNPERCENT; # skip those under quota
open(MAIL, "| $MAILPROG");
select(MAIL);
print "To: $luser\n";
map {print "BCC: $_\n"} @POSTMASTERS;
print "From: $SUADDR\n";
print "Subject: WARNING: Your mailbox is $lusers{$luser}% full.\n";
print "Reply-to: $SUADDR\n";
print "Your mailbox: $luser is $lusers{$luser}% full.\n\n";
print "Once your e-mail box has exceeded your monthly storage quota\n";
print "your monthly billing will be automatically adjusted.\n";
print "Please consider deleting e-mail and emptying your trash folder to clear some space.\n\n";
print "Contact <$SUADDR> for further assistance.\n\n";
print "Thank You.\n\n";
print "--\n";
print "$CONAME\n";
close(MAIL);
}
}
But why in the log on mysql, i don't see request for quota ?
Reply With Quote
  #4  
Old 13th August 2007, 19:09
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,740 Times in 2,575 Posts
Default

Which distribution are you using?
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
The Following User Says Thank You to falko For This Useful Post:
Tr!n!Ty (14th August 2007)
  #5  
Old 14th August 2007, 07:58
Tr!n!Ty Tr!n!Ty is offline
Junior Member
 
Join Date: Sep 2006
Posts: 17
Thanks: 1
Thanked 0 Times in 0 Posts
Default

I'm using Ubuntu edgy
Reply With Quote
  #6  
Old 15th August 2007, 18:28
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,740 Times in 2,575 Posts
Default

Please try this:
Code:
ln -sf /bin/bash /bin/sh
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #7  
Old 14th September 2007, 16:16
sremac sremac is offline
Junior Member
 
Join Date: Feb 2007
Location: Belgrade
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Unhappy

Quote:
Originally Posted by falko
Please try this:
Code:
ln -sf /bin/bash /bin/sh

hello,

have you noticed if somebody resolved problem with quota with
'home/vmail/domains'

because in /usr/local/sbin/quota_notify it suppose that you have in configuration

/home/vmail/domains/example.com/blabla

but real situation is just

/home/vmail/example.com/blabla

?

because of that, quota_notify can`t work well
Reply With Quote
  #8  
Old 14th September 2007, 22:54
Tr!n!Ty Tr!n!Ty is offline
Junior Member
 
Join Date: Sep 2006
Posts: 17
Thanks: 1
Thanked 0 Times in 0 Posts
Default

i back home and this command change nothing the report quota is empty
Reply With Quote
  #9  
Old 26th September 2007, 22:07
justiceiro_df justiceiro_df is offline
Junior Member
 
Join Date: Sep 2007
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to justiceiro_df
Default

Quote:
Originally Posted by sremac
hello,

have you noticed if somebody resolved problem with quota with
'home/vmail/domains'

because in /usr/local/sbin/quota_notify it suppose that you have in configuration

/home/vmail/domains/example.com/blabla

but real situation is just

/home/vmail/example.com/blabla

?

because of that, quota_notify can`t work well

I've notice that to, I have the same problem as descrive above... some one found any issue ???

Reply With Quote
  #10  
Old 17th January 2008, 23:18
Pinki Pinki is offline
Junior Member
 
Join Date: Jan 2008
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
 
Default

Hello
change line 95
from: my $percent = int($used / $quota * 100);
to: my $percent = sprintf "%.3f",($used / $quota * 100);

and line 111
from: printf("| %3d | %32s |\n", $lusers{$luser}, $luser);
to: printf("| %.3f | %32s |\n", $lusers{$luser}, $luser);

--
Pinki
Lukasz Rostalski
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
log files cruz Technical 3 15th May 2007 14:35
Postfix reject connections gabrix Server Operation 27 25th January 2007 08:37
postfix-tls sasl2 mysql courier-authmysql gabrix Server Operation 4 12th January 2007 22:09
Core 4: Error Messages on Fresh Install re CTX/SSL jjw Installation/Configuration 30 6th September 2006 12:16
Problems with copy & paste dspuser Server Operation 3 23rd May 2006 17:21


All times are GMT +2. The time now is 15:20.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.