Commit a2e5cf00 a2e5cf00160b4f6556ee53e4fa57a7eb07ef38b3 by Wojciech Polak

Moved from ../

1 parent 8231f6e5
# This is an example configuration file for GNU comsatd utility.
# To use, run comsatd -c <path>/comsat.conf
## General settings
# Dump on screen at most 5 lines of the message body
max-lines 5
# Honour per-user .biffrc files
allow-biffrc yes
## Security settings
# Allow no more than 10 requests in 10 seconds, then register overflow.
max-requests 10
request-control-interval 10
# Sleep for 5 seconds when the first overflow occurs.
overflow-delay-time 5
# If two overflows happen within a 15 seconds interval, double the
# sleep time.
overflow-control-interval 15
## Access Control Lists
acl allow 127.0.0.1
acl deny any
# A sample per-user biff configuration file. It should be stored
# in user home directory and named .biffrc. It must be owned by
# the user and have permissions 0600
# Each line specifies an action to be taken upon arrival of
# a message. A backslash can be used to escape the newlines.
# Actions could be:
# beep -- Produce audible signal
# echo STRING -- Output STRING to the user's tty
# exec PROG ARGS... -- Execute given program
#
# This is the default action
echo "Mail to \a$u@$h\a\n---\n\
From: $H{from}\n\
Subject: $H{Subject}\n\
---\n\
$B(,5)\n\
---\n"
# For users of X windows system: produce a bell and open an xmessage window
beep
exec /usr/X11R6/bin/xmessage -display :0.0 -timeout 10 "Mail to $u@$h \n---\n\
From: $H{from}\n\
Subject: $H{Subject}\n\
---\n\
$B(,5)\n\
---\n"
auth required pam_unix_auth.so
account required pam_unix_acct.so
auth required pam_unix_auth.so
account required pam_unix_acct.so
## This is a sample mailutils configuration file
## Upon startup, a mailutils program scans this file for a line that
## begins either with a program name or with word `mailutils'. When
## found, the rest of the line following the first word is split up
## at whitespace characters and resulting words are added to the
## program arguments _before_ the command line options.
:mailutils --maildir /var/spool/mail
:auth --sql-host sql.sample.net --sql-db Passwd \
--sql-port 3306 --sql-user mailutils \
--sql-passwd guessme \
--sql-getpwnam 'select user_name,password,uid,10000,"/dev/null","/dev/null" from pass where user_name="%u" and service="EMAIL"' \
--sql-getpwuid 'select user_name,password,uid,10000,"/dev/null","/dev/null" from pass where uid=%u and service="EMAIL"'
imap4d --daemon=20 --timeout=1800
mail.local --source %h/.filter.scm
;;;; GNU Mailutils -- a suite of utilities for electronic mail
;;;; Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc.
;;;;
;;;; GNU Mailutils is free software; you can redistribute it and/or modify
;;;; it under the terms of the GNU General Public License as published by
;;;; the Free Software Foundation; either version 2, or (at your option)
;;;; any later version.
;;;;
;;;; GNU Mailutils is distributed in the hope that it will be useful,
;;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;;;; GNU General Public License for more details.
;;;;
;;;; You should have received a copy of the GNU General Public License
;;;; along with GNU Mailutils; if not, write to the Free Software
;;;; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
;;; This is a simple Guile program that generates automatic reply to
;;; incoming mail messages.
;;;
;;; usage: to your /etc/aliases add:
;;;
;;; username: "|/usr/local/bin/guimb -f <path>/reply.scm"
;;;
;;; and adjust variables below to your liking.
;;; Any message to the address username@your.host will be responded
;;; and (optionally) saved in a mailbox.
(define indent-prefix "> ")
(define save-mailbox #f)
(define reply-text
"Sorry, I am not here to attend your message. I will do\n\
it as soon as I come back.\n\n\
Kind regards\n")
;; Reply to the incoming message
(define (reply in-msg)
(let* ((out-msg (mu-message-create))
(in-port (mu-message-get-port in-msg "r"))
(out-port (mu-message-get-port out-msg "w")))
(mu-message-set-header out-msg "To"
(mu-message-get-header in-msg "From"))
(mu-message-set-header out-msg "Cc"
(mu-message-get-header in-msg "Cc"))
(mu-message-set-header out-msg "Subject"
(string-append
"Re: "
(mu-message-get-header in-msg "Subject")))
(display reply-text out-port)
(display "\n\nOriginal message:\n" out-port)
(do ((hdr (mu-message-get-header-fields in-msg) (cdr hdr)))
((null? hdr) #f)
(let ((s (car hdr)))
(display (string-append
indent-prefix
(car s) ": " (cdr s) "\n") out-port)))
(display (string-append indent-prefix "\n") out-port)
(do ((line (read-line in-port) (read-line in-port)))
((eof-object? line) #f)
(display (string-append indent-prefix line "\n") out-port))
(close-input-port in-port)
(close-output-port out-port)
(mu-message-send out-msg)))
;;; Upon receiving a message, store it away in the save mailbox and
;;; reply to the sender.
(let ((mbox (and save-mailbox (mu-mailbox-open save-mailbox "cw")))
(msg (mu-mailbox-get-message current-mailbox 1)))
(cond
(mbox
(mu-mailbox-append-message mbox msg)
(mu-mailbox-close mbox)))
(reply msg))
\ No newline at end of file