Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

Procmailrc fun and games

  • 28-02-2003 04:59PM
    #1
    Registered Users, Registered Users 2, Paid Member Posts: 14,174 ✭✭✭✭


    Hey guys,

    I'm trying to send an autoresponse to any use sending a mail to userX, and also sending a copy of the original mail to userY

    Here's the .procmailrc (for userX)
    :0 h
    * !^From: .*autoresp
    * !^From: .*userx@blah
    * !^From: .*User.X@blah
    {
     :0
     ! userY
     :0 c
     | (formail -r ; echo "`/home/auto.reply.userX`") | sendmail -oi -t
    }
    

    Ok, I'm not getting an autoreply and userX isn't getting the original mail either.

    From what I've gathered, I'm making sure that userX isn't looping mail to themselves, then sending a copy to userY, then returning an autoreply message to the user.

    Any suggestions/ideas?


Comments

  • Registered Users, Registered Users 2 Posts: 521 ✭✭✭Ronin


    setup a log file within your procmailrc and see what it tells you for the mails


  • Registered Users, Registered Users 2, Paid Member Posts: 14,174 ✭✭✭✭Lemming


    Got it sorted :)

    Swap the two actions and everything is fine. The problem with the original version was that the email was being re-directed to the second user before a carbon copy could be sent to the original sender (or at least, that's my understanding of it)

    So I ended up with:
    :0 h
    * !^From: .*autoresp
    * !^From: .*userx@blah
    * !^From: .*User.X@blah
    {
     :0 c
     | (formail -r ; echo "`/home/auto.reply.userX`") | sendmail -oi -t
     :0
     ! userY
    }
    


Advertisement