Skip to main content

Posts

Showing posts with the label Postfix

Clear Zimbra Mail Queue

If you want to clear mail queue from specific email address run the following command in your terminal. Below will remove mail queues, by checking FROM sender. eg. remove all mail queues sent by info@example.com /opt/zimbra/postfix/sbin/mailq | tail -n +2 | grep -v '^ *(' | awk 'BEGIN { RS = "" } { if ($7 == "info@example.comt") print $1 } ' | tr -d '*!' | xargs -rn1 /opt/zimbra/postfix/sbin/postsuper -d Below will remove mail queues, by checking TO sender. eg. remove all mail queues sent to info@example.com /opt/zimbra/postfix/sbin/mailq | tail -n +2 | grep -v '^ *(' | awk 'BEGIN { RS = "" } { if ($8 == "info@example.comt") print $1 } ' | tr -d '*!' | xargs -rn1 /opt/zimbra/postfix/sbin/postsuper -d

Zimbra Mail Error: not enough free space in mail queue

If you are using Zimbra Mail and you are not able to send any mails and also you see an Error Message " not enough free space in mail queue " under /var/log/message. Then you should try out this solution. 1. Login to the server, and then again login as zimbra as follows: #su - zimbra 2. Check the Postfix message_size_limit, by default it should be 10MB (i.e. '10240000' bytes) as follows: $postconf message_size_limit message_size_limit = 10240000 3. If the value is higher than that, set it as follows to 10MB $ zmprov modifyConfig zimbraMtaMaxMessageSize 10240000 $ postfix reload Now try sending Mail, It should work. You could try out this solution for Error: " SMTP Server Reported: 452 4.3.1 Insufficient System Storage "

Mail Server Configuration in CentOS using Postfix

First thing to do is check if postfix and dovecot is installed in your Linux Machine rpm -qa postfix rpm -qa dovecot If postfix and dovecot is not installed, then install it using yum command yum install postfix dovecot -y Now lets start configuring Mail Server: 1. Look for the below line and make necessary changes in vi /etc/postfix/main.cf myhostname = mail.yj.bt mydomain = yj.bt myorigin = $mydomain inet_interfaces = all mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain mynetworks = 127.0.0.0/8, 10.0.0.0/24 home_mailbox = Maildir/ smtpd_banner = $myhostname ESMTP # Add at bottom for # for SMTP-Auth setting smtpd_sasl_type = dovecot smtpd_sasl_path = private/auth-client smtpd_sasl_auth_enable = yes smtpd_sasl_security_options = noanonymous smtpd_sasl_local_domain = $myhostname smtpd_client_restrictions = permit_mynetworks,reject_unknown_client,permit smtpd_recipient_restrictions = permit_mynetworks,permit_auth_destination,permit_sasl_auth...

Remove Mail Queue in Postfix

To see mail queue, enter : # mailq To remove all mail from the queue, enter : # postsuper -d ALL mail.pl [script removed the mail queue as entered after the script] #!/usr/bin/perl $REGEXP = shift || die "no email-adress given (regexp-style, e.g. bl.*\@yahoo.com)!"; @data = qx ; for (@data) { if (/^(\w+)(\*|\!)?\s/) { $queue_id = $1; } if($queue_id) { if (/$REGEXP/i) { $Q{$queue_id} = 1; $queue_id = ""; } } } #open(POSTSUPER,"|cat") || die "couldn't open postsuper" ; open(POSTSUPER,"|postsuper -d -") || die "couldn't open postsuper" ; foreach (keys %Q) { print POSTSUPER "$_\n"; }; close(POSTSUPER); To run the script ./mail.pl xxx.com 'or' ./mail.pl info@xx.com