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. |
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.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
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.
|
|
12-19-2003, 01:24 AM
|
#1
|
Member
Registered: May 2001
Distribution: Debian, Foresight
Posts: 72
Rep:
|
Postfix configuration
Hi
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 mydomain1.dk and mydomain2.dk (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 : 192.168.1.101 (mail, ftp and web server)
Clients :
jan1 : 192.168.1.102
jan2 : 192.168.1.103
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
Thanks
|
|
|
12-19-2003, 02:20 AM
|
#2
|
LQ Newbie
Registered: Jan 2003
Location: Rhode Island
Distribution: Debian, Gentoo
Posts: 23
Rep:
|
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.
|
|
|
12-19-2003, 02:33 AM
|
#3
|
Member
Registered: May 2001
Distribution: Debian, Foresight
Posts: 72
Original Poster
Rep:
|
Hi
<<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.
|
|
|
12-19-2003, 09:21 AM
|
#4
|
LQ Newbie
Registered: Jan 2003
Location: Rhode Island
Distribution: Debian, Gentoo
Posts: 23
Rep:
|
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.
***************************
Components:
***************************
Postfix
Fetchmail
Procmail
Spamassassin
Amavis
Clam Antivirus
Qpopper
***************************
Postfix Configuration
***************************
# Excerpts from /etc/main.cf
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 = rustybear.com, sumida.hawkwood, localhost.hawkwood, localhost
relayhost = mail.rustybear.com
mynetworks = 127.0.0.0/8
mailbox_command = procmail -a "$EXTENSION"
mailbox_size_limit = 0
recipient_delimiter = +
content_filter = smtp-amavis:[127.0.0.1]:10024
# disable_dns_lookups=yes
# Excerpts from /etc/master.cf
# entries needed for amavis virus scanning
smtp-amavis unix - - n - 2 smtp -o smtp_data_done_timeout=1200
127.0.0.1:10025 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
defaults:
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 justhogs.org with protocol pop3
user kevin%justhogs.org pass XXXXX is kosuke;
poll mail-hub.optonline.net 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
LOGFILE=$PMDIR/log
INCLUDERC=$PMDIR/rcdelivery
FORMAIL=/usr/bin/formail # useful for autoreply recipes
***************************
Spamassassin Configuration
***************************
straightforward configuration in /etc/spamassassin/local.cf
***************************
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 = "127.0.0.1"; # delivery to this IP unless $relayhost_is_client
$relayhost_port = "10025"; # (same port for all MTAs)
8. # SMTP-INPUT SETTINGS
# (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 main.cf and
# master.cf.
9. $recipient_delimiter = '+';
# You'll see this in /etc/postfix/main.cf 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 127.0.0.1 10024
Trying 127.0.0.1...
Connected to 127.0.0.1.
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.
|
|
|
All times are GMT -5. The time now is 05:11 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|