View Full Version : email gateway
Cajun Mike 02-25-2007, 10:39 AM getting ready to start one, i already have fetchmail, dovecot, postfix, procmail,
i am going to put my maildir's on another HD on my server. Well here i goes both feet in :_rofl:
Cajun Mike 02-27-2007, 12:08 PM Well I got fetchmail working, question i have multiple emails one of those is cajunmike@cox.net and so forth, and i put those multiple emails in fetchmail. now for my wifes' email do I have to make her a user on the server?
Postfix the same i don't have a domain just pop and smtp from cox???
I AM A NOOB, so take it easy
eaux-yeah 02-27-2007, 01:02 PM Mike, are you running this on a dynamic IP address?
FYI, if you run an SMTP server on a non-static address, you WILL be blacklisted against most RBL databases. It gets real fun if you add the RBL information on the SMTP server on the dynamic address. You blacklist yourself, ummm yummy fun!
I would setup Postfix to just server as SMTP for you 'Internal Network' ONLY.
In /etc/postfix/main.cf, make sure that only internal network are listed.
For you, since I know your internal network address:
mynetworks = 192.168.1.0/25, 127.0.0.0/8
Fetchmail (http://fetchmail.berlios.de) will slurp your mail form ISPs (FetchYahoo (http://fetchyahoo.sourceforge.net) for Yahoo accounts), then Postfix will take over and process it (spam/virus scan, then send to individual mail box (maildir?). Your clients will then get the mail from your server via Dovecot (or whatever imap/pop) server you wish. I recommend IMAP in this case, leave it all on the server. I also recommend Procmail (http://www.procmail.org).
Also, if you remove all you mail from the ISPs and keep it all on your server only .............................. BACKUPS, BACKUPS, BACKUPS, did I mention B A C K U P S ????? I can't stress that enough. I have seen the face of the "I lost everything and do not have a backup" administrator way too many times. I hurts me to see that when it is so easy to avoid.
Cajun Mike 02-27-2007, 01:40 PM Ok for backups, I have a DVD-RW that is also a DL i could format an rw and have g4l backoff to it???? I would love if Ghost 4 Linux would have an option to do an image backup to dvd that way in case of a crash just slip in dvd and restore. BTW Nero backups are written to dvd etc but image is restored via linux!
Severum 02-27-2007, 02:00 PM Another easy email backup solution is adding a forward entry to a gmail account. Uses minimal resouces unless you get huge attachments and adds another layer of loss protection.
You probably already have it, but SpamAssassin (http://spamassassin.apache.org/) is useful in combination with RBLs.
Cajun Mike 02-28-2007, 09:54 AM fetchmail check
postfix check no errors -tell me if this looks kosher and if yes what next!!!!!
inet_interfaces = all
myhostname = server1
mydestination = server1
mynetworks = 192.168.1.0/25, 127.0.0.0/8
postfix: dict_eval: const mail
postfix: dict_eval: const ipv4
postfix: name_mask: ipv4
postfix: dict_eval: const server1
postfix: dict_eval: const localdomain
postfix: dict_eval: const Postfix
postfix: dict_eval: const postfix
postfix: dict_eval: const postfix
postfix: dict_eval: const postdrop
postfix: dict_eval: const server1
postfix: dict_eval: expand $myhostname -> server1
postfix: dict_eval: const
postfix: dict_eval: const /usr/lib/postfix
postfix: dict_eval: const /usr/sbin
postfix: dict_eval: const /var/spool/postfix
postfix: dict_eval: const pid
postfix: dict_eval: const all
postfix: dict_eval: const
postfix: dict_eval: const double-bounce
postfix: dict_eval: const nobody
postfix: dict_eval: const hash:/etc/aliases
postfix: dict_eval: const 200600825
postfix: dict_eval: const 2.3.3
postfix: dict_eval: const hash
postfix: dict_eval: const deferred, defer
postfix: dict_eval: const
postfix: dict_eval: expand $mydestination -> server1
postfix: dict_eval: expand $relay_domains -> server1
postfix: dict_eval: const TZ MAIL_CONFIG LANG
postfix: dict_eval: const MAIL_CONFIG MAIL_DEBUG MAIL_LOGTAG TZ XAUTHORITY DISPLAY LANG=C
postfix: dict_eval: const subnet
postfix: dict_eval: const
postfix: dict_eval: const +=
postfix: dict_eval: const -=+
postfix: dict_eval: const debug_peer_list,fast_flush_domains,mynetworks,perm it_mx_backup_networks,qmqpd_authorized_clients,rel ay_domains,smtpd_access_maps
postfix: dict_eval: const
postfix: dict_eval: const bounce
postfix: dict_eval: const cleanup
postfix: dict_eval: const defer
postfix: dict_eval: const pickup
postfix: dict_eval: const qmgr
postfix: dict_eval: const rewrite
postfix: dict_eval: const showq
postfix: dict_eval: const error
postfix: dict_eval: const flush
postfix: dict_eval: const verify
postfix: dict_eval: const trace
postfix: dict_eval: const
postfix: dict_eval: const 100s
postfix: dict_eval: const 100s
postfix: dict_eval: const 100s
postfix: dict_eval: const 100s
postfix: dict_eval: const 3600s
postfix: dict_eval: const 3600s
postfix: dict_eval: const 100s
postfix: dict_eval: const 100s
postfix: dict_eval: const 1000s
postfix: dict_eval: const 1000s
postfix: dict_eval: const 10s
postfix: dict_eval: const 10s
postfix: dict_eval: const 1s
postfix: dict_eval: const 1s
postfix: dict_eval: const 1s
postfix: dict_eval: const 1s
postfix: dict_eval: const 500s
postfix: dict_eval: const 500s
postfix: dict_eval: const 18000s
postfix: dict_eval: const 18000s
postfix: dict_eval: const 1s
postfix: dict_eval: const 1s
postfix: dict_eval: const 192.168.1.0/25, 127.0.0.0/8
postfix: inet_addr_local: configured 2 IPv4 addresses
postfix: dict_eval: const /usr/sbin/sendmail
postfix: dict_eval: const /usr/bin/mailq
postfix: dict_eval: const /usr/bin/newaliases
postfix: dict_eval: const /usr/share/man
postfix: dict_eval: const /usr/share/doc/postfix/examples
postfix: dict_eval: const /usr/share/doc/postfix
postfix: dict_eval: const no
eaux-yeah 02-28-2007, 01:09 PM inet_interfaces = all
myhostname = server1
mydestination = server1
mynetworks = 192.168.1.0/25, 127.0.0.0/8
Is that your entire main.cf file??
EEESH! :covermyeyes:
BTW, the 192.168.1.0/25 is what I gave you from MY network.
Your is 192.168.1.0/24. Change that.
Actually, here is some information in my mail server that you can add to yours (disclaimer: mine runs on OpenBSD, so you mileage may vary):
myhostname = hostname_of_your_server
mydomain = your_domain (not needed for intranet setup)
myorigin = $myhostname
inet_interfaces = all
mydestination = $myhostname, localhost.$mydomain, $mydomain
unknown_local_recipient_reject_code = 550
mynetworks = 127.0.0.0/8, your_network_address
relay_domains = $mydestination
alias_maps = hash:/etc/postfix/aliases
alias_database = hash:/etc/postfix/aliases
home_mailbox = Maildir/
message_size_limit = 0
mailbox_size_limit = 0
recipient_delimiter = +
virtual_maps = hash:/etc/postfix/virtual
append_dot_mydomain = no
disable_vrfy_command = yes
default_process_limit = 10
smtpd_error_sleep_time = 30
strict_rfc821_envelopes = yes
smtpd_helo_required = yes
header_checks = regexp:/etc/postfix/maps/header_checks
body_checks = regexp:/etc/postfix/maps/body_checks
mime_header_checks = regexp:/etc/postfix/maps/mime_header_checks
unknown_address_reject_code = 550
unknown_client_reject_code = 550
unknown_hostname_reject_code = 550
# Let's control everything
smtpd_client_restrictions =
check_client_access hash:/etc/postfix/access,
permit
smtpd_recipient_restrictions =
permit_sasl_authenticated,
permit_mynetworks,
reject_unauth_destination,
reject_non_fqdn_hostname,
reject_unknown_hostname,
reject_invalid_hostname,
reject_non_fqdn_sender,
reject_non_fqdn_recipient,
reject_unknown_sender_domain,
reject_unknown_recipient_domain,
reject_unauth_pipelining,
reject_rbl_client dnsbl.njabl.org,
reject_rbl_client cbl.abuseat.org,
permit
smtpd_data_restrictions =
reject_unauth_pipelining,
permit
## Sasl2
broken_sasl_auth_clients = yes
smtpd_sasl_auth_enable = yes
smtpd_sasl_local_domain = $myhostname
smtpd_sasl_security_options = noanonymous
smtp_use_tls = yes
smtpd_use_tls = yes
smtp_tls_note_starttls_offer = yes
smtpd_tls_key_file = /etc/ssl/private/postfix.pem
smtpd_tls_cert_file = $smtpd_tls_key_file
smtpd_tls_cert_file = $smtpd_tls_key_file
smtpd_tls_CAfile = $smtpd_tls_key_file
smtpd_tls_loglevel = 1
smtpd_tls_received_header = yes
smtpd_tls_session_cache_timeout = 3600s
tls_random_source = dev:/dev/urandom
content_filter = smtp-amavis:[127.0.0.1]:10024
I left big portions dealing with directory paths out of this, they will not be the same on yours. You can copy those from one of the sample main.cf files.
You will have to run some commands to enable some of the things I have. IE., newaliases, postmap, etc.
This should also be added to the end of the master.cf file for Amavisd-new. YES, USE AMAVISD-NEW. It controls Spamassassin and/or DSpam, and Clamav very well.
#
# Amavisd
#
smtp-amavis unix - - n - 2 smtp
-o smtp_data_done_timeout=1200
-o disable_dns_lookups=yes
127.0.0.1:10025 inet n - n - - smtpd
-o content_filter=
-o local_recipient_maps=
-o relay_recipient_maps=
-o smtpd_restriction_classes=
-o smtpd_client_restrictions=
-o smtpd_helo_restrictions=
-o smtpd_sender_restrictions=
-o smtpd_recipient_restrictions=permit_mynetworks,rej ect
-o mynetworks=127.0.0.0/8
That should keep you busy for a while. As I said to you last night, I would highly recommend setting up an DNS server for your internal network before you begin this, it will be more pleasant in the long run. Use MaraDNS (http://www.maradns.org), it's in your apt sources and it's very easy to set up and uses little overhead.
Cajun Mike 02-28-2007, 05:26 PM http://www.howtoforge.com/postfix_relaying_through_another_mailserver
eaux-yeah 02-28-2007, 05:38 PM Give that boy a cookie!
Buickman 03-24-2007, 10:41 AM I've been curious. How has this worked out for you? And what exactly does it do?
Cajun Mike 03-24-2007, 12:41 PM Hey Buick it's still work in progress if you notice i post about postfix and others.
I plan to put all the info up for everyone to use, As I think this is a really good way to go
|
|