Latest LQ Deal: Linux Power User Bundle
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This 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.


  Search this Thread
Old 12-19-2003, 02:24 AM   #1
Registered: May 2001
Distribution: Debian, Foresight
Posts: 72

Rep: Reputation: 15
Postfix configuration


I have been looking but not been able to find an easy way to set up Postfix to collect mail from my 2 domains.

Today I collect mail from and (pop3) using Kmail and Evolution.

I have set up an old pc with debian for the purpose. My network is like this.

ADSL connection with router

Oldpc : (mail, ftp and web server)

Clients :

jan1 :
jan2 :

Every 2nd weekend my son wants to connect his windows pc and collect mail too.

Does anyone have an easy way to set this up

Old 12-19-2003, 03:20 AM   #2
LQ Newbie
Registered: Jan 2003
Location: Rhode Island
Distribution: Debian, Gentoo
Posts: 23

Rep: Reputation: 15
I do this same thing:

My Linux workstation pulls down the POP3 mail using fetchmail, then passes it to Postfix for delivery. I have some web-based POP3 mail client setup that reads the mailboxes in /var/mail so my wife can access her mail through a browser (that way I don't have to worry about Outlook exploits or any of that junk)

My complete setup is like this, which is also Debian:

fetchmail runs as a daemon, pulls down mail from 5 different POP3 mailboxes every 5 minutes. The mail then gets sent to Postfix, on the way it gets scanned by Amavis/ClamAV ... then Postfix checks each users home directory for a .procmail file. My .procmail file has several recipes that filter the mail, one of which is SpamAssassin. After that my mail gets dumped to /home/davis/Mail/inbox (in maildir format) and my wife's gets dumped to /var/mail/her_mailbox (in mbox format)

I did this setup over several months, playing with it here and there. It works great now with absolutely no problems.

If you need me to post config files for this setup just let me know.
Old 12-19-2003, 03:33 AM   #3
Registered: May 2001
Distribution: Debian, Foresight
Posts: 72

Original Poster
Rep: Reputation: 15

<<If you need me to post config files for this setup just let me know.

That would be great, thanks. I find it hard to setup and I really have been browsing for a long time looking for an easy way to set this up.
Old 12-19-2003, 10:21 AM   #4
LQ Newbie
Registered: Jan 2003
Location: Rhode Island
Distribution: Debian, Gentoo
Posts: 23

Rep: Reputation: 15
Here is something I found that helped me set my system up:

1 davis@linux:[~]: cat howto/mail_complete_setup.txt

No guarantees this will work for you, but these are the notes I wrote up
for myself when I set up my mail server with amavis and clam. Amavis
stuff is towards the bottom. Note also that I think newer versions of Amavis
use ports 10025 and 10026, not the ones I have shown below. HTH. Kevin


A work in progress on how to set up a SOHO email server that filters for spam
and viruses. The base Linux installation is on an i386 PIII based machine
using Debian.


Clam Antivirus

Postfix Configuration

# Excerpts from /etc/

command_directory = /usr/sbin
daemon_directory = /usr/lib/postfix
program_directory = /usr/lib/postfix

smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)
setgid_group = postdrop
biff = no

# appending .domain is the MUA's job.
append_dot_mydomain = no
myhostname = sumida.hawkwood
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
# myorigin = /etc/mailname
myorigin = $myhostname
mydestination =, sumida.hawkwood, localhost.hawkwood, localhost
relayhost =
mynetworks =
mailbox_command = procmail -a "$EXTENSION"
mailbox_size_limit = 0
recipient_delimiter = +
content_filter = smtp-amavis:[]:10024
# disable_dns_lookups=yes

# Excerpts from /etc/
# entries needed for amavis virus scanning
smtp-amavis unix - - n - 2 smtp -o smtp_data_done_timeout=1200 inet n - n - - smtpd -o content_filter=

That's really all you need to change for Postfix. If you are going to
virusscan using Amavis, have Amavis start "before" Postfix in the startup
scripts. In Debian, the startup scripts are in /etc/init.d/. Set the order
for starting these scripts by adding/moving the symbolic links in
/etc/rc(1-3).d. Also add a kill symbolic link in /etc/rc6.d/ for any start
scripts you put in rc1.d through rc3.d.

Fetchmail Configuration

#Excerpts from /etc/fetchmailrc

# /etc/fetchmailrc for system-wide daemon mode
# This file must be chmod 0600, owner fetchmail

# Daemon configuration
# These two are set in /etc/default/fetchmail
set daemon 300 # Pool every 5 minutes
set syslog # log through syslog facility

set no bouncemail # avoid loss on 4xx errors
# on the other hand, 5xx errors get
# more dangerous...
set postmaster kosuke

# Defaults =====================
# Set antispam to -1, since it is far safer to use that together with
# no bouncemail. -1 disables antispam, so nothing should get dropped
antispam -1
batchlimit 100

# Uncomment this line if, after fetching from POP3 servers, you want the
# mail to go directly to procmail for delivery to appropriate folders.
# However, if you want the mail to go to something like Amavis for virus
# processing, then you need to insert the mail into the SMTP server process
# on this machine. You do that by simply keeping the following line
# commented out.
# mda '/usr/bin/procmail -d %T' ## -d drops it in /var/mail/mailuser

poll with protocol pop3
user pass XXXXX is kosuke;

poll with protocol pop3
user rtc87 pass XXXXX is ryan;

Procmail Configuration

Set up recipes in /etc/procmail/rcdelivery

Excerpt from /etc/procmailrc

PMDIR=/etc/procmail/ # directory for storing procmail log and rc files


FORMAIL=/usr/bin/formail # useful for autoreply recipes

Spamassassin Configuration

straightforward configuration in /etc/spamassassin/

Amavis Configuration

Presently I'm using Amavis-Postfix from the Debian apt archives. There are
several other versions of Amavis, so settings might be different.

In /etc/amavis.conf, make the following changes/additions:

1. # Clam Antivirus
$clamscan = "/usr/bin/clamscan";

2. # yes - syslog, no - file logging
$DO_SYSLOG = "no";
# personal preference. if no, you'll find the logs in /var/lib/amavis,
# unless you change the log path directory in /etc/amavis.conf (see next
# item in the list)

3. # Directory to put log entries (if not using syslog)
$LOGDIR = "/var/lib/amavis";
$LOGFILE = "amavis.log";

4. $log_level = 1; # level 4 gives more details

5. # Notify admin/sender/recipient?
$warnadmin = "yes";
$warnsender = "no"; # personal preference here. most viruses seem
$warnrecip = "no"; # to come from spammers anyway

6. # who notification reports are sent from
$mailfrom = 'postmaster';
# your MUA or Postfix will append the .domain stuff

7. $relayhost = ""; # delivery to this IP unless $relayhost_is_client
$relayhost_port = "10025"; # (same port for all MTAs)

# (used when MTA is configured to pass mail to amavisd directly via SMTP)
$inet_socket_port = "10024"; # accept SMTP on this local TCP port
# This version of Amavis uses 10024 to read in mail to be scanned, and
# 10025 to put the mail back into the SMTP delivery process with an Amavis
# scanned tag in the headers so that it doesn't return again. Other
# versions of Amavis may use 10025/10026. Whatever you use, just make
# sure that you make similar changes on the Postfix end in and

9. $recipient_delimiter = '+';
# You'll see this in /etc/postfix/ too.

All other settings can be left at defaults.

To check and see if Amavis is up and listening for incoming mail to be
scanned, do the following:

--> $ telnet 10024
Connected to
Escape character is '^]'.

220 localhost amavisd

--> quit

221 Bye
Connection closed by foreign host.


Well there it is .... I hope that helps. It's what I used to set mine up.


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
Postfix configuration help. mdpolaris Linux - Software 7 10-06-2006 03:31 AM
postfix configuration jkmartha Linux - Newbie 1 04-22-2005 03:29 AM
postfix configuration argh2005 Linux - Software 3 08-31-2003 04:33 PM
postfix configuration argh2005 Linux - Networking 0 08-30-2003 11:35 PM
Postfix configuration EdwinNameless Linux - Software 0 07-18-2003 12:55 PM > Forums > Linux Forums > Linux - Software

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