<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://htyp.org/mw/index.php?action=history&amp;feed=atom&amp;title=Procmail%2Fdoc%2FFAQ</id>
	<title>Procmail/doc/FAQ - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://htyp.org/mw/index.php?action=history&amp;feed=atom&amp;title=Procmail%2Fdoc%2FFAQ"/>
	<link rel="alternate" type="text/html" href="https://htyp.org/mw/index.php?title=Procmail/doc/FAQ&amp;action=history"/>
	<updated>2026-09-26T06:07:43Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.45.3</generator>
	<entry>
		<id>https://htyp.org/mw/index.php?title=Procmail/doc/FAQ&amp;diff=18995&amp;oldid=prev</id>
		<title>Woozle: Created page with &quot;&lt;pre&gt; ------------------------------------------------------------------------------ ---------------------- Frequently Asked Questions ---------------------------- -----------...&quot;</title>
		<link rel="alternate" type="text/html" href="https://htyp.org/mw/index.php?title=Procmail/doc/FAQ&amp;diff=18995&amp;oldid=prev"/>
		<updated>2012-07-14T22:52:08Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;&amp;lt;pre&amp;gt; ------------------------------------------------------------------------------ ---------------------- Frequently Asked Questions ---------------------------- -----------...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
------------------------------------------------------------------------------&lt;br /&gt;
---------------------- Frequently Asked Questions ----------------------------&lt;br /&gt;
------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
1. How do I go about setting up a mailinglist or a mail-archive server?&lt;br /&gt;
&lt;br /&gt;
	Look in the SmartList directory, start reading the INTRO file,&lt;br /&gt;
	it describes it in detail and should get you started.&lt;br /&gt;
&lt;br /&gt;
2. I installed procmail (i.e. typed &amp;#039;make install&amp;#039;), but how am I supposed to&lt;br /&gt;
   use it?  When I type procmail on the command line it simply does nothing.&lt;br /&gt;
&lt;br /&gt;
	***********************************************************************&lt;br /&gt;
	There exists an excellent newbie FAQ about mailfilters (and procmail&lt;br /&gt;
	in particular), it is being maintained by Nancy McGough &amp;lt;nancym@ii.com&amp;gt;&lt;br /&gt;
	and can be obtained via:&lt;br /&gt;
&lt;br /&gt;
	World Wide Web (the nicest format for online reading!):&lt;br /&gt;
	http://www.faqs.org/faqs/mail/filtering-faq/&lt;br /&gt;
&lt;br /&gt;
	Anonymous FTP:&lt;br /&gt;
	ftp://rtfm.mit.edu/pub/usenet/news.answers/mail/filtering-faq&lt;br /&gt;
&lt;br /&gt;
	E-mail:&lt;br /&gt;
	Send mail to mail-server@rtfm.mit.edu containing the following:&lt;br /&gt;
	    send usenet/news.answers/mail/filtering-faq&lt;br /&gt;
&lt;br /&gt;
	UUCP:&lt;br /&gt;
	uunet!/archive/usenet/news.answers/mail/filtering-faq&lt;br /&gt;
&lt;br /&gt;
	It is also posted monthly in at least the following newsgroups:&lt;br /&gt;
		comp.mail.misc, comp.answers, news.answers&lt;br /&gt;
	***********************************************************************&lt;br /&gt;
&lt;br /&gt;
	You&amp;#039;re not supposed to start procmail from the command line.&lt;br /&gt;
	Procmail expects exactly one mail message to be presented to it&lt;br /&gt;
	on its stdin.  Usually the mail system feeds it into procmail.&lt;br /&gt;
	If you start it by hand, you have to type the mail.&lt;br /&gt;
&lt;br /&gt;
	Be sure to have a .forward and a .procmailrc file in your home&lt;br /&gt;
	directory (see the examples subdirectory or the man page).&lt;br /&gt;
	MMDF users should note that they need a .maildelivery file *instead*&lt;br /&gt;
	of a .forward file (see the man page for more detailed information).&lt;br /&gt;
&lt;br /&gt;
	If however, procmail has been integrated in the maildelivery system&lt;br /&gt;
	(i.e. if your system administrator installed it that way, ask him/her),&lt;br /&gt;
	then you no longer need the .forward files in your home directory,&lt;br /&gt;
	having a .procmailrc file will suffice.&lt;br /&gt;
&lt;br /&gt;
	On some systems .forward files are not checked.&lt;br /&gt;
	It might be possible that your system supports a command like:&lt;br /&gt;
		mail -F &amp;quot;|/usr/bin/procmail&amp;quot;&lt;br /&gt;
	to set up forwarding to a program.  (If procmail is in /usr/local/bin&lt;br /&gt;
	then use that path instead when trying these.)&lt;br /&gt;
	If that doesn&amp;#039;t seem to work it might be worth trying to put a line&lt;br /&gt;
	looking like this:&lt;br /&gt;
		Forward to |/usr/bin/procmail&lt;br /&gt;
	or if that doesn&amp;#039;t work, try:&lt;br /&gt;
		Pipe to /usr/bin/procmail&lt;br /&gt;
	as the only line in your mail spool file (e.g. /var/mail/$LOGNAME), as&lt;br /&gt;
	well as doing a &amp;quot;chmod 06660 /var/mail/$LOGNAME&amp;quot;.  For more information&lt;br /&gt;
	on such systems, do a &amp;quot;man mail&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
	If all of this doesn&amp;#039;t work, procmail can be called on a periodical&lt;br /&gt;
	basis, either via &amp;quot;cron&amp;quot;, &amp;quot;at&amp;quot; or whenever you start reading mail (or&lt;br /&gt;
	log in).  For a sample script look in the NOTES section of the&lt;br /&gt;
	procmail(1) man page.&lt;br /&gt;
&lt;br /&gt;
3. When I compile everything the compiler complains about invalid or illegal&lt;br /&gt;
   pointer combinations, but it produces the executables anyway.&lt;br /&gt;
   Should I be concerned?&lt;br /&gt;
&lt;br /&gt;
	Ignore these warnings, they simply indicate that either your compiler&lt;br /&gt;
	or your system include files are not ANSI/POSIX compliant.&lt;br /&gt;
	The compiler will produce correct code regardless of these warnings.&lt;br /&gt;
&lt;br /&gt;
4. The compiler seems to issue warnings about &amp;quot;loop not entered at top&amp;quot;,&lt;br /&gt;
   is that a problem?&lt;br /&gt;
&lt;br /&gt;
	No, no problem at all, it just means I wrote the code :-).&lt;br /&gt;
	That&amp;#039;s just about the only uncommon coding technique I use (don&amp;#039;t&lt;br /&gt;
	think I don&amp;#039;t try to avoid those jumps in loops, it&amp;#039;s just that&lt;br /&gt;
	sometimes they are the best way to code it).  This warning, as&lt;br /&gt;
	well as &amp;quot;statement not reached&amp;quot;, can be ignored -- the compiler&lt;br /&gt;
	will still generate correct code.  Use gcc if they really bother&lt;br /&gt;
	you.&lt;br /&gt;
&lt;br /&gt;
5. The compiler complains about unmodifiable lvalues or assignments to const&lt;br /&gt;
   variables.  Now what?&lt;br /&gt;
&lt;br /&gt;
	Well, if the compiler produces the executables anyway everything&lt;br /&gt;
	probably is all right.	If it doesn&amp;#039;t, you might try inserting a&lt;br /&gt;
	&amp;quot;#define const&amp;quot; in the autoconf.h file by hand.	 However in any case,&lt;br /&gt;
	your compiler is broken; I would recommend submitting this as a&lt;br /&gt;
	compiler bug to your vendor.  In any case, if this should occur, I&amp;#039;d&lt;br /&gt;
	appreciate a mail from you (so I can try to fix the autoconf script&lt;br /&gt;
	to recognise your compiler correctly as well).&lt;br /&gt;
&lt;br /&gt;
6. The compiler refuses to compile regexp.c, what is the problem?&lt;br /&gt;
&lt;br /&gt;
	Try compiling that module with optimisation turned off.&lt;br /&gt;
&lt;br /&gt;
7. Everything installed just fine, it&amp;#039;s just that there are several stale&lt;br /&gt;
   _locktst processes which refuse to die.  How do I get rid of those?&lt;br /&gt;
&lt;br /&gt;
	In order to prevent things like this from happening to procmail,&lt;br /&gt;
	_locktst tries to determine which kernel locking methods are&lt;br /&gt;
	reliable.  Sometimes this triggers a bug in the kernel or in&lt;br /&gt;
	your system-supplied lockd; this is good, because _locktst detects&lt;br /&gt;
	this and makes sure that procmail will not make the same mistake.&lt;br /&gt;
	A side effect is that this sometimes leaves behind some stale&lt;br /&gt;
	_locktst processes that seem to be unkillable.&lt;br /&gt;
&lt;br /&gt;
	This usually is the result of a buggy lockdaemon.  In order to&lt;br /&gt;
	get rid of the stale processes, ask your system administrator&lt;br /&gt;
	to kill and restart the (rpc.)lockd (and perhaps the (rpc.)statd)&lt;br /&gt;
	on both the filesystem-client (where you compiled procmail) and the&lt;br /&gt;
	filesystem-server(s) (where the lockingtests took place).&lt;br /&gt;
	Depending on the OS it might help if you send the offending&lt;br /&gt;
	_locktst processes a kill signal before or after restarting the&lt;br /&gt;
	lockd again.&lt;br /&gt;
&lt;br /&gt;
	In any case, _locktst just uncovered a bug in your operating system.&lt;br /&gt;
	You should contact your system&amp;#039;s vendor and ask for a bugfix for&lt;br /&gt;
	your lockd.&lt;br /&gt;
&lt;br /&gt;
8. When I send myself a testmail, the mail bounces with the message: cannot&lt;br /&gt;
   execute binary file.	 What am I doing wrong?&lt;br /&gt;
&lt;br /&gt;
	It is very well possible that mail is processed on a different&lt;br /&gt;
	machine from that where you usually read your mail.  Therefore you&lt;br /&gt;
	have to make sure that procmail has the right binary format to&lt;br /&gt;
	execute on those machines on which mail could arrive.  In order to&lt;br /&gt;
	get this right you might need to do some .forward file tweaking,&lt;br /&gt;
	look at the examples/advanced file for some suggestions.&lt;br /&gt;
&lt;br /&gt;
9. Where do I look for examples about:&lt;br /&gt;
	One home directory, several machine architectures?&lt;br /&gt;
	Procmail as an integrated local mail delivery agent? (generic,&lt;br /&gt;
	 sendmail, ZMailer, smail, SysV mailsurr)&lt;br /&gt;
	Changing the mail spool directory to $HOME for all users&lt;br /&gt;
	Security considerations (when installing procmail suid root)&lt;br /&gt;
&lt;br /&gt;
	Well, this probably is your lucky day :-), all these topics are covered&lt;br /&gt;
	in the examples/advanced file.&lt;br /&gt;
&lt;br /&gt;
	Other examples (e.g. for autoreplies) are most likely to be found by&lt;br /&gt;
	typing:		man procmailex&lt;br /&gt;
&lt;br /&gt;
10. How do I use procmail as a general mail filter inside sendmail?&lt;br /&gt;
&lt;br /&gt;
	See EXAMPLES section of the procmail(1) man page.&lt;br /&gt;
&lt;br /&gt;
11. Why do I have to insert my login name after the &amp;#039;#&amp;#039; in the .forward or&lt;br /&gt;
   .maildelivery file?&lt;br /&gt;
&lt;br /&gt;
	Some mailers `optimise&amp;#039; maildelivery and take out duplicates from&lt;br /&gt;
	Cc:, Bcc: and alias lists before delivery.  If two or more persons on&lt;br /&gt;
	such a list would have identical .forward files, then the mailer will&lt;br /&gt;
	eliminate all but one.	Adding a `#&amp;#039; with your login name following&lt;br /&gt;
	it will make the .forward files unique, and will ensure that the mailer&lt;br /&gt;
	doesn&amp;#039;t optimise away some addresses.&lt;br /&gt;
&lt;br /&gt;
12. How do I view the man pages?&lt;br /&gt;
&lt;br /&gt;
	If the man(1) program on your system understands the MANPATH&lt;br /&gt;
	environment variable, make sure that the installation directory listed&lt;br /&gt;
	in the Makefile for the manpages is included in your MANPATH.  If your&lt;br /&gt;
	man program does not support MANPATH, make sure that the man pages&lt;br /&gt;
	are installed in one of the standard man directories, like under&lt;br /&gt;
	/usr/man.  If you do not want to install the man pages before viewing&lt;br /&gt;
	them, you can view an individual man file by typing something like:&lt;br /&gt;
	nroff -man procmail.1 | more&lt;br /&gt;
&lt;br /&gt;
13. The leading From_ line on all my arriving mail shows the wrong time.&lt;br /&gt;
    Before putting procmail in the .forward file everything was OK.&lt;br /&gt;
&lt;br /&gt;
	This is a known bug in sendmail-5.65c+IDA.  The real fix would be&lt;br /&gt;
	to upgrade to sendmail 6.x or later.  For a quick fix, see the&lt;br /&gt;
	procmailex man page.&lt;br /&gt;
&lt;br /&gt;
14. When sending mail to someone with procmail in his/her .forward I sometimes&lt;br /&gt;
    get back an error saying: &amp;quot;Cannot mail directly to programs.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
	This is a known bug in some older sendmails that mistakenly drop&lt;br /&gt;
	their root privileges when they are given the -t flag.	Either&lt;br /&gt;
	make sure that your sendmail always forwards to a mailserver first or&lt;br /&gt;
	upgrade to sendmail 6.x or later.&lt;br /&gt;
&lt;br /&gt;
15. When sending mail to someone with procmail in his/her .forward I sometimes&lt;br /&gt;
    get back an error saying:&lt;br /&gt;
    &amp;quot;User doesn&amp;#039;t have a valid shell for mailing to programs.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
	This indicates that the mail arrives on a mailserver which most likely&lt;br /&gt;
	has a different user database (/etc/passwd) where the login shell&lt;br /&gt;
	specified for the recipient is not present in /etc/shells.&lt;br /&gt;
	Contact your administrator to put the name of that shell in&lt;br /&gt;
	/etc/shells.&lt;br /&gt;
&lt;br /&gt;
16. My mailtool sometimes reports that it is confused about the state of&lt;br /&gt;
    the mailbox, or I get &amp;quot;Couldn&amp;#039;t unlock&amp;quot; errors from procmail now and then,&lt;br /&gt;
    or sometimes it simply seems to hang just when new mail arrives.&lt;br /&gt;
&lt;br /&gt;
	This is a known bug in the OpenLook mailtool.  It holds on to&lt;br /&gt;
	the kernel lock on the mail-spoolfile most of the time as a&lt;br /&gt;
	signal to other mailtool processes.  With newer versions of&lt;br /&gt;
	mailtool, enabling the &amp;quot;Use network aware mail file locking&amp;quot;&lt;br /&gt;
	configuration option may solve the problem, though this option&lt;br /&gt;
	isn&amp;#039;t always available.	 If that doesn&amp;#039;t work then recompile&lt;br /&gt;
	procmail with both the fcntl() and lockf() locking method&lt;br /&gt;
	disabled (see config.h).&lt;br /&gt;
&lt;br /&gt;
17. I sometimes get these `Lock failure on &amp;quot;/var/mail/$LOGNAME.lock&amp;quot;&amp;#039; errors&lt;br /&gt;
    from procmail.  What do I do about it?&lt;br /&gt;
&lt;br /&gt;
	The problem here is that as long as procmail has not read a&lt;br /&gt;
	$HOME/.procmailrc file, it can hang on to the sgid mail permission&lt;br /&gt;
	(which it needs in order to create a lockfile in /var/mail).&lt;br /&gt;
	I.e. if procmail delivers mail to a user without a $HOME/.procmailrc&lt;br /&gt;
	file, procmail *can* (and does) use the /var/mail/$LOGNAME.lock file.&lt;br /&gt;
&lt;br /&gt;
	If, however, it finds a $HOME/.procmailrc file, procmail has to let go&lt;br /&gt;
	of the sgid mail permission because otherwise any ordinary user could&lt;br /&gt;
	abuse that.&lt;br /&gt;
&lt;br /&gt;
	There are several solutions to this problem:&lt;br /&gt;
	- Some systems support the sticky bit on directories (when set only&lt;br /&gt;
	  allows the owner of a file in that directory to rename or remove&lt;br /&gt;
	  it).	This enables you to make /var/mail drwxrwxrwt.  It is&lt;br /&gt;
	  thus effectively world writable, but all the mailboxes in it are&lt;br /&gt;
	  protected because only the mailbox owner can remove or rename it.&lt;br /&gt;
	- If your system did not exhibit the !@#$%^&amp;amp;* POSIX semantics for&lt;br /&gt;
	  setgid(), procmail would have been able to switch back and forth&lt;br /&gt;
	  between group mail and the group the recipient belongs to without&lt;br /&gt;
	  creating security holes.&lt;br /&gt;
	- If your system supported setrgid() or setregid() or setresgid()&lt;br /&gt;
	  with BSD semantics, procmail would have been able to switch...&lt;br /&gt;
	  (see the previous point).&lt;br /&gt;
	- You could simply put the following at the end of your .procmailrc&lt;br /&gt;
	  file:&lt;br /&gt;
&lt;br /&gt;
		LOCKFILE		# removes any preexisting lockfile&lt;br /&gt;
		LOG=`lockfile $DEFAULT$LOCKEXT`&lt;br /&gt;
		TRAP=&amp;quot;rm -f $DEFAULT$LOCKEXT&amp;quot;&lt;br /&gt;
			:0&lt;br /&gt;
			$DEFAULT&lt;br /&gt;
&lt;br /&gt;
	- You could, instead of using /var/mail/$LOGNAME, use a file below&lt;br /&gt;
	  your home directory as your default mailbox.&lt;br /&gt;
	- Or, you could still use /var/mail/$LOGNAME as the mailbox, but&lt;br /&gt;
	  simply instruct procmail to use a different lockfile.	 This can&lt;br /&gt;
	  be achieved by putting following recipe at the bottom of&lt;br /&gt;
	  your .procmailrc file:&lt;br /&gt;
&lt;br /&gt;
		:0:$HOME/.lockmail&lt;br /&gt;
		$DEFAULT&lt;br /&gt;
&lt;br /&gt;
	  You have to make sure that all other programs that update your&lt;br /&gt;
	  system mailbox will be using the same lockfile of course.&lt;br /&gt;
	- You can ignore the problem if you know that both your mail reader&lt;br /&gt;
	  and procmail use an overlapping kernel locking method.&lt;br /&gt;
&lt;br /&gt;
18. Is procmail Y2K safe/compliant?&lt;br /&gt;
&lt;br /&gt;
	Both procmail and formail are believed to be Y2K compliant if&lt;br /&gt;
	your system&amp;#039;s libraries are Y2K compliant.  In particular, they&lt;br /&gt;
	use the time_t type to hold the current time when it is needed&lt;br /&gt;
	and print out the time using the ctime() library routine.&lt;br /&gt;
	However, no actual compliancy tests have been run, so you if&lt;br /&gt;
	you need that you&amp;#039;ll need to run them yourself.&lt;br /&gt;
&lt;br /&gt;
	For those who have examined the code themselves, the casting of&lt;br /&gt;
	a time_t value to unsigned long in formail.c is guaranteed to&lt;br /&gt;
	work according to the current version of the C language&lt;br /&gt;
	standard.  Future revisions of that standard may change that,&lt;br /&gt;
	at which time formail will be updated to work with both the new&lt;br /&gt;
	and the old standards.&lt;br /&gt;
&lt;br /&gt;
	Individual recipes and rcfiles may need to be checked for&lt;br /&gt;
	unsafe date handling.&lt;br /&gt;
&lt;br /&gt;
19. How can I make procmail deliver a message to all local users?  E-mail&lt;br /&gt;
    for several people all come into a single mailbox and I&amp;#039;m trying to&lt;br /&gt;
    split them back up.&lt;br /&gt;
&lt;br /&gt;
	If you are asking this, you are on the wrong track.  Procmail&lt;br /&gt;
	cannot route messages like this correctly without special help&lt;br /&gt;
	from the MTA (sendmail, qmail, etc).  For a more lengthy&lt;br /&gt;
	discussion about the issues, please refer to&lt;br /&gt;
	http://www.iki.fi/era/procmail/mini-faq.html#advanced&lt;br /&gt;
&lt;br /&gt;
20. None of the above topics cover my problem.	Should I panic?&lt;br /&gt;
&lt;br /&gt;
	Let me ask you a question :-), have you examined the CAVEATS,&lt;br /&gt;
	WARNINGS, BUGS and NOTES sections of the manual pages *closely* ?&lt;br /&gt;
	Have you checked any of the FAQs referenced from the procmail&lt;br /&gt;
	website, http://www.procmail.org, to see if the answer it?  If&lt;br /&gt;
	you have, well, then panic.  Or, alternatively, you could&lt;br /&gt;
	submit your question to the procmail mailinglist (see the man&lt;br /&gt;
	page for the exact addresses, or try &amp;quot;procmail -v&amp;quot;, or look in&lt;br /&gt;
	the patchlevel.h file).&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Woozle</name></author>
	</entry>
</feed>