Remove Amavis Content Filter From Postfix Configuration, Requeue All Postfix Email Messages
Posted by alex in Insights at 11:30 PMI installed ISPConfig awhile back on a web hosting server that at one point also hosted email accounts. I recently moved all of the email to a different server and wanted to cut down on CPU and memory usage so I needed to disable amavisd, clamd, courier-imap, and courier-authlib. These services provided a way to receive email via POP3 and IMAP as well as content filtering and virus scanning for all of that email. So after shutting all of the services down I needed to remove the reference to the local content filter from Postfix because if amavis is shut down and mail is sent from a web application to the localhost then the connection will be refused and Postfix will not send the email. Below I describe the Postfix configuration lines to comment out as well as a way to reload all of the queued email into the Postfix queue so it could be sent again.
Disable Postfix Amavis Configuration
First you will need to comment out the content_filter line which will look similar to the below. In my case it is telling Postfix to send local mail through port 10024 on the localhost or 127.0.0.1. The Postfix configuration file is named main.cf and located in the /etc/postfix directory.
Active Postfix Amavis Configuration Using content_filter:
content_filter = amavis:[127.0.0.1]:10024
Now the below shows the same configuration line updated with a comment in front of it so it is not processed.
Disabled Postfix Amavis Configuration Using content_filter:
#content_filter = amavis:[127.0.0.1]:10024
You may also have reference to amavis in master.cf also located in the /etc/postfix directory. If you do locate it, open in your favorite editor such as vi, and comment it out as shown below.
Comment Out Amavis Reference In The Postfix Configuration File master.cf:
#amavis unix - - - - 2 smtp # -o smtp_data_done_timeout=1200 # -o smtp_send_xforward_command=yes
Restart Postfix To Enable Configuration Changes:
Now use the syntax below to load the new configuration files. This will disable content_filter and not require all email to be filtered when it is sent from the local server.
Reload The Postfix Server Using The Below Syntax:
[root@server postfix]# postfix reload postfix/postfix-script: refreshing the Postfix mail system You have new mail in /var/spool/mail/root
Requeue Postgix Email Without Content Filter:
After you have removed the content_filter configuration you may need to put emails back into the queue. Regardless after the content_filter setting has been modified you will want to run the below queue so no emails are stuck in the queue forever. Issue the below command to put emails back into the queue to be sent. For instance in my case I shut down amavis before removing the content_filter configuration line which caused numerous emails to be stuck in the Postfix queue.
Syntax To Requeue Postfix Email Messages:
[root@server postfix]# postsuper -r ALL postsuper: Requeued: 42 messages
If you watch the maillog, located in the /var/log directory, when running the above command you will see the email being sent from the server if there are any emails that were requeued. All outgoing mail will no longer be filtered.
- Clear Out Postfix Queue, Analyze Postfix Email Queue Earlier today we had a minor issue on a development...
- Postfix Logrotate Script For Gentoo Linux Working on a friends server earlier this morning I noticed...
- Remove Deleted IMAP Email Messages From View in Outlook 2007 Recently I have combined numerous email accounts into one Google...
- Setup Gmail Aliases To Easily Filter and Organize Incoming Email I discovered something really cool tonight to help organize my...
- Extra SPAM Protection For ISPConfig Running Postfix This article was written to create an easy step to...
Tags: 10024, amavis, amavisd, clamd, content_filter, email, IMAP, localhost, maillog, main.cf, master.cf, message, POP3, postfix, postsuper, queue, reload, requeue, SMTP


























Entries (RSS)
Thanks. This one helped me.
[Reply]
alex Reply:
April 21st, 2010 at 2:21 PM
Hello Amin Abbaspour,
No problem. Thanks for taking the time to leave feedback. We hope you find other articles on the site helpful as well.
Thanks.
alex
[Reply]