[imp] From Address- try 2

DragonWolf kilmarac@yahoo.com
Sat, 10 Nov 2001 00:08:51 -0500


Below is the entire configuration file.   The only thing thats different
from what I can tell, is the patch where the IMP gets the users Domain name
from whatever the URL they used to enter the webmail is.

<?php

/**
 ** General Webserver Configuration
 **/

// Where does IMP live _in the web tree_? Ex: /horde/imp. IMPORTANT: Do
// _not_ put a trailing slash on this value. If IMP is the top-level
// thing in the web tree, the correct value is '' (empty string), not
// '/'.
$default->root_url = '';

// Where do the graphics live _in the web tree_?. So, if IMP is at
// /horde/imp, and the graphics are at /horde/imp/graphics, then this
// should be set to '/horde/imp/graphics', or, a little bit more
// generally, $default->root_url . '/graphics'. The same caveat about
// trailing slashes applies.
$default->graphics_url = $default->root_url . '/graphics';

// Where are the templates? This is a filesystem path. The default
// installation places the templates in a subdirectory of the main imp
// directory; in this case the correct value is './templates', which
// is the default. Other possibilities might be
// '/etc/horde/imp/templates' or whatever, depending on how you set up
// your installation.
$default->include_dir = './templates';

// What umask should we run with? This will affect the permissions on
// temporary files created by uploading attachments, mswordview, and
// other attachment routines that use temporary files.
$default->umask = 077;

// Display the link to the new user introduction?
$default->newuser_link = true;

// Use as few new (popup) windows as possible?
$default->minimum_popups = false;



/**
 ** IMAP Configuration
 **/

// get hostname from http URL (patch for PSA)
$headers = getallheaders();
$ServerName = preg_replace('/^webmail\./', '', preg_replace('/^www\./', '',
$headers['Host']));
$ServerName = ($ServerName != '') ? $ServerName : @DEFAULT_SERVERNAME@;


// What IMAP server should we connect to by default?
$default->server = $ServerName;

// Should users be able to change the server they are connecting to?
$default->user_change_server = false;

// Should we display a list of servers (defined in
// config/servers.php3) for users to choose from? NOTE:
// $default->user_change_server needs to be true for this to be
// displayed.
//
// However, if you set user_change_server to false, and
// use_server_list to true, then the "preferred" mechanism by which
// the server list determines what server is selected by default will
// be used to determine which servers.php3 entry to use.
$default->use_server_list = false; // use server list dropdown

// If a user uses the default server, what domain should we send mail
// from? For example, if the default server is 'mail.foobar.com', and
// you want mail to be sent from user@foobar.com, instead of
// user@mail.foobar.com, you should set $default->from_server to
// 'foobar.com'.
$default->from_server = $ServerName;

// Should we complete addresses lacking an '@' in the compose window,
// and if so, what domain should we tack on? This is kind of a "combo"
// option: false means don't do it; any other value means to use that
// value as the domain to tack on. For example, $default->to_domain =
// 'foobar.com' would turn 'joe' into 'joe@foobar.com'.
$default->to_domain = false;

// What port should we connect to by default? The official port for
// IMAP is 143, so if you are unsure, you probably don't have to
// change this. However, if you are connecting to a POP3 server by
// default, you should set this to 110.
$default->port = '143';

// Should users be able to change the port they are connecting to?
$default->user_change_port = false;

// What kind of server should we connect to by default? Valid values
// are 'imap' and 'pop3'.
$default->servtype = 'imap';

// Should users be able to change the kind of server they are
// connectiong to?
$default->user_change_servtype = false;

// Should we allow users to use folders at all? NOTE: setting this to
// false will mean there is no place to save sent-mail or postponed
// messages, along with the obvious affects of restricting the user to
// their INBOX.
$default->user_use_folders = true;

// What prefix should we use to look for folders? For UW-imapd, this
// is very likely 'mail/'. If you don't know what to set this to,
// leave it empty (''), as that will never exclude anything from the
// list. If you find that you are getting too much, then set this
// value to the prefix that you want to restrict the list to.
$default->folders = '';

// Should users be able to change the folder prefix at login?
$default->user_change_folder = false;

// Servers like Cyrus and Courier-IMAP place personal folders in a
// hierarchy below INBOX, as INBOX.foldername. If you want the
// 'INBOX.' portion of that name hidden from your users, set this to
// 'INBOX.'. Otherwise, leave it blank.
$default->personal_folders = '';

// Should we use imap_subscribe? Doing so may cause users to be
// confused, as only folders that they have "subscribed" to will show
// up in the folder lists.
$default->use_imap_subscribe = true;

// Should we ignore files that begin with a '.' in the folder lists?
$default->show_dotfiles = false;

// Should we show any folders in UW-imapd's #shared/ hierarchy?
// Setting this to true on a non-UW server, or one that does not have
// this hierarchy, will probably have no effect.
$default->show_shared_hierarchy = false;

// Should we show any folders in UW-imapd's #public/ hierarchy?
// Setting this to true on a non-UW server, or one that does not have
// this hierarchy, will probably have no effect.
$default->show_public_hierarchy = false;

// Should we show any folders in UW-imapd's #news/ hierarchy? Setting
// this to true on a non-UW server, or one that does not have this
// hierarchy, will probably have no effect.
$default->show_news_hierarchy = false;



/**
 ** Sending Messages
 **/

// Should we include the contents of imp/config/header.txt in the
// headers of every message sent?
$default->append_header = true;

// Should we append the contents of imp/config/trailer.txt to the end
// of every message sent?
$default->append_trailer = false;

// Should we run usernames through a custom function before sending
// mail? If true, IMP will look for a function
// imp_expand_fromaddress() to use to expand ... from addresses! :)
$default->custom_from_hook = false;

// Here is an example imp_expand_fromaddress function (It will
// probably not work for you by default!). You get passed the $imp
// object, and have access to evenything inside it, which should be
// plenty of information. You can global anything else you
// need. Return an address - either just the user@ side, or a full
// address, and it should be used.
//
// NB: If users are allowed to change their fromaddresses (not
// fullnames, though), and they have one set, this will be overridden.
//
// NB2: The code assumes that this function will return a reasonable
// address, so make sure to fall back to $imp->user or some such on
// failure.
function imp_expand_fromaddress ($imp) {
  if ($imp->server != 'example.com') { return $imp->user; }

  $cmd = '/usr/local/bin/ph unix=' . escapeShellCmd($imp->user) . ' |
/bin/grep email | /usr/bin/awk \'{print $2}\'';
  $name = `$cmd`;
  return (empty($name) ? $imp->user : $name);
} // imp_expand_fromaddress()

// Should we save copies of every message that is sent?
$default->save_sent_mail = false;

// What folder should we save sent messages to? This is relative to
// both $default->folders and $default->personal_folders.
//
// Ex: if you
// are using UW, and the sent-mail box is $HOME/mail/sent-mail, and
// $default->folders = 'mail/', then this should be set to
// 'sent-mail'. If $default->folders were empty, then this would have to be
'mail/sent-mail'.
//
// For Cyrus, if both $default->folders and $default->personal_folders
// are empty, this should probably be 'INBOX.sent-mail'. However, if
// you set $default->personal_folders to 'INBOX.', then this can
// safely be just 'sent-mail'.
$default->sent_mail = 'sent-mail';

// What folder should we save postponed messages in? This is also
// relative to $default->folders and $default->personal_folders, and
// everything said above about $default->sent_mail applies.
$default->postponed = 'drafts';

// How should we prefix quoted lines in a reply?
$default->quote_prefix = '> ';



/**
 ** Viewing Attachments Configuration
 **/

// Should we show all text parts inline (ie, in the main message
// view)?
$default->text_parts_inline = true;

// Should we include parts that are shown inline in the parts list
// table?
$default->inline_in_parts_list = false;

// how big a part can be (in k) before we won't display it inline. 0
// means no size limit.
$default->text_inline_size = 0;

// Include a link in the parts list to view the raw message?
$default->view_message_source = true;



/**
 ** Debugging and Logging Configuration
 **/

// The value to set error_reporting() to. Valid values are: E_ERROR,
// E_WARNING, E_PARSE, E_NOTICE, E_CORE_ERROR, E_CORE_WARNING,
// E_ALL. See http://www.php.net/manual/function.error-reporting.php
// for more information.
$default->error_level = E_ALL;             /* level of error_reporting()  */

// If we need to perform a long operation, what should we set
// max_execution_time to (in seconds)? 0 means no limit; however, a
// value of 0 will cause a warning if you are running in safe
// mode. See http://www.php.net/manual/function.set-time-limit.php for
// more information.
$default->max_execution_time = 0;          /* number to set exec time to for
long operations */

// Should we log statistics using syslog?
$default->log_stats = false;

// If so, what log facility should we send the messages to?
$default->log_stats_facil = LOG_LOCAL4;

// What priority should be used?
$default->log_prio = LOG_NOTICE;

// What identifier should we send?
$default->log_ident = 'IMP';

// Should we log logins (and login failures)?
$default->log_auth = true;

// If so, what facility should we log them on?
$default->log_auth_facil = LOG_AUTH;



/**
 ** New Mail Checking Configuration
 **/

// Should we check for new mail, and throw up a javascript alert if
// there is some?
$default->newmail_popup = true;

// If so, how often (in seconds) should we check?
$default->refresh_delay = 300;



/**
 ** Internationalization and Language Configuration
 **/

// The langauge to fall back on if we cannot determine one any other
// way (user choice, preferences, HTTP_ACCEPT_LANGUAGE).
$default->language = 'en';

// Should the user be given a menu of language options? true = yes,
// false = no.
$default->user_change_language = true;

// What format string should we pass to strftime() for messages sent on
// days other than today?
$default->date_format = '%Y-%m-%d';

// What format string should we pass to strftime() for messages sent
// today?
$default->time_format = '%I:%M %p';

// What format string should be pass to strftime() for the heading of the
// compose window?
$default->compose_date_format = '%c';



/**
 ** Preferences, Addressbook, Contacts, and LDAP Configuration
 **/

// Should users be able to change their from address? If preferences
// are enabled, then setting this to true will allow users to change
// the reply-to address stored in preferences. In any case, it will
// make the From: line when composing an email editable.
$default->user_change_from = false;

// Should users be allowed to change the fullname stored in
// preferences? This is only relevant if preferences are enabled.
$default->user_change_fullname = true;

// Should we display the contacts link on the menu? Setting this to
// false will allow you to let users bring up the ldap window from
// compose screens, but no where else. It is probably best to leave it
// true.
$default->menu_contacts_link   = true;

// Should we allow users to use the addressbook? For this to have any
// effect, you must be using a non-dummy database driver to store the
// addresses in.
$default->user_use_addressbook = false;

// Allow LDAP searching? If you enable this, you will need to
// configure at least one LDAP server in config/ldap.php3.
$default->use_ldap_search = true;

// Hide deleted messages from the mailbox listing?
$default->hide_deleted = false;



/**
 ** Password Change Configuration
 **/

// Should we display a password change link? false means don't display
// a link; any other link will be assumed to be the address of a page
// that provides the opportunity to change your password. One
// possibility is 'poppassd.php3', which would link to the poppasswd
// script included with IMP. Another possibility is for this to be a
// fully-qualified URL pointing to an SSL webserver providing
// password-changing capability.
$default->change_password = true;

// What server should poppassd.php3 attempt to connect to?
$default->poppassd_server = $SERVER_NAME;

// What port should poppassd.php3 attempt to connect on (106 is
// standard)?
$default->poppassd_port = 106;



/**
 ** Database Configuration
 **/

$default->use_db = true;

// What database_driver should we use? Valid options are: dummy,
// pgsql, mysql, informix oracle, or sybase.
$default->database_driver = 'dummy';

// What username should we use to connect to the database server?
$default->db_user_name = 'hordemgr';

// What password should we use to connect to the database server?
if (!($fd = fopen("@WEBMAIL_PASSWORD_FILE@", "r"))) {
 echo "<script>alert('Unable to get webmail password!')</script>";
 exit();
}
fscanf($fd, "%s", $buff);
fclose($fd);
$default->db_password = preg_replace("/\n/", "", $buff);


// Should we warn about a default password security hole?
$default->db_security_nag = true;

// What is the name of the database that we should use?
$default->db_name = 'horde';

// What server is the database on?
$default->db_server_name = 'localhost';

// What is the name of the table where preferences are stored?
$default->db_pref_table = 'imp_pref';

// What is the name of the table where contacts are stored?
$default->db_address_table = 'imp_addr';

// If the database is on a non-standard port, what is it?
$default->db_server_port = '';



/**
 ** Utility Programs Configuration
 **/

// Where does sendmail live? We need this to send email.
$default->path_to_sendmail = '/usr/sbin/sendmail';

// If ispell is available, then we will provide a basic spelling checker.
$default->path_to_ispell = '/usr/bin/ispell';

// If mswordview is available, then we can show msword attachments in
// the browser.
// **NOTE** For older versions of this application (e.g., 0.5.14), set
// this value to '/usr/bin/mswordview -o -' (note the arguments).
$default->path_to_mswordview = '/usr/bin/wvHtml';

// If xlHtml is available, then we can show Excel attachments in the browser
$default->path_to_xlHtml = '/usr/bin/xlHtml';

// If tar is available, we can show a listing of the contents of tar
// format attachments.
$default->path_to_tar = '/bin/tar';

// If zipinfo is available, we can show a listing of the contents of
// zip file attachments.
$default->path_to_zipinfo = '/usr/bin/zipinfo';

// Path to rpm and dpkg so that packaging info can be listed for rpm
// or dpkg attachments.  These will only be useful if you use Debian
// or Red Hat; mostly by default they are commented out.  You must
// uncomment the appropriate lines in config/mime.php3
// $default->path_to_rpm = '/usr/bin/rpm';
// $default->path_to_dpkg = '/usr/bin/dpkg';

?>

----- Original Message -----
From: "Chuck Hagenbuch" <chuck@horde.org>
To: <imp@lists.horde.org>
Sent: Friday, November 09, 2001 11:03 PM
Subject: Re: [imp] From Address- try 2


> Quoting DragonWolf <kilmarac@yahoo.com>:
>
> > Yes it does.
> >
> > The version is IMP 2.2.6
>
> Well, I just double-checked the code, and the check is right there in the
> compose template. You didn't put false in quotes in defaults.php3, by
chance,
> did you? _Something_ is configured wacky on your end.
>
> -chuck
>
> --
> Charles Hagenbuch, <chuck@horde.org>
> "What was and what may be, lie, like children whose faces we cannot see,
in the
> arms of silence. All we ever have is here, now." - Ursula K. Le Guin
>
> --
> IMP mailing list: http://horde.org/imp/
> Archive: http://marc.theaimsgroup.com/?l=imp&r=1&w=2
> Frequently Asked Questions: http://horde.org/faq/
> To unsubscribe, mail: imp-unsubscribe@lists.horde.org


_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com