Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > Linux Forums > Server Operation

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Thread Tools Display Modes
Old 8th January 2010, 13:04
ojha_riddhish ojha_riddhish is offline
Junior Member
Join Date: Jan 2010
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Question Sender Address Rewriting In Postfix!

Dear friends,

I am here with a typical problem with my home email server. I hope anyone of you would have exerienced the same problem I'm experiencing currently. Please help me or guide me if somebody knows something about it. Thanks in advance!
My requirement:
I want a mail server that can relay mails to the internet using GMail and fetch the mails of different accounts into the mail server and distribute them to their respective users. I am using Postfix, Fetchmail and Dovecot. I have a PC with 3 users. My father, brother and I use the PC having Ubuntu 9.04 and share the internet. We all send mail and retrieve mail. We do use Evolution and Mutt sometimes. We want to send our mails with our email_ids without even logging in.



raj======raj@mail.myhomepc.com=====thinking_raj@ya hoo.com
ravi=====ravi@mail.myhomepc.com====ravi_lonedreame r@gmail.com
raghav===raghav@mail.myhomepc.com===raghav123@redi ffmail.com

Whenever, I send a message using raj's account, the From address and Reply-To address contains raj@mail.myhomepc.com or raj@homepc.com. But I want it to be rewritten to my original email_id, that is, thinking_raj@yahoo.com. But somehow this is not happening.

My main.cf file contains:

smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
biff = no
append_dot_mydomain = no
readme_directory = no
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myhostname = mail.myhomepc.com
myorigin = /etc/mailname
mydestination = myhomepc.com, mail.myhomepc.com, localhost.myhomepc.com, localhost
mynetworks = [::ffff:]/104 [::1]/128
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
inet_protocols = all
smtpd_recipient_restrictions = permit_sasl_authenticated,permit_mynetworks,reject _unauth_destination
broken_sasl_auth_clients = yes
smtp_tls_CAfile = /etc/postfix/cacert.pem
smtp_tls_cert_file = /etc/postfix/MyHomePC-cert.pem
smtp_tls_key_file = /etc/postfix/MyHomePC-key.pem
smtp_use_tls = yes
smtpd_use_tls = yes
smtpd_tls_CAfile = /etc/postfix/cacert.pem
smtpd_tls_cert_file = /etc/postfix/MyHomePC-cert.pem
smtpd_tls_key_file = /etc/postfix/MyHomePC-key.pem
smtpd_tls_received_header = yes
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
tls_random_source = dev:/dev/urandom
smtpd_sasl_auth_enable = no
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtpd_sasl_local_domain = $myhostname
smtp_sasl_security_options = noanonymous
smtp_sasl_tls_security_options = noanonymous
smtpd_sasl_application_name = smtpd
smtp_tls_per_site = hash:/etc/postfix/tls_per_site
relayhost = [smtp.gmail.com]:587
disable_dns_lookups = yes
smtp_generic_maps = hash:/etc/postfix/generic
transport_maps = hash:/etc/postfix/transport

My sasl_passwd file contains:

[smtp.gmail.com]:587 ravi_lonedreamer@gmail.com:ravi's_password

My generic file contains:

raj@mail.myhomepc.com==========thinking_raj@yahoo. com
raj@myhomepc.com=============thinking_raj@yahoo.co m
raj@localhost.myhomepc.com=======thi...aj@yaho o.com
raj@localhost=================thinking_raj@yahoo.c om
ravi@mail.myhomepc.com=========ravi_...er@gm ail.com
ravi@myhomepc.com============ravi_lo...er@gmai l.com
ravi@localhost.myhomepc.com======rav...er@ gmail.com
ravi@localhost================ravi_l...er@gma il.com
raghav@mail.myhomepc.com=======ragha...diffmai l.com
raghav@myhomepc.com==========raghav123@rediffmail. com
raghav@localhost.myhomepc.com====rag...diffm ail.com
raghav@localhost==============raghav...diffmail .com

A part of my master.cf file contains:

relay unix - - - - - smtp
-o smtp_generic_maps=
-o smtp_fallback_relay=

I have created my custom certificate using SSL. I've created the Postfix's main.cf file following a tutorial on the net. Currently mails are going fine, but with our local email_ids. I want Postfix to rewrite our local email_ids with the equivalent email_id on the net. I know that it's possible, but somehow I can't figure it out. Please help me in either correcting the wrong configuration on my part or guiding me to achieving what I require. Thanks in advance!

Thanks & Regards,
Reply With Quote
Sponsored Links


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Need help get mail to work (can't recieve and apperently can't send) omega13a Installation/Configuration 19 20th August 2009 21:06
postfix, pop3 uvbnserved Server Operation 22 24th May 2009 21:00
Help needed error rpmbuild -ba postfix.spec mr_bo Installation/Configuration 2 15th May 2009 09:47
return address for bouncing msgs from hosted domain in postfix humpy Server Operation 2 11th March 2009 18:04
Postfix: connection refused error tosin Server Operation 1 30th October 2007 17:30

All times are GMT +2. The time now is 03:53.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.