LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 11-02-2012, 09:24 AM   #1
Sanford Stein
Member
 
Registered: Jun 2008
Location: Evanston, Illinois
Distribution: RHEL 6.4
Posts: 126

Rep: Reputation: 17
Cannot get procmail to work


We are using sendmail with cyrus-imapd. I want to give users the ability to set up a vacation message, and I believe that procmail is the correct tool.

Using my own account as a test , I set up the following files in my $HOME directory:

.forward:
|/usr/bin/procmail

.procmailrc
0: vac
| (formail -r -I"Subject: On vacation"; echo 'I am not really on vacation. I'm still here') | /usr/sbin/sendmail -t

When I send email to myself from an outside account, I do not get the vacation reply.

My /etc/mail/sendmail.cf has the following lines in it related to procmail:

Mprocmail, P=/usr/bin/procmail, F=DFMSPhnu9, S=EnvFromSMTP/HdrFromSMTP, R=EnvToSMTP/HdrFromSMTP,
A=procmail -Y -m $h $f $u
Mlocal, P=/usr/bin/procmail, F=lsDFMAw5:/|@qSPfhn9, S=EnvFromL/HdrFromL, R=EnvToL/HdrToL,
A=procmail -t -Y -a $h -d $u

What am I missing? Does something have to be configured in Cyrus?

Thanks,
Sanford Stein
CyberTools Inc.
 
Old 11-02-2012, 12:59 PM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,165
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Hi,

You don't need to mess with procmail. Use the vacation program that comes with sendmail to send vacation messages.
Read the man page to see how to setup the .forward and the .vacation.msg files needed.

Regards
 
Old 11-02-2012, 02:40 PM   #3
Sanford Stein
Member
 
Registered: Jun 2008
Location: Evanston, Illinois
Distribution: RHEL 6.4
Posts: 126

Original Poster
Rep: Reputation: 17
Bathory,

Thanks for your response. Before I started messing with 'procmail', I tried to get 'vacation' to work and did not have any success. Here are the files I used:

.forward:
\sstein, "|/usr/bin/vacation sstein"

.vacation.msg:
Subject: Away
From: Sanford Stein
I am testing my vacation message. I am really here.
Your subject is "$SUBJECT"

I ran 'vacation -I' and confirmed that .vacation.db was created. It still fails to send a vacation reply.

I don't really care which one works, and if you can tell me what I am doing wrong with 'vacation' that would be great.
I was told that it was non-standard and that Red Hat supports 'procmail', which is why I turned my attention there.

Since 'procmail' and 'vacation' are very similar, I still suspect that Cyrus is somehow standing in the way here.

Thanks,
Sanford Stein
CyberTools Inc.
 
Old 11-02-2012, 03:49 PM   #4
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,165
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Check if vacation is installed, because according to this looks like you need to compile it from sources.
If it's installed, you need to add it in /etc/smrsh restricted shell (see #6 in the link above)

Cheers
 
Old 11-02-2012, 04:16 PM   #5
Sanford Stein
Member
 
Registered: Jun 2008
Location: Evanston, Illinois
Distribution: RHEL 6.4
Posts: 126

Original Poster
Rep: Reputation: 17
I did compile 'vacation' from source -- my version is 1.2.7
I just redid it to make sure (make;make install), and added the link to /etc/smrsh, which was not there before.

I still get no vacation reply message.

I appreciate your help and don't want to take up too much of your time, but any more ideas?
 
Old 11-02-2012, 04:42 PM   #6
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,165
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Are you sure that the vacation binary is located in /usr/bin/vacation?
Delete .vacation/db and recreate it, before running any tests, because it keeps the recipients that got the vacation message.
Also check /var/log/maillog (or whatever logfile sendmail writes its logs) to see what happens
 
Old 11-05-2012, 09:26 AM   #7
Sanford Stein
Member
 
Registered: Jun 2008
Location: Evanston, Illinois
Distribution: RHEL 6.4
Posts: 126

Original Poster
Rep: Reputation: 17
Yes, the binary is definitely in /usr/bin/vacation. I deleted $HOME/.vacation.db, ran 'vacation -I' to reinitialize, and tested again. Still no luck. There is nothing in /var/log/maillog. It looks like the message was sent, via Cyrus, with no reference at all to 'vacation'. So somehow it's still not getting recognized.
 
Old 11-05-2012, 10:58 AM   #8
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,165
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Quote:
It looks like the message was sent, via Cyrus, with no reference at all to 'vacation'. So somehow it's still not getting recognized.
The mail is sent via smtp (sendmail in this case) not cyrus (the imap server). I don't know how cyrus-imapd works, but it's procmail that sends the vacation message once it sees a ~/.forward file with the vacation command in it.

Anyway searching a bit, looks like you need to write some sieve rules, if you want cyrus to deliver mail.
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Procmail: Forwarding just does not work j-epp Linux - Newbie 3 03-13-2011 07:55 PM
Procmail doesn't work with alias? Possibly? Dan BadJar Linux - Software 0 07-07-2009 08:25 AM
procmail mailboxes ... some work, some don't Spechal Linux - Newbie 1 01-13-2009 12:23 PM
How Does Procmail Work w/ MTA? carlosinfl Linux - Server 4 01-31-2008 08:28 PM
qmail work with procmail sizzlingdesi Linux - Software 0 11-02-2006 06:44 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 01:38 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration