LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 07-14-2008, 01:07 PM   #1
BobNutfield
Senior Member
 
Registered: Dec 2005
Location: United Kingdom
Distribution: Fedora , Ubuntu, Slackware-Current
Posts: 1,526

Rep: Reputation: 53
Sending/Receiving Mail from console programs


Hello Everyone,

Might sound like a silly experiment to some, but I have attempting spend one week using my Slack without a GUI, trying to do normal tasks like printing, writing, and home network communications. It is all just a learning exercise, and it has been great fun.

While I have been successful at almost everything I tried to do without a GUI Desktop, I have failed to set up email to send and receive. I was planning on using Pine to send and fetchmail to receive. Pine seems pretty easy to set up, but when sending a message I get the following:

Code:
[Mail not sent. Sending error: 421 SMTP connection broken
When I open Pine, it starts by asking me my mail password, so it looks like it is working, but obviously isn't.

When trying to get mail from my ISP with fetchmail, I get a complaint that localhost refused the connection, eventhough fetchmail found the mail and attempted to download it. I have been reading that incoming POP3 mail is received through port 25, and this port seems to be the problem, but I can send and receive just fine with Thunderbird.

There are a lot of threads on Pine and fetchmail, but to me they are confusing. None of this is really important, just my attempt to learn Slack and Linux in general a little deeper, so it won't be a disaster if I don't get much of a reply, but if anyone has a simple answer (or even a complicated one), I would love to hear from you.

Many thanks in advance.

Bob
 
Old 07-14-2008, 02:16 PM   #2
chess
Member
 
Registered: Mar 2002
Location: 127.0.0.1
Distribution: Slackware and OpenBSD
Posts: 740

Rep: Reputation: 190Reputation: 190
Pine, like Mutt, is just a mail client, or mail user agent. They do not send or receive mail. Take a look at the "What Pine Does Not Do" list from the Pine website:

http://www.washington.edu/pine/faq/whatis.html#2.1.2

Pine and Mutt are generally set up to simply display mail message in your mbox file or Maildir folder. Fetchmail and getmail can grab mail from a remote server and copy it to your mbox or Maildir folder to enable Pine/Mutt to read it. To send, you need to set up a mail transfer agent such as sendmail or postfix. If you already have an account with your ISP or Gmail or whatever, then you may want to look at simple MTA's, such as msmtp or esmtp. All they do is really just forward your mail to the smtp server of your ISP or Gmail. I have used msmtp and it works very well.

I hope this helps a bit.

Last edited by chess; 07-14-2008 at 02:17 PM.
 
Old 07-14-2008, 02:29 PM   #3
BobNutfield
Senior Member
 
Registered: Dec 2005
Location: United Kingdom
Distribution: Fedora , Ubuntu, Slackware-Current
Posts: 1,526

Original Poster
Rep: Reputation: 53
Thank you, yes that does help. However, with some additional tweaking Pine DOES seem to be grabbing the mail from my ISP saving to an INBOX with the Pine app. I sent two test messages and I received them both through Pine. It tries to send as well, but fails authentication. Oh well, one out of two accomplished. I will have a look at sendmail. I have wanted to learn, anyway.

Thanks again for your help.

Bob
 
Old 07-14-2008, 02:31 PM   #4
dive
Senior Member
 
Registered: Aug 2003
Location: UK
Distribution: Slackware
Posts: 3,467

Rep: Reputation: Disabled
I use mutt, sendmail, procmail, spamassassin and fetchmail. Been using them for ages now even in X.

So for sending:

mutt -> sendmail

For receiving:

fetchmail -> procmail -> spamassassin -> procmail again -> mutt

Once they are set up they will last forever.

procmail is called automatically after fetchmail, forwards everything to spamassassin which is called from ~/.procmailrc, then finally sorts everything into proper folders.
 
Old 07-14-2008, 03:33 PM   #5
BobNutfield
Senior Member
 
Registered: Dec 2005
Location: United Kingdom
Distribution: Fedora , Ubuntu, Slackware-Current
Posts: 1,526

Original Poster
Rep: Reputation: 53
Most working now, but still working on sendmail. But, I have created an .fetchmailrc file in my home directory, with the following:

Quote:
poll mail.myisp.com proto POP3 fetchall
user mymailuser is "bob" here
This follows the conventions shown everywhere for configuring this file. But when I run fetchmail -vk, I get:

Quote:
bob@bob-laptop:~$ fetchmail -vk
fetchmail:/home/bob/.fetchmailrc:2: syntax error at user
The problem is fetchmail is trying to login with the server using my Slackware account, NOT my mail username, and of course authentication is failing.

What is wrong with the .fetchmailrc file shown above?

Thanks

Bob
 
Old 07-14-2008, 03:58 PM   #6
dive
Senior Member
 
Registered: Aug 2003
Location: UK
Distribution: Slackware
Posts: 3,467

Rep: Reputation: Disabled
Did you put your email address in quotes? Mine:

user 'dave@blabla.co.uk' there with password 'xx' is 'dive' here options no rewrite
 
Old 07-14-2008, 04:11 PM   #7
BobNutfield
Senior Member
 
Registered: Dec 2005
Location: United Kingdom
Distribution: Fedora , Ubuntu, Slackware-Current
Posts: 1,526

Original Poster
Rep: Reputation: 53
Yes, I did, and I still get a systax errors. However, I can get it to work with fetchmail -u and supply my user name. It then asks for a password, and after entering it it finds the mail. It still won't download it, though, because I get "connection refused" to local host.

The complete .fetchmailrc is:

Quote:
poll mail.btinternet.com proto POP3 fetchall
user 'wetumpka@btinternet.com' there with password 'XXXXXXX' is 'bob' here
Bob

Last edited by BobNutfield; 07-14-2008 at 04:13 PM.
 
Old 07-14-2008, 06:00 PM   #8
dive
Senior Member
 
Registered: Aug 2003
Location: UK
Distribution: Slackware
Posts: 3,467

Rep: Reputation: Disabled
I wonder if its looking for sendmail or other running on localhost. That's the only thing I can think of that would explain connection refused by localhost. Do you have procmail installed?
 
Old 07-14-2008, 06:51 PM   #9
andrew.46
Senior Member
 
Registered: Oct 2007
Distribution: Slackware
Posts: 1,365

Rep: Reputation: 493Reputation: 493Reputation: 493Reputation: 493Reputation: 493
As dive suggested you perhaps need to hand the mail to an MDA such as procmail. My own:

http://www.andrews-corner.org/mutt.html#fetchmail

Andrew
 
Old 07-15-2008, 02:10 AM   #10
BobNutfield
Senior Member
 
Registered: Dec 2005
Location: United Kingdom
Distribution: Fedora , Ubuntu, Slackware-Current
Posts: 1,526

Original Poster
Rep: Reputation: 53
Quote:
I wonder if its looking for sendmail or other running on localhost. That's the only thing I can think of that would explain connection refused by localhost. Do you have procmail installed?
Yes, procmail is installed. It's odd, my little experiment was intended to use fetchmail to get my mail and Pine to send it, but Pine now downloads my mail and puts it in an inbox within Pine, but won't send with authentication failures. I'll try with Mutt once I have read the man pages and get to grips with it. Mutt does not seem nearly as intuitive and easy to use as Pine. As far as port 25 is concerned, I can ping it, but telnet also gets a "connection refused" complaint.

Thanks again

Bob
 
Old 07-15-2008, 02:19 AM   #11
BobNutfield
Senior Member
 
Registered: Dec 2005
Location: United Kingdom
Distribution: Fedora , Ubuntu, Slackware-Current
Posts: 1,526

Original Poster
Rep: Reputation: 53
Quote:
Originally Posted by andrew.46 View Post
As dive suggested you perhaps need to hand the mail to an MDA such as procmail. My own:

http://www.andrews-corner.org/mutt.html#fetchmail

Andrew
This is a terrific HOWTO. Thanks for providing it. I do have a googlemail account and I will experiment with it (Gmail is not available in GB because of copyright issues, but googlemail is the same system.) With my experimenting, I want to be careful not to bork my actual GUI email setup with Thunderbird. All of this, after all, is just a learning experiment.

Bob
 
Old 07-15-2008, 09:16 AM   #12
multios
Member
 
Registered: Mar 2006
Location: Homer, Alaska USA
Distribution: OpenBSD, FreeBSD, Slackware64-current
Posts: 276

Rep: Reputation: 58
Quote:
Originally Posted by BobNutfield View Post
Yes, I did, and I still get a systax errors. However, I can get it to work with fetchmail -u and supply my user name. It then asks for a password, and after entering it it finds the mail. It still won't download it, though, because I get "connection refused" to local host.

The complete .fetchmailrc is:

Bob
This works fine for me when using fetchmail:
poll mail.isp.com proto pop3 user ispaccountuser password xxxxx is localuser here
mda '/usr/bin/procmail -f fetchmail'
 
Old 07-15-2008, 03:36 PM   #13
BobNutfield
Senior Member
 
Registered: Dec 2005
Location: United Kingdom
Distribution: Fedora , Ubuntu, Slackware-Current
Posts: 1,526

Original Poster
Rep: Reputation: 53
Thanks, multios. That seemed to do the trick. I guess the syntax errors were because I was using two lines, I don't know.


Thanks for this post.

Bob
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Help...sending email but not receiving fiona333 Linux - Newbie 9 09-07-2007 08:28 AM
Receiving/sending data from other programs OpsVentus Programming 4 12-18-2005 07:03 AM
eXtremail SMTPD not receiving mail, but sending is OK... ServerStorm Linux - Software 7 05-25-2005 09:11 AM
Sending And Receiving Mail Using Pine Bheki Linux - Newbie 1 01-25-2002 07:09 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 04:18 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration