Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem bypassing content filter 1

Status
Not open for further replies.

fugtruck

MIS
Jul 1, 2009
62
0
0
US
In my Postfix + Amavisd-new + Spamassassin setup, I am trying to bypass the content filtering for specific senders. Messages that match my header checks are producing an error in the maillog, "warning: connect to transport 127.0.0.1: No such file or directory" and the message just sits in the queue. Messages that don't match the header checks process normally. Any suggestions on what I've done wrong?

In my main.cf, I have the following:
[red]content_filter=amavisfeed:[127.0.0.1]:10024
header_checks=pcre:/etc/postfix/whitelist
[/red]

Inside my whitelist file, I have
[red] /sender@somedomain/ FILTER 127.0.0.1:10025
[/red]


Inside my master.cf, I have the following:
[red]smtp inet n - n - - smtpd
-o cleanup_service_name=pre-cleanup

pre-cleanup unix n - n - 0 cleanup
-o virtual_alisas_maps=
pickup fifo n - n 60 1 pickup
-o cleanup_service_name=pre-cleanup
cleanup unix n - n - 0 cleanup
-o mime_header_checks=
-o nested_header_checks=
-o body_checks=
-o header_checks=
.
.
.
amavisfeed unix - - n - 6 lmtp
-o lmtp_data_done_timeout=1200
-o lmtp_send_xforward_command=yes
-o disable_dns_lookups=yes
-o max_use=20

127.0.0.1:10025 inet n - n - - smtpd
-o content_filter=
-o smtpd_delay_reject=no
-o smtpd_client_restrictions=permit_mynetworks,reject
-o smtpd_helo_restrictions=
-o smtpd_sender_restrictions=
-o smtpd_recipient_restrictions=permit_mynetworks,reject
-o smtpd_data_restrictions=reject_unauth_pipelining
-o smtpd_end_of_data_restrictions=
-o smtpd_restriction_classes=
-o mynetworks=127.0.0.0/8
-o smtpd_error_sleep_time=0
-o smtpd_soft_error_limit=1001
-o smtpd_hard_error_limit=1000
-o smtpd_client_connection_count_limit=0
-o smtpd_client_connection_rate_limit=0
-o receive_override_options=no_header_body_checks,no_unknown_recipient_checks,no_milters
-o local_header_rewrite_clients=
[/red]
 
This is a good question and I don't have any good answers for you off the top of my head. One thing to try would be to flush the mail queue as you may have some stuff in there that was subject to the old filter results and it may be 'stuck'.

When I searched for your error message I found this document: that might be of some help. I scanned through it without reading it. It was suggested as a really good how-to regarding mail filtering for someone else that was getting the same error message, which appears to be caused by mail entering an infinite loop. The document lists examples, both complex and simple and seems to show how to bypass the filtering in some cases, which sounds like what you are after.
 
Yea, I've been reading that document over and over but just can't pinpoint the problem. The thing that frustrates me in that document is that they give example services for master.cf such as
[red]1.2.3.5:smtp inet n - n - - smtpd [/red]

but they give example filter syntax like
[red]/whatever/ FILTER foo:bar[/red]

which leaves me guessing as to what foo and bar correspond to. So what would the transport:destination be for the service
[red]127.0.0.1:10025 inet n - n - - smtpd[/red]?

Because having a transport:destination of [red]127.0.0.1:10025[/red] sure doesn't work.
 
ok, I have it solved. In the whitelist file, I should have had
[red]/whatever/ FILTER smtp:[127.0.0.1]:10025[/red]
 
It appears that the cause is the syntax of having smtp:[127.0.0.1]:10025. I am curious, did you find a document or something that explains this cryptic syntax? If so, would you please share it or a link to it?
 
No, I couldn't find any documentation. I had to join the amavisd-new mailing list and someone suggested that. I normally go to mailing lists as a last resort because I get tired of hearing "Did read the f###ing manual before bothering us?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top