Showing posts with label MX. Show all posts
Showing posts with label MX. Show all posts

MAILX: to send mail out from Linux cmd with attachment.


1. create a file under your user profile with contents below:
$ vi /home/user1/.mailrc

Contents:
account admin {
set from="admin@serverA.com"
set smtp=192.168.1.1:25
}

2. run from cmd
$ echo "test mail content" | mail -A admin -a file.jpg -s "test mail" abc@abc.com"

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

Mail SPAM DB List

If you suspect your mail server's IP address being blacklisted in those SPAM db.
Try to give a quick check via URLs below:

http://www.mxtoolbox.com/SuperTool.aspx
http://www.dnsbl.info/dnsbl-database-check.php
http://whatismyipaddress.com/blacklist-check

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.

Use telnet to test send mail

How to send mail using telnet

Commands below is to demonstrate how to use telnet to log into a server and send mail out.

If you are using Linux, in your terminal type commands below. If you are using MS Windows, type them in command prompt.


% telnet 127.0.0.1 25

Trying 127.0.0.1...

Connected to 127.0.0.1.

Escape character is '^]'.

220 domain ESMTP

helo dude

250 domain

mail my_name@domain

250 ok

rcpt my_name@domain

250 ok

data

354 go ahead

Subject: testing

This is a test.
.

250 ok 812345679 qp 12345

quit

221 domain

Connection closed by foreign host.

%