I 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.
Thanks. This one helped me.
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
Thank you, very useful.
Hello Juan G.,
No problem. Thank you for posting feedback.
Thanks.
alex
A line that should be also commented out in /etc/postfix/main.cf when disabling Amavis is the following, so that Postfix checks virtual aliases:
receive_override_options = no_address_mappings
Hello Juan G.,
Thanks for following up with this information.
Thanks.
alex
Thank you so much for this!
Alex, Dude, thanks for that 1! U plum saved my bacon. As a beginner Linux Sysadmin I likely have no business running Postfix, but I needed the functionality. I tried installing Ispconfig3, & things ended up pretty fubar. This helped me get my mailing list unstuck. Thanks again! If u had a donation button on this site you’d have gotten 1. Bad move lol.