create noreply email id in postfixadmin mysql database

create noreply email id in Virtual Domain and Users postfix mail server in postfixadmin’s mysql database

I always prefer to go with Postfix mail server with mysql and dovecot. For postfix mysql as backend I generally use the postfixadmin. Postfixadmin is easy to configure whereas through web interface or command line you can manage the multiple domain’s email accounts in a single mail hosting server.

If you are already aware about how to install and configure multiple virtual domain and email account in Postfix with mysql(Postfixadmin) as backened , this tutorial is easy to understand for you.

Okay lets start…. noreply,donotreply,no-reply,do-notreply etc. are email id which is generally used by many companies,organisation or websites to inform their recipients about some update but they also want when any user or recipient reply in these email id ,the email should go into some trash means not in inbox.

As these noreply email id describe itself if recipient reply to this email id ,no response or reply will come back.

Now as a Mail server admin how you should make a proper noreply email id.
I am taking an example from my own mail server setup on which I configure this email id.

Details :

Postfixadmin :Web interface to manage Mail accounts and mysql as backend for all data information plus authentication

MTA : Postfix

Database Name in mysql Server : postfix

Mysql Table name on which we will work : alias

Follow the given below steps to create the noreply email id.

Step 1: Open the postfixadmin web interface in your browser

Step 2: Click on “Virtual list” then click on “Add Mailbox” .
Create an email id with name called noreply or donotreply .

postfixadmin

Step 3 After creating the email id from postfix admin login into your mail server or the server where postfixadmin’s mysql server is located .

Login into mysql server

mysql -u root -p

(Here postfix is database name for postfixadmin, replace the database name as per your mysql details for postfixadmin)

mysql> use postfix ;

(Replace noreply@emaildomain.com with your noreply email id)

mysql> select * from alias where address='noreply@emaildomain.com';

+------------------------------+-------------------------------+------------------+---------------------+-------------------+--------+
| address                      | goto                          | domain           | created             | modified          | active|
+------------------------------+-------------------------------+------------------+---------------------+-------------------+--------+
| noreply@emaildomain.com      | noreply@emaildomain.com      | emaildomain.com | 2013-06-25 04:41:55 | 2013-06-25 04:41:55 |      1 |
+-------------------------------+-------------------------------+------------------+---------------------+-------------------+--------+
6 rows in set (0.00 sec)

mysql>

mysql> update alias set goto='devnull' where address='noreply@emaildomain.com';

mysql> select * from alias where address='noreply@emaildomain.com';
+--------------------------+---------+------------------+---------------------+---------------------+--------+
| address                  | goto    | domain           | created             | modified            | active |
+--------------------------+---------+------------------+---------------------+---------------------+--------+
| noreply@emaildomain.com  | devnull | emaildomain.com  | 2013-06-25 04:41:55 | 2013-06-25 04:41:55 |      1 |
+--------------------------+---------+------------------+---------------------+---------------------+--------+
1 row in set (0.00 sec)
 
mysql> exit;

In my case,I have set alias file path in postfix main.cf . Hence I will do changes in /etc/aliases file.
Check your main.cf file of postfix and do the changes in that file.

root@mail:/etc/postfix# grep alias main.cf
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
virtual_alias_maps = mysql:/etc/postfix/mysql_virtual_alias_maps.cf
root@mail:/etc/postfix#

Step 4 : Edit the alias file and write down alias for devnull

vi /etc/aliases

devnull: /dev/null

Step 5: Now run the command newaliases and restart the postfix (optional)

newaliases

Step 6: Now send a test email to noreply email id. The email should go to /dev/null . Means it will not go to inbox.

Below one is the mail server log details, see in last line it will give status “delivered to file: /dev/null”

Jul 1 06:27:03 mail postfix/qmgr[17117]: DF29E60752: from=<sender@gmail.com>, size=2014, nrcpt=1 (queue active)
Jul 1 06:27:03 mail postfix/local[17130]: DF29E60752: to=<devnull@mail.emaildomain.com>, orig_to=<noreply@emaildomain.com>, relay=local, delay=3.3, delays=3.3/0/0/0, dsn=2.0.0, status=sent (delivered to file: /dev/null)

FAQ

What is /dev/null ?

In Unix-like operating systems, /dev/null or the null device is a special file that discards all data written to it but reports that the write operation succeeded. It provides no data to any process that reads from it, yielding EOF immediately (courtesy : Wikipedia)

4 thoughts on “create noreply email id in postfixadmin mysql database”

  1. Hi Sharad
    I know this is an old post, but I hope you can give some guide anyways, being a newbie to postfix.
    I’ve created the alias, and also updated the database.
    First I tried setting the goto to devnull, that gave me an error that bounce.localdomain was not found
    I then tried going with the devnull@localdomain, but that tells me that devnull@localdomain.localdomain is not found.
    What is the correct setting here?

    Reply
    • Thankyou Alex,

      Your comment is useful. Will give some more understanding to newbie that this is also a possible scenario.

      Highly appreciated.

      Regards
      Sharad

      Reply

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.