List Info

Thread: relay_recipient_maps for postfix




relay_recipient_maps for postfix
user name
2006-08-22 13:11:21
Yes I could have done that, but just because my user has a
email on the exchange server does not mean I want them to
get any email from the outside world 

-----Original Message-----
From: David Sims [mailto:dpsimsdpsims.com] 
Sent: Monday, August 21, 2006 5:33 PM
To: Dan OConnor
Cc: maia-usersrenaissoft.com
Subject: Re: [Maia-users] relay_recipient_maps for postfix

Hi,

  I think you want to use the postfix
reject_unverified_recipient command.
See http://www.postfix.org/ADDRESS_VERIFICATION_README.ht
ml.... The
reject_unverified_recipient will probe the downstream
postoffice to see if
the recipient is a valid one... and if not then reject the
message with a
450 (or 550 if you also use unverified_recipient_reject_code
= 550)...

Dave
************************************************************
***************
On Mon, 21 Aug 2006, Dan OConnor wrote:

> Hi All,
>
> I setup a script to pull a list of users from the Maia
db and use it for
> postfix for the relay_recipient_maps so it will reject
mail coming into
> the system that is not going to a valid mailbox. I have
spent the last
> couple weeks looking for something to do it, but either
I am oblivious
> to the utterly obvious and did not see it listed
anywhere or I just was
> not asking Google the right questions.  I am hardly an
expert so if you
> see anything missing or have idea give me a shout.
>
>
>
> =====================================================
>
>
>
> First in your main.cf file add this to the bottom.
>
> relay_recipient_maps =
hash:/etc/postfix/relay_recipients
>
>
>
> Also add this line, it can help to stop DOS attacks,
got it from the
> list, I can't remember who though, but thanks!
>
> unverified_recipient_reject_code = 550
>
>
>
> Do not restart postfix just yet 
>
> Go to your scripts dir in Maia and create a new file
called 'list' and
> add this to it.
>
>
>
> email
>
> yourdomain.com
>
> .
>
>
>
> You can also add any other domains you have in maia
here.
>
> Next make a new file called 'exportemail'
>
>
>
> #! /bin/bash
>
>
#########################################################
>
> # ExportEmail
>
> # -- Created By Dan O, Aug 21st 2006 --
>
> # Legacyboy at gmail dot com
>
> # This will export a list of users from the Maia
>
> # MySQL DB and creat the relay_recipients file
>
> # for Postfix.
>
>
########################################################
>
>
>
>
>
> ##Get the list of users from MySQL
>
>
>
> echo "select email from users;" | mysql -u
user -ppassword -D maia >
> dump
>
>
>
> ##Now remove the lines of Junk at the top
>
>
>
> IFS=$'\n'
>
> for NAME in $(cat list)
>
> do
>
> sed -i "\|^$NAME\$|d" dump
>
> done
>
>
>
> ##Add a OK to the end of each address
>
>
>
> sed 's/$/ OK/g' dump > relay_recipients
>
>
>
> ## Remove the dump file
>
> rm dump
>
>
>
> #Move the file to the /etc/postfix dir
>
> cp relay_recipients /etc/postfix/relay_recipients
>
> rm relay_recipients
>
> #Now we need to postmap the file so postfix can read
it.
>
> postmap /etc/postfix/relay_recipients
>
>
>
> ##-Fin-##
>
>
>
>
>
> Don't forget to chmod a+x the file.
>
> Then you can give it a run, check the final file in
/etc/postfix/ it
> should look like this
>
> emaildomain.com OK
>
> email2domain.com OK
>
> email3domain.com OK
>
> etc...
>
>
>
> If it looks good, give postfix a kick, if it breaks
just rem out those
> two lines we added.
>
>
>
> I have set mine up to run as a cron job every hour to
make sure the file
> is always up to date,
>
> Also at this point it will only run as root. (I know, I
know, I will fix
> it soon).
>
>
>
> Dan O'Connor CNA
>
> Network Support Technician
>
> St. Amant
>
> Ph: (204) 256-4301 ext. 2321
>
> Fax: (204) 254-3768
>
> Email: doconnorstamant.mb.ca
>
>
>
>
>




******* INTERNET E-MAIL CONFIDENTIALITY DISCLAIMER ********
This email and/or any documents in this transmission is
intended for the address(es) only and may contain legally
privileged or confidential information.  Any unauthorized
use, disclosure, distribution, copying or dissemination is
strictly prohibited.  If you receive this transmission in
error, please notify the sender immediately and return the
original.

St. Amant does not accept liability for any errors,
omissions, corruption or virus in the contents of this
message or any attachments that arise as a result of e-mail
transmission.

Ce courriel et tout document dans cette transmission est
destinÿÿ ÿÿ la personne ou aux personnes ÿÿ qui il est
adressÿÿ. Il peut contenir des informations ilÿÿgier ou
confidentielles. Toute utilisation, divulgation,
distribution, copie, ou diffusion non autorisÿÿe est
strictement dÿÿfendue. Si vous n'ÿÿtes pasdestinataire de
ce message, veuillez en informer l'expÿÿditeur
immÿÿdiatement et lui remettre l'original.

St. Amant ne prend aucune responsabilitÿÿ d'erreurs,
omissions, corruptions ou virus compris dans le contenu de
se message ou de n'importe quels attachement qui en est le
rÿÿsultat d'une transmission de courrier ÿÿlectronique.


>





******* INTERNET E-MAIL CONFIDENTIALITY DISCLAIMER ********
This email and/or any documents in this transmission is
intended for the address(es) only and may contain legally
privileged or confidential information.  Any unauthorized
use, disclosure, distribution, copying or dissemination is
strictly prohibited.  If you receive this transmission in
error, please notify the sender immediately and return the
original.

St. Amant does not accept liability for any errors,
omissions, corruption or virus in the contents of this
message or any attachments that arise as a result of e-mail
transmission.

Ce courriel et tout document dans cette transmission est
destiné à la personne ou aux personnes à qui il est
adressé. Il peut contenir des informations ilégier ou
confidentielles. Toute utilisation, divulgation,
distribution, copie, ou diffusion non autorisée est
strictement défendue. Si vous n'êtes pasdestinataire de
ce message, veuillez en informer l'expéditeur
immédiatement et lui remettre l'original.

St. Amant ne prend aucune responsabilité d'erreurs,
omissions, corruptions ou virus compris dans le contenu de
se message ou de n'importe quels attachement qui en est le
résultat d'une transmission de courrier électronique.

_______________________________________________
Maia-users mailing list
Maia-usersrenaissoft.com
http://www.renaissoft.com/mailman/listinfo/maia-users
[1]

about | contact  Other archives ( Real Estate discussion Medical topics )