Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Server
User Name
Linux - Server This forum is for the discussion of Linux Software used in a server related context.


  Search this Thread
Old 01-08-2009, 05:15 AM   #1
Registered: Jul 2005
Location: Manchester (UK)
Distribution: Fedora CentOS
Posts: 132

Rep: Reputation: 18
[solved] Fetchmail with Postfix Downloading Duplicates

Hello all,

Long time since I've posted on here.

Here is my issue at present, I've looked around but can't seem to find a solution or even if there is one.

The problem is I have just setup a server to be an email and webmail server, however the domain it is serving email for has its emails delivered to a POP server and as this server is going to be on a dynamic IP address I'd prefer it to stay that way.

So I've setup fetchmail to download this domains emails and drop them into postfix which is installed on the server, however, until I roll the server out I need to ensure I don't make any mistakes so I'm keeping the emails on the POP server too when fetchmail downloads them, however on next poll of fetchmail it downloads them all again.

I'd prefer to keep the emails on the server so the setup is as follows:

[ POP SERVER ] --fetchmail-- [ MAIL SERVER ]

I just wondered if anyone was aware of a way to keep the emails on the server and also not have them duplicate on the system.

The fetchmail settings are:

options flush

# Check mail every X seconds
set daemon 120
set syslog
set postmaster {admin user}
set bouncemail
poll {POPSERVER} with proto POP3 and options no dns
user {pop_user} there with pass {pop_password} is {mail_user} here options ssl
smtphost localhost

Any assistance would be greatly appreciated.

Last edited by Lee_Ball; 01-09-2009 at 07:39 AM.
Old 01-08-2009, 07:27 AM   #2
LQ Guru
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
How are you keeping them on the server if you aren't using the "-k" option? If you are, you should be able to use "-U" in conjunction with "-k" to only download new messages.

See man fetchmail
Old 01-08-2009, 08:14 AM   #3
Registered: Jul 2005
Location: Manchester (UK)
Distribution: Fedora CentOS
Posts: 132

Original Poster
Rep: Reputation: 18
Its funny you should post this reply as I've just managed to resolve it.

I did indeed need to use the -k option but didn't know about the -u option.

I was having issues getting the keep options to actually KEEP the emails, so as I'd followed a script online to create a service I took a look at the /etc/init.d/fetchmail file and modified how it starts it up by adding the -k option to it.

Here is the section:

# See how we were called.
case "$1" in
if [ -s /etc/fetchmail.conf ]; then
echo -n "Loading fetchmail: "
/usr/bin/fetchmail -k --uidl -f /etc/fetchmail.conf
touch /var/lock/subsys/fetchmail
exit 1

Previously it didn't have the --uidl option.


fetchmail, postfix

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
Fetchmail to postfix gnirtS Linux - Server 1 12-23-2007 12:55 AM
Downloading remote mail to the local router with fetchmail ?? How? sys7em Linux - Software 6 08-30-2005 11:24 AM
Fetchmail, downloading only email I don't already have miknight Linux - Software 1 06-06-2004 05:28 AM
Postfix+fetchmail+DNS? DavidHayes Linux - Networking 4 01-29-2004 02:51 PM
Postfix+fetchmail+DNS? DavidHayes Linux - Networking 2 01-27-2004 08:50 AM > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 06:47 AM.

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