001    /*
002     * Copyright (c) 2009 The openGion Project.
003     *
004     * Licensed under the Apache License, Version 2.0 (the "License");
005     * you may not use this file except in compliance with the License.
006     * You may obtain a copy of the License at
007     *
008     *     http://www.apache.org/licenses/LICENSE-2.0
009     *
010     * Unless required by applicable law or agreed to in writing, software
011     * distributed under the License is distributed on an "AS IS" BASIS,
012     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
013     * either express or implied. See the License for the specific language
014     * governing permissions and limitations under the License.
015     */
016    package org.opengion.hayabusa.taglib;
017    
018    import org.opengion.hayabusa.common.HybsSystem;
019    import org.opengion.hayabusa.common.HybsSystemException;
020    import org.opengion.hayabusa.resource.LDAPSearch;
021    import org.opengion.fukurou.db.DBUtil;
022    import org.opengion.fukurou.mail.MailTX;
023    import org.opengion.fukurou.util.StringUtil;
024    // import org.opengion.hayabusa.mail.AbstractMailManager;
025    import org.opengion.hayabusa.mail.MailPattern;
026    
027    import static org.opengion.fukurou.util.StringUtil.nval ;
028    
029    import java.util.List;
030    import java.io.ObjectOutputStream;
031    import java.io.ObjectInputStream;
032    import java.io.IOException;
033    
034    /**
035     * メールをé?ä¿¡ã™ã‚‹ãŸã‚ã®ç°¡æ˜“ã‚¿ã‚°ã§ã™ã?
036     *
037     * Body 部ã«ã€ãƒ¡ãƒ?‚»ãƒ¼ã‚¸ã‚’記述ã—ã¾ã™ã?
038     *
039     * @og.formSample
040     * â—å½¢å¼ï¼?lt;og:mailSender from="…" to="…" subject="?¥?¥?¥"/>
041     * â—body?šã‚ã‚?EVAL_BODY_BUFFERED:BODYを評価ã—ã?{@XXXX} ã‚’è§£æžã—ã¾ã?
042     *
043     * â—Tag定義??
044     *   <og:mailSender
045     *       subject            ã€TAG】タイトルを指定ã—ã¾ã?
046     *       from               ã€TAG】é?ä¿¡å…??¦?²?¯?­)アドレスを指定ã—ã¾ã?
047     *       to                 ã€TAG】é?ä¿¡å…??´?¯)アドレスをCSVå½¢å¼ã§æŒ?®šã—ã¾ã?
048     *       cc                 ã€TAG】é?ä¿¡å…??£?£)アドレスをCSVå½¢å¼ã§æŒ?®šã—ã¾ã?
049     *       bcc                ã€TAG】é?ä¿¡å…??¢?£?£)アドレスをCSVå½¢å¼ã§æŒ?®šã—ã¾ã?
050     *       replyTo            ã€TAG】返信å…?replyTo)アドレスをCSVå½¢å¼ã§æŒ?®šã—ã¾ã?
051     *       host               ã€TAG】メールサーãƒã?を指定ã—ã¾ã?(åˆæœŸå€¤:COMMON_MAIL_SERVER[=])
052     *       smtpPort           ã€TAG】SMTPãƒã?トをCSVå½¢å¼ã§æŒ?®šã—ã¾ã?åˆæœŸå€¤:SMTP_PORT)    // 5.8.1.1 (2014/11/14)
053     *       authType           ã€TAG】èªè¨¼æ–¹å¼?         åˆæœŸå€¤:MAIL_SEND_AUTH                         // 5.8.1.1 (2014/11/14)
054     *       authPort           ã€TAG】èªè¨¼ãƒã?ãƒ?       åˆæœŸå€¤:MAIL_SEND_AUTH_PORT                     // 5.8.1.1 (2014/11/14)
055     *       authUser           ã€TAG】èªè¨¼ãƒ¦ãƒ¼ã‚¶ãƒ¼      åˆæœŸå€¤:MAIL_SEND_AUTH_USER                   // 5.8.1.1 (2014/11/14)
056     *       authPass           ã€TAG】èªè¨¼ãƒ‘スワーãƒ?   åˆæœŸå€¤:MAIL_SEND_AUTH_PASSWORD         // 5.8.1.1 (2014/11/14)
057     *       charset            ã€TAG】文字エンコーãƒ?‚£ãƒ³ã‚°ã‚’指定ã—ã¾ã?(åˆæœŸå€¤:MAIL_DEFAULT_CHARSET[=ISO-2022-JP])
058     *       fileURL            ã€TAG】添付ファイルã®ã‚»ãƒ¼ãƒ–ディレクトリを指定ã—ã¾ã?(åˆæœŸå€¤:FILE_URL[=filetemp/])
059     *       filename           ã€TAG】添付ファイルåã‚’CSVå½¢å¼ã§æŒ?®šã—ã¾ã?
060     *       useLDAP            ã€TAG】メールアドレスをLDAPを利用ã—ã¦å–å¾—ã™ã‚‹ã‹ã©ã?‹[true/false]を指定ã—ã¾ã?åˆæœŸå€¤:false)
061     *       ldapKey            ã€TAG】アドレスを検索ã™ã‚‹ã‚­ãƒ¼ã‚’指定ã—ã¾ã?åˆæœŸå€¤:LDAP_MAILSEND_KEY[=uid] C社員番å·)
062     *       ldapVals           ã€TAG】LDAP検索時ã?属æ?åã‚’æŒ?®šã—ã¾ã?åˆæœŸå€¤:LDAP_MAILSEND_VALS[=cn,mail])
063     *       debug              ã€TAG】デãƒãƒƒã‚°æƒ??ã‚’å?力ã™ã‚‹ã‹ã©ã?‹[true/false]を指定ã—ã¾ã?åˆæœŸå€¤:false)
064     *   >   ... Body ...
065     *   </og:mailSender>
066     *
067     * â—使用ä¾?
068     *     <og:mailSender from="C00000" to="C99999" subject="{@SUBJECT}" >
069     *          メールå†?®¹
070     *     </og:mailSender >
071     *
072     *        charset   = キャラクタセãƒ?ƒˆ  (例:Windows-31J , ISO-2022-JP)
073     *        from      = From       é€ä¿¡å…?
074     *        to        = To         é€ä¿¡å…?è¤?•°ç™»éŒ²å¯èƒ½)
075     *        cc        = Cc         é€ä¿¡å…?è¤?•°ç™»éŒ²å¯èƒ½)
076     *        bcc       = Bcc        é€ä¿¡å…?è¤?•°ç™»éŒ²å¯èƒ½)
077     *        replyTo   = ReplyTo    返信先å?(è¤?•°ç™»éŒ²å¯èƒ½)
078     *        useLDAP   = false/true メールアドレスをLDAPを利用ã—ã¦å–å¾—ã™ã‚‹ã‹ã©ã?‹
079     *        ldapKey   = "uid"      アドレスを検索ã™ã‚‹ã‚­ãƒ¼(åˆæœŸå€¤:シスãƒ?ƒ ãƒªã‚½ãƒ¼ã‚¹ C社員番å·)
080     *        ldapVals  = "cn,mail"  LDAP検索時ã?属æ?åã?ã²ã¨ã¤ãªã‚‰ã‚¢ãƒ‰ãƒ¬ã‚¹ã€‚ï¼’ã¤ãªã‚‰åå‰ã¨ã‚¢ãƒ‰ãƒ¬ã‚¹
081     *        host      = SMTPサーãƒã?å?
082     *        smtpPort  = SMTPãƒã?ãƒ?       åˆæœŸå€¤:SMTP_PORT                                   // 5.8.1.1 (2014/11/14)
083     *        authType  = èªè¨¼æ–¹å¼?         åˆæœŸå€¤:MAIL_SEND_AUTH                             // 5.8.1.1 (2014/11/14)
084     *        authPort  = èªè¨¼ãƒã?ãƒ?       åˆæœŸå€¤:MAIL_SEND_AUTH_PORT                 // 5.8.1.1 (2014/11/14)
085     *        authUser  = èªè¨¼ãƒ¦ãƒ¼ã‚¶ãƒ¼      åˆæœŸå€¤:MAIL_SEND_AUTH_USER                       // 5.8.1.1 (2014/11/14)
086     *        authPass  = èªè¨¼ãƒ‘スワーãƒ?   åˆæœŸå€¤:MAIL_SEND_AUTH_PASSWORD             // 5.8.1.1 (2014/11/14)
087     *        subject   = タイトル
088     *        fileURL   = 添付ファイルã®ã‚»ãƒ¼ãƒ–ディレクトリ
089     *        filename  = 添付ファイルå?ローカルã«ã‚»ãƒ¼ãƒ–ã•れãŸãƒ•ァイルå?(è¤?•°ç™»éŒ²å¯èƒ½)
090     *        debug     = true/false;
091     *
092     * è¤?•°ç™»éŒ²å¯èƒ½ãªå€‹æ‰€ã¯ã€ã‚«ãƒ³ãƒžåŒºåˆ?‚Šã§ã€è¤?•°ç™»éŒ²ã§ãã¾ã™ã?
093     * アドレス(from,to,cc,bcc,replyTo)ã¯ã€ã?"åç§°" <メールアドレス>ã€å½¢å¼ãŒ
094     * æŒ?®šã§ãã¾ã™ã?< 㨠> ã§å›²ã¾ã‚ŒãŸç¯?›²ãŒãƒ¡ãƒ¼ãƒ«ã‚¢ãƒ‰ãƒ¬ã‚¹ã«ãªã‚Šã¾ã™ã?
095     * åç§°ã«ã¯ã€æ¼¢å­—ãŒä½¿ç”¨ã§ãã¾ã™ã?
096     *
097     * host ã¯ã€ã‚·ã‚¹ãƒ?ƒ ãƒ‘ラメータ ã® COMMON_MAIL_SERVER 属æ?ãŒå?期å?ã§è¨­å®šã•れã¾ã™ã?
098     * charset ã¯ã€ã‚·ã‚¹ãƒ?ƒ ãƒ‘ラメータ ã® MAIL_DEFAULT_CHARSET 属æ?ãŒå?期å?ã§è¨­å®šã•れã¾ã™ã?
099     *
100     * @og.group ãã?ä»–å?åŠ?
101     *
102     * @version  4.0
103     * @author   Kazuhiko Hasegawa
104     * @since    JDK5.0,
105     */
106    public class MailSenderTag extends CommonTagSupport {
107            //* ã“ã?プログラãƒ??VERSIONæ–?­—å?を設定ã—ã¾ã™ã?       {@value} */
108            private static final String VERSION = "5.8.1.1 (2014/11/14)" ;
109    
110            private static final long serialVersionUID = 581120141114L ;
111    
112            private transient MailTX     mail     = null;
113            private String     host     = HybsSystem.sys( "COMMON_MAIL_SERVER" );
114            private String     charset  = HybsSystem.sys( "MAIL_DEFAULT_CHARSET" ); // 3.5.6.6 (2004/08/23)
115            private String     from     = null;
116            private String[]   to       = null;
117            private String[]   cc       = null;
118            private String[]   bcc      = null;
119            private String[]   replyTo  = null;
120            private String     subject  = null;
121            private String[]   filename = null;
122            private String     fileURL      = HybsSystem.sys( "FILE_URL" );
123    
124            private String          smtpPort        = HybsSystem.sys( "SMTP_PORT" );                                        // 5.8.1.1 (2014/11/14)
125            private String          authType        = HybsSystem.sys( "MAIL_SEND_AUTH" );                           // 5.8.1.1 (2014/11/14)
126            private String          authPort        = HybsSystem.sys( "MAIL_SEND_AUTH_PORT" );                      // 5.8.1.1 (2014/11/14)
127            private String          authUser        = HybsSystem.sys( "MAIL_SEND_AUTH_USER" );                      // 5.8.1.1 (2014/11/14)
128            private String          authPass        = HybsSystem.sys( "MAIL_SEND_AUTH_PASSWORD" );          // 5.8.1.1 (2014/11/14)
129    
130            private boolean         useLDAP = false;                                // 3.7.1.0 (2005/04/15)
131            // uid Cç¤¾å“¡ç•ªå· ã€employeeNumber 社員番å·
132    //      private String          ldapKey = "uid";                                // 3.7.1.0 (2005/04/26)
133    //      private String          ldapVals= "cn,mail";                    // 3.7.1.0 (2005/04/15)
134            private String          ldapKey = HybsSystem.sys( "LDAP_MAILSEND_KEY" );                // 5.6.7.0 (2013/07/27)
135            private String          ldapVals= HybsSystem.sys( "LDAP_MAILSEND_VALS" );               // 5.6.7.0 (2013/07/27)
136            
137            private boolean         useDB   = false;                                // 5.6.9.3 (2013/10/25) GE35ã‹ã‚‰ãƒ¡ãƒ¼ãƒ«ã‚¢ãƒ‰ãƒ¬ã‚¹ã‚’å–å¾?
138            private final String DBID = HybsSystem.sys( "RESOURCE_DBID" );
139    
140            /**
141             * Taglibã®é–‹å§‹ã‚¿ã‚°ãŒè¦‹ã¤ã‹ã£ãŸã¨ãã«å‡¦ç?™ã‚?doStartTag() ã‚?オーãƒã?ライドã—ã¾ã™ã?
142             *
143             * @return      後続å?ç??æŒ?¤º( EVAL_BODY_BUFFERED )
144             */
145            @Override
146            public int doStartTag() {
147    //              mail = new MailTX( host,charset );
148                    mail = new MailTX( host,charset,smtpPort,authType,authPort,authUser,authPass );         // 5.8.1.1 (2014/11/14)
149                    return( EVAL_BODY_BUFFERED );   // Body を評価ã™ã‚‹ã€? extends BodyTagSupport æ™?
150            }
151    
152            /**
153             * Taglibã®ã‚¿ã‚°æœ¬ä½“を処ç?™ã‚?doAfterBody() ã‚?オーãƒã?ライドã—ã¾ã™ã?
154             *
155             * @og.rev 3.1.1.0 (2003/03/28) ボディã®å†?®¹ã‚’å–å¾—ã™ã‚‹å?ç?‚’ã€CommonTagSupport ã§è¡Œã†ã€?
156             *
157             * @return      後続å?ç??æŒ?¤º(SKIP_BODY)
158             */
159            @Override
160            public int doAfterBody() {
161                    String message = getBodyString();
162    
163                    mail.setMessage( message );
164    
165                    return(SKIP_BODY);
166            }
167    
168            /**
169             * Taglibã®çµ‚äº?‚¿ã‚°ãŒè¦‹ã¤ã‹ã£ãŸã¨ãã«å‡¦ç?™ã‚?doEndTag() ã‚?オーãƒã?ライドã—ã¾ã™ã?
170             *
171             * @og.rev 3.1.1.2 (2003/04/04) Tomcat4.1 対応ã?release2() ã‚?doEndTag()ã§å‘¼ã¶ã€?
172             * @og.rev 3.7.1.0 (2005/04/15) LDAP検索 æ–°è¦è¿½åŠ?
173             * @og.rev 5.6.9.3 (2013/10/25) useDB対�
174             *
175             * @return      後続å?ç??æŒ?¤º
176             */
177            @Override
178            public int doEndTag() {
179                    debugPrint();           // 4.0.0 (2005/02/28)
180    
181                    // 3.7.1.0 (2005/04/15) LDAP検索 æ–°è¦è¿½åŠ?
182                    if( useLDAP ) {
183                            String[] vals = StringUtil.csv2Array( ldapVals );
184    
185                            LDAPSearch serch = new LDAPSearch();
186                            serch.setAttributes( vals );
187                            serch.init();
188    
189                            from    = setLDAPAddress( serch,from    );
190                            to              = setLDAPAddress( serch,to              );
191                            cc              = setLDAPAddress( serch,cc              );
192                            bcc             = setLDAPAddress( serch,bcc             );
193                            replyTo = setLDAPAddress( serch,replyTo );
194                    }
195                    else if( useDB ){ // 5.6.9.3 (2013/10/25) GE35ã‹ã‚‰ãƒ¡ãƒ¼ãƒ«ã‚¢ãƒ‰ãƒ¬ã‚¹ã‚’å–å¾?
196                            String[] from_array = {from};
197                            from    = getAddressArray( from_array )[0];
198                            to              = getAddressArray( to           );
199                            cc              = getAddressArray( cc           );
200                            bcc             = getAddressArray( bcc          );
201                            replyTo = getAddressArray( replyTo      );
202                    }
203    
204    //              mail.setHost( host );
205                    mail.setFrom( from );
206                    mail.setTo( to );
207                    mail.setCc( cc );
208                    mail.setBcc( bcc );
209                    mail.setReplyTo( replyTo );
210                    mail.setSubject( subject );
211    //              mail.setCharset( charset );
212                    mail.setDebug( isDebug() );
213    
214                    if( filename != null && filename.length > 0 ) {
215                            String[] temp = new String[filename.length];
216                            String directory = HybsSystem.url2dir( fileURL );
217                            for( int i=0; i<temp.length; i++ ) {
218                                    temp[i] = StringUtil.urlAppend( directory, filename[i] );
219                            }
220                            mail.setFilename( temp );
221                    }
222    
223                    mail.sendmail() ;
224    
225                    return(EVAL_PAGE);
226            }
227    
228            /**
229             * タグリブオブジェクトをリリースã—ã¾ã™ã?
230             * キャãƒ?‚·ãƒ¥ã•れã¦å†åˆ©ç”¨ã•れるã?ã§ã€ãƒ•ィールドã?åˆæœŸè¨­å®šã‚’行ã„ã¾ã™ã?
231             *
232             * @og.rev 2.0.0.4 (2002/09/27) カスタãƒ?‚¿ã‚°ã® release() メソãƒ?ƒ‰ã‚’ã?追åŠ?
233             * @og.rev 3.1.1.2 (2003/04/04) Tomcat4.1 対応ã?release2() ã‚?doEndTag()ã§å‘¼ã¶ã€?
234             * @og.rev 3.7.1.0 (2005/04/15) LDAP検索 useLDAP,ldapKey,ldapVals 属æ?追åŠ?
235             * @og.rev 5.6.7.0 (2013/07/27) ldapKey,ldapValsã®å–得をリソースã«å¤‰æ›´
236             * @og.rev 5.6.9.3 (2013/10/25) useDB追�
237             * @og.rev 5.8.1.1 (2014/11/14) メールé€ä¿¡æ™‚èªè¨¼è¿½åŠ??smtpPort,authPort,authType,authUser,authPass
238             *
239             */
240            @Override
241            protected void release2() {
242                    super.release2();
243                    mail     = null;
244                    host     = HybsSystem.sys( "COMMON_MAIL_SERVER" );
245                    charset  = HybsSystem.sys( "MAIL_DEFAULT_CHARSET" );    // 3.5.6.6 (2004/08/23)
246                    from     = null;
247                    to       = null;
248                    cc       = null;
249                    bcc      = null;
250                    replyTo  = null;
251                    subject  = null;
252                    fileURL  = HybsSystem.sys( "FILE_URL" );
253                    filename = null;
254                    useLDAP  = false;                               // 3.7.1.0 (2005/04/15)
255    //              ldapKey  = "uid";                               // 3.7.1.0 (2005/04/26)
256    //              ldapVals = "cn,mail";                   // 3.7.1.0 (2005/04/15)
257                    ldapKey = HybsSystem.sys( "LDAP_MAILSEND_KEY" );                // 5.6.7.0 (2013/07/27)
258                    ldapVals= HybsSystem.sys( "LDAP_MAILSEND_VALS" );               // 5.6.7.0 (2013/07/27)
259                    useDB   = false;                                // 5.6.9.3 (2013/10/25) GE35ã‹ã‚‰ãƒ¡ãƒ¼ãƒ«ã‚¢ãƒ‰ãƒ¬ã‚¹ã‚’å–å¾?
260                    smtpPort        = HybsSystem.sys( "SMTP_PORT" );                                // 5.8.1.1 (2014/11/14)
261                    authType        = HybsSystem.sys( "MAIL_SEND_AUTH" );                   // 5.8.1.1 (2014/11/14)
262                    authPort        = HybsSystem.sys( "MAIL_SEND_AUTH_PORT" );              // 5.8.1.1 (2014/11/14)
263                    authUser        = HybsSystem.sys( "MAIL_SEND_AUTH_USER" );              // 5.8.1.1 (2014/11/14)
264                    authPass        = HybsSystem.sys( "MAIL_SEND_AUTH_PASSWORD" );  // 5.8.1.1 (2014/11/14)
265            }
266    
267            /**
268             * LDAP を利用ã—ãŸãƒ¡ãƒ¼ãƒ«ã‚¢ãƒ‰ãƒ¬ã‚¹ã‚’設定ã—ç›´ã—ã¾ã™ã?
269             *
270             * LDAPよりã€ldapKeyをキーã«ã€ldapVals を設定å?ã¨ã—ã¦ã€èª­ã¿è¾¼ã¿ã¾ã™ã?
271             * åˆæœŸå€¤ã¯ã€ldapKeyã¯ã€uid(ユニã?クID) ldapValsã¯ã€cn,mail(åå‰ã€ãƒ¡ãƒ¼ãƒ«ã‚¢ãƒ‰ãƒ¬ã‚¹)ã¨ãªã£ã¦ã?¾ã™ã?
272             * from,to,cc,bcc,replyTo ã®è¨­å®šå?ã‚’ã?target ã«ã‚»ãƒ?ƒˆã—ã¦ã€æ¤œç´¢ã—ã¾ã™ã?
273             * 通常ã€ã“ã®ãƒ¡ã‚½ãƒ?ƒ‰ã¯ã€useLDAP=true ã®å ´åˆã«å‘¼ã³å‡ºã™ã‚ˆã?«è¨­å®šã—ã¾ã™ã?
274             * target ã?null ã‹ã?ゼロæ–?­—å?ã?メールアドレス(ã“ã“ã§ã¯ã€?#064; æ–?­—ã‚’å«ã‚?‹ã©ã?‹ã§åˆ¤å®?ã®å ´åˆã?
275             * ãã?ã¾ã¾ target ã‚’è¿”ã—ã¾ã™ã?
276             *
277             * @og.rev 3.7.1.0 (2005/04/15) LDAP検索 æ–°è¦è¿½åŠ?
278             *
279             * @param       serch   LDAPSearchオブジェク�
280             * @param       target  ldapKeyキーã«å¯¾ã™ã‚‹è¨­å®šå?
281             *
282             * @return      メールアドレス
283             * @see   #setLDAPAddress( LDAPSearch serch, String[] targets )
284             */
285            private String setLDAPAddress( final LDAPSearch serch, final String target ) {
286                    final String rtnAdrs ;
287    
288    //              if( target == null || target.length() == 0 || target.indexOf("@") > 0 ) { return target; }
289                    if( target != null && target.indexOf( '@' ) < 0 ) {
290                            List<String[]> list = serch.search( ldapKey + "=" + target );
291                            if( list.size() == 1 ) {
292                                    String[] vals = list.get(0);
293                                    if( ldapVals.indexOf(',') < 0 ) {    // 検索値ãŒï¼’ã¤ã®å ´åˆã§ãªã?
294                                            rtnAdrs = vals[0] ;             // メールアドレスã®ã¿
295                                    }
296                                    else {
297                                            rtnAdrs = vals[0] + "<" + vals[1] + ">" ; // "åå‰<aaaa@bbbb>" å½¢å¼?
298                                    }
299                            }
300                            else {
301                                    String errMsg = "LDAP検索ã®çµæžœã€ãƒ¡ãƒ¼ãƒ«ã‚¢ãƒ‰ãƒ¬ã‚¹ãŒè¦‹ã¤ã‹ã‚Šã¾ã›ã‚“ã§ã—ãŸã€?
302                                                            + "設定å?=[" + target + "] , 検索キー=[" + ldapKey + "] , 検索属æ?=["
303                                                            + ldapVals + "]" ;
304                                    throw new HybsSystemException( errMsg );
305                            }
306                    }
307                    else {
308                            rtnAdrs = target;
309                    }
310    
311                    return rtnAdrs ;
312            }
313    
314            /**
315             * LDAP を利用ã—ãŸè¤?•°ã®ãƒ¡ãƒ¼ãƒ«ã‚¢ãƒ‰ãƒ¬ã‚¹ã‚’å–å¾—ã—ã¾ã™ã?
316             *
317             * LDAPよりã€ldapKeyをキーã«ã€ldapVals を設定å?ã¨ã—ã¦ã€èª­ã¿è¾¼ã¿ã¾ã™ã?
318             * åˆæœŸå€¤ã¯ã€ldapKeyã¯ã€uid(ユニã?クID) ldapValsã¯ã€cn,mail(åå‰ã€ãƒ¡ãƒ¼ãƒ«ã‚¢ãƒ‰ãƒ¬ã‚¹)ã¨ãªã£ã¦ã?¾ã™ã?
319             * from,to,cc,bcc,replyTo ã®è¨­å®šå?ã‚’ã?target ã«ã‚»ãƒ?ƒˆã—ã¦ã€æ¤œç´¢ã—ã¾ã™ã?
320             * 通常ã€ã“ã®ãƒ¡ã‚½ãƒ?ƒ‰ã¯ã€useLDAP=true ã®å ´åˆã«å‘¼ã³å‡ºã™ã‚ˆã?«è¨­å®šã—ã¾ã™ã?
321             * target ãŒãƒ¡ãƒ¼ãƒ«ã‚¢ãƒ‰ãƒ¬ã‚¹ã®å ´åˆã?(ã“ã“ã§ã¯ã€?#064; æ–?­—ã‚’å«ã‚?‹ã©ã?‹ã§åˆ¤å®?ãã?ã¾ã¾è¿”ã—ã¾ã™ã?
322             *
323             * @og.rev 3.7.1.0 (2005/04/26) LDAP検索 æ–°è¦è¿½åŠ?
324             *
325             * @param       serch   LDAPSearchオブジェク�
326             * @param       targets ldapKeyキーã«å¯¾ã™ã‚‹è¨­å®šå?ã®é…å?
327             *
328             * @return      è¤?•°ã®ãƒ¡ãƒ¼ãƒ«ã‚¢ãƒ‰ãƒ¬ã‚¹(é…å?)
329             * @see   #setLDAPAddress( LDAPSearch serch, String target )
330             */
331            private String[] setLDAPAddress( final LDAPSearch serch, final String[] targets ) {
332                    if( targets == null || targets.length == 0 ) { return targets; }
333    
334                    String[] rtn = new String[targets.length];
335    
336                    for( int i=0; i<targets.length; i++ ) {
337                            rtn[i] = setLDAPAddress( serch,targets[i] );
338                    }
339                    return rtn ;
340            }
341    
342            /**
343             * ã€TAG】é?ä¿¡å…??¦?²?¯?­)アドレスを指定ã—ã¾ã™ã?
344             *
345             * @og.tag é€ä¿¡å…??¦?²?¯?­)アドレスを指定ã—ã¾ã™ã?
346             *
347             * @param   fromAdrs é€ä¿¡å…??¦?²?¯?­)アドレス
348             */
349            public void setFrom( final String fromAdrs ) {
350                    from = nval( getRequestParameter( fromAdrs ), from );
351            }
352    
353            /**
354             * ã€TAG】é?ä¿¡å…??´?¯)アドレスをCSVå½¢å¼ã§æŒ?®šã—ã¾ã™ã?
355             *
356             * @og.tag
357             * è¤?•°ã‚¢ãƒ‰ãƒ¬ã‚¹ã‚’カンマ区åˆ?‚Šã§ã‚»ãƒ?ƒˆã§ãã¾ã™ã?
358             *
359             * @og.rev 3.5.6.2 (2004/07/05) å…ˆã«é…å?ã«åˆ?§£ã—ã¦ã‹ã‚‰ãƒªã‚¯ã‚¨ã‚¹ãƒˆå¤‰æ•°ã®å€¤ã‚’å–å¾?
360             * @og.rev 3.5.6.4 (2004/07/16) å…ˆã«ãƒªã‚¯ã‚¨ã‚¹ãƒˆå¤‰æ•°ã®å€¤ã‚’å–å¾—ã—ã¦ã‹ã‚‰é…å?ã«åˆ?§£
361             *
362             * @param   toAdrs é€ä¿¡å…??´?¯)アドレス(CSVå½¢å¼?
363             */
364            public void setTo( final String toAdrs ) {
365                    to = StringUtil.csv2ArrayOnly( getRequestParameter( toAdrs ) );
366            }
367    
368            /**
369             * ã€TAG】é?ä¿¡å…??£?£)アドレスをCSVå½¢å¼ã§æŒ?®šã—ã¾ã™ã?
370             *
371             * @og.tag
372             * è¤?•°ã‚¢ãƒ‰ãƒ¬ã‚¹ã‚’カンマ区åˆ?‚Šã§ã‚»ãƒ?ƒˆã§ãã¾ã™ã?
373             *
374             * @og.rev 3.5.6.2 (2004/07/05) å…ˆã«é…å?ã«åˆ?§£ã—ã¦ã‹ã‚‰ãƒªã‚¯ã‚¨ã‚¹ãƒˆå¤‰æ•°ã®å€¤ã‚’å–å¾?
375             * @og.rev 3.5.6.4 (2004/07/16) å…ˆã«ãƒªã‚¯ã‚¨ã‚¹ãƒˆå¤‰æ•°ã®å€¤ã‚’å–å¾—ã—ã¦ã‹ã‚‰é…å?ã«åˆ?§£
376             *
377             * @param   ccAdrs é€ä¿¡å…??£?£)アドレス(CSVå½¢å¼?
378             */
379            public void setCc( final String ccAdrs ) {
380                    cc = StringUtil.csv2ArrayOnly( getRequestParameter( ccAdrs ) );
381            }
382    
383            /**
384             * ã€TAG】é?ä¿¡å…??¢?£?£)アドレスをCSVå½¢å¼ã§æŒ?®šã—ã¾ã™ã?
385             *
386             * @og.tag
387             * è¤?•°ã‚¢ãƒ‰ãƒ¬ã‚¹ã‚’カンマ区åˆ?‚Šã§ã‚»ãƒ?ƒˆã§ãã¾ã™ã?
388             *
389             * @og.rev 3.5.6.2 (2004/07/05) å…ˆã«é…å?ã«åˆ?§£ã—ã¦ã‹ã‚‰ãƒªã‚¯ã‚¨ã‚¹ãƒˆå¤‰æ•°ã®å€¤ã‚’å–å¾?
390             * @og.rev 3.5.6.4 (2004/07/16) å…ˆã«ãƒªã‚¯ã‚¨ã‚¹ãƒˆå¤‰æ•°ã®å€¤ã‚’å–å¾—ã—ã¦ã‹ã‚‰é…å?ã«åˆ?§£
391             *
392             * @param   bccAdrs é€ä¿¡å…??¢?£?£)アドレス(CSVå½¢å¼?
393             */
394            public void setBcc( final String bccAdrs ) {
395                    bcc = StringUtil.csv2ArrayOnly( getRequestParameter( bccAdrs ) );
396            }
397    
398            /**
399             * ã€TAG】返信å…?replyTo)アドレスをCSVå½¢å¼ã§æŒ?®šã—ã¾ã™ã?
400             *
401             * @og.tag
402             * è¤?•°ã‚¢ãƒ‰ãƒ¬ã‚¹ã‚’カンマ区åˆ?‚Šã§ã‚»ãƒ?ƒˆã§ãã¾ã™ã?
403             *
404             * @og.rev 3.5.6.6 (2004/08/23) æ–°è¦è¿½åŠ?
405             *
406             * @param   replyToAdrs 返信�replyTo)アドレス(CSV形�
407             */
408            public void setReplyTo( final String replyToAdrs ) {
409                    replyTo = StringUtil.csv2ArrayOnly( getRequestParameter( replyToAdrs ) );
410            }
411    
412            /**
413             * ã€TAG】メールサーãƒã?を指定ã—ã¾ã?
414             *              (åˆæœŸå€¤:COMMON_MAIL_SERVER[={@og.value org.opengion.hayabusa.common.SystemData#COMMON_MAIL_SERVER}])ã€?
415             *
416             * @og.tag メールサーãƒã?を指定ã—ã¾ã™ã?
417             * (åˆæœŸå€¤:シスãƒ?ƒ å®šæ•°ã®COMMON_MAIL_SERVER[={@og.value org.opengion.hayabusa.common.SystemData#COMMON_MAIL_SERVER}])ã€?
418             *
419             * @og.rev 3.5.6.6 (2004/08/23) åˆæœŸå€¤ã‚’è?æ…®ã™ã‚‹ã‚ˆã†ã«å¤‰æ›´ã€?
420             *
421             * @param   hst メールサーãƒã?
422             * @see         org.opengion.hayabusa.common.SystemData#COMMON_MAIL_SERVER
423             */
424            public void setHost( final String hst ) {
425                    host = nval( getRequestParameter( hst ),host );
426            }
427    
428            /**
429             * ã€TAG】タイトルを指定ã—ã¾ã™ã?
430             *
431             * @og.tag タイトルを指定ã—ã¾ã™ã?
432             *
433             * @param   subjct タイトル
434             */
435            public void setSubject( final String subjct ) {
436                    this.subject = getRequestParameter( subjct );
437            }
438    
439            /**
440             * ã€TAG】添付ファイルåã‚’CSVå½¢å¼ã§æŒ?®šã—ã¾ã™ã?
441             *
442             * @og.tag
443             * è¤?•°ãƒ•ァイルをセãƒ?ƒˆã§ãã¾ã™ã?
444             * 設定方法ã?ã€ã‚«ãƒ³ãƒžã§åŒºåˆ?£ã¦ä¸¦ã¹è¤?•°æŒ?®šã§ãã¾ã™ã?
445             *
446             * @og.rev 3.5.6.6 (2004/08/23) è¤?•°ãƒ•ァイルæŒ?®šæ–¹æ³•ã‚’ã€?‡è¤?ƒªã‚¯ã‚¨ã‚¹ãƒˆã‹ã‚‰ã‚«ãƒ³ãƒžåŒºåˆ?‚Šã«å¤‰æ›´
447             *
448             * @param   fname 添付ファイルå?CSVå½¢å¼?
449             */
450            public void setFilename( final String fname ) {
451                    filename = StringUtil.csv2ArrayOnly( getRequestParameter( fname ) );
452            }
453    
454            /**
455             * ã€TAG】文字エンコーãƒ?‚£ãƒ³ã‚°ã‚’指定ã—ã¾ã?
456             *              (åˆæœŸå€¤:MAIL_DEFAULT_CHARSET[={@og.value org.opengion.hayabusa.common.SystemData#MAIL_DEFAULT_CHARSET}])ã€?
457             *
458             * @og.tag
459             * æ–?­—エンコーãƒ?‚£ãƒ³ã‚°ã¯ã€ãƒ¡ãƒ¼ãƒ«æœ¬æ–?«å¯¾ã™ã‚‹ã‚¨ãƒ³ã‚³ãƒ¼ãƒ?‚£ãƒ³ã‚°æŒ?®šã§ã™ã?
460             * ã“れã¯ã€Windows-31J ã€MS932ã€Shift_JIS ã®ã©ã‚Œã‹ãŒæŒ‡å®šã•れãŸå ´åˆã?
461             * 『指定ã?æ–?­—コーãƒ?+ 8bit é€ä¿¡ã€ã—ã¾ã™ã?
462             * ãれ以外ã?æŒ?®šã?ã€ã?ISO-2022-JP ã«ç‹¬è‡ªå¤‰æ› + 7bit é€ä¿¡ã€ã«ãªã‚Šã¾ã™ã?
463             * (åˆæœŸå€¤:シスãƒ?ƒ å®šæ•°ã®MAIL_DEFAULT_CHARSET[={@og.value org.opengion.hayabusa.common.SystemData#MAIL_DEFAULT_CHARSET}])ã€?
464             *
465             * @param   chset æ–?­—エンコーãƒ?‚£ãƒ³ã‚°
466             * @see         org.opengion.hayabusa.common.SystemData#MAIL_DEFAULT_CHARSET
467             */
468            public void setCharset( final String chset ) {
469                    charset = nval( getRequestParameter( chset ),charset );
470            }
471    
472            /**
473             * ã€TAG】添付ファイルã®ã‚»ãƒ¼ãƒ–ディレクトリを指定ã—ã¾ã?
474             *              (åˆæœŸå€¤:FILE_URL[={@og.value org.opengion.hayabusa.common.SystemData#FILE_URL}])ã€?
475             *
476             * @og.tag
477             * ã“ã?属æ?ã§æŒ?®šã•れるãƒ?‚£ãƒ¬ã‚¯ãƒˆãƒªã«ã€æ·»ä»˜ãƒ•ァイルãŒå­˜åœ¨ã™ã‚‹ã¨ä»®å®šã—ã¾ã™ã?
478             * æŒ?®šæ–¹æ³•ã?ã€??常㮠fileURL 属æ?ã¨åŒæ§˜ã«ã€å?é ­ãŒã?'/' (UNIX) ã¾ãŸã?ã€?¼’文字目ãŒã?
479             * ":" (Windows)ã®å ´åˆã?ã€æŒ‡å®šã?URLãã?ã¾ã¾ã®ãƒ?‚£ãƒ¬ã‚¯ãƒˆãƒªã«ã€ãã?§ãªã??åˆã?ã€?
480             * fileURL = "{&#064;USER.ID}" ã¨æŒ?®šã™ã‚‹ã¨ã€FILE_URL 属æ?ã§æŒ?®šã?フォルãƒ??下ã«ã€?
481             * ã•らã«ã€å„個人ID別ã®ãƒ•ォルãƒ?‚’作æ?ã—ã¦ã€ãã“を使用ã—ã¾ã™ã?
482             * (åˆæœŸå€¤:シスãƒ?ƒ å®šæ•°ã®FILE_URL[={@og.value org.opengion.hayabusa.common.SystemData#FILE_URL}])ã€?
483             *
484             * @og.rev 4.0.0.0 (2005/01/31) StringUtil.urlAppend メソãƒ?ƒ‰ã®åˆ©ç”¨
485             * @og.rev 4.0.0.0 (2007/11/20) æŒ?®šã•れãŸãƒ?‚£ãƒ¬ã‚¯ãƒˆãƒªåã?æœ?¾ŒãŒ"\"or"/"ã§çµ‚ã‚ã£ã¦ã?ªã??åˆã«ã€?/"を付加ã™ã‚‹ã€?
486             *
487             * @param       url 添付ファイルã®ã‚»ãƒ¼ãƒ–ディレクトリ
488             * @see         org.opengion.hayabusa.common.SystemData#FILE_URL
489             */
490            public void setFileURL( final String url ) {
491                    String furl = nval( getRequestParameter( url ),null );
492                    if( furl != null ) {
493                            char ch = furl.charAt( furl.length()-1 );
494                            if( ch != '/' && ch != '\\' ) { furl = furl + "/"; }
495                            fileURL = StringUtil.urlAppend( fileURL,furl );
496                    }
497            }
498    
499            /**
500             * ã€TAG】メールアドレスをLDAPを利用ã—ã¦å–å¾—ã™ã‚‹ã‹ã©ã?‹[true/false]を指定ã—ã¾ã?åˆæœŸå€¤:false)ã€?
501             *
502             * @og.tag
503             * LDAP ã®ãƒ¡ãƒ¼ãƒ«ã‚¢ãƒ‰ãƒ¬ã‚¹ã‚’å–å¾—ã™ã‚‹å?åˆã?ã€true ã‚’ã‚»ãƒ?ƒˆã—ã¾ã™ã?false ã®å ´åˆã?ã€?
504             * from,to,cc,bcc,replyTo ã®è¨­å®šå?ãŒãã®ã¾ã¾ä½¿ç”¨ã•れã¾ã™ã?
505             * 上記アドレスã«ã€?#064; ã‚’å«ã‚??åˆã?ã€LDAP を検索ã›ãšã€ãƒ¡ãƒ¼ãƒ«ã‚¢ãƒ‰ãƒ¬ã‚¹ã¨ã—ã¦
506             * ãã?ã¾ã¾ä½¿ç”¨ã—ã¾ã™ã?LDAP ã®æ¤œç´¢çµæžœãŒå­˜åœ¨ã—ãªã??åˆã?ã€ä¸æ­£ãªã‚¢ãƒ‰ãƒ¬ã‚¹ã¨ã—ã¦ã€?
507             * エラーã¨ã—ã¾ã™ã?
508             * åˆæœŸå€¤ã¯ã€false ã§ã™ã?
509             *
510             * @og.rev 3.7.1.0 (2005/04/15) LDAP検索 æ–°è¦è¿½åŠ?
511             *
512             * @param   useLDAP メールアドレスをLDAPを利用ã—ã¦å–å¾—ã™ã‚‹ã‹ã©ã?‹ [true:å–å¾—ã™ã‚?false:å–å¾—ã—ãªã„]
513             */
514            public void setUseLDAP( final String useLDAP ) {
515                    this.useLDAP = nval( getRequestParameter( useLDAP ),this.useLDAP );
516            }
517    
518            /**
519             * ã€TAG】アドレスを検索ã™ã‚‹ã‚­ãƒ¼ã‚’指定ã—ã¾ã?åˆæœŸå€¤:uid C社員番å·)ã€?
520             *
521             * @og.tag
522             * LDAP ã®ãƒ¡ãƒ¼ãƒ«ã‚¢ãƒ‰ãƒ¬ã‚¹ã‚’å–å¾—ã™ã‚‹å?åˆã?ã€æ¤œç´¢ã™ã‚‹ã‚­ãƒ¼ã‚’指定ã—ã¾ã™ã?
523             * from,to,cc,bcc,replyTo ã®è¨­å®šå?ã‚’ã?ã“ã?キーã«ã‚»ãƒ?ƒˆã—ã¦ã€æ¤œç´¢ã—ã¾ã™ã?
524             * uid Cç¤¾å“¡ç•ªå· ã€employeeNumber ç¤¾å“¡ç•ªå· ãªã©ãŒè?ãˆã‚‰ã‚Œã¾ã™ã?
525             * åˆæœŸå€¤ã¯ã€uid(C社員番å·)ã§ã™ã?
526             * ã“ã?キーã§è¤?•°ã®æ¤œç´¢çµæžœãŒå¾—られãŸå ´åˆã?ã€ã‚¨ãƒ©ãƒ¼ã¨ã—ã¾ã™ã?
527             *
528             * @og.rev 3.7.1.0 (2005/04/15) LDAP検索 æ–°è¦è¿½åŠ?
529             *
530             * @param   ldapKey アドレスを検索ã™ã‚‹ã‚­ãƒ¼
531             */
532            public void setLdapKey( final String ldapKey ) {
533                    this.ldapKey = nval( getRequestParameter( ldapKey ),this.ldapKey );
534            }
535    
536            /**
537             * ã€TAG】LDAP検索時ã?属æ?åã‚’æŒ?®šã—ã¾ã?åˆæœŸå€¤:cn,mail)ã€?
538             *
539             * @og.tag
540             * LDAPを検索ã™ã‚‹å ´åˆã?"æ‹?½“è?å?&lt;メールアドレス&gt;å½¢å¼ã?メールアドレスを作æ?ã™ã‚‹
541             * å ´åˆã?検索ã™ã‚‹å±žæ?値を指定ã—ã¾ã™ã?
542             * ã²ã¨ã¤ãªã‚‰ã‚¢ãƒ‰ãƒ¬ã‚¹ã€‚ï¼’ã¤ãªã‚‰åå‰ã¨ã‚¢ãƒ‰ãƒ¬ã‚¹ã®é ?§æŒ?®šã•れãŸã¨èªè­˜ã—ã¾ã™ã?
543             *
544             * @og.rev 3.7.1.0 (2005/04/15) LDAP検索 æ–°è¦è¿½åŠ?
545             *
546             * @param   ldapVals LDAP検索時ã?属æ?å?
547             */
548            public void setLdapVals( final String ldapVals ) {
549                    this.ldapVals = nval( getRequestParameter( ldapVals ),this.ldapVals );
550            }
551            
552            /**
553             * ã€TAG】メールアドレスをGE35を利用ã—ã¦å–å¾—ã™ã‚‹ã‹ã©ã?‹[true/false]を指定ã—ã¾ã?åˆæœŸå€¤:false)ã€?
554             *
555             * @og.tag
556             * GE35ã‹ã‚‰ãƒ¡ãƒ¼ãƒ«ã‚¢ãƒ‰ãƒ¬ã‚¹ã‚’å–å¾—ã™ã‚‹å?åˆã?ã€true ã‚’ã‚»ãƒ?ƒˆã—ã¾ã™ã?false ã®å ´åˆã?ã€?
557             * from,to,cc,bcc,replyTo ã®è¨­å®šå?ãŒãã®ã¾ã¾ä½¿ç”¨ã•れã¾ã™ã?
558             * 上記アドレスã«ã€?#064; ã‚’å«ã‚??åˆã?ã€DB を検索ã›ãšã€ãƒ¡ãƒ¼ãƒ«ã‚¢ãƒ‰ãƒ¬ã‚¹ã¨ã—ã¦
559             * ãã?ã¾ã¾ä½¿ç”¨ã—ã¾ã™ã?DB ã®æ¤œç´¢çµæžœãŒå­˜åœ¨ã—ãªã??åˆã?ã€ä¸æ­£ãªã‚¢ãƒ‰ãƒ¬ã‚¹ã¨ã—ã¦ã€?
560             * エラーã¨ã—ã¾ã™ã?
561             * useLDAPã¨åŒæ™‚ã«è¨­å®šã•れã¦ã?‚‹å ´åˆã?ã€LDAP設定ãŒå„ªå…ˆã•れã¾ã™ã?
562             * åˆæœŸå€¤ã¯ã€false ã§ã™ã?
563             *
564             * @og.rev 5.6.9.3 (2013/10/25) æ–°è¦è¿½åŠ?
565             *
566             * @param   flg メールアドレスをGE35を利用ã—ã¦å–å¾—ã™ã‚‹ã‹ã©ã?‹ [true:å–å¾—ã™ã‚?false:å–å¾—ã—ãªã„]
567             */
568            public void setUseDB( final String flg ) {
569                    useDB = nval( getRequestParameter( flg ),useDB );
570            }
571    
572            /**
573             * ã€TAG】メールé€ä¿¡ãƒã?ト番å·ã‚’ã‚»ãƒ?ƒˆã—ã¾ã™ã?
574             *
575             * @og.tag
576             * åˆæœŸå€¤ã¯ã€ã‚·ã‚¹ãƒ?ƒ å®šæ•°ã®SMTP_PORT を使用ã—ã¾ã™ã?
577             *
578             * (åˆæœŸå€¤:シスãƒ?ƒ å®šæ•°ã®SMTP_PORT[={@og.value org.opengion.hayabusa.common.SystemData#SMTP_PORT}])ã€?
579             * 
580             * @og.rev 5.8.1.1 (2014/11/14) メールé€ä¿¡æ™‚èªè¨¼ã€ŒPOP_BEFORE_SMTPã€è¿½åŠ?
581             * 
582             * @param  port SMTPãƒã?ãƒ?
583             */
584            public void setSmtpPort( final String port ) {
585                    smtpPort = nval( getRequestParameter(port), smtpPort );
586            }
587    
588            /**
589             * ã€TAG】メールé€ä¿¡æ™‚èªè¨¼æ–¹å¼ã‚’ã‚»ãƒ?ƒˆã—ã¾ã™ã?
590             *
591             * @og.tag
592             * èªè¨¼ã‚’行ã†å ´åˆã?「POP_BEFORE_SMTPã€ã¨æŒ?®šã—ã¦ä¸‹ã•ã??
593             * èªè¨¼æ™‚ã«ã¯èªè¨¼ãƒ¦ãƒ¼ã‚¶ã¨èªè¨¼ãƒ‘スワードを設定ã™ã‚‹å¿?¦ãŒã‚りã¾ã™ã?
594             * åˆæœŸå€¤ã¯ã€ã‚·ã‚¹ãƒ?ƒ å®šæ•°ã®MAIL_SEND_AUTH を使用ã—ã¾ã™ã?
595             *
596             * (åˆæœŸå€¤:シスãƒ?ƒ å®šæ•°ã®MAIL_SEND_AUTH_TYPE[={@og.value org.opengion.hayabusa.common.SystemData#MAIL_SEND_AUTH}])ã€?
597             * 
598             * @og.rev 5.8.1.1 (2014/11/14) メールé€ä¿¡æ™‚èªè¨¼ã€ŒPOP_BEFORE_SMTPã€è¿½åŠ?
599             * 
600             * @param  type èªè¨¼æ–¹å¼?
601             */
602            public void setAuthType( final String type ) {
603                    authType = nval( getRequestParameter(type), authType );
604            }
605    
606            /**
607             * ã€TAG】メールé€ä¿¡æ™‚èªè¨¼ãƒã?トをセãƒ?ƒˆã—ã¾ã™ã?
608             *
609             * @og.tag
610             * 「POP_BEFORE_SMTPã€èªè¨¼ã‚’行ã†å ´åˆã«ã€POPサーãƒã?ã«æŽ¥ç¶šã™ã‚‹ã?ート番å·ã‚’指定ã—ã¾ã™ã?
611             * æŒ?®šã—ãªã??åˆã?ã€POP3ãƒ?ƒ•ォルトã?ートを使用ã—ã¾ã™ã?
612             * åˆæœŸå€¤ã¯ã€ã‚·ã‚¹ãƒ?ƒ å®šæ•°ã®MAIL_SEND_AUTH_PORT を使用ã—ã¾ã™ã?
613             *
614             * (åˆæœŸå€¤:シスãƒ?ƒ å®šæ•°ã®MAIL_SEND_AUTH_PORT[={@og.value org.opengion.hayabusa.common.SystemData#MAIL_SEND_AUTH_PORT}])ã€?
615             * 
616             * @og.rev 5.8.1.1 (2014/11/14) メールé€ä¿¡æ™‚èªè¨¼ã€ŒPOP_BEFORE_SMTPã€è¿½åŠ?
617             * 
618             * @param  port èªè¨¼ãƒã?ãƒ?
619             */
620            public void setAuthPort( final String port ) {
621                    authPort = nval( getRequestParameter(port), authPort );
622            }
623    
624            /**
625             * ã€TAG】メールé€ä¿¡èªè¨¼ãƒ¦ãƒ¼ã‚¶ã‚’ã‚»ãƒ?ƒˆã—ã¾ã™ã?
626             *
627             * @og.tag
628             * åˆæœŸå€¤ã¯ã€ã‚·ã‚¹ãƒ?ƒ å®šæ•°ã®MAIL_SEND_AUTH_USER を使用ã—ã¾ã™ã?
629             *
630             * (åˆæœŸå€¤:シスãƒ?ƒ å®šæ•°ã®MAIL_SEND_AUTH_USER[={@og.value org.opengion.hayabusa.common.SystemData#MAIL_SEND_AUTH_USER}])ã€?
631             * 
632             * @og.rev 5.8.1.1 (2014/11/14) メールé€ä¿¡æ™‚èªè¨¼ã€ŒPOP_BEFORE_SMTPã€è¿½åŠ?
633             * 
634             * @param  user èªè¨¼ãƒ¦ãƒ¼ã‚¶
635             */
636            public void setAuthUser( final String user ) {
637                    authUser = nval( getRequestParameter(user), authUser );
638            }
639    
640            /**
641             * ã€TAG】メールé€ä¿¡èªè¨¼ãƒ‘スワードをセãƒ?ƒˆã—ã¾ã™ã?
642             *
643             * @og.tag
644             * åˆæœŸå€¤ã¯ã€ã‚·ã‚¹ãƒ?ƒ å®šæ•°ã®MAIL_SEND_AUTH_PASSWORD を使用ã—ã¾ã™ã?
645             *
646             * (åˆæœŸå€¤:シスãƒ?ƒ å®šæ•°ã®MAIL_SEND_AUTH_PASSWORD[={@og.value org.opengion.hayabusa.common.SystemData#MAIL_SEND_AUTH_PASSWORD}])ã€?
647             * 
648             * @og.rev 5.8.1.1 (2014/11/14) メールé€ä¿¡æ™‚èªè¨¼ã€ŒPOP_BEFORE_SMTPã€è¿½åŠ?
649             * 
650             * @param  pass èªè¨¼ãƒ‘スワーãƒ?
651             */
652            public void setAuthPass( final String pass ) {
653                    authPass = nval( getRequestParameter(pass), authPass );
654            }
655    
656            /**
657             * シリアライズ用ã®ã‚«ã‚¹ã‚¿ãƒ?‚·ãƒªã‚¢ãƒ©ã‚¤ã‚ºæ›¸ãè¾¼ã¿ãƒ¡ã‚½ãƒ?ƒ‰
658             *
659             * @og.rev 4.0.0.0 (2006/09/31) æ–°è¦è¿½åŠ?
660             * @serialData ä¸?ƒ¨ã®ã‚ªãƒ–ジェクトã?ã€ã‚·ãƒªã‚¢ãƒ©ã‚¤ã‚ºã•れã¾ã›ã‚“ã€?
661             *
662             * @param       strm    ObjectOutputStreamオブジェク�
663             * @throws IOException  入出力エラーãŒç™ºç”Ÿã—ãŸå?å?
664             */
665            private void writeObject( final ObjectOutputStream strm ) throws IOException {
666                    strm.defaultWriteObject();
667            }
668    
669            /**
670             * シリアライズ用ã®ã‚«ã‚¹ã‚¿ãƒ?‚·ãƒªã‚¢ãƒ©ã‚¤ã‚ºèª­ã¿è¾¼ã¿ãƒ¡ã‚½ãƒ?ƒ‰
671             *
672             * ã“ã“ã§ã¯ã€transient 宣è¨?•れãŸå†?ƒ¨å¤‰æ•°ã®å†??åˆæœŸåŒ–ãŒå¿?¦ãªãƒ•ィールドã?ã¿è¨­å®šã—ã¾ã™ã?
673             *
674             * @og.rev 4.0.0.0 (2006/09/31) æ–°è¦è¿½åŠ?
675             * @serialData ä¸?ƒ¨ã®ã‚ªãƒ–ジェクトã?ã€ã‚·ãƒªã‚¢ãƒ©ã‚¤ã‚ºã•れã¾ã›ã‚“ã€?
676             *
677             * @param       strm    ObjectInputStreamオブジェク�
678             * @see #release2()
679             * @throws IOException  シリアライズã«é–¢ã™ã‚‹å…¥å‡ºåŠ›ã‚¨ãƒ©ãƒ¼ãŒç™ºç”Ÿã—ãŸå?å?
680             * @throws ClassNotFoundException       クラスを見ã¤ã‘ã‚‹ã“ã¨ãŒã§ããªã‹ã£ãŸå?å?
681             */
682            private void readObject( final ObjectInputStream strm ) throws IOException , ClassNotFoundException {
683                    strm.defaultReadObject();
684            }
685    
686            /**
687             * 引数ã®ã‚¢ãƒ‰ãƒ¬ã‚¹é…å?を社員マスタ??E35)ã§å¤‰æ›ã—ã¦è¿”ã—ã¾ã™ã?
688             * グループIDã¯åˆ©ç”¨ã—ã¾ã›ã‚“ã€?
689             * 
690             * @og.rev 5.6.9.3 (2013/10/25) æ–°è¦è¿½åŠ?
691             * 
692             * @param       src     引数é…å?
693             *
694             * @return      変æ›å¾Œã‚¢ãƒ‰ãƒ¬ã‚¹é…å?
695             */
696            public String[] getAddressArray( final String[] src ){
697                    if( src == null || src.length == 0 ) { return src; }
698                    
699                    String[] rtn= src.clone();
700                    
701                    for( int i=0; i < src.length; i++ ){
702                            String addr = src[i];                                                   // å®›å?ID
703                            String[] userAddr = getUserAddr( addr );
704                            if ( userAddr != null && userAddr.length > 0 ){
705                                    if( userAddr[MailPattern.GE35_NAME] != null ){  // å®›å?å?
706                                            addr = userAddr[MailPattern.GE35_NAME] + "<" + userAddr[MailPattern.GE35_MAIL] + ">";
707                                    }
708                                    else{
709                                            addr = userAddr[MailPattern.GE35_MAIL];
710                                    }
711                                    
712                                    rtn[i] = addr;
713    
714                            }
715                    }
716    
717                    return rtn;
718            }
719            
720            
721            /**
722             * 社員マスタよりåå‰ã€ãƒ¡ãƒ¼ãƒ«ã‚¢ãƒ‰ãƒ¬ã‚¹ã‚’å–å¾—ã—ã¾ã™ã?
723             * 戻りå? rtn[0]:ユーザーåã? rtn[1]:ユーザーメールアドレス
724             *
725             * @og.rev 5.6.9.3 (2013/10/25) mailSenderã§ã‚?E35を扱ã??
726             *
727             * @param   userId  ユーザーID
728             *
729             * @return      é…å?æ–?­—å?(rtn[0]:ユーザーåã? rtn[1]:ユーザーメールアドレス)
730             */
731            private String[] getUserAddr( final String userId ){
732                    String[] rtn = null;
733    
734                    if ( userId.contains( "@" ) ) {
735                            rtn = new String[2];
736                            rtn[0] = "";
737                            rtn[1] = userId;
738                    }
739                    else {
740                            String[] ge35SelArgs = { userId };
741                            String[][] ge35Datas = DBUtil.dbExecute( MailPattern.selGE35,ge35SelArgs,getApplicationInfo(), DBID );
742                            if ( ge35Datas.length > 0) {
743                                    rtn = ge35Datas[0];
744                            }
745                            else {
746                                    String errMsg = "ユーザーæƒ??å–å¾—ã§ãã¾ã›ã‚“。ユーザーID?? + userId ;
747                                    throw new HybsSystemException( errMsg );
748                            }
749                    }
750                    return rtn;
751            }
752    
753            /**
754             * ã“ã?オブジェクトã?æ–?­—å?表ç¾ã‚’è¿”ã—ã¾ã™ã?
755             * 基本çš?«ãƒ?ƒãƒ?‚°ç›®çš?«ä½¿ç”¨ã—ã¾ã™ã?
756             * 
757             * @og.rev 5.6.9.3 (2013/10/25) useDBã®å¯¾å¿?
758             *
759             * @return ã“ã?ã‚¯ãƒ©ã‚¹ã®æ–?­—å?表ç¾
760             */
761            @Override
762            public String toString() {
763                    return org.opengion.fukurou.util.ToString.title( this.getClass().getName() )
764                                    .println( "VERSION"             ,VERSION        )
765                                    .println( "host"                ,host           )
766                                    .println( "charset"             ,charset        )
767                                    .println( "from"                ,from           )
768                                    .println( "to"                  ,to                     )
769                                    .println( "cc"                  ,cc                     )
770                                    .println( "bcc"                 ,bcc            )
771                                    .println( "replyTo"             ,replyTo        )
772                                    .println( "subject"             ,subject        )
773                                    .println( "filename"    ,filename       )
774                                    .println( "fileURL"     ,fileURL        )
775                                    .println( "useLDAP"             ,useLDAP        )
776                                    .println( "ldapKey"             ,ldapKey        )
777                                    .println( "ldapVals"    ,ldapVals       )
778                                    .println( "useDB"               ,useDB          ) // 5.6.9.3 (2013/10/25)
779                                    .println( "Other..."    ,getAttributes().getAttribute() )
780                                    .fixForm().toString() ;
781            }
782    }