Disable ipv6 in Exim4
Solution 1
Enter a root shell:
sudo bash
First you need to determine if you are using the split or the non-split configuration. Run the following:
update-exim4.conf -v
Then you have to do one of the following:
- If you are using the
non-split
configuration, edit the single-file config template directly:
vi /etc/exim4/exim4.conf.template # add "disable_ipv6 = true" in the main conf section
- If you are using the
split
configuration, you need to create a new config:
echo 'disable_ipv6 = true' > /etc/exim4/conf.d/main/90_exim4-disable_ipv6
Finally, you need to regenerate the Exim4 config file and restart Exim4:
update-exim4.conf
service exim4 restart # or run "/etc/init.d/exim4 restart"
Solution 2
I think you can check and find file config /etc/exim4/update-exim4.conf
. You can add option disable_ipv6=true
and restart exim with command service exim4 restart
.
After you added option you can check and netstat listening on port 25 against the IPv6 address as: netstat -tulpn | grep :25
. If port 25 have listening in IPv6 maybe you can change dc_local_interfaces='127.0.0.1 ; ::1'
--> dc_local_interfaces='127.0.0.1'
.
Finally, finally, I noticed that there is a configuration template file/etc/exim4/exim4.conf.template
. Curiously, I’ve added disable_ipv6=true
directive over there, restarted exim and maybe it started working.
I hope you will find this article useful, and save some time when you run into similar problem with exim.
Solution 3
If your only need is to get around Google's IPv6 reverse DNS (PTR record) policies, add the following to main/02_exim4-config_options.
dns_ipv4_lookup = *google.com : *gmail.com
This will effectively disable IPv6 (address lookups) to any message going to Gmail without disabling IPv6 entirely.
Solution 4
### main/02_exim4-config_options
#################################
disable_ipv6
dns_ipv4_lookup='*'
#dns_ipv4_lookup = *gmail.com
I plan to get a little more fine-grained, presently I'm belt and braces sure not to need the qualifications to speak SMTP over IPv6 to Google Mail. Indeed that seems a little antethical to the ethos of the sphere.
Related videos on Youtube
![Dennis Williamson](https://i.stack.imgur.com/S1BbQ.png?s=256&g=1)
Dennis Williamson
Stackathlon Leader Boards #SOreadytohelp The Bridge Builder I am the first user to earn at least 50,000 reputation points each on all three of Stack Overflow, Server Fault and Super User. I was also the first user to surpass the 10K, 20K, 30K and 40K point levels each on all three of those sites. ###Are you a Stackathlete? ###Check the standings on Profile:I'm a Unix/Linux devops engineer/sysadmin/programmer Devotion to Duty Try my unofficial Printifier for xkcd.
Updated on September 18, 2022Comments
-
Dennis Williamson almost 2 years
Exim4 has an option
disable_ipv6=true
. As great in many ways as Debian/Ubuntu's split configuration files for Exim4 may be, it makes it difficult sometimes to know where to put configuration options.Where do I add the line
disable_ipv6=true
? -
Ingo over 6 yearsI don't understand what you mean. What is this snippet? Why does it answer the question?
-
xecgr about 4 years
/etc/exim4/exim4.conf.template
step lets the black magic happen!