(Sendmail) Is possible to change the received email path?

Sendmail is the easiest mail system around but i've a specific need i'm not able to manage atm.

i'm using a software (that use the maildir structure) and i would like to move all received email in another folder instead of the default one.

I've not seen anything configurable into sendmail.cf that could help me. Anyone have solved this problem or i need to pass further and think about adding postfix?

Regards


Solution 1:

By default RHEL Sendmail uses procmail as the the local delivery agent, which you can easily tune from a ~/.procmailrc configuration file.

The sample .procmailrc below will duplicate each received message to two Maildir directories

### Keep carbon copy of message in ~/Backup_Inbox/
:0 c
./Backup_Inbox/
### Move messages to ~/Maildir/
:0w
./Maildir/

Solution 2:

That's a job for a mail delivery agent (MDA) instead of a mail transfer agent (MTA).

  • For a standalone solution there's Procmail, Maildrop, Sieve...
  • Some IMAP server suites like Dovecot and Cyrus IMAP includes a MDA.
  • You have Postfix as a tag. For Postfix, there's Postdrop.