Hi all, The *only* mail I want to do with my (debian) linux box is *send* informational emails to myself with a cron job using: mail johnsonmlw@yahoo.com < info.txt I'm lost in a world of mta's etc. I've read howtos and think I understand how it all works. I have a default gateway (a linux box connected to my broadband connection with ipmasq installed). I have a linux workstation behind it and get access to all internet services I need with no problems. I have exim4 installed (I'm lost on that). I type the command as above and the mail never arrives in my yahoo box. Do I need to tell it to go via the gateway or am I leagues off the point? I could use some pointers please. What components of the mail trail do I actually need to install to do this task? What packages don't I need to worry about. Thanks in advance. -- Matt Johnson ___________________________________________________________ ALL-NEW Yahoo! Messenger - all new features - even more fun! http://uk.messenger.yahoo.com
--- Matt Johnson
I have exim4 installed (I'm lost on that). I type the command as above and the mail never arrives in my yahoo box. Do I need to tell it to go via the gateway or am I leagues off the point?
Not leagues, no. What you haven't said is whether the MTA is installed on your gateway box, or on your workstation. I'll assume it is installed on your workstation. It might well pay you to "revisit" the questions you would have answered via debconf when you installed exim4. The command: # dpkg-reconfigure exim4 will do that. What you're wanting to do is probably just relay mail. To be perfectly honest, if you answer the questions properly, you won't have anything to worry about. They're there for a reason. When it asks you -- you should allow for relaying mail on your domain. Since I have a private (non-routable) IP, I have that defined in '/etc/exim4/update-exim4.conf.conf' as: dc_relay_nets='192.168.0.0/24' So that any machine on that subnet is able to accept mail. This is fine, since everything will go out via your "default gateway". I also have: dc_eximconfig_configtype='internet' defined as one of the first questions "dpkg-reconfigure exim4" asks. Note that *if* you edit that file by hand, note what is in the header: # /etc/exim4/update-exim4.conf.conf # # Edit this file and /etc/mailname by hand and execute update-exim4.conf # yourself or use 'dpkg-reconfigure exim4-config' If though, you have the MTA on the gateway box (and your workstation picks up mail from there) -- I'd install a nullmailer ("nullmailer" or "ssmtp") and let that "inject" the e-mail into the MTA queue on the gateway box. It certainly saves running exim (or another MTA) on every workstation. I hope that helps. -- Thomas Adam ===== "The Linux Weekend Mechanic" -- http://linuxgazette.net "TAG Editor" -- http://linuxgazette.net "<shrug> We'll just save up your sins, Thomas, and punish you for all of them at once when you get better. The experience will probably kill you. :)" -- Benjamin A. Okopnik (Linux Gazette Technical Editor) ___________________________________________________________ ALL-NEW Yahoo! Messenger - all new features - even more fun! http://uk.messenger.yahoo.com
Hi Thomas, Thanks for your reply - it has made things clearer. The nullmailer makes a lot of sense, and I think I "get it".
I have exim4 installed (I'm lost on that). I type the command as above and the mail never arrives in my yahoo box. Do I need to tell it to go via the gateway or am I leagues off the point?
Not leagues, no. What you haven't said is whether the MTA is installed on your gateway box, or on your workstation. I'll assume it is installed on your workstation.
I'd tried both, but yes - the workstation.
It might well pay you to "revisit" the questions you would have answered via debconf when you installed exim4. The command:
# dpkg-reconfigure exim4
Seem to need: # dpkg-reconfigure exim4-config which seems unusual.
will do that. What you're wanting to do is probably just relay mail. To be perfectly honest, if you answer the questions properly, you won't have anything to worry about. They're there for a reason.
Yes, I had revisited dpkg-reconfigure a handful of times. I answered the questions sensibly. I have now discovered the problem!... This is a home network, but I needed to append a .com (or similar) to the "system mail name" in the config dialogue. My machine is called "desktop", and it was getting "501 syntax errors" from the yahoo smtp server (which I was blissfully unaware of as I was reading the wrong local mail - where the error messages were sitting). I now call it desktop.com in the dpkg-reconfigure dialogue and it works. I don't think this will cause a problem for the real desktop.com domain as I'm only sending mail from and to myself, but what's the proper way round this problem? Am I allowed to send mail if I don't have a domain to send from? I can now happily mail from either my desktop or gateway. I plan to get alerts from nagios now... A blinding bit of kit. Thanks for you help. -- Matt ___________________________________________________________ ALL-NEW Yahoo! Messenger - all new features - even more fun! http://uk.messenger.yahoo.com
--- Matt Johnson
Hi Thomas,
Thanks for your reply - it has made things clearer. The nullmailer makes a lot of sense, and I think I "get it".
Yes, they're useful.
I'd tried both, but yes - the workstation.
There are reasons why you might prefer to run the service on one and not the other -- you might find that the processing of the mail is best done away from your workstation, hence install and configure your MTA on the gateway machine. If you do that (and as I said before) it would be much "easier" for you to then goto your workstation(s) in turn, and install a nullmailer. There are several of these around [1]. I actually use the nullmailer called 'nullmailer'.
Seem to need:
# dpkg-reconfigure exim4-config
Yes, that was a mistake on my part. Sorry.
which seems unusual.
:) Debianites are mysterious people. It's not so unusual, when you realise that exim4-config as a package is dedicated purely to configuring exim. I might file a wishlist bug for debconf support to redirect to that package if called as: "dpkg-reconfigure exim4".
sitting). I now call it desktop.com in the dpkg-reconfigure dialogue and it works.
/etc/mailname
I don't think this will cause a problem for the real desktop.com domain as I'm only sending mail from and to myself, but what's the proper way round this problem? Am I allowed to send mail if I don't have a domain to send from?
But you do have a domain to send from -- what you don't have is a valid domain name resolved to that public IP. Am I correct in assuming that this gateway machine of yours is the only public-facing machine on the web? If it is, you'll be doing some form of NATing at least (ip-masquerading probably). (note that if it isn't, then it must be a proxy server). So I'm going to imagine a scenario (I might be way off-beam, but I like to exercise my brain once in a while :P). You have a setup like this (IP addresses are fictional): workstation ---> gateway ---> Internet (192.168.0.100) (192.168.0.1) (217.42.164.23) Where "gateway" has two IPs -- one internal, and the other assigned to it via the PPP session. I've used a dynamic IP address range here (typically), although you might have a static-IP, I don't know. Not that it matters. Your workstation will therefore appear to have the IP address of '217.42.164.23' - yet internally, all traffic is routed accordingly to 192.168.0.100. Of course, how does this help you send e-mails? Well, as you have already seen your "domain name" was invalid - and as you have it "desktop.com" is as well. You can't just make up domain names :), they need to be registered accordingly. Nor can you just hijack a domain name already in existance. Although if this is a dynamic IP, you could use a dyndns [1] account. Would make life much easier, certainly. So if you don't have a valid hostname (one that's routable on a *public* network) the only way I could send you an e-mail is by doing: matt@217.42.164.23 (or some equivalent user). Note that, like Sendmail, Exim allows you to define aliases for users. They're mapped in the /etc/aliases (and unlike Sendmail, you don't have to run the command 'newaliases' each time you change the file :P).
From Unix though, I might use the mailx(1) command:
mail matt@217.42.164.23 < ./foo.txt For historical reasons, when using the IP as the raw destination, it's better to put the IP in brackets [2]: mail matt@[217.42.164.23] < ./foo.txt Of course, all of this has been assuming that your workstation has not got a public IP assigned to it. If it does, then you have nothing to worry about, the above still applies - but it would make your "gateway" box redundant somewhat. So the best thing you can do? If it's a dynamic IP, get a dyndns account [1]. If it's a static IP, register a domain name. I realise that I might be preaching to the choir somewhat here, but I think I've understood the question you were asking.
I can now happily mail from either my desktop or gateway. I plan to get alerts from nagios now... A blinding bit of kit.
Nagios is useful, yes.
Thanks for you help.
You're welcome. -- Thomas Adam [1] http://www.dyndns.org [2] There are two reasons for this, but this e-mail is long enough already, without further ramblings from myself. :) ===== "The Linux Weekend Mechanic" -- http://linuxgazette.net "TAG Editor" -- http://linuxgazette.net "<shrug> We'll just save up your sins, Thomas, and punish you for all of them at once when you get better. The experience will probably kill you. :)" -- Benjamin A. Okopnik (Linux Gazette Technical Editor) ___________________________________________________________ ALL-NEW Yahoo! Messenger - all new features - even more fun! http://uk.messenger.yahoo.com
--- Thomas Adam
--- Matt Johnson
wrote: Hi Thomas,
Thanks for your reply - it has made things clearer. The nullmailer makes a lot of sense, and I think I "get it".
Yes, they're useful.
"Nullmailer" is now installed instead of exim4 on the workstation. Exim4 on the gateway (which as you said is indeed NATing with ipmasq). Works a treat, and is much lighter.
I'd tried both, but yes - the workstation.
There are reasons why you might prefer to run the service on one and not the other -- you might find that the processing of the mail is best done away from your workstation, hence install and configure your MTA on the gateway machine.
Done :)
Seem to need:
# dpkg-reconfigure exim4-config
Yes, that was a mistake on my part. Sorry.
which seems unusual.
:) Debianites are mysterious people. It's not so unusual, when you realise that exim4-config as a package is dedicated purely to configuring exim. I might file a wishlist bug for debconf support to redirect to that package if called as: "dpkg-reconfigure exim4".
I've now seen the config package, so it does indeed make sense. It's not very obvious to the uniniciated. Wishlist sounds like a good plan. Thanks for the dyndns link. Very interesting. Clever stuff. My ip is reasonably static, but that's not the same as static obviously! Ta very much. -- Matt ___________________________________________________________ ALL-NEW Yahoo! Messenger - all new features - even more fun! http://uk.messenger.yahoo.com
--- Matt Johnson
"Nullmailer" is now installed instead of exim4 on the workstation. Exim4 on the gateway (which as you said is indeed NATing with ipmasq). Works a treat, and is much lighter.
Yes. :) This is the exact same setup that I have here (although not from this email address). Of course, as well as the MTA, you'll want some means of receiving the emails. I use 'dovecot' (as an IMAP server) on my own gateway machine, and then just use 'fetchmail' on my workstations, with mutt as my MUA. -- Thomas Adam ===== "The Linux Weekend Mechanic" -- http://linuxgazette.net "TAG Editor" -- http://linuxgazette.net "<shrug> We'll just save up your sins, Thomas, and punish you for all of them at once when you get better. The experience will probably kill you. :)" -- Benjamin A. Okopnik (Linux Gazette Technical Editor) ___________________________________________________________ ALL-NEW Yahoo! Messenger - all new features - even more fun! http://uk.messenger.yahoo.com
participants (2)
-
Matt Johnson
-
Thomas Adam