PDA

View Full Version : postfix open remailer


gabrix
21st June 2008, 22:44
Having a list of servers i want to allow to relay mail through my server how do i better configure postfix ????

falko
22nd June 2008, 15:00
Add the IP addresses to mynetworks in /etc/postfix/main.cf, e.g.
mynetworks = 127.0.0.0/8, 1.2.3.4/32

gabrix
15th July 2008, 10:53
I have a list of clients i don't want them to go through gmail still using the local smtp , which uses gmail to see mail delivered to the final recipient because mine is a blacklisted dial up account and i have my system clients i want to use local smtp and so gmail . To do this i have commented the relayhost directive pointing to [smtp.gmail.com] and insted i'm using

smtp_sender_dependent_authentication = yes
sender_dependent_relayhost_maps = hash:/etc/postfix/sender_relayhost

To say postfix to use a different smtp relayhost for senders.
I have also added:

relay_domains = hash:/etc/postfix/relay_domains
transport_maps = hash:/etc/postfix/transport

With $relay_domains placed also in $mydestination
I want to post you also my actual postconf -n:

alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
append_dot_mydomain = no
biff = no
broken_sasl_auth_clients = yes
command_directory = /usr/sbin
config_directory = /etc/postfix
daemon_directory = /usr/lib/postfix
data_directory = /var/lib/postfix
debug_peer_level = 3
debug_peer_list = 127.0.0.1, 10.0.0.0/24
delay_warning_time = 8h
disable_dns_lookups = yes
html_directory = no
inet_interfaces = all
mailbox_command =
mailbox_size_limit = 0
mailq_path = /usr/bin/mailq
manpage_directory = /usr/local/man
mydestination = $relay_domains, mail.$mydomain ,pop.$mydomain , smtp.$mydomain,www.$mydomain,ns2.$mydomain,ns1.$my domain ,argo.$mydomain, ftp.$mydomain, localhost.gabrix.ath.cx, localhost.localdomain , localhost
mydomain = gabrix.ath.cx
myhostname = mail.$mydomain
mynetworks = 127.0.0.0/8 , 10.0.0.0/24
newaliases_path = /usr/bin/newaliases
queue_directory = /var/spool/postfix
recipient_delimiter = +
sender_dependent_relayhost_maps = hash:/etc/postfix/sender_relayhost
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_sasl_security_options =
smtp_sasl_tls_security_options = $smtp_sasl_security_options
smtp_sender_dependent_authentication = yes
smtp_tls_CAfile = /etc/postfix/ssl/cacert.pem
smtp_tls_cert_file = /etc/postfix/ssl/smtpcert.pem
smtp_tls_key_file = /etc/postfix/ssl/smtpkey.pem
smtp_tls_loglevel = 2
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtp_use_tls = yes
smtpd_banner = $myhostname ESMTP $mail_name (GNULinux/FreeSystem)
smtpd_enforce_tls = no
smtpd_recipient_restrictions = permit_sasl_authenticated, permit_mynetworks, check_relay_domains, permit
smtpd_sasl_auth_enable = yes
smtpd_sasl_authenticated_header = yes
smtpd_sasl_local_domain = $mydomain
smtpd_sasl_path = private/auth
smtpd_sasl_type = dovecot
smtpd_tls_CAfile = /etc/postfix/ssl/cacert.pem
smtpd_tls_CApath = /etc/postfix/ssl/
smtpd_tls_ask_ccert = no
smtpd_tls_auth_only = no
smtpd_tls_cert_file = /etc/postfix/ssl/smtpcert.pem
smtpd_tls_key_file = /etc/postfix/ssl/smtpkey.pem
smtpd_tls_received_header = yes
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtpd_tls_wrappermode = yes
smtpd_use_tls = yes
soft_bounce = yes
tls_random_exchange_name = ${data_directory}/prng_exch
tls_random_source = dev:/dev/urandom
transport_maps = hash:/etc/postfix/transport

To have a better general understanding of my plan .
I have split senders also at bind9 dns level making a subdomain of mydomain which i don't want mail to be sent by my local smtp through smtp.gmail.com.
Logs look like postfix is using smtp.gmail.com succesfully , for localusers .

Jul 15 10:13:57 mail postfix/smtp[4079]: 6F6571079CA: to=<sickuser@gmail.com>, relay=smtp.gmail.com[66.249.93.111]:25, delay=3.4, delays=0.07/0.03/1/2.3, dsn=2.0.0, status=sent (250 2.0.0 OK 1216109600 z40sm2181928ugc.55)
Jul 15 10:13:57 mail postfix/qmgr[3749]: 6F6571079CA: removed

But i don't see still mail delivered to Maildir for pop , where i have dovecot , it might be also a bind9 issue , my subdomain is also second MX .