Koozali.org: home of the SME Server

Using procmail to reply to nominated user

Offline axessit

  • *****
  • 213
  • +0/-0
Using procmail to reply to nominated user
« on: March 06, 2008, 02:32:51 PM »
I am wanting to send a reply to a sender (or any sender) when I create a message rule. I have the procmail contrib installed, but don't want a global vacation message. If a user eg sender@sendersdomain sends an email, I want to use procmail to search the message (subject or even using the from rule) and send a reply to that user with a standard response (eg "Your message has been received, but the receiver has prioritised your email and will reply soon") and reply to that sender only (ie sender@sendersdomain) but if I get en email from you@yourdomain, it gets processed normally.

I tried to set up a user, eg reply@mydomain, and get procmail to forward to that user, then use the vacation message for reply@mydomain. The trouble is, reply@mydomain's mail correctly shows the From email address (eg , sender@sendersdomain) but the vacation message only gets sent back to me@mydomain. Do I need to set up or disable a double bounce or something ?


Offline sognenovski

  • ***
  • 64
  • +0/-0
Re: Using procmail to reply to nominated user
« Reply #1 on: March 06, 2008, 09:52:16 PM »
Quote
I am wanting to send a reply to a sender (or any sender) when I create a message rule. I have the procmail contrib installed, but don't want a global vacation message. If a user eg sender@sendersdomain sends an email, I want to use procmail to search the message (subject or even using the from rule) and send a reply to that user with a standard response (eg "Your message has been received, but the receiver has prioritised your email and will reply soon") and reply to that sender only (ie sender@sendersdomain) but if I get en email from you@yourdomain, it gets processed normally.
Understand

Quote
I tried to set up a user, eg reply@mydomain, and get procmail to forward to that user, then use the vacation message for reply@mydomain. The trouble is, reply@mydomain's mail correctly shows the From email address (eg , sender@sendersdomain) but the vacation message only gets sent back to me@mydomain. Do I need to set up or disable a double bounce or something ?
Dont understand  :?

I had a similar situation a few months back.
Setting up additional procmail rules beyond whats available in server-manager was tricky.
Take a look at this source rpm on how I managed to achieve this.
wget http://distro.ibiblio.org/pub/linux/distributions/smeserver/contribs/sognenovski/SRPMS/smeserver-usersendsms-0.1-1.src.rpm
Basically a user account is created ‘sendsms’. All email received for that user is piped to a bash script.
I know, its not exactly what you after but its a start.

Perhaps there is a better way. Stephen?

Offline axessit

  • *****
  • 213
  • +0/-0
Re: Using procmail to reply to nominated user
« Reply #2 on: March 06, 2008, 11:04:06 PM »
Quote
I tried to set up a user, eg reply@mydomain, and get procmail to forward to that user, then use the vacation message for reply@mydomain. The trouble is, reply@mydomain's mail correctly shows the From email address (eg , sender@sendersdomain) but the vacation message only gets sent back to me@mydomain. Do I need to set up or disable a double bounce or something ?

OK, I'll try to explain in another way. If you take the approach of trying to blacklist and email address, and let the sender know you have blacklisted them (but with a custom response, perhaps with a phone number to call to get unblocked). I set up a user blacklist@mydomain, and created a vacation message with my custom response. If I send an email to blacklist@mydomain, I get the "polite" reply.

If then set up a procmail rule for me@mydomain that uses the From:"sender@sendersdomain", I can redirect that email to an imap folder (junkmail or blacklist or whatever) so it doesn't clog up my pop3 inbox. I can also forward that email to blacklist.

Blacklist's inbox shows the email as being sent from "sender@sendersdomain". The vacation message, however, gets sent to me@mydomain.

BTW, I had to set the VacationDelay to 1 second. Did this on both blacklist and my user. Also disabled duplicate message dump.

After I posted this I searched the forums for blacklist and found one relating to installing the Emailwbl contrib, which I installed, but couldn't get any reply to happen, 505 or anything. Not sure if I had to put the sender@sendersdomain in a blacklist for the admin or me or whether this was a global rule. Also not sure if my ISP just dumped the reply.

Will look through your script. Might show me something. I have written a few basic perl scripts, so might get something working.

Offline stephen noble

  • *
  • 607
  • +1/-0
    • Dungog
Re: Using procmail to reply to nominated user
« Reply #3 on: March 06, 2008, 11:16:37 PM »
Perhaps there is a better way. Stephen?

Adding a custom procmail rule will be needed, sognenovski has shown how
it could be similar but simpler
it could be just plain text, the exact rule
 
the rest is just a standard procmail question, maybe ask on procmail lists