Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
mailfiltering - for end server, not gateway [SOLVED]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
s3ntinel
n00b
n00b


Joined: 04 Apr 2005
Posts: 64

PostPosted: Mon Nov 28, 2005 11:16 pm    Post subject: mailfiltering - for end server, not gateway [SOLVED] Reply with quote

Having a bit of trouble with the gentoo mailfiltering guide. As I only have one mail server, I want my mails to end up on it, not relayed on elsewhere, however following the guide, and the virtual mail guide has ended up with a borked system. (it worked without the filtering!). A previous attempt before a hdd failure worked too (must learn to back up ;-).

How do I configure the master.cf to deliver the mails locally after postfix and amavis processing? or do I need to reconfigure the transport maps referenced by main.cf?
The log below shows a 5 second timeout - but where is it going?

I can telnet to ports 25, 10025, 10024 on localhost...

mail.log gives
Code:

Nov 28 23:02:02 localhost postfix/smtp[32723]: 8DE37AE5B1: to=<me@my.domain>, relay=127.0.0.1[127.0.0.1], delay=30, status=sent (250 2.6.0 Ok, id=13133-01, from MTA([127.0.0.1]:10025): 250 Ok: queued as A4EF1AF78A)
Nov 28 23:02:02 localhost postfix/smtpd[32727]: match_hostaddr: 127.0.0.1 ~? 127.0.0.0/8
Nov 28 23:02:02 localhost postfix/qmgr[31408]: 8DE37AE5B1: removed
Nov 28 23:02:02 localhost postfix/smtpd[32727]: disconnect from unknown[127.0.0.1]
Nov 28 23:02:02 localhost postfix/smtpd[32727]: master_notify: status 1
Nov 28 23:02:02 localhost postfix/smtpd[32727]: connection closed
Nov 28 23:02:07 localhost postfix/smtp[32728]: connect to my.domain[ext.ern.al.ip]: Connection refused (port 25)
Nov 28 23:02:07 localhost postfix/smtp[32728]: A4EF1AF78A: to=<me@my.domain>, relay=none, delay=9, status=deferred (connect to my.domain[ext.ern.al.ip]: Connection refused)


main.cf
Note: I had been using mysql for users, aliases, etc, and tried the same for transports, but created hash as desperate attempt as per the guide!
Code:


smtpd_sasl_auth_enable = yes
smtpd_sasl2_auth_enable = yes
smtpd_sasl_security_options = noanonymous
broken_sasl_auth_clients = yes
smtpd_sasl_local_domain =

smtpd_helo_required = yes

smtpd_recipient_restrictions =
        permit_sasl_authenticated,
        permit_mynetworks,
        reject_unauth_destination,
        reject_invalid_hostname,
        reject_non_fqdn_hostname,
        reject_non_fqdn_sender,
        reject_non_fqdn_recipient,
        reject_unknown_sender_domain,
        reject_unknown_recipient_domain,
        permit

smtpd_data_restrictions =
        reject_unauth_pipelining,
        permit
smtpd_use_tls = yes

smtpd_tls_key_file = /etc/postfix/newreq.pem
smtpd_tls_cert_file = /etc/postfix/newcert.pem
smtpd_tls_CAfile = /etc/postfix/cacert.pem
smtpd_tls_loglevel = 3
smtpd_tls_received_header = yes
smtpd_tls_session_cache_timeout = 3600s
tls_random_source = dev:/dev/urandom

alias_maps = mysql:/etc/postfix/mysql-aliases.cf
relocated_maps = mysql:/etc/postfix/mysql-relocated.cf
#transport_maps = mysql:/etc/postfix/mysql-transport.cf
transport_maps = hash:/etc/postfix/transport
local_transport = local
local_recipient_maps = $alias_maps unix:passwd.byname
biff = no
empty_address_recipient = MAILER-DAEMON
queue_minfree = 120000000

content_filter = smtp-amavis:[127.0.0.1]:10024

relay_domains = $transport_maps



master.cf
Code:

smtp      inet  n       -       n       -       -       smtpd -v
pickup    fifo  n       -       n       60      1       pickup
cleanup   unix  n       -       n       -       0       cleanup
qmgr      fifo  n       -       n       300     1       qmgr
tlsmgr    unix  -       -       n       1000?   1       tlsmgr
rewrite   unix  -       -       n       -       -       trivial-rewrite
bounce    unix  -       -       n       -       0       bounce
defer     unix  -       -       n       -       0       bounce
trace     unix  -       -       n       -       0       bounce
verify    unix  -       -       n       -       1       verify
flush     unix  n       -       n       1000?   0       flush
proxymap  unix  -       -       n       -       -       proxymap
smtp      unix  -       -       n       -       -       smtp
relay     unix  -       -       n       -       -       smtp

smtp-amavis unix -      -       n       -       2       smtp
    -o smtp_data_done_timeout=1200
 #  -o smtp_send_xforward_command=yes

127.0.0.1:10025 inet    n       -       y       -       -       smtpd -v
    -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,reject
    -o mynetworks=127.0.0.0/8
    -o strict_rfc821_envelopes=yes


amavisd.conf
(Exactly as per guide)
Code:

$forward_method = 'smtp:[127.0.0.1]:10025';


Any ideas? Many thanks.
Just annoying, as this was all working before, and a new deluge of virus/spam seems to be hitting right now!


Last edited by s3ntinel on Wed Dec 07, 2005 2:36 pm; edited 1 time in total
Back to top
View user's profile Send private message
s3ntinel
n00b
n00b


Joined: 04 Apr 2005
Posts: 64

PostPosted: Wed Dec 07, 2005 2:35 pm    Post subject: Reply with quote

Answer came from http://www.securitysage.com/antispam/amavis.html

using smptd_proxy_filter, instead of content_filter in main.cf

and related changes to master.cf

then I was able to follow the rest of the mailfiltering guide and install procmail, and configure amavis
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum