Installing MailScanner on Fedora

Mail No Comments

Below is a great tutorial on how to build a Mail Server on Fedora with MailScanner, Squirrelmail, Mailwatch, spamassassin & ClamAV.

http://www.scudconsulting.com/docs/mailserver.html

Thank you

Postfix not delivering to Maildir

Mail, Red Hat No Comments

I came across this problem a few time and I keep forgetting the solution. Sometimes, even if you set in:

/etc/postfix/main.cf:

home_mailbox = Maildir/

postfix will still deliver to /var/spool/mail/user.

There are 2 ways to solve this problem:

1. you can disable procmail by removing the following line from /etc/postfix/main.cf:
mailbox_command = /usr/bin/procmail

2. If you need procmail, add the following lines to /etc/procmailrc:
MAILDIR=$HOME/Maildir
DEFAULT=${MAILDIR}/

That’s it!
–JC

Configure BCC Maps in Postfix

Mail No Comments

BCC maps are handled in postfix by the following tags:

always_bcc = address
Deliver a copy of all mail to the specified address. In Postfix versions before 2.1, this feature is implemented by smtpd(8), qmqpd(8), or pickup(8).

sender_bcc_maps = type:table
Search the specified “type:table” lookup table with the envelope sender address for an automatic BCC address. This feature is available in Postfix 2.1 and later.

recipient_bcc_maps = type:table
Search the specified “type:table” lookup table with the envelope recipient address for an automatic BCC address. This feature is available in Postfix 2.1 and later.

So this is how I did it:

Added the following lines to /etc/postfix/main.cf:

sender_bcc_maps = hash:/etc/postfix/bcc_maps
recipient_bcc_maps = hash:/etc/postfix/bcc_maps

Edited the file /etc/postfix/bcc_maps :

monitorme@linuxzone.org admin@linuxzone.org

This way for all messages sent and received by monitorme@linuxzone.org, a copy will be sent to admin@linuxzone.org

Ran postmap /etc/postfix/bcc_maps

restarted postfix.

Redirecting Ports Using iptables Prerouting

Commands, Firewall, Mail 2 Comments

Prerouting can be very useful if you need a quick fix and do not want to mess with the application itself. For example, if you need to have your MTA listen on port 587 and do not want to alter the configuration files (the daemon will not actually listen on port 587, iptables will redirect the traffic), you can use the following iptables rule to preroute traffic going to port 587 to port 25.

/sbin/iptables -t nat -I PREROUTING -p tcp --dport 587 -j REDIRECT --to-ports 25