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

SMTP Sender BCC - POSTFIX

If you want to make a Sender BCC for specific email account under your postfix, you can
add the following in your config.

Edit your main.cf, and add in below
   
    sender_bcc_maps = hash:/etc/postfix/sender_bcc

Now create a file for it

    echo "anthony@example.com     test@example.com" >> /etc/postfix/sender_bcc

Now, hash the file for postfix to read it

    postmap /etc/postfix/sender_bcc

And you will get a file named

    /etc/postfix/sender_bcc.db
   
Check on the timestamp, both should have the same timestamp

    -rw-r--r-- 1 root root        394 Mar 20 17:03 sender_bcc
    -rw-r--r-- 1 root root      12288 Mar 20 17:03 sender_bcc.db

Configuring SASL for SMTP authentication

Configuring SASL is easy, you just need to provide one configuration file called smtpd.conf which should be created in the directory ‘/usr/lib/sasl2/’ or ' /usr/lib64/sasl2/' if you are using 64bit. Startup your Terminal and create the smtpd.conf file with the following content or download one I prepared earlier at the bottom of this page:
pwcheck_method: authdaemond
log_level: 3
mech_list: PLAIN LOGIN
authdaemond_path:/usr/local/var/spool/authdaemon/socket
There will be an error when running this as it is configured currently because of permissions set on the authdaemond socket. In the mail.log you would see an error appear that says something like:
SASL authentication failure: cannot connect to Courier
          authdaemond: Permission denied
To prevent this error you need to execute the following command in a Terminal:
sudo chmod o+x /usr/local/var/spool/authdaemon
After that everything will be fine and working as expected.

how to set postfix mailbox size limit and message size limit

By default, attachment size that can be sent by postfix is 10MB ~ 10240000 byte. How did I know it? I looked in log file (for my system it is in /var/log/mail/errors. For other system, the file to look is/var/log/maillog). The line looked like this:

Feb 26 16:30:53 webmail postfix/sendmail[30775]: fatal: me@mymailserver.org(74): Message file too big

Solution
Open /etc/postfix/main.cf with a text editor of choice and find message_size_limit directive and change accordingly. If it is not there, add the directive like this:

message_size_limit = 20480000

This sets limit to 20MB.

Some other parameters you need to change are in file php.ini which is usually located in dir /etc. Set their parameters as above or higher values as below:
post_max_size = 20M
upload_max_filesize = 20M

reload or restart postfix when you're done: 


service postfix reload 

or 

service postfix restart

There's also mailbox_size_limit directive. You need to change this if SM can not open mailbox sized more than 10 MB.