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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can I bounce emails ?

Status
Not open for further replies.

bluegroper

Technical User
Dec 12, 2002
407
AU
I have an "off-line" postfix mailserver. It does a great job for a small and busy office.
Handles internal LAN email, as well as relaying outgoing email to the isp's mailserver.

/etc/postfix/main.cf includes the following line
Relayhost = mailserver.isp.com.

Incoming email is pulled from the isp using fetchmail, and handed on to postfix for local delivery. That works well.

I'm trying to use an access table to selectively bounce some emails.
Edited /etc/postfix/access, then postmap access to create access.db
Also postfix reload.

/etc/postfix/access contains the following line
myrealbox.com 550 Your unsolicited email is unwelcome. All email from your domain has been blocked.

Also using following line in main.cf
smtpd_sender_restrictions = hash:/etc/postfix/access

OK so far.

But when I send myself an email from myrealbox.com, it looks like fetchmail hands postfix the email which postfix tries to bounce, it gives the message back to fetchmail, who sends the bounced message to the postfix postmaster. Result is that the message is not bounced at all. Simply delivered to the postmaster.

Here's the log entries :

fetchmail: 1 message for user_name at mailserver.isp.com (1240 octets).
fetchmail: reading message 1 of 1 (1240 octets) fetchmail: SMTP error: 550 <user_name@myrealbox.com>: Sender address rejected: Your unsolicited email is unwelcome. All email from your domain has been blocked.
fetchmail: mail from FETCHMAIL-DAEMON@Fileserver bounced to postmaster@network.lan
fetchmail: can't even send to postmaster@network.lan!
fetchmail: flushed

How do I instruct postfix to send such rejected messages back via the relayhost defined above ?
Can it be done without taking my postfix server fully &quot;on-line&quot; to bounce my emails?

TIA's

ßG

Edit. Just using myrealbox.com for testing. Its a great no-spam, free email service.
 
Actually 545 sends email to postmaster
550 drops email
 
Now, it sort of works. (Had to switch back on the fetchmail set spambounce command.)
Using SMTP error code 550, postfix sends back a singe line message &quot;Our spam filter rejected this transaction.&quot; Thats good.
But the original message was not attached.
I guess thats not part of the SMTP protocol.
Maybe I need procmail to do this.
/makes note to self to RTFM procmail
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top