Aug 052009

Postfix, by default only listen on ipv4 interface.
this is howto make Postfix listen on both ipv4/ipv6
This example using IPv6 address given by


-- others config --
-- snippet --
inet_protocols = ipv4, ipv6
inet_interfaces =,, [::1], [2001:470:19:xxxx::2]

mynetworks = [2001:470:19:xxxx::/64], [::1/128],,

-- others config --
-- end of snippet --

easy isn’t it? 🙂 IPv6 is enabled out of the box in postfix, all you have to is little configuration tweak.
Have a nice try 😉

Apr 282009

Biasanya From: header akan di isi oleh nilai dari settingan client masing2 user.

contoh: di thunderbird From: header akan di isi settingan dari Your Name:.

untuk email2 official From header bisa di paksakan supaya menggunakan nama user yg ada di database postfix user.
dengan bantuan altermime dan sedikit coding(c dan bash script).

altermime dapat di download disini:

Coding c (access mysql db):

fungsinya untuk query field “name” (nama lengkap email user) di database postfix

paste code ini di console editor.(vi atau pico)


main(int argc,char *argv[]) {
   MYSQL *conn;
   MYSQL_RES *res;
   MYSQL_ROW row;

   char *server = "localhost";
   char *user = "user";
   char *password = "password";
   char *database = "db";
   char strsql[512];

   if(argc != 2)
       printf("Usage: %s ’string query’\n", argv[0]);

   snprintf(strsql, 512, "SELECT REPLACE(TRIM(name),’\n’,”) FROM mailbox WHERE username=TRIM(’%s’)", argv[1]);

   conn = mysql_init(NULL);

   /* Connect to database */
   if (!mysql_real_connect(conn, server,
         user, password, database, 0, NULL, 0)) {
      fprintf(stderr, "%s\n", mysql_error(conn));

   /* send SQL query */
   if (mysql_query(conn, strsql)) {
      fprintf(stderr, "%s\n", mysql_error(conn));

   res = mysql_use_result(conn);

     while ( (row = mysql_fetch_row(res))  !=  NULL )
      printf("%s\n", row[0]);

   /* Release memory used to store results and close connection */

Continue reading »