Sponsored Content
Full Discussion: Postfix-postfwd testing
Top Forums UNIX for Advanced & Expert Users Postfix-postfwd testing Post 302378155 by fisfia on Monday 7th of December 2009 04:58:32 AM
Old 12-07-2009
Postfix-postfwd testing

Hi,

I'm trying to test rules set up with postfwd on postfix (under debian).

Just to try I took this rule:

Code:
id=RULE01 ; sender==user@lillefan.com ; action=REJECT not allowed

in postfwd.cf.

Restarted postfix. Postfwd is started with this command:

#postfwd -d -i 127.0.0.1 -p 10040 -u root -g root -f /etc/postfwd.cf

The rule works fine if I test it with telnet. If I try it with a script that uses mailx nothing happens. All the mail are still delivered with mailx. In telnet I am refused to send the mail.

Mailscript: (run by user, and tried to run as root too)
Code:
#!/bin/bash
i=0
while [ $i != 2500 ]; do
echo test | /bin/mail -s "test message$i" "user@lillefan.com"
i=$(( $i + 1 ))
done;

Who is recipient in the case of my script? Is that the problem? I thought if I'm user@server:~$ then "user" is recipient when I run the script?

In telnet I do this:

Code:
telnet localhost 25
mail from: user@lillefan.com
rcpt to: user2@lillefan.com
data
hello from user!
.
quit

In telnet I get this: "Recipient address rejected: not allowed". With my bash script I get all my mails delivered without protest.

I should also add that this system is not up in the network. It's just for testing. Except this problem with the postfwd rules postfix works fine and as far as I can see the logs are OK.

Grateful for any and all ideas and suggestions.
Thanks!
//fisfia
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Postfix

I can send email. I just can't receive email I am getting and error Permanent Failure: 554_Transaction_failed. All the services are running. I can telnet to 110 25 143. I am also running Imap. I can send and receive email internally I can send email outside of my network I can't receive emails... (3 Replies)
Discussion started by: rbizzell
3 Replies

2. UNIX for Advanced & Expert Users

Postfix 2.3.

When I use the postalias command I am getting an error that says no mapping in /etc/mail/mailer.conf. I am running FreeBsd 6.1 and in my main.cf I have my alias database is alias_maps= hash:/etc/mail/aliases I tried the command two different ways /usr/local/sbin/postalias /etc/mail/aliases... (2 Replies)
Discussion started by: rbizzell
2 Replies

3. Linux

postfix

hi when I telnet to my machine on port 25 and send an email to myself, the machine sends the email to the old corporate mail server instead of the new corporate mail server. how to change that so that any email sent from my linux box goes directly to the new mail server? thx (2 Replies)
Discussion started by: melanie_pfefer
2 Replies

4. UNIX for Dummies Questions & Answers

postfix

I have a strange problem I have a solaris 8 machine which sends me an email to my outlook every night about the status of the system. The end of this script looks like this mailx -s "$TITLE" mrxyz@mycompany.com < $TMPF and it is working fine My problem is when i just use mailx... (1 Reply)
Discussion started by: Tirmazi
1 Replies

5. IP Networking

postfix - reinject mail to postfix from hold queue directory

hi all. Am using smtpd_recipient_restrictions & check_recipient_access in postfix. The hash file looks like this: emailaddress1 HOLD emailaddress2 HOLD The aim is to place email from these recipients in the hold directory,check them then reinject them back in postfix on some... (0 Replies)
Discussion started by: coolatt
0 Replies

6. Solaris

Postfix

recently installed postfix on Solaris 10 but can not find the folder where you install the application to set the default main.cf postfix brings. solaris that saves the configuration part of the applications that are installed. thank (4 Replies)
Discussion started by: cejodrake
4 Replies

7. UNIX for Dummies Questions & Answers

Please help with Postfix config issue - How to allow remote Exchange server to relay to my postfix

Hi guys One of our clients have a problem with sending email to a certain domain. No matter what we try, the mails just dont get delivered. What I did then, is created a new connector on their Exchange server, pointing all mail sent to their client at "domain1" to relay to our Postfix mail... (0 Replies)
Discussion started by: wbdevilliers
0 Replies

8. UNIX and Linux Applications

mynetworks - postfix

Hi guys. I want to allow all IPs to use my smtp server running postfix. what should i write in mynetworks parameter? (1 Reply)
Discussion started by: majid.merkava
1 Replies

9. UNIX and Linux Applications

Postfix: Active Directory and postfix alias

I have a mailserver with postfix i want to alias all mail for administrator@domain.fqdn to root@domain.fqdn I have the aliases configured,and i did newliases but doesn't work. How to did this?Postfix is configured for virtual domain on ad server. (2 Replies)
Discussion started by: Linusolaradm1
2 Replies

10. UNIX for Dummies Questions & Answers

Postfix Problem

Hello, I have a problem remotely connecting to the postfix. It sais "Connection refused". # telnet 104.200.16.232 25 Trying 104.200.16.232... telnet: connect to address 104.200.16.232: Connection refused But the postfix is started and running. # telnet 127.0.0.1 25 Trying... (3 Replies)
Discussion started by: galford
3 Replies
POSTFIX-WRAPPER(5)						File Formats Manual						POSTFIX-WRAPPER(5)

NAME
postfix-wrapper - Postfix multi-instance API DESCRIPTION
Support for managing multiple Postfix instances is available as of version 2.6. Instances share executable files and documentation, but have their own directories for configuration, queue and data files. This document describes how the familiar "postfix start" etc. user interface can be used to manage one or multiple Postfix instances, and gives details of an API to coordinate activities between the postfix(1) command and a multi-instance manager program. With multi-instance support, the default Postfix instance is always required. This instance is identified by the config_directory parame- ter's default value. GENERAL OPERATION
Multi-instance support is backwards compatible: when you run only one Postfix instance, commands such as "postfix start" will not change behavior at all. Even with multiple Postfix instances, you can keep using the same postfix commands in boot scripts, upgrade procedures, and other places. The commands do more work, but humans are not forced to learn new tricks. For example, to start all Postfix instances, use: # postfix start Other postfix(1) commands also work as expected. For example, to find out what Postfix instances exist in a multi-instance configuration, use: # postfix status This enumerates the status of all Postfix instances within a multi-instance configuration. MANAGING AN INDIVIDUAL POSTFIX INSTANCE
To manage a specific Postfix instance, specify its configuration directory on the postfix(1) command line: # postfix -c /path/to/config_directory command Alternatively, the postfix(1) command accepts the instance's configuration directory via the MAIL_CONFIG environment variable (the -c com- mand-line option has higher precedence). Otherwise, the postfix(1) command will operate on all Postfix instances. ENABLING
POSTFIX(1) MULTI-INSTANCE MODE By default, the postfix(1) command operates in single-instance mode. In this mode the command invokes the postfix-script file directly (currently installed in the daemon directory). This file contains the commands that start or stop one Postfix instance, that upgrade the configuration of one Postfix instance, and so on. When the postfix(1) command operates in multi-instance mode as discussed below, the command needs to execute start, stop, etc. commands for each Postfix instance. This multiplication of commands is handled by a multi-instance manager program. Turning on postfix(1) multi-instance mode goes as follows: in the default Postfix instance's main.cf file, 1) specify the pathname of a multi-instance manager program with the multi_instance_wrapper parameter; 2) populate the multi_instance_directories parameter with the configuration directory pathnames of additional Postfix instances. For example: /etc/postfix/main.cf: multi_instance_wrapper = $daemon_directory/postfix-wrapper multi_instance_directories = /etc/postfix-test The $daemon_directory/postfix-wrapper file implements a simple manager and contains instructions for creating Postfix instances by hand. The postmulti(1) command provides a more extensive implementation including support for life-cycle management. The multi_instance_directories and other main.cf parameters are listed below in the CONFIGURATION PARAMETERS section. In multi-instance mode, the postfix(1) command invokes the $multi_instance_wrapper command instead of the postfix-script file. This multi- instance manager in turn executes the postfix(1) command in single-instance mode for each Postfix instance. To illustrate the main ideas behind multi-instance operation, below is an example of a simple but useful multi-instance manager implementa- tion: #!/bin/sh : ${command_directory?"do not invoke this command directly"} POSTCONF=$command_directory/postconf POSTFIX=$command_directory/postfix instance_dirs=`$POSTCONF -h multi_instance_directories | sed 's/,/ /'` || exit 1 err=0 for dir in $config_directory $instance_dirs do case "$1" in stop|abort|flush|reload|drain) test "`$POSTCONF -c $dir -h multi_instance_enable`" = yes || continue;; start) test "`$POSTCONF -c $dir -h multi_instance_enable`" = yes || { $POSTFIX -c $dir check || err=$? continue };; esac $POSTFIX -c $dir "$@" || err=$? done exit $err PER-INSTANCE MULTI-INSTANCE MANAGER CONTROLS Each Postfix instance has its own main.cf file with parameters that control how the multi-instance manager operates on that instance. This section discusses the most important settings. The setting "multi_instance_enable = yes" allows the multi-instance manager to start (stop, etc.) the corresponding Postfix instance. For safety reasons, this setting is not the default. The default setting "multi_instance_enable = no" is useful for manual testing with "postfix -c /path/name start" etc. The multi-instance manager will not start such an instance, and it will skip commands such as "stop" or "flush" that require a running Postfix instance. The multi-instance manager will execute commands such as "check", "set-permissions" or "upgrade-configuration", and it will replace "start" by "check" so that problems will be reported even when the instance is disabled. MAINTAINING SHARED AND NON-SHARED FILES Some files are shared between Postfix instances, such as executables and manpages, and some files are per-instance, such as configuration files, mail queue files, and data files. See the NON-SHARED FILES section below for a list of per-instance files. Before Postfix multi-instance support was implemented, the executables, manpages, etc., have always been maintained as part of the default Postfix instance. With multi-instance support, we simply continue to do this. Specifically, a Postfix instance will not check or update shared files when that instance's config_directory value is listed with the default main.cf file's multi_instance_directories parameter. The consequence of this approach is that the default Postfix instance should be checked and updated before any other instances. MULTI-INSTANCE API SUMMARY Only the multi-instance manager implements support for the multi_instance_enable configuration parameter. The multi-instance manager will start only Postfix instances whose main.cf file has "multi_instance_enable = yes". A setting of "no" allows a Postfix instance to be tested by hand. The postfix(1) command operates on only one Postfix instance when the -c option is specified, or when MAIL_CONFIG is present in the process environment. This is necessary to terminate recursion. Otherwise, when the multi_instance_directories parameter value is non-empty, the postfix(1) command executes the command specified with the multi_instance_wrapper parameter, instead of executing the commands in postfix-script. The multi-instance manager skips commands such as "stop" or "reload" that require a running Postfix instance, when an instance does not have "multi_instance_enable = yes". This avoids false error messages. The multi-instance manager replaces a "start" command by "check" when a Postfix instance's main.cf file does not have "multi_instance_enable = yes". This substitution ensures that problems will be reported even when the instance is disabled. No Postfix command or script will update or check shared files when its config_directory value is listed in the default main.cf's multi_instance_directories parameter value. Therefore, the default instance should be checked and updated before any Postfix instances that depend on it. Set-gid commands such as postdrop(1) and postqueue(1) effectively append the multi_instance_directories parameter value to the legacy alternate_config_directories parameter value. The commands use this information to determine whether a -c option or MAIL_CONFIG environment setting specifies a legitimate value. The legacy alternate_config_directories parameter remains necessary for non-default Postfix instances that are running different versions of Postfix, or that are not managed together with the default Postfix instance. ENVIRONMENT VARIABLES
MAIL_CONFIG When present, this forces the postfix(1) command to operate only on the specified Postfix instance. This environment variable is exported by the postfix(1) -c option, so that postfix(1) commands in descendant processes will work correctly. CONFIGURATION PARAMETERS
The text below provides only a parameter summary. See postconf(5) for more details. multi_instance_directories (empty) An optional list of non-default Postfix configuration directories; these directories belong to additional Postfix instances that share the Postfix executable files and documentation with the default Postfix instance, and that are started, stopped, etc., together with the default Postfix instance. multi_instance_wrapper (empty) The pathname of a multi-instance manager command that the postfix(1) command invokes when the multi_instance_directories parameter value is non-empty. multi_instance_name (empty) The optional instance name of this Postfix instance. multi_instance_group (empty) The optional instance group name of this Postfix instance. multi_instance_enable (no) Allow this Postfix instance to be started, stopped, etc., by a multi-instance manager. NON-SHARED FILES config_directory (see 'postconf -d' output) The default location of the Postfix main.cf and master.cf configuration files. data_directory (see 'postconf -d' output) The directory with Postfix-writable data files (for example: caches, pseudo-random numbers). queue_directory (see 'postconf -d' output) The location of the Postfix top-level queue directory. SEE ALSO
postfix(1) Postfix control program postmulti(1) full-blown multi-instance manager $daemon_directory/postfix-wrapper simple multi-instance manager LICENSE
The Secure Mailer license must be distributed with this software. AUTHOR(S) Wietse Venema IBM T.J. Watson Research P.O. Box 704 Yorktown Heights, NY 10598, USA POSTFIX-WRAPPER(5)
All times are GMT -4. The time now is 11:57 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy