Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > ISPConfig 3 > General

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 24th August 2009, 15:43
MrM MrM is offline
Member
 
Join Date: Oct 2008
Location: Ljubljana, Slovenia
Posts: 58
Thanks: 6
Thanked 0 Times in 0 Posts
Question Blacklist outgouing mail

Hi,

A major Slovenian free e-mail provider has recently gone bust. As a result, thousands of outgoing e-mails are being deferred in our server's mail logs, as some of the hosted sites still try to send e-mail to these addresses.

Is there a way to tell postfix (through ISPConfig if possible) to completely ignore any e-mail being sent out, whose recipient belongs to a certain domain? Postfix should not try to send such messages and if possible, not even log the attempt.

I tried adding a record to "Email > Global Filters > Postfix Blacklist" with "@offending-domain.tld" as Blacklist Address and Recipient as Type. This doesn't seem to have the desired effect though.
Reply With Quote
Sponsored Links
  #2  
Old 24th August 2009, 19:22
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 36,065
Thanks: 826
Thanked 5,395 Times in 4,239 Posts
Default

Try this:

add a email route / (transport) in ispconfig with:

domain: offending-domain.tld
type: error
destination: This email address does not exist anymore.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
The Following User Says Thank You to till For This Useful Post:
MrM (24th August 2009)
  #3  
Old 24th August 2009, 20:45
MrM MrM is offline
Member
 
Join Date: Oct 2008
Location: Ljubljana, Slovenia
Posts: 58
Thanks: 6
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by till View Post
Try this:

add a email route / (transport) in ispconfig with:

domain: offending-domain.tld
type: error
destination: This email address does not exist anymore.
Thanks, till. It worked. The messages no longer go to the queue. However, quite a lot of entries are still added to the logs for a single message:
Code:
Aug 24 20:32:34 prod postfix/pickup[8518]: 4D0F51CF1F2: uid=0 from=<root>
Aug 24 20:32:34 prod postfix/cleanup[8551]: 4D0F51CF1F2: message-id=<20090824183234.4D0F51CF1F2@hostname.server-domain.tld>
Aug 24 20:32:34 prod postfix/qmgr[8520]: 4D0F51CF1F2: from=<root@hostname.server-domain.tld>, size=316, nrcpt=1 (queue active)
Aug 24 20:32:34 prod postfix/error[8554]: 4D0F51CF1F2: to=<mailbox@offending-domain.tld>, relay=none, delay=0.12, delays=0.09/0.01/0/0.01, dsn=5.0.0, status=bounced ([This email address does not exist anymore.])
Aug 24 20:32:34 prod postfix/cleanup[8551]: 5C5851CF1F3: message-id=<20090824183234.5C5851CF1F3@hostname.server-domain.tld>
Aug 24 20:32:34 prod postfix/qmgr[8520]: 5C5851CF1F3: from=<>, size=2025, nrcpt=1 (queue active)
Aug 24 20:32:34 prod postfix/bounce[8555]: 4D0F51CF1F2: sender non-delivery notification: 5C5851CF1F3
Aug 24 20:32:34 prod postfix/qmgr[8520]: 4D0F51CF1F2: removed
Aug 24 20:32:34 prod postfix/cleanup[8551]: 654221CF1EA: message-id=<20090824183234.5C5851CF1F3@hostname.server-domain.tld>
Aug 24 20:32:34 prod postfix/qmgr[8520]: 654221CF1EA: from=<>, size=2162, nrcpt=1 (queue active)
Aug 24 20:32:34 prod postfix/local[8556]: 5C5851CF1F3: to=<root@hostname.server-domain.tld>, relay=local, delay=0.04, delays=0.02/0.01/0/0.01, dsn=2.0.0, status=sent (forwarded as 654221CF1EA)
Aug 24 20:32:34 prod postfix/qmgr[8520]: 5C5851CF1F3: removed
It looks like the message gets bounced now. Is it possible to send it to /dev/null instead? It's not a big problem if this is not possible. Getting all those messages out of the queue was my first priority. Completely ignoring them would be a better option, but as I said, not strictly necessary.
Reply With Quote
  #4  
Old 25th August 2009, 02:45
bajodel bajodel is offline
Member
 
Join Date: Jul 2007
Location: Italy
Posts: 63
Thanks: 26
Thanked 12 Times in 11 Posts
Default

Quote:
Originally Posted by MrM View Post
..completely ignoring them would be a better option, but as I said, not strictly necessary.
Take a look at postfix restrictions parameters .. expecially at "reject_unknown_recipient_domain"

Requirements: the dns (mx or a) records of that provider domain must no longer exist.

If it suits your needs you will able ( modding your /etc/postfix/main.cf ) to do the trick in a better way ..you can avoid to receive the entire messages before dropping them (blocking them at smtp first dialog level) .. saving bandwith :-)

Bye..

bajodel.
Reply With Quote
  #5  
Old 25th August 2009, 03:09
MrM MrM is offline
Member
 
Join Date: Oct 2008
Location: Ljubljana, Slovenia
Posts: 58
Thanks: 6
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by bajodel View Post
Take a look at postfix restrictions parameters .. expecially at "reject_unknown_recipient_domain"

Requirements: the dns (mx or a) records of that provider domain must no longer exist.
In this case, the MX record still exists, but the SMTP server is no longer responding, so I guess this option will not help.

The provider in question is actually email.si:
Code:
$ dig email.si IN MX
...
;; ANSWER SECTION:
email.si.		3421	IN	MX	20 mx5.email.si.


$ telnet mx5.email.si 25
Trying 81.24.97.24...
telnet: Unable to connect to remote host: Connection timed out
Quote:
Originally Posted by bajodel View Post
If it suits your needs you will able ( modding your /etc/postfix/main.cf ) to do the trick in a better way ..you can avoid to receive the entire messages before dropping them (blocking them at smtp first dialog level) .. saving bandwith :-)
Heh, bandwidth actually isn't a problem in this case, since the postfix server is only being used by the websites running on the same server. I was only hoping to get rid of the log entries and bounced messages, but as I said before, it's just a minor annoyance, not a serious issue. The bulk of the problem has already been solved with till's suggestion.
Reply With Quote
  #6  
Old 25th August 2009, 03:51
bajodel bajodel is offline
Member
 
Join Date: Jul 2007
Location: Italy
Posts: 63
Thanks: 26
Thanked 12 Times in 11 Posts
Default

Quote:
Originally Posted by MrM View Post
In this case, the MX record still exists ..[CUT]..
Ok.. it's not so clean ..but you can 'cook' fake ones :-) configuring that domain in your dns with a TEXT record only.
Postfix will look at MX and A records -> not present -> reject

Quote:
Originally Posted by MrM View Post
..[CUT].. bandwidth actually isn't a problem in this case ..[CUT]..
Ok.. maybe it is not a problem for you, but it could be usefull for others..

Bye..

bajodel.
Reply With Quote
The Following User Says Thank You to bajodel For This Useful Post:
MrM (27th August 2009)
  #7  
Old 27th August 2009, 00:27
MrM MrM is offline
Member
 
Join Date: Oct 2008
Location: Ljubljana, Slovenia
Posts: 58
Thanks: 6
Thanked 0 Times in 0 Posts
 
Default

Quote:
Originally Posted by bajodel View Post
Ok.. it's not so clean ..but you can 'cook' fake ones :-) configuring that domain in your dns with a TEXT record only.
Postfix will look at MX and A records -> not present -> reject
I'll do that. Thanks for the idea.


Quote:
Originally Posted by bajodel View Post
Ok.. maybe it is not a problem for you, but it could be usefull for others..
You're right. Sorry if I sounded ungrateful.

Thanks, till and bajodel, for helping out.
Reply With Quote
Reply

Bookmarks

Tags
blacklist, e-mail, postfix

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Postfix problem and few questions Gimly Installation/Configuration 12 7th July 2009 16:27
Postfix + postfixadmin = SMTP errors... Rashef Server Operation 4 25th June 2009 16:12
just the last step...and it works. Postfix...need help config. ubuntusr Installation/Configuration 1 5th January 2009 09:50
Problem with dcc-client installation (Postfix) swap-as Installation/Configuration 9 18th September 2008 20:47
Core 4: Error Messages on Fresh Install re CTX/SSL jjw Installation/Configuration 30 6th September 2006 12:16


All times are GMT +2. The time now is 18:30.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.