Php & Postfix

I'm trying to configure my /usr/local/php.ini to allow the mail() command from php to use Postfix as SMTP relay.
All the explanations I found around don't help, maybe I didn't look at the right place.
Any ideas? or solutions?
Thierry

Excellent !!!
the fact was. Everything was ok without any modification of the php.ini file (whaterver the location or type of php configuration), but it is impossible to send a message to an account sitting on the same machine.
I guess this: if you machine ip is 192.168.1.5, this machien host DNS, Apache, Postfix and some user accounts. If you want to send a message to john.smth which is a local user, you would have to mail him from php:
mail("[email protected]","php message","hello World \n\n");
This doesn't work!! I guess it's a postfix configuration problem and DNS interaction, don't you?
If you just send [email protected] averything is ok.
Thanks
Thierry

Similar Messages

  • Php & postfix mail problem [solved]

    Was having a battle with php mail() and it not wanting to send with postfix.
    Struggle ensued, and just as I though I was beaten, a dancing sandwich showed me the light!
    this was in my php.ini file..
    sendmail_path = /usr/sbin/sendmail
    for postfix, this is what you need
    sendmail_path = /usr/sbin/sendmail -t -i
    And there was much rejoicing in the land.

    Aug 11 11:52:25 hanna postfix/smtpd[13463]: fatal: incorrect version of Berkeley DB: compiled against 4.3.29, run-time linked against 4.4.20
    Within that line the error is. It was due to the fact that some librarys and such had been updated whilst the postfix-mysql hadn't been recompiled to meet these new dependencys or whatever you want to call them. Simple as that, I just got the pkgbuild file for postfix-mysql and remade the package and voila, it works like a charm!

  • [SOLVED]Issue with Postfix sending to external mail addresses

    I'm having a very silly issue with Postfix. I followed the wiki article at [link]https://wiki.archlinux.org/index.php/Postfix[/link], and everything seems to work properly, however I cannot send to emails outside of my domain.
    I get the error:
    550 5.1.1 <[email protected]>: Recipient address rejected: Local delivery only!
    Here is what the logs say:
    May 08 16:05:12 my.dns.stuff.org postfix/smtpd[31464]: connect from localhost.localdomain[127.0.0.1]
    May 08 16:05:12 my.dns.stuff.org postfix/smtpd[31464]: 091E011E3C: client=localhost.localdomain[127.0.0.1]
    May 08 16:05:12 my.dns.stuff.org postfix/smtpd[31464]: 091E011E3C: reject: RCPT from localhost.localdomain[127.0.0.1]: 550 5.1.1 <[email protected]>: Recipient address rejected: Local delivery only!; from=<[email protected]> to=<[email protected]> proto=ESMTP helo=<sendingdomain.com>
    May 08 16:05:12 my.dns.stuff.org postfix/smtpd[31464]: lost connection after RCPT from localhost.localdomain[127.0.0.1]
    May 08 16:05:12 my.dns.stuff.org postfix/smtpd[31464]: disconnect from localhost.localdomain[127.0.0.1]
    May 08 16:05:14 my.dns.stuff.org sudo[31476]: me : TTY=pts/0 ; PWD=/etc/postfix ; USER=root ; COMMAND=/usr/bin/journalctl
    main.cf
    # Global Postfix configuration file. This file lists only a subset
    # of all parameters. For the syntax, and for a complete parameter
    # list, see the postconf(5) manual page (command: "man 5 postconf").
    # For common configuration examples, see BASIC_CONFIGURATION_README
    # and STANDARD_CONFIGURATION_README. To find these documents, use
    # the command "postconf html_directory readme_directory", or go to
    # http://www.postfix.org/BASIC_CONFIGURATION_README.html etc.
    # For best results, change no more than 2-3 parameters at a time,
    # and test if Postfix still works after every change.
    # SOFT BOUNCE
    # The soft_bounce parameter provides a limited safety net for
    # testing. When soft_bounce is enabled, mail will remain queued that
    # would otherwise bounce. This parameter disables locally-generated
    # bounces, and prevents the SMTP server from rejecting mail permanently
    # (by changing 5xx replies into 4xx replies). However, soft_bounce
    # is no cure for address rewriting mistakes or mail routing mistakes.
    #soft_bounce = no
    # LOCAL PATHNAME INFORMATION
    # The queue_directory specifies the location of the Postfix queue.
    # This is also the root directory of Postfix daemons that run chrooted.
    # See the files in examples/chroot-setup for setting up Postfix chroot
    # environments on different UNIX systems.
    queue_directory = /var/spool/postfix
    # The command_directory parameter specifies the location of all
    # postXXX commands.
    command_directory = /usr/bin
    # The daemon_directory parameter specifies the location of all Postfix
    # daemon programs (i.e. programs listed in the master.cf file). This
    # directory must be owned by root.
    daemon_directory = /usr/lib/postfix
    # The data_directory parameter specifies the location of Postfix-writable
    # data files (caches, random numbers). This directory must be owned
    # by the mail_owner account (see below).
    data_directory = /var/lib/postfix
    # QUEUE AND PROCESS OWNERSHIP
    # The mail_owner parameter specifies the owner of the Postfix queue
    # and of most Postfix daemon processes. Specify the name of a user
    # account THAT DOES NOT SHARE ITS USER OR GROUP ID WITH OTHER ACCOUNTS
    # AND THAT OWNS NO OTHER FILES OR PROCESSES ON THE SYSTEM. In
    # particular, don't specify nobody or daemon. PLEASE USE A DEDICATED
    # USER.
    mail_owner = postfix
    # The default_privs parameter specifies the default rights used by
    # the local delivery agent for delivery to external file or command.
    # These rights are used in the absence of a recipient user context.
    # DO NOT SPECIFY A PRIVILEGED USER OR THE POSTFIX OWNER.
    #default_privs = nobody
    # INTERNET HOST AND DOMAIN NAMES
    # The myhostname parameter specifies the internet hostname of this
    # mail system. The default is to use the fully-qualified domain name
    # from gethostname(). $myhostname is used as a default value for many
    # other configuration parameters.
    #myhostname = host.domain.tld
    myhostname = mail.sendingdomain.com
    # The mydomain parameter specifies the local internet domain name.
    # The default is to use $myhostname minus the first component.
    # $mydomain is used as a default value for many other configuration
    # parameters.
    mydomain = www.sendingdomain.com
    # SENDING MAIL
    # The myorigin parameter specifies the domain that locally-posted
    # mail appears to come from. The default is to append $myhostname,
    # which is fine for small sites. If you run a domain with multiple
    # machines, you should (1) change this to $mydomain and (2) set up
    # a domain-wide alias database that aliases each user to
    # [email protected].
    # For the sake of consistency between sender and recipient addresses,
    # myorigin also specifies the default domain name that is appended
    # to recipient addresses that have no @domain part.
    #myorigin = $myhostname
    myorigin = $mydomain
    append_dot_mydomain = no
    # RECEIVING MAIL
    # The inet_interfaces parameter specifies the network interface
    # addresses that this mail system receives mail on. By default,
    # the software claims all active interfaces on the machine. The
    # parameter also controls delivery of mail to user@[ip.address].
    # See also the proxy_interfaces parameter, for network addresses that
    # are forwarded to us via a proxy or network address translator.
    # Note: you need to stop/start Postfix when this parameter changes.
    inet_interfaces = all
    #inet_interfaces = loopback-only
    #inet_interfaces = $myhostname
    #inet_interfaces = $myhostname, localhost
    # The proxy_interfaces parameter specifies the network interface
    # addresses that this mail system receives mail on by way of a
    # proxy or network address translation unit. This setting extends
    # the address list specified with the inet_interfaces parameter.
    # You must specify your proxy/NAT addresses when your system is a
    # backup MX host for other domains, otherwise mail delivery loops
    # will happen when the primary MX host is down.
    #proxy_interfaces =
    #proxy_interfaces = 1.2.3.4
    # The mydestination parameter specifies the list of domains that this
    # machine considers itself the final destination for.
    # These domains are routed to the delivery agent specified with the
    # local_transport parameter setting. By default, that is the UNIX
    # compatible delivery agent that lookups all recipients in /etc/passwd
    # and /etc/aliases or their equivalent.
    # The default is $myhostname + localhost.$mydomain. On a mail domain
    # gateway, you should also include $mydomain.
    # Do not specify the names of virtual domains - those domains are
    # specified elsewhere (see VIRTUAL_README).
    # Do not specify the names of domains that this machine is backup MX
    # host for. Specify those names via the relay_domains settings for
    # the SMTP server, or use permit_mx_backup if you are lazy (see
    # STANDARD_CONFIGURATION_README).
    # The local machine is always the final destination for mail addressed
    # to user@[the.net.work.address] of an interface that the mail system
    # receives mail on (see the inet_interfaces parameter).
    # Specify a list of host or domain names, /file/name or type:table
    # patterns, separated by commas and/or whitespace. A /file/name
    # pattern is replaced by its contents; a type:table is matched when
    # a name matches a lookup key (the right-hand side is ignored).
    # Continue long lines by starting the next line with whitespace.
    # See also below, section "REJECTING MAIL FOR UNKNOWN LOCAL USERS".
    #mydestination = $myhostname, localhost.$mydomain, localhost
    #mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain
    mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain
    #mydestination = localhost
    # mail.$mydomain, www.$mydomain, ftp.$mydomain
    # REJECTING MAIL FOR UNKNOWN LOCAL USERS
    # The local_recipient_maps parameter specifies optional lookup tables
    # with all names or addresses of users that are local with respect
    # to $mydestination, $inet_interfaces or $proxy_interfaces.
    # If this parameter is defined, then the SMTP server will reject
    # mail for unknown local users. This parameter is defined by default.
    # To turn off local recipient checking in the SMTP server, specify
    # local_recipient_maps = (i.e. empty).
    # The default setting assumes that you use the default Postfix local
    # delivery agent for local delivery. You need to update the
    # local_recipient_maps setting if:
    # - You define $mydestination domain recipients in files other than
    # /etc/passwd, /etc/aliases, or the $virtual_alias_maps files.
    # For example, you define $mydestination domain recipients in
    # the $virtual_mailbox_maps files.
    # - You redefine the local delivery agent in master.cf.
    # - You redefine the "local_transport" setting in main.cf.
    # - You use the "luser_relay", "mailbox_transport", or "fallback_transport"
    # feature of the Postfix local delivery agent (see local(8)).
    # Details are described in the LOCAL_RECIPIENT_README file.
    # Beware: if the Postfix SMTP server runs chrooted, you probably have
    # to access the passwd file via the proxymap service, in order to
    # overcome chroot restrictions. The alternative, having a copy of
    # the system passwd file in the chroot jail is just not practical.
    # The right-hand side of the lookup tables is conveniently ignored.
    # In the left-hand side, specify a bare username, an @domain.tld
    # wild-card, or specify a [email protected] address.
    #local_recipient_maps = unix:passwd.byname $alias_maps
    local_recipient_maps = proxy:unix:passwd.byname $alias_maps
    #local_recipient_maps =
    # The unknown_local_recipient_reject_code specifies the SMTP server
    # response code when a recipient domain matches $mydestination or
    # ${proxy,inet}_interfaces, while $local_recipient_maps is non-empty
    # and the recipient address or address local-part is not found.
    # The default setting is 550 (reject mail) but it is safer to start
    # with 450 (try again later) until you are certain that your
    # local_recipient_maps settings are OK.
    unknown_local_recipient_reject_code = 550
    # TRUST AND RELAY CONTROL
    # The mynetworks parameter specifies the list of "trusted" SMTP
    # clients that have more privileges than "strangers".
    # In particular, "trusted" SMTP clients are allowed to relay mail
    # through Postfix. See the smtpd_recipient_restrictions parameter
    # in postconf(5).
    # You can specify the list of "trusted" network addresses by hand
    # or you can let Postfix do it for you (which is the default).
    # By default (mynetworks_style = subnet), Postfix "trusts" SMTP
    # clients in the same IP subnetworks as the local machine.
    # On Linux, this does works correctly only with interfaces specified
    # with the "ifconfig" command.
    # Specify "mynetworks_style = class" when Postfix should "trust" SMTP
    # clients in the same IP class A/B/C networks as the local machine.
    # Don't do this with a dialup site - it would cause Postfix to "trust"
    # your entire provider's network. Instead, specify an explicit
    # mynetworks list by hand, as described below.
    # Specify "mynetworks_style = host" when Postfix should "trust"
    # only the local machine.
    #mynetworks_style = class
    #mynetworks_style = subnet
    mynetworks_style = host
    # Alternatively, you can specify the mynetworks list by hand, in
    # which case Postfix ignores the mynetworks_style setting.
    # Specify an explicit list of network/netmask patterns, where the
    # mask specifies the number of bits in the network part of a host
    # address.
    # You can also specify the absolute pathname of a pattern file instead
    # of listing the patterns here. Specify type:table for table-based lookups
    # (the value on the table right-hand side is not used).
    #mynetworks = 168.100.189.0/28, 127.0.0.0/8
    #mynetworks = $config_directory/mynetworks
    #mynetworks = hash:/etc/postfix/network_table
    # The relay_domains parameter restricts what destinations this system will
    # relay mail to. See the smtpd_recipient_restrictions description in
    # postconf(5) for detailed information.
    # By default, Postfix relays mail
    # - from "trusted" clients (IP address matches $mynetworks) to any destination,
    # - from "untrusted" clients to destinations that match $relay_domains or
    # subdomains thereof, except addresses with sender-specified routing.
    # The default relay_domains value is $mydestination.
    # In addition to the above, the Postfix SMTP server by default accepts mail
    # that Postfix is final destination for:
    # - destinations that match $inet_interfaces or $proxy_interfaces,
    # - destinations that match $mydestination
    # - destinations that match $virtual_alias_domains,
    # - destinations that match $virtual_mailbox_domains.
    # These destinations do not need to be listed in $relay_domains.
    # Specify a list of hosts or domains, /file/name patterns or type:name
    # lookup tables, separated by commas and/or whitespace. Continue
    # long lines by starting the next line with whitespace. A file name
    # is replaced by its contents; a type:name table is matched when a
    # (parent) domain appears as lookup key.
    # NOTE: Postfix will not automatically forward mail for domains that
    # list this system as their primary or backup MX host. See the
    # permit_mx_backup restriction description in postconf(5).
    relay_domains = $mydestination
    # INTERNET OR INTRANET
    # The relayhost parameter specifies the default host to send mail to
    # when no entry is matched in the optional transport(5) table. When
    # no relayhost is given, mail is routed directly to the destination.
    # On an intranet, specify the organizational domain name. If your
    # internal DNS uses no MX records, specify the name of the intranet
    # gateway host instead.
    # In the case of SMTP, specify a domain, host, host:port, [host]:port,
    # [address] or [address]:port; the form [host] turns off MX lookups.
    # If you're connected via UUCP, see also the default_transport parameter.
    #relayhost = $mydomain
    #relayhost = [gateway.my.domain]
    #relayhost = [mailserver.isp.tld]
    #relayhost = uucphost
    #relayhost = [an.ip.add.ress]
    default_transport = error: Local delivery only!
    # REJECTING UNKNOWN RELAY USERS
    # The relay_recipient_maps parameter specifies optional lookup tables
    # with all addresses in the domains that match $relay_domains.
    # If this parameter is defined, then the SMTP server will reject
    # mail for unknown relay users. This feature is off by default.
    # The right-hand side of the lookup tables is conveniently ignored.
    # In the left-hand side, specify an @domain.tld wild-card, or specify
    # a [email protected] address.
    #relay_recipient_maps = hash:/etc/postfix/relay_recipients
    # INPUT RATE CONTROL
    # The in_flow_delay configuration parameter implements mail input
    # flow control. This feature is turned on by default, although it
    # still needs further development (it's disabled on SCO UNIX due
    # to an SCO bug).
    # A Postfix process will pause for $in_flow_delay seconds before
    # accepting a new message, when the message arrival rate exceeds the
    # message delivery rate. With the default 100 SMTP server process
    # limit, this limits the mail inflow to 100 messages a second more
    # than the number of messages delivered per second.
    # Specify 0 to disable the feature. Valid delays are 0..10.
    #in_flow_delay = 1s
    # ADDRESS REWRITING
    # The ADDRESS_REWRITING_README document gives information about
    # address masquerading or other forms of address rewriting including
    # username->Firstname.Lastname mapping.
    # ADDRESS REDIRECTION (VIRTUAL DOMAIN)
    # The VIRTUAL_README document gives information about the many forms
    # of domain hosting that Postfix supports.
    # "USER HAS MOVED" BOUNCE MESSAGES
    # See the discussion in the ADDRESS_REWRITING_README document.
    # TRANSPORT MAP
    # See the discussion in the ADDRESS_REWRITING_README document.
    # ALIAS DATABASE
    # The alias_maps parameter specifies the list of alias databases used
    # by the local delivery agent. The default list is system dependent.
    # On systems with NIS, the default is to search the local alias
    # database, then the NIS alias database. See aliases(5) for syntax
    # details.
    # If you change the alias database, run "postalias /etc/aliases" (or
    # wherever your system stores the mail alias file), or simply run
    # "newaliases" to build the necessary DBM or DB file.
    # It will take a minute or so before changes become visible. Use
    # "postfix reload" to eliminate the delay.
    #alias_maps = dbm:/etc/aliases
    #alias_maps = hash:/etc/aliases
    #alias_maps = hash:/etc/aliases, nis:mail.aliases
    #alias_maps = netinfo:/aliases
    alias_maps = hash:/etc/postfix/aliases
    # The alias_database parameter specifies the alias database(s) that
    # are built with "newaliases" or "sendmail -bi". This is a separate
    # configuration parameter, because alias_maps (see above) may specify
    # tables that are not necessarily all under control by Postfix.
    #alias_database = dbm:/etc/aliases
    #alias_database = dbm:/etc/mail/aliases
    #alias_database = hash:/etc/aliases
    #alias_database = hash:/etc/aliases, hash:/opt/majordomo/aliases
    alias_database = $alias_maps
    # ADDRESS EXTENSIONS (e.g., user+foo)
    # The recipient_delimiter parameter specifies the separator between
    # user names and address extensions (user+foo). See canonical(5),
    # local(8), relocated(5) and virtual(5) for the effects this has on
    # aliases, canonical, virtual, relocated and .forward file lookups.
    # Basically, the software tries user+foo and .forward+foo before
    # trying user and .forward.
    #recipient_delimiter = +
    # DELIVERY TO MAILBOX
    # The home_mailbox parameter specifies the optional pathname of a
    # mailbox file relative to a user's home directory. The default
    # mailbox file is /var/spool/mail/user or /var/mail/user. Specify
    # "Maildir/" for qmail-style delivery (the / is required).
    #home_mailbox = Mailbox
    home_mailbox = Maildir/
    # The mail_spool_directory parameter specifies the directory where
    # UNIX-style mailboxes are kept. The default setting depends on the
    # system type.
    #mail_spool_directory = /var/mail
    #mail_spool_directory = /var/spool/mail
    # The mailbox_command parameter specifies the optional external
    # command to use instead of mailbox delivery. The command is run as
    # the recipient with proper HOME, SHELL and LOGNAME environment settings.
    # Exception: delivery for root is done as $default_user.
    # Other environment variables of interest: USER (recipient username),
    # EXTENSION (address extension), DOMAIN (domain part of address),
    # and LOCAL (the address localpart).
    # Unlike other Postfix configuration parameters, the mailbox_command
    # parameter is not subjected to $parameter substitutions. This is to
    # make it easier to specify shell syntax (see example below).
    # Avoid shell meta characters because they will force Postfix to run
    # an expensive shell process. Procmail alone is expensive enough.
    # IF YOU USE THIS TO DELIVER MAIL SYSTEM-WIDE, YOU MUST SET UP AN
    # ALIAS THAT FORWARDS MAIL FOR ROOT TO A REAL USER.
    #mailbox_command = /some/where/procmail
    #mailbox_command = /some/where/procmail -a "$EXTENSION"
    # The mailbox_transport specifies the optional transport in master.cf
    # to use after processing aliases and .forward files. This parameter
    # has precedence over the mailbox_command, fallback_transport and
    # luser_relay parameters.
    # Specify a string of the form transport:nexthop, where transport is
    # the name of a mail delivery transport defined in master.cf. The
    # :nexthop part is optional. For more details see the sample transport
    # configuration file.
    # NOTE: if you use this feature for accounts not in the UNIX password
    # file, then you must update the "local_recipient_maps" setting in
    # the main.cf file, otherwise the SMTP server will reject mail for
    # non-UNIX accounts with "User unknown in local recipient table".
    # Cyrus IMAP over LMTP. Specify ``lmtpunix cmd="lmtpd"
    # listen="/var/imap/socket/lmtp" prefork=0'' in cyrus.conf.
    #mailbox_transport = lmtp:unix:/var/imap/socket/lmtp
    # Cyrus IMAP via command line. Uncomment the "cyrus...pipe" and
    # subsequent line in master.cf.
    #mailbox_transport = cyrus
    # The fallback_transport specifies the optional transport in master.cf
    # to use for recipients that are not found in the UNIX passwd database.
    # This parameter has precedence over the luser_relay parameter.
    # Specify a string of the form transport:nexthop, where transport is
    # the name of a mail delivery transport defined in master.cf. The
    # :nexthop part is optional. For more details see the sample transport
    # configuration file.
    # NOTE: if you use this feature for accounts not in the UNIX password
    # file, then you must update the "local_recipient_maps" setting in
    # the main.cf file, otherwise the SMTP server will reject mail for
    # non-UNIX accounts with "User unknown in local recipient table".
    #fallback_transport = lmtp:unix:/file/name
    #fallback_transport = cyrus
    #fallback_transport =
    # The luser_relay parameter specifies an optional destination address
    # for unknown recipients. By default, mail for unknown@$mydestination,
    # unknown@[$inet_interfaces] or unknown@[$proxy_interfaces] is returned
    # as undeliverable.
    # The following expansions are done on luser_relay: $user (recipient
    # username), $shell (recipient shell), $home (recipient home directory),
    # $recipient (full recipient address), $extension (recipient address
    # extension), $domain (recipient domain), $local (entire recipient
    # localpart), $recipient_delimiter. Specify ${name?value} or
    # ${name:value} to expand value only when $name does (does not) exist.
    # luser_relay works only for the default Postfix local delivery agent.
    # NOTE: if you use this feature for accounts not in the UNIX password
    # file, then you must specify "local_recipient_maps =" (i.e. empty) in
    # the main.cf file, otherwise the SMTP server will reject mail for
    # non-UNIX accounts with "User unknown in local recipient table".
    #luser_relay = [email protected]
    #luser_relay = [email protected]
    #luser_relay = admin+$local
    # JUNK MAIL CONTROLS
    # The controls listed here are only a very small subset. The file
    # SMTPD_ACCESS_README provides an overview.
    # The header_checks parameter specifies an optional table with patterns
    # that each logical message header is matched against, including
    # headers that span multiple physical lines.
    # By default, these patterns also apply to MIME headers and to the
    # headers of attached messages. With older Postfix versions, MIME and
    # attached message headers were treated as body text.
    # For details, see "man header_checks".
    #header_checks = regexp:/etc/postfix/header_checks
    # FAST ETRN SERVICE
    # Postfix maintains per-destination logfiles with information about
    # deferred mail, so that mail can be flushed quickly with the SMTP
    # "ETRN domain.tld" command, or by executing "sendmail -qRdomain.tld".
    # See the ETRN_README document for a detailed description.
    # The fast_flush_domains parameter controls what destinations are
    # eligible for this service. By default, they are all domains that
    # this server is willing to relay mail to.
    #fast_flush_domains = $relay_domains
    # SHOW SOFTWARE VERSION OR NOT
    # The smtpd_banner parameter specifies the text that follows the 220
    # code in the SMTP server's greeting banner. Some people like to see
    # the mail version advertised. By default, Postfix shows no version.
    # You MUST specify $myhostname at the start of the text. That is an
    # RFC requirement. Postfix itself does not care.
    #smtpd_banner = $myhostname ESMTP $mail_name
    #smtpd_banner = $myhostname ESMTP $mail_name ($mail_version)
    # PARALLEL DELIVERY TO THE SAME DESTINATION
    # How many parallel deliveries to the same user or domain? With local
    # delivery, it does not make sense to do massively parallel delivery
    # to the same user, because mailbox updates must happen sequentially,
    # and expensive pipelines in .forward files can cause disasters when
    # too many are run at the same time. With SMTP deliveries, 10
    # simultaneous connections to the same domain could be sufficient to
    # raise eyebrows.
    # Each message delivery transport has its XXX_destination_concurrency_limit
    # parameter. The default is $default_destination_concurrency_limit for
    # most delivery transports. For the local delivery agent the default is 2.
    #local_destination_concurrency_limit = 2
    #default_destination_concurrency_limit = 20
    # DEBUGGING CONTROL
    # The debug_peer_level parameter specifies the increment in verbose
    # logging level when an SMTP client or server host name or address
    # matches a pattern in the debug_peer_list parameter.
    debug_peer_level = 2
    # The debug_peer_list parameter specifies an optional list of domain
    # or network patterns, /file/name patterns or type:name tables. When
    # an SMTP client or server host name or address matches a pattern,
    # increase the verbose logging level by the amount specified in the
    # debug_peer_level parameter.
    #debug_peer_list = 127.0.0.1
    #debug_peer_list = some.domain
    # The debugger_command specifies the external command that is executed
    # when a Postfix daemon program is run with the -D option.
    # Use "command .. & sleep 5" so that the debugger can attach before
    # the process marches on. If you use an X-based debugger, be sure to
    # set up your XAUTHORITY environment variable before starting Postfix.
    debugger_command =
    PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin
    ddd $daemon_directory/$process_name $process_id & sleep 5
    # If you can't use X, use this to capture the call stack when a
    # daemon crashes. The result is in a file in the configuration
    # directory, and is named after the process name and the process ID.
    # debugger_command =
    # PATH=/bin:/usr/bin:/usr/local/bin; export PATH; (echo cont;
    # echo where) | gdb $daemon_directory/$process_name $process_id 2>&1
    # >$config_directory/$process_name.$process_id.log & sleep 5
    # Another possibility is to run gdb under a detached screen session.
    # To attach to the screen sesssion, su root and run "screen -r
    # <id_string>" where <id_string> uniquely matches one of the detached
    # sessions (from "screen -list").
    # debugger_command =
    # PATH=/bin:/usr/bin:/sbin:/usr/sbin; export PATH; screen
    # -dmS $process_name gdb $daemon_directory/$process_name
    # $process_id & sleep 1
    # INSTALL-TIME CONFIGURATION INFORMATION
    # The following parameters are used when installing a new Postfix version.
    # sendmail_path: The full pathname of the Postfix sendmail command.
    # This is the Sendmail-compatible mail posting interface.
    sendmail_path = /usr/bin/sendmail
    # newaliases_path: The full pathname of the Postfix newaliases command.
    # This is the Sendmail-compatible command to build alias databases.
    newaliases_path = /usr/bin/newaliases
    # mailq_path: The full pathname of the Postfix mailq command. This
    # is the Sendmail-compatible mail queue listing command.
    mailq_path = /usr/bin/mailq
    # setgid_group: The group for mail submission and queue management
    # commands. This must be a group name with a numerical group ID that
    # is not shared with other accounts, not even with the Postfix account.
    setgid_group = postdrop
    # html_directory: The location of the Postfix HTML documentation.
    html_directory = no
    # manpage_directory: The location of the Postfix on-line manual pages.
    manpage_directory = /usr/share/man
    # sample_directory: The location of the Postfix sample configuration files.
    # This parameter is obsolete as of Postfix 2.1.
    sample_directory = /etc/postfix/sample
    # readme_directory: The location of the Postfix README files.
    readme_directory = /usr/share/doc/postfix
    inet_protocols = ipv4
    #virtual_mailbox_domains = sendingdomain.com
    virtual_alias_maps = hash:/etc/postfix/virtual_alias, mysql:/etc/postfix/mysql_virtual_forwards.cf
    virtual_mailbox_domains = mysql:/etc/postfix/mysql_virtual_domains.cf
    virtual_mailbox_maps = mysql:/etc/postfix/mysql_virtual_mailboxes.cf
    virtual_mailbox_base = /home/vmailer
    virtual_uid_maps = static:5003
    virtual_gid_maps = static:5003
    virtual_minimum_uid = 5003
    virtual_mailbox_limit = 51200000
    Any help would be appreciated. Thank you.
    Last edited by nadman10 (2014-05-14 14:36:10)

    Your main.cf seems redundant.
    For example:
    if you specify:
    virtual_alias_maps = hash:/etc/postfix/virtual_alias, mysql:/etc/postfix/mysql_virtual_forwards.cf
    you don't need this:
    alias_maps = hash:/etc/postfix/aliases
    and i think you have a lot of more options you don't need.
    This is my main.cf on my vps and everything works great (sending and receiving emails from/to most common mail server: gmail, hotmail etc etc)
    smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)
    biff = no
    # appending .domain is the MUA's job.
    append_dot_mydomain = no
    readme_directory = no
    # TLS parameters
    smtpd_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
    smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
    smtpd_use_tls=yes
    smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
    smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
    message_size_limit = 4194304
    virtual_mailbox_domains = mysql:/etc/postfix/mysql-virtual-mailbox-domains.cf
    virtual_mailbox_maps = mysql:/etc/postfix/mysql-virtual-mailbox-maps.cf
    virtual_alias_maps = mysql:/etc/postfix/mysql-virtual-alias-maps.cf
    virtual_transport = dovecot
    dovecot_destination_recipient_limit = 1
    it is very simple (no dkim, no forced tls, no mailbox limits and so on) and it can be improved but it works..
    as I suggested you just try spending some hour wiping postfix installation and giving a look to this guide

  • [SOLVED] Help needed to configure postfix

    I aim to be able to manage myself my mailserver.
    For now i just need help in order to configure postfix so i can send an email from my postfix configured mail to my gmail account.
    I've read the following wiki pages :
    https://wiki.archlinux.org/index.php/postfix
    https://wiki.archlinux.org/index.php/Si … ail_System
    Wich are really not informative.
    I've my own domain name, wich can be pinged, i will call it : domain.free.fr
    Here is what i've done so far :
    Install postfix :
    sudo pacman -S postfix
    Configure myhostname in /etc/postfix/main.cf
    myhostname = domain.free.fr
    Configure the username in  /etc/postfix/aliases
    root: glow
    Reload aliases and postfix
    newaliases
    postfix reload
    postfix status
    postfix/postfix-script: the Postfix mail system is running: PID: 11706
    Then i've tried to use sendmail to send an email to my gmail adress :
    sendmail [email protected]
    Test
    Nothing coming in my mail.
    What do i do wrong ?
    Ican't find any log about postfix, /var/log/mail.log do not exist, is this normal ?
    Last edited by GloW_on_dub (2014-03-31 15:45:54)

    mailq
    -Queue ID- --Size-- ----Arrival Time---- -Sender/Recipient-------
    CCD29FF253 262 Mon Mar 31 16:58:37 [email protected]
    (delivery temporarily suspended: connect to alt4.gmail-smtp-in.l.google.com[74.125.25.27]:25: Connection timed out)
    [email protected]
    -- 0 Kbytes in 1 Request.
    My mail is in the queue, but cannot be delivered
    Last edited by GloW_on_dub (2014-03-31 15:03:51)

  • Setup Mailserver

    Hi
    I try to setup a mailserver with Postfix and Dovecot.
    I found some tutorials:
    https://wiki.archlinux.org/index.php/Postfix
    https://wiki.archlinux.org/index.php/Dovecot
    https://www.digitalocean.com/community/ … th-dovecot
    https://skrilnetz.net/?page_id=213
    http://cnedelcu.blogspot.de/2014/01/how … linux.html
    I can't get it working.
    At the moment I have it configured like in the Arch Wiki (links above) without SSL.  (but I would like to use SSL later...)
    But I cannot send/recive any e-mail.
    Please tell me if you need more information
    I hope someone can help me.
    aligator
    edit:
    here is the log of postfix:
    http://pastebin.com/zz7sPpzv
    in Dovecot I get only SSL-Errors. (maybe because I tried to send from a SSL-Mail)
    and the configuration of postfix:
    http://pastebin.com/dBkZUWRy
    in Dovecot I only changed it like in the wiki
    Last edited by aligator (2014-12-04 21:22:38)

    Setting up an email server is *not* easy/trivial and can not be done in "5 easy steps". Any guide that claims so is full of bs. It is far from trivial to *correctly* set up a email server that won't instantly turn into a spam relay or end up blacklisted. Here is a slightly less horrible guide:
    http://arstechnica.com/information-tech … in-part-1/

  • Sending mail with php via postfix to EIMS running on the same machine.

    Hello it was suggested I clarify and repost this question as previously I had posted it in a already answered thread,
    I am running EIMS as my mail program on my Mac OS 10.4.6 Server for email.
    http://www.eudora.co.nz/
    I need to send email through the standard php mail command from my php scripts because many scripts written by others use this command. (Rewriting all the php apps written by third parties to uses another mail library is not an option.)
    This forces me to use postfix to send the emails. I have already tried the EiMS command line tool and this program is not up to the task.
    I had postfix configured properly as a "Null Client" so that postfix delivers mail to another server and doesn't try to deliver mail to itself or listen for new mail coming in. I got the instructions for the null client from here:
    http://www.postfix.org/STANDARDCONFIGURATION_README.html#nullclient
    This was working fine but I have changed my server to use open directory and in the process, I had to change the hostname of my server from shenzhenparty to shenzhenparty.com. My original server name was not a fully qualified domain name and so postfix didn't know it was sending mail to the same server. Now postfix is able to detect a mail loop again.
    You can take a look at the log below:
    May 29 14:30:21 shenzhenparty postfix/cleanup[23298]: 506E15F725C: message-id=<[email protected]>
    May 29 14:30:21 shenzhenparty postfix/qmgr[23034]: 506E15F725C: from=<[email protected]>, size=868, nrcpt=2 (queue active)
    May 29 14:30:21 shenzhenparty postfix/error[23301]: 506E15F725C: to=<[email protected]>, relay=none, delay=0, status=bounced (local delivery is disabled)
    May 29 14:30:21 shenzhenparty postfix/smtp[23302]: warning: host mail.shenzhenparty.com[210.17.235.228] greeted me with my own hostname shenzhenparty.com
    May 29 14:30:21 shenzhenparty postfix/smtp[23302]: warning: host mail.shenzhenparty.com[210.17.235.228] replied to HELO/EHLO with my own hostname shenzhenparty.com
    May 29 14:30:21 shenzhenparty postfix/smtp[23302]: 506E15F725C: to=<[email protected]>, relay=mail.shenzhenparty.com[210.17.235.228], delay=0, status=bounced (mail for mail.shenzhenparty.com loops back to myself)
    May 29 14:30:21 shenzhenparty postfix/cleanup[23298]: 5B1C55F725E: message-id=<[email protected]>
    May 29 14:30:21 shenzhenparty postfix/qmgr[23034]: 5B1C55F725E: from=, size=2809, nrcpt=1 (queue active)
    May 29 14:30:21 shenzhenparty postfix/qmgr[23034]: 506E15F725C: removed
    May 29 14:30:21 shenzhenparty postfix/error[23305]: 5B1C55F725E: to=<[email protected]>, relay=none, delay=0, status=bounced (local delivery is disabled)
    May 29 14:30:21 shenzhenparty postfix/qmgr[23034]: 5B1C55F725E: removed
    Postfix seems to have an option for everything, doesn't it have an option to disable this loop back check? i have looked through all the options and have not found a way. Below is my postfix configuration in case that helps:
    shenzhenparty:~ deverman$ postconf -n
    command_directory = /usr/sbin
    config_directory = /etc/postfix
    daemon_directory = /usr/libexec/postfix
    debugpeerlevel = 2
    html_directory = no
    inet_interfaces = localhost
    local_transport = error:local delivery is disabled
    mail_owner = postfix
    mailboxsizelimit = 0
    mailq_path = /usr/bin/mailq
    manpage_directory = /usr/share/man
    mydomain = shenzhenparty.com
    mydomain_fallback = localhost
    mynetworks_style = host
    myorigin = $mydomain
    newaliases_path = /usr/bin/newaliases
    queue_directory = /private/var/spool/postfix
    readme_directory = /usr/share/doc/postfix
    relayhost = mail.shenzhenparty.com
    sample_directory = /usr/share/doc/postfix/examples
    sendmail_path = /usr/sbin/sendmail
    setgid_group = postdrop
    smtpdtls_keyfile =
    unknownlocal_recipient_rejectcode = 550
    As postfix has given me a lot of trouble on this issue I don't see switching from EIMS to postfix as a viable option just to get php emails working on a Mac OS X Server. I also do not want to use an additional IP just to get emails working either because if I have to do that I might as well move to a managed solution on a linux box.
    I hope someone has a suggestion. Thanks

    You can add a private IP address so that one mta listens on the public and the other listens on the private. The ISP would not be routing the private IP, so there would be cost or even knowledge of the private IP.
    I'm not saying that's an solution to your issue- but clarifying that it's easy to add alternate private IPs to an interface.
    Jeff

  • Blank Mail Logs - Postfix - PHP

    I need a really simple solution but all the instructions I've found so far involve setting up extra stuff I don't need. So I'm hoping someone can give me a quick bit of info.
    Basically I have a site that sends email notifications at times (using PHP mail() function).
    I have Postfix installed which I assume is handling the sending of these emails.
    But no logs are being made. All the /var/log/mail.log files are completely blank 0Kb files.
    I need them to log each email sent out by the server with a time. I enabled the php mail() logging function in php.ini but that doesn't include timestamping. So I need the fuller logs Postfix can do.
    But the instructions I've found all want to set up full blown email servers. I just want some timestamped logging.
    Can anyone help me out?

    In fact most of my log files seem to be empty. Any idea why??

  • Sending php mail(); using postfix. Authentication failed.

    Trying to set up my localhost to send php mail() using postfix.
    I did the following:
    Created the sasl_passwd file
    Created the sasl_passwd.db file
    Edited mail.cf in the postfix folder to include relay host: relayhost=smtp.live.com:587
    I'm trying to relay through my hotmail account. The mail.log returns the following:
    Jan 24 13:17:30 Richards-MacBook-Pro.local postfix/error[927]: E75CCE40EE4: to=<[email protected]>, relay=none, delay=1580, delays=1580/0.07/0/0, dsn=4.0.0, status=deferred (delivery temporarily suspended: SASL authentication failed; server smtp.live.com[65.55.162.200] said: 535 5.0.0 Authentication Failed)
    Any ideas what I'm doing wrong here?

    Ok problem solved :)
    Problem was between oracle and MS exchange server. Live server oracle 9i is on linux, and testing server works on windows.
    So the problem was with configuration. Our admins corrected it and now works :). I don't know details.

  • Postfix relay=none, ... status=deferred (Host or domain name not found...

    Hi,
    I actually posted this question 2 weeks ago but under the wrong topic. So, first of all wanted to apologise for double-posting... but since no one replied, I thought I'd try again under the right topic.
    I've been trying to solve this all day today (that was Feb 26th). I used to be able to send emails but for some reason it does not work anymore. At first I thought it was a problem with php (I use entropy pack php 5.2.6) but after searching the topic, I think it is a problem with my network. BTW OS is 10.5.5 and Postfix version 2.4.3
    First of all, after computer restart, I don't think postfix starts automatically
    Running 'sudo postfix start' gives me:
    postfix/postfix-script: starting the Postfix mail system
    Looking at '/var/log/mail.log' I find:
    Feb 27 12:51:04 AMs-MBP postfix/qmgr331: AA70A7A7C77: from=<[email protected]>, size=842, nrcpt=1 (queue active)
    Feb 27 12:52:19 AMs-MBP postfix/smtp456: AA70A7A7C77: to=<[email protected]>, relay=none, delay=3437, delays=3362/0.02/75/0, dsn=4.4.3, status=deferred (Host or domain name not found. Name service error for name=email.com type=MX: Host not found, try again)
    Running 'sudo postfix check' does not give me any errors
    Checking my '/etc/resolv.conf' it has nameserver 192.168.1.1
    Running 'ifconfig | grep netmask | grep -v 127.0.0.1 | awk {'print $2'}L' gives:
    192.168.1.5
    Checking http://switch.richard5.net/2006/08/19/fatal-open-lock-file-pidmasterpid/ and running 'launchctl list' gives me a long list but no item matches org.postfix.master
    Running 'ps aux|grep postfix' gives
    AM 546 0.3 0.0 599820 468 s000 S+ 1:41pm 0:00.00 grep postfix
    _postfix 331 0.0 0.0 599816 824 ?? S 11:56am 0:00.04 qmgr -l -t fifo -u
    root 329 0.0 0.0 600784 752 ?? Ss 11:56am 0:00.11 /usr/libexec/postfix/master
    _postfix 519 0.0 0.0 599768 752 ?? S 1:36pm 0:00.01 pickup -l -t fifo -u
    Running 'postconf inet_interfaces' at first gave me
    inet_interfaces = localhost
    which I changed to All in '/etc/postfix/main.cf'
    I looked at http://www.postfix-book.com/debugging.html
    Running 'telnet localhost 25' gives me
    Trying ::1...
    telnet: connect to address ::1: Connection refused
    Trying fe80::1...
    telnet: connect to address fe80::1: Connection refused
    Trying 127.0.0.1...
    Connected to localhost.
    Escape character is '^]'.
    220 AMs-MBP.local ESMTP Postfix
    quit
    221 2.0.0 Bye
    Connection closed by foreign host.
    But running 'telnet 10.1.2.233 25' gives me
    Trying 10.1.2.233...
    telnet: connect to address 10.1.2.233: Operation timed out
    telnet: Unable to connect to remote host
    Running 'ping 134.169.9.107' takes a long time. After a while I stop it and get:
    PING 134.169.9.107 (134.169.9.107): 56 data bytes
    ^C
    o
    + 134.169.9.107 ping statistics ---
    28 packets transmitted, 0 packets received, 100% packet loss
    I have not idea what the problem is and/or how to fix it. I know the messages get to the postfix daemon but for some reason they do not continue on their way.
    Please, does anyone have an idea of how to fix this?
    TIA,
    Elle

    Dynamic IP addresses with DynDNS Updater (or equivalent) makes it pretty darned reliable, particularly if you buy DynDNS' Mailhop Forward service, which prevents the likes of roadrunner.com and aol.com from blocking mail coming from your server just because it lives in dynamicIP-land. Way cheaper than paying your ISP extra for a static IPA, too, and totally acceptable for low-volume, residential-based servers for personal not-for-profit use.
    Regarding reliable delivery to a dynIPA server, you are only at risk of non-receipt for perhaps a few minutes immediately following when your ISP rotates your WAN IPA, until DynDNS Updater (or equivalent) updates the DynDNS (or equivalent) servers with your new WAN IPA. But that's really not a problem because I think all, well, okay, most, smtp servers will queue for a redelivery attempt if the initial delivery attempt just happens to occur at that time.
    I wouldn't suggest this practice for high-volume enterprise-class servers or for people trying to run a bootleg mail server business for profit (besides, the ISP would shut it down as an abuse of terms of service, anyways), but for low-volume, residential-based servers for personal use and enjoyment, which I suspect is the case for the O.P., I can't say that I find anything unreliable about my dynamic IP-based mail server.

  • PHP mail() function not working

    Hello, I am having a problem sending mail with php while hosting my own website with apache on my mac. First of all I would like to note that I do not have a large background with web hosting and php. Everything that I did so far was just suggestions from online articles and other forums, so please include detail with any answers.
    I have apache started, and my website hosted just fine. I can also view php pages so I know php is running too. My problem is using the php mail() function.
    I have a simple form in my site who's action attribute is set to results.php. In the results.php file I have the mail() function (along with html code displaying "thank you...blah blah blah") sending info from the form to my email address. I never get an error on the php side, but my mail never gets sent.
    Is there some type of setting in a config file that need to be turned on or changed?
    Here is what I have done/modified so far from my research from online articles. i dont know what some of them mean, but followed the steps correctly:
    Edited the /etc/hostconfig file and added the line MAILSERVER=-YES-
    Edited the /etc/postfix/main.cf file and uncommented the #myhostname = ...line and made it "myhostname = localhost" (without quotes)
    Edited the php.ini file to the following - The line under where it says
    ; For unix only. You may supply arguments as well (default: "sendmail -t -i")
    Sendmail_path = usr/sbin/sendmail -t -i
    I opened the mail.log file and here are some entries from the other day:
    Code:
    Jul 9 08:16:50 new-host postfix/master[689]: daemon started -- version 2.4.3, configuration /etc/postfix
    Jul 9 08:16:50 new-host postfix/qmgr[691]: 4B4DC2E8331: from=<[email protected]>, size=323, nrcpt=1 (queue active)
    Jul 9 08:16:50 new-host postfix/qmgr[691]: 7A8242EE3C0: from=<[email protected]>, size=280, nrcpt=1 (queue active)
    Jul 9 08:16:50 new-host postfix/qmgr[691]: B1C052EE3C4: from=<[email protected]>, size=280, nrcpt=1 (queue active)
    Jul 9 08:16:50 new-host postfix/qmgr[691]: C281C2EE3C5: from=<[email protected]>, size=327, nrcpt=1 (queue active)
    Jul 9 08:16:50 new-host postfix/smtp[694]: 4B4DC2E8331: to=<[email protected]>, relay=relay.verizon.net[206.46.232.11]:25, delay=213262, delays=213261/0.05/0.86/0, dsn=4.0.0, status=deferred (host relay.verizon.net[206.46.232.11] refused to talk to me: 571 Email from 74.102.108.224 is currently blocked by Verizon Online's anti-spam system. The email sender or Email Service Provider may visit http://www.verizon.net/whitelist and request removal of the block. 100709)
    Jul 9 08:16:51 new-host postfix/pickup[690]: 0F5D22EE4DB: uid=70 from=<_www>
    Jul 9 08:16:51 new-host postfix/cleanup[692]: 0F5D22EE4DB: message-id=<20100709121651.0F5D22EE4DB@localhost>
    Jul 9 08:16:51 new-host postfix/qmgr[691]: 0F5D22EE4DB: from=<[email protected]>, size=333, nrcpt=1 (queue active)
    Jul 9 08:16:51 new-host postfix/smtp[695]: 7A8242EE3C0: to=<[email protected]>, relay=relay.verizon.net[206.46.232.11]:25, delay=27074, delays=27073/0.02/1.1/0, dsn=4.0.0, status=deferred (host relay.verizon.net[206.46.232.11] refused to talk to me: 571 Email from 74.102.108.224 is currently blocked by Verizon Online's anti-spam system. The email sender or Email Service Provider may visit http://www.verizon.net/whitelist and request removal of the block. 100709)
    Jul 9 08:16:51 new-host postfix/smtp[697]: C281C2EE3C5: to=<[email protected]>, relay=relay.verizon.net[206.46.232.11]:25, delay=26817, delays=26816/0.02/1.1/0, dsn=4.0.0, status=deferred (host relay.verizon.net[206.46.232.11] refused to talk to me: 571 Email from 74.102.108.224 is currently blocked by Verizon Online's anti-spam system. The email sender or Email Service Provider may visit http://www.verizon.net/whitelist and request removal of the block. 100709)
    Jul 9 08:16:51 new-host postfix/smtp[696]: B1C052EE3C4: to=<[email protected]>, relay=relay.verizon.net[206.46.232.11]:25, delay=27174, delays=27173/0.01/1.1/0, dsn=4.0.0, status=deferred (host relay.verizon.net[206.46.232.11] refused to talk to me: 571 Email from 74.102.108.224 is currently blocked by Verizon Online's anti-spam system. The email sender or Email Service Provider may visit http://www.verizon.net/whitelist and request removal of the block. 100709)
    Jul 9 08:17:23 new-host postfix/smtp[694]: connect to mx1.comcast.net[76.96.62.116]: Operation timed out (port 25)
    Jul 9 08:17:50 new-host postfix/master[689]: master exit time has arrived
    Any other suggestions on how to get this to work? I have also created a simple php file that sends mail without retreiving info from a form and also tried using several different email addresses to send to and from, but still nothing

    Edited the /etc/postfix/main.cf file and uncommented the #myhostname = ...line and made it "myhostname = localhost" (without quotes) Change that to mail.yourispname.com Then run sudo postfix reload and see if it sends mail. The reason being, is that you don't have a fully qualified domain name.
    And make that reflective in your mail() function file/template.
    Message was edited by: doug pennington

  • Xserve mail server: setup postfix to ignore/delete undeliverable mail

    Hi,
    I've trouble with mail server on Leopard 10.5.8@xserve, that many mails has unknown recepients. In ServerAdmin I may set only copy undelivarable mail to existing mail. But I want delete this. There are some way as manually configure postfix?
    Thanks.

    The roundcube db schema needs to setup manually. See /usr/share/webapps/roundcube/INSTALL
    Also, from your /etc/webapps/postfixadmin/config.inc.php:
    $CONF['domain_path'] = 'NO';
    $CONF['domain_in_mailbox'] = 'YES';
    $CONF['maildir_name_hook'] = 'NO';
    ..which results in /var/mail/vmail/[email protected]
    From your dovecot.conf
    mail_home = /var/mail/vmail/%d/%u
    ...which results in /var/mail/vmail/domain.com/user
    That doesn't fit together.

  • Php.ini sendmail_path directive in Mac OS 10.4.8

    Hi,
    I am taking a PHP progamming with MySql course and am working with email forms. My book tells me to edit my php.ini file and assign the path where sendmail is installed to the sendmail_path directive.
    In an old discussion forum I found that this would be:
    sendmail_path = /usr/sbin/sendmail -t -i
    in the php.ini file.
    But does OS 10.4.8 even use Sendmail? I did not find sendmail in the sbin directory.
    What would be the correct way to configure my php.ini file to be able to work with PHP e-mail forms?
    Any information or suggestions much appreciated.
    Best,
    Shelley

    OK, I now know that Tiger uses postfix as its mailer. So how do I configure my php.ini file to use postfix to deal with php email forms?
    Shelley

  • [Solved] Postfixadmin, can't run setup.php

    First time for me to try setting up any server stuff with arch, so forgive if I come across as clueless
    The story is I followed this page from the arch wiki:  https://wiki.archlinux.org/index.php/SO … #SMTP-AUTH to setup postfix, dovecot and postfixadmin (without smtp-auth as I have to use my isp's server for outgoing mail) and have a few issues but I think the first place I need to start is postfixadmin.  Haven't been able to get it to run the setup.php file which as far a I can see will create the mysql tables mapped in postfix's main.cf file
    When I try running http://mydomain/postfixadmin/setup.php I get this error:
    Please edit config.inc.php - change $CONF['configured'] to true after setting your database settings
    In my /srv/http/postfixadmin/config_inc.php file I have already set this like so:
    $CONF['configured'] = true;
    I'm thinking maybe I did something wrong in the config_inc.php file, I'm able to use phpmyadmin so I don't think it's an issue with my apache/php installation, here's my full /srv/http/postfixadmin/config_inc.php file in case anyone can spot anything:
    <?php
    * You have to set $CONF['configured'] = true; before the application will run!
    $CONF['configured'] = true;
    // In order to setup Postfixadmin, you MUST specify a hashed password here.
    // To create the hash, visit setup.php in a browser and type a password into the field,
    // on submission it will be echoed out to you as a hashed value.
    $CONF['setup_password'] = '';
    // Postfix Admin Path
    $CONF['postfix_admin_url'] = '[url]http://mydomain.com/postfixadmin[/url]';
    // shouldn't need changing.
    $CONF['postfix_admin_path'] = dirname(__FILE__);
    $CONF['default_language'] = 'en';
    // Database Config
    // mysql = MySQL 3.23 and 4.0, 4.1 or 5
    // mysqli = MySQL 4.1+
    // pgsql = PostgreSQL
    $CONF['database_type'] = 'mysqli';
    $CONF['database_host'] = 'localhost';
    $CONF['database_user'] = 'my_db_user';
    $CONF['database_password'] = 'my_db_password';
    $CONF['database_name'] = 'postfix';
    // If you need to specify a different port for a MYSQL database connection, use e.g.
    // $CONF['database_host'] = '172.30.33.66:3308';
    // Here, if you need, you can customize table names.
    $CONF['database_prefix'] = '';
    $CONF['database_tables'] = array (
    'admin' => 'admin',
    'alias' => 'alias',
    'alias_domain' => 'alias_domain',
    'config' => 'config',
    'domain' => 'domain',
    'domain_admins' => 'domain_admins',
    'fetchmail' => 'fetchmail',
    'log' => 'log',
    'mailbox' => 'mailbox',
    'vacation' => 'vacation',
    'vacation_notification' => 'vacation_notification',
    'quota' => 'quota',
    'quota2' => 'quota2',
    // Site Admin
    // Define the Site Admins email address below.
    // This will be used to send emails from to create mailboxes.
    $CONF['admin_email'] = '[email protected]';
    // Mail Server
    // Hostname (FQDN) of your mail server.
    // This is used to send email to Postfix in order to create mailboxes.
    $CONF['smtp_server'] = 'localhost';
    $CONF['smtp_server'] = 'mydomain.com';
    $CONF['smtp_port'] = '25';
    // Encrypt
    // In what way do you want the passwords to be crypted?
    // md5crypt = internal postfix admin md5
    // md5 = md5 sum of the password
    // system = whatever you have set as your PHP system default
    // cleartext = clear text passwords (ouch!)
    // mysql_encrypt = useful for PAM integration
    // authlib = support for courier-authlib style passwords
    // dovecot:CRYPT-METHOD = use dovecotpw -s 'CRYPT-METHOD'. Example: dovecot:CRAM-MD5
    $CONF['encrypt'] = 'md5crypt';
    // In what flavor should courier-authlib style passwords be enrypted?
    // md5 = {md5} + base64 encoded md5 hash
    // md5raw = {md5raw} + plain encoded md5 hash
    // SHA = {SHA} + base64-encoded sha1 hash
    // crypt = {crypt} + Standard UNIX DES-enrypted with 2-character salt
    $CONF['authlib_default_flavor'] = 'md5raw';
    // If you use the dovecot encryption method: where is the dovecotpw binary located?
    $CONF['dovecotpw'] = "/usr/sbin/dovecotpw";
    // Minimum length required for passwords. Postfixadmin will not
    // allow users to set passwords which are shorter than this value.
    $CONF['min_password_length'] = 5;
    // Generate Password
    // Generate a random password for a mailbox or admin and display it.
    // If you want to automagically generate paswords set this to 'YES'.
    $CONF['generate_password'] = 'NO';
    // Show Password
    // Always show password after adding a mailbox or admin.
    // If you want to always see what password was set set this to 'YES'.
    $CONF['show_password'] = 'NO';
    // Page Size
    // Set the number of entries that you would like to see
    // in one page.
    $CONF['page_size'] = '10';
    // Default Aliases
    // The default aliases that need to be created for all domains.
    $CONF['default_aliases'] = array (
    'abuse' => '[email protected]',
    'hostmaster' => '[email protected]',
    'postmaster' => '[email protected]',
    'webmaster' => '[email protected]'
    // Mailboxes
    // If you want to store the mailboxes per domain set this to 'YES'.
    // Examples:
    // YES: /usr/local/virtual/domain.tld/[email protected]
    // NO: /usr/local/virtual/[email protected]
    $CONF['domain_path'] = 'NO';
    // If you don't want to have the domain in your mailbox set this to 'NO'.
    // Examples:
    // YES: /usr/local/virtual/domain.tld/[email protected]
    // NO: /usr/local/virtual/domain.tld/username
    // Note: If $CONF['domain_path'] is set to NO, this setting will be forced to YES.
    $CONF['domain_in_mailbox'] = 'YES';
    // If you want to define your own function to generate a maildir path set this to the name of the function.
    // Notes:
    // - this configuration directive will override both domain_path and domain_in_mailbox
    // - the maildir_name_hook() function example is present below, commented out
    // - if the function does not exist the program will default to the above domain_path and domain_in_mailbox settings
    $CONF['maildir_name_hook'] = 'NO';
    maildir_name_hook example function
    Called by create-mailbox.php if $CONF['maildir_name_hook'] == '<name_of_the_function>'
    - allows for customized maildir paths determined by a custom function
    - the example below will prepend a single-character directory to the
    beginning of the maildir, splitting domains more or less evenly over
    36 directories for improved filesystem performance with large numbers
    of domains.
    Returns: maildir path
    ie. I/example.com/user/
    function maildir_name_hook($domain, $user) {
    $chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
    $dir_index = hexdec(substr(md5($domain), 28)) % strlen($chars);
    $dir = substr($chars, $dir_index, 1);
    return sprintf("%s/%s/%s/", $dir, $domain, $user);
    // Default Domain Values
    // Specify your default values below. Quota in MB.
    $CONF['aliases'] = '10';
    $CONF['mailboxes'] = '10';
    $CONF['maxquota'] = '10';
    // Quota
    // When you want to enforce quota for your mailbox users set this to 'YES'.
    $CONF['quota'] = 'NO';
    // You can either use '1024000' or '1048576'
    $CONF['quota_multiplier'] = '1024000';
    // Transport
    // If you want to define additional transport options for a domain set this to 'YES'.
    // Read the transport file of the Postfix documentation.
    $CONF['transport'] = 'NO';
    // Transport options
    // If you want to define additional transport options put them in array below.
    $CONF['transport_options'] = array (
    'virtual', // for virtual accounts
    'local', // for system accounts
    'relay' // for backup mx
    // Transport default
    // You should define default transport. It must be in array above.
    $CONF['transport_default'] = 'virtual';
    // Virtual Vacation
    // If you want to use virtual vacation for you mailbox users set this to 'YES'.
    // NOTE: Make sure that you install the vacation module. (See VIRTUAL-VACATION/)
    $CONF['vacation'] = 'NO';
    // This is the autoreply domain that you will need to set in your Postfix
    // transport maps to handle virtual vacations. It does not need to be a
    // real domain (i.e. you don't need to setup DNS for it).
    $CONF['vacation_domain'] = 'autoreply.change-this-to-your.domain.tld';
    // Vacation Control
    // If you want users to take control of vacation set this to 'YES'.
    $CONF['vacation_control'] ='YES';
    // Vacation Control for admins
    // Set to 'YES' if your domain admins should be able to edit user vacation.
    $CONF['vacation_control_admin'] = 'YES';
    // Alias Control
    // Postfix Admin inserts an alias in the alias table for every mailbox it creates.
    // The reason for this is that when you want catch-all and normal mailboxes
    // to work you need to have the mailbox replicated in the alias table.
    // If you want to take control of these aliases as well set this to 'YES'.
    // Alias control for superadmins
    $CONF['alias_control'] = 'NO';
    // Alias Control for domain admins
    $CONF['alias_control_admin'] = 'NO';
    // Special Alias Control
    // Set to 'NO' if your domain admins shouldn't be able to edit the default aliases
    // as defined in $CONF['default_aliases']
    $CONF['special_alias_control'] = 'NO';
    // Alias Goto Field Limit
    // Set the max number of entries that you would like to see
    // in one 'goto' field in overview, the rest will be hidden and "[and X more...]" will be added.
    // '0' means no limits.
    $CONF['alias_goto_limit'] = '0';
    // Alias Domains
    // Alias domains allow to "mirror" aliases and mailboxes to another domain. This makes
    // configuration easier if you need the same set of aliases on multiple domains, but
    // also requires postfix to do more database queries.
    // Note: If you update from 2.2.x or earlier, you will have to update your postfix configuration.
    // Set to 'NO' to disable alias domains.
    $CONF['alias_domain'] = 'YES';
    // Backup
    // If you don't want backup tab set this to 'NO';
    $CONF['backup'] = 'YES';
    // Send Mail
    // If you don't want sendmail tab set this to 'NO';
    $CONF['sendmail'] = 'YES';
    // Logging
    // If you don't want logging set this to 'NO';
    $CONF['logging'] = 'YES';
    // Fetchmail
    // If you don't want fetchmail tab set this to 'NO';
    $CONF['fetchmail'] = 'YES';
    // fetchmail_extra_options allows users to specify any fetchmail options and any MDA
    // (it will even accept 'rm -rf /' as MDA!)
    // This should be set to NO, except if you *really* trust *all* your users.
    $CONF['fetchmail_extra_options'] = 'NO';
    // Header
    $CONF['show_header_text'] = 'NO';
    $CONF['header_text'] = ':: Postfix Admin ::';
    // link to display under 'Main' menu when logged in as a user.
    $CONF['user_footer_link'] = "[url]http://change-this-to-your.domain.tld/main[/url]";
    // link to display under 'Main' menu when logged in as a user.
    $CONF['user_footer_link'] = "[url]http://change-this-to-your.domain.tld/main[/url]";
    // Footer
    // Below information will be on all pages.
    // If you don't want the footer information to appear set this to 'NO'.
    $CONF['show_footer_text'] = 'YES';
    $CONF['footer_text'] = 'Return to change-this-to-your.domain.tld';
    $CONF['footer_link'] = '[url]http://change-this-to-your.domain.tld[/url]';
    // Welcome Message
    // This message is send to every newly created mailbox.
    // Change the text between EOM.
    $CONF['welcome_text'] = <<<EOM
    Hi,
    Welcome to your new account.
    EOM;
    // When creating mailboxes or aliases, check that the domain-part of the
    // address is legal by performing a name server look-up.
    $CONF['emailcheck_resolve_domain']='YES';
    // Optional:
    // color names available on most browsers
    //set to YES to enable this feature
    $CONF['show_status']='YES';
    //display a guide to what these colors mean
    $CONF['show_status_key']='YES';
    // 'show_status_text' will be displayed with the background colors
    // associated with each status, you can customize it here
    $CONF['show_status_text']='&nbsp;&nbsp;';
    // show_undeliverable is useful if most accounts are delivered to this
    // postfix system. If many aliases and mailboxes are forwarded
    // elsewhere, you will probably want to disable this.
    $CONF['show_undeliverable']='NO';
    $CONF['show_undeliverable_color']='tomato';
    // mails to these domains will never be flagged as undeliverable
    $CONF['show_undeliverable_exceptions']=array("unixmail.domain.ext","exchangeserver.domain.ext","gmail.com");
    $CONF['show_popimap']='NO';
    $CONF['show_popimap_color']='darkgrey';
    // you can assign special colors to some domains. To do this,
    // - add the domain to show_custom_domains
    // - add the corresponding color to show_custom_colors
    $CONF['show_custom_domains']=array("subdomain.domain.ext","domain2.ext");
    $CONF['show_custom_colors']=array("lightgreen","lightblue");
    // If you use a recipient_delimiter in your postfix config, you can also honor it when aliases are checked.
    // Example: $CONF['recipient_delimiter'] = "+";
    // Set to "" to disable this check.
    $CONF['recipient_delimiter'] = "";
    // Optional:
    // Script to run after creation of mailboxes.
    // Note that this may fail if PHP is run in "safe mode", or if
    // operating system features (such as SELinux) or limitations
    // prevent the web-server from executing external scripts.
    // Parameters: (1) username (2) domain (3) maildir (4) quota
    // $CONF['mailbox_postcreation_script']='sudo -u courier /usr/local/bin/postfixadmin-mailbox-postcreation.sh';
    // Optional:
    // Script to run after alteration of mailboxes.
    // Note that this may fail if PHP is run in "safe mode", or if
    // operating system features (such as SELinux) or limitations
    // prevent the web-server from executing external scripts.
    // Parameters: (1) username (2) domain (3) maildir (4) quota
    // $CONF['mailbox_postedit_script']='sudo -u courier /usr/local/bin/postfixadmin-mailbox-postedit.sh';
    // Optional:
    // Script to run after deletion of mailboxes.
    // Note that this may fail if PHP is run in "safe mode", or if
    // operating system features (such as SELinux) or limitations
    // prevent the web-server from executing external scripts.
    // Parameters: (1) username (2) domain
    // $CONF['mailbox_postdeletion_script']='sudo -u courier /usr/local/bin/postfixadmin-mailbox-postdeletion.sh';
    // Optional:
    // Script to run after creation of domains.
    // Note that this may fail if PHP is run in "safe mode", or if
    // operating system features (such as SELinux) or limitations
    // prevent the web-server from executing external scripts.
    // Parameters: (1) domain
    //$CONF['domain_postcreation_script']='sudo -u courier /usr/local/bin/postfixadmin-domain-postcreation.sh';
    // Optional:
    // Script to run after deletion of domains.
    // Note that this may fail if PHP is run in "safe mode", or if
    // operating system features (such as SELinux) or limitations
    // prevent the web-server from executing external scripts.
    // Parameters: (1) domain
    // $CONF['domain_postdeletion_script']='sudo -u courier /usr/local/bin/postfixadmin-domain-postdeletion.sh';
    // Optional:
    // Sub-folders which should automatically be created for new users.
    // The sub-folders will also be subscribed to automatically.
    // Will only work with IMAP server which implement sub-folders.
    // Will not work with POP3.
    // If you define create_mailbox_subdirs, then the
    // create_mailbox_subdirs_host must also be defined.
    // $CONF['create_mailbox_subdirs']=array('Spam');
    // $CONF['create_mailbox_subdirs_host']='localhost';
    // Specify '' for Dovecot and 'INBOX.' for Courier.
    $CONF['create_mailbox_subdirs_prefix']='INBOX.';
    // Optional:
    // Show used quotas from Dovecot dictionary backend in virtual
    // mailbox listing.
    // See: DOCUMENTATION/DOVECOT.txt
    // [url]http://wiki.dovecot.org/Quota/Dict[/url]
    $CONF['used_quotas'] = 'NO';
    // if you use dovecot >= 1.2, set this to yes.
    // Note about dovecot config: table "quota" is for 1.0 & 1.1, table "quota2" is for dovecot 1.2 and newer
    $CONF['new_quota_table'] = 'NO';
    // Normally, the TCP port number does not have to be specified.
    // $CONF['create_mailbox_subdirs_hostport']=143;
    // If you have trouble connecting to the IMAP-server, then specify
    // a value for $CONF['create_mailbox_subdirs_hostoptions']. These
    // are some examples to experiment with:
    // $CONF['create_mailbox_subdirs_hostoptions']=array('notls');
    // $CONF['create_mailbox_subdirs_hostoptions']=array('novalidate-cert','norsh');
    // See also the "Optional flags for names" table at
    // [url]http://www.php.net/manual/en/function.imap-open.php[/url]
    // Theme Config
    // Specify your own logo and CSS file
    $CONF['theme_logo'] = 'images/logo-default.png';
    $CONF['theme_css'] = 'css/default.css';
    // XMLRPC Interface.
    // This should be only of use if you wish to use e.g the
    // Postfixadmin-Squirrelmail package
    // change to boolean true to enable xmlrpc
    $CONF['xmlrpc_enabled'] = false;
    // If you want to keep most settings at default values and/or want to ensure
    // that future updates work without problems, you can use a separate config
    // file (config.local.php) instead of editing this file and override some
    // settings there.
    if (file_exists(dirname(__FILE__) . '/config.local.php')) {
    include(dirname(__FILE__) . '/config.local.php');
    // END OF CONFIG FILE
    /* vim: set expandtab softtabstop=4 tabstop=4 shiftwidth=4: */
    Any suggestions on what I can try to get postfixadmin's setup.php to run will be much appreciated
    Last edited by Ecky (2012-09-14 23:23:24)

    Just worked out I had an errant dns sending me to a postfixadmin on another machine which I'd never used ... god do I feel stupid!
    Now that the url is sendng me to the correct machine (and copy of postfixadmin) I'm getting a 403 permissions errors when I try to open setup.php, the config.inc.php I posted btw is the correct one
    When following the arch wiki page I put a symlink called postfixadmin in /srv/http which points to /usr/share/webapps/postfixAdmin and then followed this part of the wiki to set permissions:
    chown -R nobody:nobody /home/httpd/html/postfixadmin-2.1.0/
    cd /home/httpd/html/postfixadmin/
    chmod 640 *.php
    cd /home/httpd/html/postfixadmin/admin/
    chmod 640 *.php
    cd /home/httpd/html/postfixadmin/images/
    chmod 640 *.png
    cd /home/httpd/html/postfixadmin/languages/
    chmod 640 *.lang
    cd /home/httpd/html/postfixadmin/templates/
    chmod 640 *.php
    cd /home/httpd/html/postfixadmin/users/
    chmod 640 *.php
    That's directly from the wiki, obviously in my case I changed the paths from /home/httpd/html to /srv//http so as to reflect my setup. Assuming the permissions on the wiki are correct I don't know why I get the 403 error when I try opening the setup.php file
    Access forbidden!
    You don't have permission to access the requested object. It is either read-protected or not readable by the server.
    If you think this is a server error, please contact the webmaster.
    Error 403
    Any ideas?
    Last edited by Ecky (2012-09-14 11:39:52)

  • How to get PHP mail() function to WORK?

    The topic title speaks for itself. I only want the exact following code to actually send an e-mail, just as it does on any external server:
    <?php
    mail(<i>an e-mail address</i>, <i>a subject</i>, <i>some text</i>);
    ?>
    Is it possible?
    I have the sendmail_path set to /usr/sbin/sendmail -t -i in php.ini, and MAILSERVER=-YES- in hostconfig.
    I would like to avoid using sendmail's -f option if possible (this does not work for all e-mail addresses anyway).
    Mac mini Core Duo   Mac OS X (10.4.7)  

    Hi Neithan,
       If, as your profile indicates, you are using Tiger, you are using postfix when you use the "sendmail" command. Sendmail is no longer installed but postfix comes with an "emulator" to keep legacy stuff from breaking. It's still a good command line method for sending mail.
       I'm not sure if setting MAILSERVER=-YES- causes postfix to listen on the smtp port or just for local connections. However, I thought that local connections were sufficient to send mail. Try it and if it doesn't work use Postfix Enabler. Just remember that changing the hostconfig file doesn't take effect until the next reboot. (or run of SystemStarter)
       Also remember that most ISPs don't accept mail from unrecognized machines anymore.
    Gary
    ~~~~
       Money isn't everything -- but it's a long way ahead of
       what comes next.
             -- Sir Edmond Stockdale

  • Impossible to send an email with Mac OS X, apache 1.3, php and sendmail

    I want to use my MacMini as Web Werver and I want to send an email using php by the mail() function. But it doesn't work. What must I do ?
    Please help me !

    Here is procedure to do working an email (in french) :
    Email envoyé par la fonction mail() de php sous Mac OS X avec votre serveur web perso sous apache.
    Si vous n'arrivez pas à envoyer un email par php à un destinataire, il peut y avoir au moins deux raisons :
    - une erreur dans le codage de la fonction mail( ) (voir pour cela : http://fr.php.net/manual/fr/function.mail.php)
    - un problème dans l'utilisation par php de sendmail (expliqué dans http://fr.php.net/manual/fr/ref.mail.php). Et comme la doc n'est pas explicite, vous allez ici comprendre ce qu'il faut faire. Deux jours de travail pour en arriver là à un ignorant du programme Terminal de Mac OS X, de sudo, et tout le reste... !
    Pour que cela fonctionne il faut modifier deux fichiers :
    Pour cela, sauvegardez d'abord le fichier /etc/postfix/main.cf en en faisant une copie. Pour cela, vous pouvez faire :
    sudo pico /etc/postfix/main.cf
    puis mettre un espace n'importe où où cela est possible, puis CTRL X, ajoutez un caractère ou deux au nom du fichier, puis Y.
    Pour modifier ensuite le premier fichier, faites à nouveau :
    sudo pico /etc/postfix/main.cf
    et ajoutez la ligne :
    myhostname = nomdedomainevalide.com
    à mettre après :
    # INTERNET HOST AND DOMAIN NAMES
    # The myhostname parameter specifies the internet hostname of this
    # mail system. The default is to use the fully-qualified domain name
    # from gethostname(). $myhostname is used as a default value for many
    # other configuration parameters.
    #myhostname = host.domain.tld
    #myhostname = virtual.domain.tld
    Enregistrez (CTRL X, puis Y)
    Ce nom de domaine que vous devez ajouter doit être valide et ne pas être le même que celui que vous allez mettre dans le deuxième fichier à modifier. Pour cela faites une sauvegarde comme précédemment pour le fichier main.cf, puis tapez à nouveau :
    sudo pico /usr/local/php5/lib/php.ini
    Ajoutez la ligne :
    sendmail_path = /usr/sbin/sendmail -t -i -f adressevalide@nomdedomainevalide
    que vous mettez après :
    [mail function]
    ; For Win32 only.
    SMTP = localhost
    smtp_port = 25
    ; For Win32 only.
    ;sendmail_from = [email protected]
    ; For Unix only. You may supply arguments as well (default: "sendmail -t -i").
    Puis enfin, enregistrer (CTRLX, puis Y)
    Je répète qu'il est impératif que le nom de domaine de l'adresse email ne soit pas le même que celui placé dans le premier fichier main.cf. Par ailleurs l'adresse email doit être valide pour être acceptée comme telle par celui qui reçoit votre message. Il vaut mieux que cette adresse soit votre adresse car elle ne sert qu'à vous envoyer des messages d'erreur envoyés par sendmail si jamais il y avait une erreur bien sûr !!! Le programme sendmail étant situé dans le path donné ci-dessus : /usr/sbin.
    Si cela ne fonctionne pas, vous pouvez debugger en faisant :
    sudo pico /var/log/mail.log
    cela vous permet de comprendre ce qui se passe chaque fois que vous envoyez par php un email.
    La procédure indiquée fonctionne avec Mac OS X.4.8, apache 1.3 et php 5.2.0
    Good Luck!

Maybe you are looking for