Arch Linux

Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!
Tasklist

FS#28864 - [mutt] 1.5.21 does not respect /etc/resolv.conf settings

Attached to Project: Arch Linux
Opened by Lubos Kolouch (kolcon) - Sunday, 11 March 2012, 12:10 GMT
Last edited by Gaetan Bisson (vesath) - Wednesday, 27 June 2012, 15:45 GMT
Task Type Bug Report
Category Packages: Extra
Status Closed
Assigned To Gaetan Bisson (vesath)
Architecture x86_64
Severity Medium
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 1
Private No

Details

Description:

When mutt is launched, it remembers the DNS settings from /etc/resolv.conf and keeps using them,
even if the resolv.conf file has been changed.

This is causing problem when hibernating the laptop and resuming in another network, where
the original DNS server is not accessible (cannot resolve the smtp name).

Mutt that is included in Gentoo behaves correctly.

Additional info:
* package version(s)
* config and/or log files etc.


Steps to reproduce:
1. Launch mutt
2. Suspend/hibernate
3. Resume in another network with different DNS settings
4. Try to send email
5. Fail
This task depends upon

Closed by  Gaetan Bisson (vesath)
Wednesday, 27 June 2012, 15:45 GMT
Reason for closing:  Won't fix
Additional comments about closing:  I see no solution to this problem, but please ask to reopen if you come up with a patch or identify the source of your issue.
Comment by Gaetan Bisson (vesath) - Sunday, 11 March 2012, 15:20 GMT
What DNS settings are you talking about? The host domain name? Because Mutt resolves DNS names via gethostbyname, so whatever name server you have in /etc/resolv.conf should be picked up by glibc every time...
Comment by Lubos Kolouch (kolcon) - Sunday, 11 March 2012, 16:29 GMT
I am talking about /etc/resolv.conf

Just try it yourself - launch mutt, then put some nonsense to /etc/resolv.conf, but mutt will
happily continue to use the "cached" DNS of the SMTP server. Or at least does in my arch installation.
Comment by Fabian Homborg (alfa) - Sunday, 11 March 2012, 20:49 GMT
Works for me.

Tried both ways:

- Launching mutt with working resolv.conf, then changing it do nonsense and trying to send mail (couldn't resolve the hostname of course)

- Launching mutt with broken resolv.conf, then changing it to a working one and trying to send mail (worked)


I have mutt 1.5.21-6 and use net-auto-wireless from netcfg to connect to my network (so nothing updating resolv.conf automatically).
Comment by Gaetan Bisson (vesath) - Sunday, 11 March 2012, 22:17 GMT
Lubos, could you finally give us details a little more precise than "some nonsense" so that we can reproduce your issue?
Comment by Fabian Homborg (alfa) - Sunday, 11 March 2012, 22:43 GMT
To be clear, _my_ test was with an invalid ip adress (something like "nameserver 1231.4124.135.1352" and all other lines commented out)
Comment by Gaetan Bisson (vesath) - Sunday, 11 March 2012, 23:12 GMT
You are not helping by being vague...
What I am supposed to do with "something like", no muttrc, no clue as to how your Mutt handles outgoing emails, etc.
I assume you are using sendmail or msmtp and the bug is actually there, but I am not going to search for your bug myself.
Everything works as expected here.
Comment by Fabian Homborg (alfa) - Sunday, 11 March 2012, 23:26 GMT
I should have added that.

However note that I'm not the person who opened this bug, I just tried to add an additional sample.

I have "smtp_url" and "smtp_pass" set in .muttrc and have neither sendmail nor msmtp nor smtp-forwarder installed, so I suppose I use a method internal to mutt or at least included in the package.

The exact steps I took:

Open mutt, compose test mail to myself.
Open /etc/resolv.conf, comment out every line, add new line "nameserver 256.256.256.256" (note the invalid/nonsensical ip),save
Try to send mail
Get error "Could not find host smtp.gmail.com" (in german)

Now for the other way around:

Close mutt, open mutt again (with the invalid resolv.conf), compose new test mail
Open /etc/resolv.conf, remove erronous line, uncomment old working lines ("nameserver 172.16.100.12","nameserver 8.8.8.8","nameserver 8.8.4.4"),save
Try to send mail
Success


Now note that this is exactly the way it is expected, and I could _not_ reproduce the bug.
Comment by Lubos Kolouch (kolcon) - Monday, 12 March 2012, 06:46 GMT
Very sorry for being vague.

I have exactly the same issue Fabian described (even with smtp.gmail.com)

from my .muttrc:
set smtp_url = "smtp://name@company:5557/" (or smtp.gmail.com in another setup)

Test scenario:
1) empty resolv.conf
2) Start mutt
3) Try to send email : Could not find the host "smtp.gmail.com"
4) adding correct nameserver to resolv.conf
5) Try to send email: Could not find the host "smtp.gmail.com"
6) Close mutt
7) Open mutt
8) Try to send email: Email sent OK
9) empty resolv.conf
10) Try to send email: Email sent OK
11) Close mutt
12) Open mutt
13) Try to send email: Could not find the host "smtp.gmail.com"

Is it a bit clearer now?

Comment by Gaetan Bisson (vesath) - Monday, 12 March 2012, 07:30 GMT
Lubos: Not really because with roughly the same workflow Fabian says he sees no bug...
Comment by Lubos Kolouch (kolcon) - Monday, 12 March 2012, 07:38 GMT
Understood. Will investigate the issue some more and see if I can come with something...
I am quite sure my .muttrc is not the issue as I have the same one working fine under Gentoo
on the same laptop...
Comment by Gaetan Bisson (vesath) - Monday, 12 March 2012, 07:48 GMT
Lubos: Alright, your issue is probably that gethostbyname/getaddrinfo results get cached. That's not specific to Mutt, you will have the same problem with any application making DNS queries.
Comment by Lubos Kolouch (kolcon) - Monday, 12 March 2012, 13:42 GMT
I did three some tests:

1) created a new user with empty profile (only modified .muttrc) - same (wrong) behaviour
2) ping smtp.gmail.com works as expected (works if /etc/resolv.conf correct, does not if incorrect)
3) tried firefox - works as expected (same like 2)
4) tried newsbeuter (console news program) - works as expected (same like 2)
5) tried irssi (IRC) - works as expected (same like 2)

So, what would you suggest to try further and why this seems to misbehave only in mutt?
Comment by Gaetan Bisson (vesath) - Monday, 12 March 2012, 14:04 GMT
The easiest approach seems to be to determine why Mutt behaves differently on Gentoo, but it could be Mutt itself, the glibc, or something else. I'll try looking if I find the time.
Comment by Lubos Kolouch (kolcon) - Saturday, 24 March 2012, 09:00 GMT
I believe this is the relevant part from strace...

1) I sent email to gmail with valid resolv.conf
strace : http://paste.pocoo.org/show/570389/

2) I emptied the resolv.conf and tried to send, email sent OK
strace : http://paste.pocoo.org/show/570391/

Does it help?
Comment by Gaetan Bisson (vesath) - Saturday, 24 March 2012, 10:07 GMT
All I can see here is that the result of the DNS lookup is indeed cached.
To me this is a standard behavior; the mystery is why Gentoo works differently.
You should probably consider asking on the upstream mailing list.
Comment by Lubos Kolouch (kolcon) - Saturday, 24 March 2012, 10:11 GMT
Yes, but why it does not happen in other applications?
Should it really be cached when you can wake the notebook in completely different
network with different DNS settings?
Comment by Lubos Kolouch (kolcon) - Saturday, 24 March 2012, 10:27 GMT
... posted question to gmane.mail.mutt.users ...
Comment by Gaetan Bisson (vesath) - Saturday, 24 March 2012, 10:57 GMT
Back when Mutt was written, there were no netbooks; besides, restarting it is cheap when you use header_cache. Just saying it makes sense to cache.

Loading...