Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
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'm looking for a special email client for the purpose of doing testing of mail servers. I need to be able to test:
1. Shell command line capability. If it also can do X windows, I need a version that does not need X libs (maybe build that from source). Source code would be nice to have.
2. Access to POP, IMAP, SMTP, and both SSL and STARTTLS variations. I do need all these variations.
3. I need to be able to specify the login name, email address, and server hostname or IP address, and optional port number to access.
4. It should prompt me for password if I don't supply it in some other means (one of command argument, environment variable, or file I point to).
5. It should report how much mail is there if it can get in but NOT actually fetch it (options to tell it to fetch mail would be optional, but I don't need that).
6. If it cannot get in, it needs to detail why as much as can be determined ... and NOT phrase things for ordinary users.
7. I do NOT want to have to "setup up an account" in the client to use it. I would be using it to, among other things, verify that access to accounts being set up on servers is actually working.
Alpine, maybe? There's a debug option mentioned in the command line options. The source is available. It comes with something called mailutil which I think might do at least some of what you want. I once used it to script sucking email out of one account via and in to another via IMAP.
Last edited by arizonagroovejet; 09-14-2011 at 01:50 PM.
Reason: there was an instance of the word 'to' that shouldn't have been there
Well, I'm not looking for a new mail client in the usual sense. But if the alpine package has tools, or just the right set of command line options, to carry out the testing I need to do, then that might be what I want. I'll take a look at it (again ... looked at it several years ago once for ordinary client needs but ended up using mutt and don't remember the specifics of why).
FWIW, I just found that script I mentioned. Here's an example line which might give you a vauge sense of what can be done with mailutil
Code:
/usr/bin/mailutil transfer -verbose $where {imap.mail.server/ssl/novalidate-cert/user=$SECOND_USER};
$where is a path to a local directory.
Given that you seems to know exactly what you want, if you have some scripting/programming skills it might be worth looking at writing something to do what you want. Since my last post I've remembered that about five years ago I wrote a script in PHP that connected to an IMAP sever and retrieved the size of all the user's mail folders. I'm sure such a thing is possible in other languages too.
Well, telnet would be far from it. It wouldn't all be on one command. You'd have to do separate "commands" for each line of the protocol. The IMAP protocol is more complex than POP (and the one I need most). And it would be really hard to do the SSL and STARTTLS stuff (what I need most).
FWIW, I just found that script I mentioned. Here's an example line which might give you a vauge sense of what can be done with mailutil
Code:
/usr/bin/mailutil transfer -verbose $where {imap.mail.server/ssl/novalidate-cert/user=$SECOND_USER};
$where is a path to a local directory.
What is the local directory defined by $where for?
I don't want to save any state at the machine I execute this from. The only need I can see for some directory is for a collection of CA certs (that I can add my self-signed ones to) to verify SSL key authenticity. And LIBSSL I believe has a tool for that much, anyway (if that's the only test I want to run at that moment).
Quote:
Originally Posted by arizonagroovejet
Given that you seems to know exactly what you want, if you have some scripting/programming skills it might be worth looking at writing something to do what you want. Since my last post I've remembered that about five years ago I wrote a script in PHP that connected to an IMAP sever and retrieved the size of all the user's mail folders. I'm sure such a thing is possible in other languages too.
Yes, that is the fallback plan. I can program in C and have some ability in PHP, Pike, and Python. But it is always wise to check, first, to see if someone has already done so. Inventing a wheel can look rather embarassing
What I want is basically a tool a mail system administrator can use to test if user access to a mail server is working ... without munging up their real mail client's account base with a temporary account ... and without having to deal with a bunch of different mail account configuration settings to see which works. The ideal tool will try that account in many variations to see what works. Whatever port it is directed to, it should try to autodetect which protocol (POP vs. IMAP) is there. And that's after connecting in the clear, in the clear with STARTTLS, and fully encrypted with SSL from the start. It should also try the username alone, and the username appended with "@" and the full hostname, and also with just the domain part of the hostname. It would report back what works and does not work. It would report failed to connect, failed to authenticate host, failed to login, mailbox empty, number of messages, as appropriate. Ability to use proxies (like HTTP CONNECT and SOCKS) would be nice.
Do you see where I'm going with this, yet? I want to do something like:
I don't see at all where to put the username, hostname, portnumber, and password to access the selected mail server for the tests. And I don't file any "mailutil" program in packages for Slackware or Ubuntu. The closest package is "mailutils" but that's the classic MH client.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.