ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I am not 100% sure this is the right forum - apologies if not.
I am trying to write a python script to automate some things at work.
However I do not have access to root - how can I find our mail server's address? So I can use that to send emails?
Not to be a twit, but if this is for your work environment, you should be able to ask your systems admins for that information, and they'll be happy to provide it.
On a non-twit related note, you can try to look into the /etc/mail/sendmail.cf or submit.cf files (may be different for Postfix, but sendmail uses those), and see where things are relayed (look for the Smarthost line). It should have an address or host name in there, but that will just tell you the next server upstream. Depending on how the mail system is set up, your program may need to be 'allowed' to relay mail through, or you may have other hoops to jump through. Your mail admins should be able to give you all the details...hate to be vague, but mail in a corporate environment can get very convoluted.
Not to be a twit, but if this is for your work environment, you should be able to ask your systems admins for that information, and they'll be happy to provide it.
launch nslookup from CLI
enter "set type=mx"
enter "yourdomainname.com"
this will give the fqdn of that domain's mx servers, if listed in DNS records of course.
This will work if trying to find out public mail server BUT NOT an internally used mail server.
Last edited by Carl Filby; 09-29-2008 at 12:34 PM.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.