hi frndz...
i m new to linux i need to config sendmail MTA and i hav to use procmail as filter and cyrus as LDA... plz help me guys ...
i need a sendmail config file for the above mentioned options ....

Dani AI

Generated

Good start by — invoking procmail from sendmail and then handing off to the Cyrus LDA is a common, workable pattern. A few practical points to make that arrangement robust and easier to maintain:

Edit the buildable config, not the generated file. Editing sendmail.cf by hand is fragile; change sendmail.mc (the m4 source) and regenerate sendmail.cf using the distro-recommended method (m4 or the /etc/mail make target). Keep a backup of the original sendmail.cf before any change. The mailer definition should invoke procmail while preserving the environment and pass the recipient name in an environment variable so the global procmail file can include per-user rule files.

Keep procmail global simple and safe. The global file should set PATH and the path to the Cyrus LDA, enable logging, include per-user RC files, and use locking on recipes to prevent concurrent-delivery corruption. Always have a final “catch-all” action that calls the Cyrus LDA so mail lands in the IMAP mailbox when no filter matches. Enable a procmail log (LOG or LOGFILE) to capture why a message matched or was delivered.

Permissions, security and debugging. Ensure the procmail global and per-user files are readable by the account procmail runs as (commonly the Cyrus user) but not world-writable. If SELinux or AppArmor is enabled, confirm the procmail/deliver binaries and maildirs have the correct contexts or profiles; audit denial messages when deliveries fail. For debugging, monitor the mail log (for example /var/log/maillog or /var/log/mail.log), check the procmail log, and inspect the mail queue for held messages.

Operational note. Procmail is an older tool and is not the preferred path for many modern deployments; for long-term setups consider server-side filtering that the IMAP server supports (Sieve/ManageSieve or native Cyrus filtering) for clearer security and easier per-user management.

hi guys i found a solution for that i think it will be helpfull to others by posting this ...


Edit /etc/ and look for the section that defines the Cyrus mailer. It will look something like the lines below. If you've customized your sendmail configuration, it might look slightly different, but will begin with the identifier "Mcyrus".

Mcyrus, P=/usr/cyrus/bin/deliver, F=lsDFMnPqA5@, S=10, R=20/40, T=X-Unix,
U=cyrus:mail,
A=deliver -e -m $h -- $u
Comment out that section and add the following lines below it:

Mcyrus, P=/usr/bin/procmail, F=lsDFMnPqA5@, S=10, R=20/40, T=X-Unix,
U=cyrus:mail,
A=procmail -p /var/imap/procmail/procmail.global CYRUSUSER=$u
The -p argument tells procmail to preserve the existing environment.The last parameter, /var/imap/procmail/procmail.global, tells procmail to use /var/imap/procmail/procmail.global to determine its filtering behavior. The last parameter, CYRUSUSER, sets the CYRUSUSER variable to username and passes the variable to procmail. CYRUSUSER is used in the procmail rules files

A Global procmail Rules File:
*********************************

# File: procmail.global

PATH=/usr/bin:/usr/local/bin:/usr/cyrus/bin
SHELL=/bin/sh
DELIVER=/usr/cyrus/bin/deliver
SPAM=/dev/null

# Make a backup copy of all incoming mail (comment the next entry
# out once you're finished testing procmail integration)
#:0 ic
#| $DELIVER -e -a $CYRUSUSER -m user.$CYRUSUSER.backup

# Execute CYRUSUSER's personal rules
INCLUDERC=/var/imap/procmail/user/procmail.$CYRUSUSER

[The user's procmail rules are included (via the INCLUDERC statement above)
and executed here. Rules after this point resume after the user's personal
rules have been executed.]

# Example recipes

# If the "To:" line doesn't exist, it's SPAM
:0:$CYRUSUSER.lock
* !^To:
| $SPAM

# Get rid of SPAM from a specific email address
:0:$CYRUSUSER.lock
* ^To:.*
| $SPAM

# All the mail that falls through to this point
# will be delivered into the user's INBOX
:0:$CYRUSUSER.lock
| $DELIVER -e -a $CYRUSUSER -m user.$CYRUSUSER
Personal procmail rules file

Each user has a personal procmail rules file. It's stored under /var/imap/procmail/user/ in the file procmail.username. The personal rules file is the file each user edits when he wants to change his filtering rules. If the file exists, the INCLUDERC statement in the global procmail rules file runs the rules in the personal file.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.