Discussion:
[bug-mailutils] Using maidag.
G.W. Haywood
2016-06-03 19:09:07 UTC
Permalink
Hi there,

I hope this is the right place for a question like this, I looked in
the list index and found nothing else I thought suitable.

Is there some documentation somewhere which will teach me how to use
maidag as a replacement for procmail in a sendmail setup?

I've read 'info mailutils' but it doesn't give me enough information
to be able to use maidag. I still have no idea how to write a simple
script for maidag to decide, based on the envelope sender, to which
one of two mail files a message is to be delivered.

For reference, here is the procmail recipe:

8<--------------------------------------------------
:0 :
* ^Return-Path:.*@jubileegroup.co.uk
/home/copy/mail/outgoing
:0 :
/home/copy/mail/incoming
8<--------------------------------------------------
--
73,
Ged.
William Hay
2016-06-04 13:20:34 UTC
Permalink
Post by G.W. Haywood
Hi there,
I hope this is the right place for a question like this, I looked in
the list index and found nothing else I thought suitable.
Is there some documentation somewhere which will teach me how to use
maidag as a replacement for procmail in a sendmail setup?
I've read 'info mailutils' but it doesn't give me enough information
to be able to use maidag. I still have no idea how to write a simple
script for maidag to decide, based on the envelope sender, to which
one of two mail files a message is to be delivered.
I have the following in my ~/.maidag which make maidag
use a specified sieve file:
filter{ language sieve; pattern "~/.mailfilter.sv";}

.mailfilter.sv contains my sieve rules. Sieve is a mailfiltering
language with multiple implementations and you can find
examples and tutorials from http://sieve.info/

William
G.W. Haywood
2016-06-05 09:08:41 UTC
Permalink
Hi there,

http://www.gnu.org/software/mailutils//manual/html_node/Debug-Statement.html#Debug-Statement

[QUOTE]
A comma before equal sign, as in 'mailbox:=<trace7' means [...]
[/QUOTE]

s/comma/colon/
--
73,
Ged.
G.W. Haywood
2016-06-08 10:22:33 UTC
Permalink
Hello again,

I wondered why the message below hadn't appeared on the list. I now
see that I sent it to Mr. Hay's email address and not to the list, I
hadn't set up my mail client properly at the time. Please accept my
apologies Mr. Hay, I do know better than that.
I have the following in my ~/.maidag ...
That looks like exactly what I need. Thank you.
I still seem to be missing a vital link in the chain.

What causes maidag to execute the filter? I have replaced procmail
with maidag in sendmail.cf, and mail is delivered to users' inboxes
(unix-style mboxes in /var/mail/). However it appears that the sieve
script in the home directory of user 'copy' is not called when mail is
delivered to 'copy'. Instead mail just stays in /var/mail/copy, as if
maidag has taken no action. There is no configuration in SYSCONFDIR
(/usr/local/etc/).

mail4:~# >>> maidag --show-config-options
VERSION=2.2 - Version of this package
SYSCONFDIR=/usr/local/etc - System configuration directory
MAILSPOOLDIR=/var/mail/ - Default mail spool directory
SCHEME=mbox - Default mailbox type
LOG_FACILITY=mail - Default syslog facility
USE_LIBPAM - PAM support
HAVE_LIBLTDL - a portable `dlopen' wrapper library
WITH_GNUTLS - TLS support using GNU TLS
WITH_PYTHON - Support for Python as extension language
WITH_PTHREAD - Support for POSIX threads
WITH_LDAP
ENABLE_VIRTUAL_DOMAINS - Support for virtual mail domains
ENABLE_IMAP - IMAP4 protocol support
ENABLE_POP - POP3 protocol support
ENABLE_MH - MH mail storage support
ENABLE_MAILDIR - Maildir mail storage support
ENABLE_SMTP - SMTP protocol support
ENABLE_SENDMAIL - Sendmail command line interface support
ENABLE_NNTP - NNTP protocol support

mail4:~# >>> cat /home/copy/.maidag # comments removed from the output below
#debug=trace2
debug {
level mailbox=trace2;
line-info true;
}
logging {
facility mail;
tag maidag ;
}
filter {
language sieve;
pattern "~/.mailfilter.sv";
}

mail4:~# >>> cat /home/copy/.mailfilter.sv
require ["fileinto"];
if address :is :domain "from" "jubileegroup.co.uk"
{
fileinto "/home/copy/mail/outgoing";
}
else
{
fileinto "/home/copy/mail/incoming";
}

mail4:~# >>> ls -lart /home/copy/.mailfilter.sv /home/copy/.maidag
-rwx------ 1 copy copy 395 Jun 4 22:42 /home/copy/.mailfilter.sv
-rwx------ 1 copy copy 454 Jun 5 09:58 /home/copy/.maidag

mail4:~# >>> maidag --config-lint --config-verbose
mail4:~# >>>

Mail delivered to user 'copy' is actually addressed (cc'd) to the
addresses '***@...' or '***@...' and that those addresses
are aliases for 'copy' in Sendmail's 'virtusertable' dbm file.

Once more, the working .procmailrc:

8<-----------------------------------
:0 :
* ^Return-Path:.*@jubileegroup.co.uk
/home/copy/mail/outgoing
:0 :
/home/copy/mail/incoming
8<-----------------------------------

What am I missing?
--
73,
Ged.
G.W. Haywood
2016-06-11 09:57:55 UTC
Permalink
Hello once again,
Post by G.W. Haywood
I still seem to be missing a vital link in the chain.
What causes maidag to execute the filter? I have replaced procmail
with maidag in sendmail.cf, and mail is delivered to users' inboxes
(unix-style mboxes in /var/mail/). However it appears that the sieve
script in the home directory of user 'copy' is not called when mail is
delivered to 'copy'. Instead mail just stays in /var/mail/copy, as if
maidag has taken no action. ...
There's been no reply, so this morning I have had to file just under a
thousand emails manually, abandon maidag and go back to procmail.
--
73,
Ged.
Loading...