LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 08-22-2004, 05:52 AM   #1
broxtor
Member
 
Registered: Jul 2003
Location: The Netherlands
Distribution: Linux Mint 19.1
Posts: 99

Rep: Reputation: 16
Fetchmail can connect but not retrieve


Hi There,

I have a firewall issue. I'm trying to let fetchmail retrieve my email from my ISP's pop3 server. When I execute fetchmail to this, he can connect ok, but isn't able to retrieve the message.
/usr/bin/fetchmail -v gives the following output.
fetchmail: 6.2.5 querying mail.chello.nl (protocol POP3) at Sun Aug 22 11:19:32 2004: poll started
fetchmail: POP3< +OK InterMail POP3 server ready.
fetchmail: POP3> CAPA
fetchmail: POP3< +OK Capability list follows
fetchmail: POP3< TOP
fetchmail: POP3< USER
fetchmail: POP3< RESP_CODES
fetchmail: POP3< PIPELINING
fetchmail: POP3< EXPIRE 365
fetchmail: POP3< UIDL
fetchmail: POP3< IMPLEMENTATION Openwave Email vM.5.01.06.04 201-253-122-130-104fetchmail: POP3< -20030726
fetchmail: POP3< .
fetchmail: POP3> USER MyUsername
fetchmail: POP3< +OK please send PASS command
fetchmail: POP3> PASS *
fetchmail: POP3< +OK MyUsername is welcome here
fetchmail: POP3> STAT
fetchmail: POP3< +OK 1 941
fetchmail: POP3> LAST
fetchmail: POP3< +OK 0
1 message for MyUsername at mail.ISP.nl (941 octets).
fetchmail: POP3> LIST 1
fetchmail: POP3< +OK 1 941
fetchmail: POP3> TOP 1 99999999
fetchmail: POP3< +OK 941 octets
reading message MyUsername@mail.ISP.nl:1 of 1 (941 octets)
fetchmail: SMTP connect to localhost failed
fetchmail: POP3> QUIT
fetchmail: POP3< Another test message
fetchmail: SMTP transaction error while fetching from mail.ISP.nl
fetchmail: 6.2.5 querying mail.ISP.nl (protocol POP3) at Sun Aug 22 11:22:45 2004: poll completed
fetchmail: Query status=10 (SMTP)
fetchmail: normal termination, status 10

I know this a firewall issue, 'cause when I open up the SMTP and POP3 ports everything works fine. But then I'm stuck with two open ports. In my firewall script I have the following two rules:

iptables -A INPUT -j ACCEPT -p tcp --dport 110 -i eth1
iptables -A INPUT -j ACCEPT -p tcp --dport 25 -i eth1

eth1 is my LAN NIC, eht0 is connected to the internet.
When I remove "-i eth1" fom both lines I end up with two open ports. (Checked on grc.com)
What should I put in my firewall script in order to make this work and to keep my ports closed? (Preferably stealth)
 
Old 08-22-2004, 06:11 AM   #2
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 79
If you are trying to deliver to your local server then just use the loopback address for fetchmail to deliver to "127.0.0.1", then open up the loopback on the firewall:
iptables -A INPUT -j ACCEPT -p tcp --dport 25 -i lo
 
Old 08-22-2004, 02:29 PM   #3
broxtor
Member
 
Registered: Jul 2003
Location: The Netherlands
Distribution: Linux Mint 19.1
Posts: 99

Original Poster
Rep: Reputation: 16
Thanks for your response. Please correct me if I'm wrong, but if I could get fetchmail to deliver to localhost the message still has to go through the firewall, doesn't it? So I don't understand how that would help me.

What I did now is that I used fetchmails -m option, which makes it possible to deliver the messages directly to procmail. This way, there's no need anymore for open ports. The only problem I got in return (as usual is the case lately) is that I'm no longer able to retrieve the messages from the server to my workstation. I use mozilla mail for this and when I try to check if there are any messages, I get the following error:
"Sending of password did not succeed. Mail server 192.168.1.1 responded: Unable to process From lines (envelopes), change recognition modes or check for corrupte mail drop."

I haven't got a clue what that means. Does anybody else?
 
Old 08-22-2004, 07:42 PM   #4
seabass55
Member
 
Registered: Jan 2003
Location: 127.0.0.1
Distribution: Fedora&Gentoo
Posts: 207

Rep: Reputation: 30
I use this in my .fetchmailrc

mda "/usr/bin/procmail -d %T"

All mail is delivered to /var/spool/mail/username and I access it from there with either pine or othermachines on the network via dovecot (imap).
 
Old 08-23-2004, 01:47 PM   #5
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 79
Quote:
Originally posted by broxtor
Thanks for your response. Please correct me if I'm wrong, but if I could get fetchmail to deliver to localhost the message still has to go through the firewall, doesn't it? So I don't understand how that would help me.
Yes but you would only need to open the port on the loopback device which would stop it being available from any other machines.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
how to retrieve a sent e-mail? kpachopoulos General 3 03-27-2006 03:26 PM
Can't retrieve email Bond007 Linux - Networking 14 11-10-2005 03:26 PM
How do I retrieve the link state? bb002 Linux - Networking 1 10-31-2005 02:49 AM
How to retrieve bytes sent AzidStar Linux - Networking 5 03-01-2005 04:25 AM
How to retrieve MX record... karthikavk Linux - Newbie 1 12-06-2001 08:51 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 10:29 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