Showing posts with label Postfix. Show all posts
Showing posts with label Postfix. Show all posts

Wednesday, September 1, 2010

using the mail command

To test postfix mail routing, use the mail command.

make sure mailutils is already installed

to send a message type:
mail -s (enter)
someone@home.com (enter)
(enter)
this is a test (enter)
control-d to send message
or
control-c twice to cancel message

Example:
mail -s testing
To: someone@home.com
CC:
This is a test of my postfix install/routing
^d

Monday, May 18, 2009

How to filter messages by Subject in Postfix

In Postfix in the main.cf file there is an entry for “header_checks = regexp:/etc/postfix/header_checks”

Under /etc/postfix/ edit the header_checks file
Here is an example of a header_checkes file with a filter:
##############################################
/^Subject:.*canceled: local event error/ DISCARD
/^Subject:/ WARN
##############################################
The line /^Subject:.*canceled: local event error/ DISCARD - will deleted without notice to the sender or sending server and log the action in the log file.

The line /^Subject:/ WARN will write the Subject of each message to the log file. This is handy when trying to find a specific message.

Wednesday, April 8, 2009

Postfix enable Subject for logging

To enable logging of the "Subject:" information feature in Postfix, you need to modify the "header_checks" file in the main.cf file.

To create a file use this:
"regexp:/etc/postfix/header_checks".

main.cf entry = "header_checks = regexp:/etc/postfix/header_checks"

Once that file is created, you need to modify the file by adding:
"/^Subject:/ WARN"

This will add the Subject text to the info or mail.info log file. You can then grep based on the subject text.

Friday, July 4, 2008

Postfix command -- helpful

postcat -q "msg id" to display the message within the cli.

Monday, August 6, 2007

Dovecot on Ubuntu

When using dovecot on ubuntu, be sure to apt-get install dovecot-imapd.

This is key....

Thursday, July 26, 2007

mandrake msec

msec is mandrakes security script. It runs in the hourly cron jobs.

To see what the script does go run "msec -o print=1" (man msec)

To change permissions that msec sets, edit /usr/share/msec/perm.* ( you can see which perm file to edit when you run "msec -o print=1"

I needed to change /var/spool/ chmod 1777 mail/ for IMAP to work.

From:
http://app.linux.org.mt/article/killspam

Note that Mandrake Linux will try to set the permissions back automatically to the default values through the msec program. To control this, edit the files /usr/share/msec/perm.*, find the line for /var/spool/mail, and set the permission to 1777.

Monday, July 23, 2007

Allow mail to be accepted by postfix

Starting with Postfix 2.0,by default it looks up the local_recipient_table for accepting messages. So by default it will not accept any connections past the "rcpt to" command if it is not valid.

To change this add the following line in the main.cf file:
/etc/postfix/main.cf
local_recipient_maps =

Friday, June 29, 2007

Postfix Generic senders address mapping

If you have a postfix server and you want to rewrite the senders address, you can add in the main.cf file the following:

smtp_generic_maps = hash:/etc/postfix/generic

# and in the generic file, add the following:

user@domain.com newuser@domain.com (where the user is the name of your accounts.)

any changes to the generic file, you need to rerun the postmap command:

postmap /etc/postfix/generic

then

postfix reload

To test this type:
postmap -q user@domain.com /etc/postfix/generic

you should see the new address you specified.